Title: [140322] trunk/Source/WebKit/qt
Revision
140322
Author
[email protected]
Date
2013-01-21 04:33:40 -0800 (Mon, 21 Jan 2013)

Log Message

[Qt] Crash in gmail on enabling desktop notifications
https://bugs.webkit.org/show_bug.cgi?id=106699

Patch by David Rosca.
Reviewed by Jocelyn Turcotte.

Protect against callback that may be null. This also matches WebKit2 behaviour.

* WebCoreSupport/NotificationPresenterClientQt.cpp:
(WebCore::NotificationPresenterClientQt::allowNotificationForFrame):

Modified Paths

Diff

Modified: trunk/Source/WebKit/qt/ChangeLog (140321 => 140322)


--- trunk/Source/WebKit/qt/ChangeLog	2013-01-21 12:06:57 UTC (rev 140321)
+++ trunk/Source/WebKit/qt/ChangeLog	2013-01-21 12:33:40 UTC (rev 140322)
@@ -1,3 +1,16 @@
+2013-01-21  Allan Sandfeld Jensen  <[email protected]>
+
+        [Qt] Crash in gmail on enabling desktop notifications
+        https://bugs.webkit.org/show_bug.cgi?id=106699
+
+        Patch by David Rosca.
+        Reviewed by Jocelyn Turcotte.
+
+        Protect against callback that may be null. This also matches WebKit2 behaviour.
+
+        * WebCoreSupport/NotificationPresenterClientQt.cpp:
+        (WebCore::NotificationPresenterClientQt::allowNotificationForFrame):
+
 2013-01-18  Shinya Kawanaka  <[email protected]>
 
         Introduce isHTMLTextFormControlElement and toHTMLTextFormControlElement instead of toTextFormControl

Modified: trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp (140321 => 140322)


--- trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp	2013-01-21 12:06:57 UTC (rev 140321)
+++ trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp	2013-01-21 12:33:40 UTC (rev 140322)
@@ -367,8 +367,10 @@
         return;
 
     QList<RefPtr<VoidCallback> >& callbacks = iter.value().m_callbacks;
-    for (int i = 0; i < callbacks.size(); i++)
-        callbacks.at(i)->handleEvent();
+    Q_FOREACH(const RefPtr<VoidCallback>& callback, callbacks) {
+        if (callback)
+            callback->handleEvent();
+    }
     m_pendingPermissionRequests.remove(iter.key());
 }
 
@@ -379,7 +381,6 @@
         sendEvent(notification, "show");
 }
 
-
 void NotificationPresenterClientQt::sendEvent(Notification* notification, const AtomicString& eventName)
 {
     if (notification->scriptExecutionContext())
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to