<?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>95589</bug_id>
          
          <creation_ts>2012-08-31 10:53:07 -0700</creation_ts>
          <short_desc>[Mac] Clarify -[WebView _setNotificationProvider:]</short_desc>
          <delta_ts>2012-08-31 10:54:33 -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>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.8</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jon Lee">jonlee</reporter>
          <assigned_to name="Jon Lee">jonlee</assigned_to>
          <cc>darin</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>709798</commentid>
    <comment_count>0</comment_count>
    <who name="Jon Lee">jonlee</who>
    <bug_when>2012-08-31 10:53:07 -0700</bug_when>
    <thetext>From bug 95465:

&gt;&gt;&gt; Source/WebKit/mac/WebView/WebView.mm:6526
&gt;&gt;&gt;  }
&gt;&gt; 
&gt;&gt; It seems a little non-obvious that this method does nothing once a notification provider is set. Are the callers able to tolerate this behavior? The alternative would be to teach this function to unregister the old provider when setting a new one.
&gt; 
&gt; The provider is set once, typically during initialization of the web view. There is no reason I can think of that one would want to switch providers in the middle of the web view&apos;s lifetime. The case is similar with other kinds of providers like geolocation.
&gt; 
&gt; Because of the use case, I opted to just go with initialize-once rather than unregister-the-old-provider, since that is not the intended use for this method. Maybe renaming this to _initializeNotificationProvider would be more descriptive.

The name change is one possible way to increase clarity. Another would be to add an ASSERT_NOT_REACHED along with early return instead of nesting the function inside an if. The _private == nil case seems expected and harmless while the !_private-&gt;_notificationProvider seems like it always reflects a programming error. Might also want to assert that the provider is non-nil or something.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>709799</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2012-08-31 10:53:19 -0700</bug_when>
    <thetext>&lt;rdar://problem/12216386&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>