summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-01-28 10:42:13 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-28 15:52:47 +0100
commit30400131a4c18e9a0e0895d517c620b599aaddee (patch)
treeb9f360afe8ec48badd4e36bad53055b6b898cc65
parentfb05427cdb248eaffeac8b045a90b004f896f605 (diff)
[Qt] Crash in gmail on enabling desktop notificationsv5.0.1
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): Change-Id: Ic8e421c4c6948b6dc5578355b41e754b5beca723 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
-rw-r--r--Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp7
1 files changed, 4 insertions, 3 deletions
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())