summaryrefslogtreecommitdiff
path: root/Source/WebKit
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-01-22 15:09:02 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-22 15:23:15 +0100
commit28b2bb706534bc641f475dbc3e5cf32b9f39fb8c (patch)
tree06cb7a3c23ed4cc3abac21732c62dbc752b0b2ff /Source/WebKit
parent70c60ffc8530221d54e0b3f5d9b8687cd3eff875 (diff)
downloadqtwebkit-28b2bb706534bc641f475dbc3e5cf32b9f39fb8c.tar.gz
[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): Reviewed-by: jocelyn.turcotte@digia.com Change-Id: Icac8f0202c378d129895b47224bfabc9b2a53b3d Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'Source/WebKit')
-rw-r--r--Source/WebKit/qt/ChangeLog13
-rw-r--r--Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp7
2 files changed, 17 insertions, 3 deletions
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index 0557e66fe..f03960ceb 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,16 @@
+2013-01-21 Allan Sandfeld Jensen <allan.jensen@digia.com>
+
+ [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-21 Jocelyn Turcotte <jocelyn.turcotte@digia.com>
[Qt] Update the documentation about the storage of inspector settings
diff --git a/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
index 06840c455..2f25b8960 100644
--- a/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
@@ -367,8 +367,10 @@ void NotificationPresenterClientQt::allowNotificationForFrame(Frame* frame)
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 @@ void NotificationPresenterClientQt::sendDisplayEvent(NotificationWrapper* wrappe
sendEvent(notification, "show");
}
-
void NotificationPresenterClientQt::sendEvent(Notification* notification, const AtomicString& eventName)
{
if (notification->scriptExecutionContext())