[Qt][WK2] Setting Download as action for navigation request crashes WebProcess
authorjesus@webkit.org <jesus@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Dec 2011 13:18:44 +0000 (13:18 +0000)
committerjesus@webkit.org <jesus@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Dec 2011 13:18:44 +0000 (13:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=74526

Reviewed by Simon Hausmann.

Adding checks for networkcontext and networkAccessManager
and return true in case they don't exist, following the same
logic as if the CookieJar doesn't exist.

* platform/qt/ThirdPartyCookiesQt.cpp:
(WebCore::thirdPartyCookiePolicyPermits):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102926 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/qt/ThirdPartyCookiesQt.cpp

index 1beb98b..c54b69b 100644 (file)
@@ -1,3 +1,17 @@
+2011-12-15  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        [Qt][WK2] Setting Download as action for navigation request crashes WebProcess
+        https://bugs.webkit.org/show_bug.cgi?id=74526
+
+        Reviewed by Simon Hausmann.
+
+        Adding checks for networkcontext and networkAccessManager
+        and return true in case they don't exist, following the same
+        logic as if the CookieJar doesn't exist.
+
+        * platform/qt/ThirdPartyCookiesQt.cpp:
+        (WebCore::thirdPartyCookiePolicyPermits):
+
 2011-12-14  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
 
         [Qt] Get rid of layering violation in PluginViewQt
index 23d71e9..3d49abe 100644 (file)
@@ -62,6 +62,12 @@ static bool urlsShareSameDomain(const QUrl& url, const QUrl& firstPartyUrl)
 bool thirdPartyCookiePolicyPermits(NetworkingContext* context, const QUrl& url, const QUrl& firstPartyUrl)
 {
 #if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
+    if (!context)
+        return true;
+
+    if (!context->networkAccessManager())
+        return true;
+
     QNetworkCookieJar* jar = context->networkAccessManager()->cookieJar();
     if (!jar)
         return true;