<?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>108482</bug_id>
          
          <creation_ts>2013-01-31 07:29:15 -0800</creation_ts>
          <short_desc>[WebCore][Notifications] Do not assume the page has a NotificationClient</short_desc>
          <delta_ts>2014-02-05 11:14:54 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></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>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Claudio Saavedra">csaavedra</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>jonlee</cc>
    
    <cc>mathstuf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>821514</commentid>
    <comment_count>0</comment_count>
    <who name="Claudio Saavedra">csaavedra</who>
    <bug_when>2013-01-31 07:29:15 -0800</bug_when>
    <thetext>[WebCore][Notifications] Do not assume the page has a NotificationClient</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>821516</commentid>
    <comment_count>1</comment_count>
      <attachid>185782</attachid>
    <who name="Claudio Saavedra">csaavedra</who>
    <bug_when>2013-01-31 07:33:22 -0800</bug_when>
    <thetext>Created attachment 185782
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>821517</commentid>
    <comment_count>2</comment_count>
    <who name="Claudio Saavedra">csaavedra</who>
    <bug_when>2013-01-31 07:37:37 -0800</bug_when>
    <thetext>Hi again Jon! :)

This one is a crasher that happens with WK1 clients when enabling NOTIFICATIONS. I am working exclusively on adding notifications support in wk2 for the GTK port and clients still using WK1 should not crash, even if notifications are enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>821652</commentid>
    <comment_count>3</comment_count>
      <attachid>185782</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2013-01-31 10:42:03 -0800</bug_when>
    <thetext>Comment on attachment 185782
Patch

There is another unchecked use of NotificationController::from in Notification::permission. Should it be fixed, too?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>822876</commentid>
    <comment_count>4</comment_count>
    <who name="Claudio Saavedra">csaavedra</who>
    <bug_when>2013-02-01 09:33:40 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (From update of attachment 185782 [details])
&gt; There is another unchecked use of NotificationController::from in Notification::permission. Should it be fixed, too?

I see. So far I can&apos;t tell whether it&apos;s an issue but I guess it wouldn&apos;t hurt to ensure it won&apos;t crash.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>823014</commentid>
    <comment_count>5</comment_count>
      <attachid>185782</attachid>
    <who name="Jon Lee">jonlee</who>
    <bug_when>2013-02-01 11:24:23 -0800</bug_when>
    <thetext>Comment on attachment 185782
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=185782&amp;action=review

Unofficial r=me.

&gt; Source/WebCore/Modules/notifications/Notification.cpp:291
&gt; +    if (client)

It would be better to define it in the if clause:

if (NotificationClient* client = ...)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>823025</commentid>
    <comment_count>6</comment_count>
    <who name="Jon Lee">jonlee</who>
    <bug_when>2013-02-01 11:29:04 -0800</bug_when>
    <thetext>Actually, doesn&apos;t it make more sense to not call provideNotification(), and check for the existence of a controller?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>827198</commentid>
    <comment_count>7</comment_count>
    <who name="Claudio Saavedra">csaavedra</who>
    <bug_when>2013-02-07 02:19:16 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; Actually, doesn&apos;t it make more sense to not call provideNotification(), and check for the existence of a controller?

Actually the caller of Notification::requestPermission() seems to be JSNotification::requestPermission(). Not sure I understand what you mean?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>827519</commentid>
    <comment_count>8</comment_count>
    <who name="Jon Lee">jonlee</who>
    <bug_when>2013-02-07 07:56:46 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #6)
&gt; &gt; Actually, doesn&apos;t it make more sense to not call provideNotification(), and check for the existence of a controller?
&gt; 
&gt; Actually the caller of Notification::requestPermission() seems to be JSNotification::requestPermission(). Not sure I understand what you mean?

If you don&apos;t have a notification client, then you shouldn&apos;t be adding a NotificationController as a supplement to the Page. So I think you should be able to check for a null NotificationController, rather than  checking for a null NotificationClient.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>976968</commentid>
    <comment_count>9</comment_count>
      <attachid>185782</attachid>
    <who name="Andreas Kling">kling</who>
    <bug_when>2014-02-05 11:14:54 -0800</bug_when>
    <thetext>Comment on attachment 185782
Patch

Clearing review flag on patches from before 2014. If this patch is still relevant, please reset the r? flag.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>185782</attachid>
            <date>2013-01-31 07:33:22 -0800</date>
            <delta_ts>2014-02-05 11:14:53 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-108482-20130131173005.patch</filename>
            <type>text/plain</type>
            <size>1690</size>
            <attacher name="Claudio Saavedra">csaavedra</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTQwOTY2CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggMWZ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