<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>43848</bug_id>
          
          <creation_ts>2010-08-11 06:34:45 -0700</creation_ts>
          <short_desc>Need EmptyDeviceOrientationClient and EmptyDeviceMotionClient for use with SVGImage</short_desc>
          <delta_ts>2010-08-12 07:38:16 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>30335</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Steve Block">steveblock</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>dglazkov</cc>
    
    <cc>dino</cc>
    
    <cc>jorlow</cc>
    
    <cc>steveblock</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>263217</commentid>
    <comment_count>0</comment_count>
    <who name="Steve Block">steveblock</who>
    <bug_when>2010-08-11 06:34:45 -0700</bug_when>
    <thetext>Without these empty clients, crashes occur when DEVICE_ORIENTATION is enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>263220</commentid>
    <comment_count>1</comment_count>
      <attachid>64106</attachid>
    <who name="Steve Block">steveblock</who>
    <bug_when>2010-08-11 06:40:25 -0700</bug_when>
    <thetext>Created attachment 64106
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>263234</commentid>
    <comment_count>2</comment_count>
      <attachid>64106</attachid>
    <who name="Jeremy Orlow">jorlow</who>
    <bug_when>2010-08-11 07:10:52 -0700</bug_when>
    <thetext>Comment on attachment 64106
Patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>263456</commentid>
    <comment_count>3</comment_count>
      <attachid>64106</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-08-11 14:35:37 -0700</bug_when>
    <thetext>Comment on attachment 64106
Patch

Clearing flags on attachment: 64106

Committed r65185: &lt;http://trac.webkit.org/changeset/65185&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>263457</commentid>
    <comment_count>4</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-08-11 14:35:41 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>263662</commentid>
    <comment_count>5</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2010-08-12 02:05:32 -0700</bug_when>
    <thetext>I don&apos;t know if I like this approach. This is why I filed 
https://bugs.webkit.org/show_bug.cgi?id=43533

Rather than create all these empty clients, I think it is better to avoid creating the controller.

For example, Page::Page could have this:

: m_deviceMotionController((RuntimeEnabledFeatures::deviceMotionEnabled() &amp;&amp; pageClients.deviceMotionClient) ? new DeviceMotionController(pageClients.deviceMotionClient) : 0)

That way, if the pageClients never gets a deviceMotionClient, then it will not bother constructing a controller. 

What&apos;s the benefit of having an empty client and controller that will never be used?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>263667</commentid>
    <comment_count>6</comment_count>
    <who name="Jeremy Orlow">jorlow</who>
    <bug_when>2010-08-12 02:22:04 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; I don&apos;t know if I like this approach. This is why I filed 
&gt; https://bugs.webkit.org/show_bug.cgi?id=43533
&gt; 
&gt; Rather than create all these empty clients, I think it is better to avoid creating the controller.
&gt; 
&gt; For example, Page::Page could have this:
&gt; 
&gt; : m_deviceMotionController((RuntimeEnabledFeatures::deviceMotionEnabled() &amp;&amp; pageClients.deviceMotionClient) ? new DeviceMotionController(pageClients.deviceMotionClient) : 0)
&gt; 
&gt; That way, if the pageClients never gets a deviceMotionClient, then it will not bother constructing a controller. 
&gt; 
&gt; What&apos;s the benefit of having an empty client and controller that will never be used?

I thought about that, but it seemed like the precedent is to create empty clients.  Is there something different about this case vs. the others?  Is it worth revisiting the approach on the other clients as well?

I don&apos;t really have a strong opinion either way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>263669</commentid>
    <comment_count>7</comment_count>
    <who name="Steve Block">steveblock</who>
    <bug_when>2010-08-12 02:24:07 -0700</bug_when>
    <thetext>&gt; Rather than create all these empty clients, I think it is better to avoid
&gt; creating the controller.
Sure, that makes sense. I don&apos;t feel strongly either way, but my impression was that code of this kind should generally be written assuming that the client is non-null (if the feature is enabled).

Perhaps it&apos;s best if you start a discussion on webkit-dev to get some background and to get other people&apos;s opinions on this.

See also the related discussion in https://lists.webkit.org/pipermail/webkit-dev/2010-July/013597.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>263672</commentid>
    <comment_count>8</comment_count>
    <who name="Steve Block">steveblock</who>
    <bug_when>2010-08-12 02:26:06 -0700</bug_when>
    <thetext>*** Bug 43869 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>263802</commentid>
    <comment_count>9</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2010-08-12 07:38:16 -0700</bug_when>
    <thetext>Pages are created in a number of places (SVGImage, as you show in your patch). They don&apos;t always need all the clients (eg. you don&apos;t need the inspector client in SVGImage), so there are already cases where null clients are passed in.

This gets even more common in the platform implementations. 

It&apos;s a good question as to whether it is better to protect against null clients or to create Empty/Stub versions and use them all over the place.

By the way, I&apos;m currently struggling to work out why DeviceOrientation is a client of Page anyway. It seems to me that it would make more sense on Frame, where it could be easily suspended when the user navigates back/forward, or other similar situations. Without this, I get into the case where a Page is still trying to dispatch events even though the document/window have gone away.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>64106</attachid>
            <date>2010-08-11 06:40:25 -0700</date>
            <delta_ts>2010-08-11 14:35:37 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-43848-20100811144023.patch</filename>
            <type>text/plain</type>
            <size>3426</size>
            <attacher name="Steve Block">steveblock</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA2NTE1MSkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMjQgQEAKKzIwMTAtMDgtMTEgIFN0ZXZlIEJsb2NrICA8c3RldmVibG9ja0Bnb29n
bGUuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAg
IE5lZWQgRW1wdHlEZXZpY2VPcmllbnRhdGlvbkNsaWVudCBhbmQgRW1wdHlEZXZpY2VNb3Rpb25D
bGllbnQgZm9yIHVzZSB3aXRoIFNWR0ltYWdlCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQu
b3JnL3Nob3dfYnVnLmNnaT9pZD00Mzg0OAorCisgICAgICAgIFRlc3RlZCBieSBleGlzdGluZyBE
ZXZpY2VPcmllbnRhdGlvbiB0ZXN0cy4KKworICAgICAgICAqIGxvYWRlci9FbXB0eUNsaWVudHMu
aDoKKyAgICAgICAgKFdlYkNvcmU6OkVtcHR5RGV2aWNlTW90aW9uQ2xpZW50OjpzZXRDb250cm9s
bGVyKToKKyA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XlEZXZpY2VPcmllbnRhdGlvbkNsaWVudCA9IG5l
dyBFbXB0eURldmljZU9yaWVudGF0aW9uQ2xpZW50OworICAgICAgICBwYWdlQ2xpZW50cy5kZXZp
Y2VPcmllbnRhdGlvbkNsaWVudCA9IGR1bW15RGV2aWNlT3JpZW50YXRpb25DbGllbnQ7CisjZW5k
aWYKKwogICAgICAgICAvLyBGSVhNRTogSWYgdGhpcyBTVkcgZW5kcyB1cCBsb2FkaW5nIGl0c2Vs
Ziwgd2UgbWlnaHQgbGVhayB0aGUgd29ybGQuCiAgICAgICAgIC8vIFRoZSBjb21tZW50IHNhaWQg
dGhhdCB0aGUgQ2FjaGUgY29kZSBkb2VzIG5vdCBrbm93IGFib3V0IENhY2hlZEltYWdlcwogICAg
ICAgICAvLyBob2xkaW5nIEZyYW1lcyBhbmQgd29uJ3Qga25vdyB0byBicmVhayB0aGUgY3ljbGUu
IEJ1dCAK
</data>

          </attachment>
      

    </bug>

</bugzilla>