[Curl] Fix DRT crash related to private browsing.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jan 2019 17:04:34 +0000 (17:04 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jan 2019 17:04:34 +0000 (17:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193816

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2019-01-31
Reviewed by Alex Christensen.

Source/WebKitLegacy:

* WebCoreSupport/NetworkStorageSessionMap.cpp:
(NetworkStorageSessionMap::ensureSession):

Source/WebKitLegacy/win:

* WebCoreSupport/WebFrameNetworkingContext.cpp:
(WebFrameNetworkingContext::ensurePrivateBrowsingSession):

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

Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/WebCoreSupport/NetworkStorageSessionMap.cpp
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebCoreSupport/WebFrameNetworkingContext.cpp

index d9590d8..174fb6b 100644 (file)
@@ -1,3 +1,13 @@
+2019-01-31  Takashi Komori  <Takashi.Komori@sony.com>
+
+        [Curl] Fix DRT crash related to private browsing.
+        https://bugs.webkit.org/show_bug.cgi?id=193816
+
+        Reviewed by Alex Christensen.
+
+        * WebCoreSupport/NetworkStorageSessionMap.cpp:
+        (NetworkStorageSessionMap::ensureSession):
+
 2019-01-26  Darin Adler  <darin@apple.com>
   
         Replace many uses of String::format with more type-safe alternatives
index 584f0a1..e5ae807 100644 (file)
@@ -106,6 +106,11 @@ void NetworkStorageSessionMap::ensureSession(const PAL::SessionID& sessionID, co
     }
 
     addResult.iterator->value = std::make_unique<WebCore::NetworkStorageSession>(sessionID, WTFMove(storageSession), WTFMove(cookieStorage));
+
+#elif USE(CURL)
+    globalSessionMap().ensure(sessionID, [sessionID] {
+        return std::make_unique<WebCore::NetworkStorageSession>(sessionID, nullptr);
+    });
 #endif
 }
 
index bdc4fe1..b79b24c 100644 (file)
@@ -1,3 +1,13 @@
+2019-01-31  Takashi Komori  <Takashi.Komori@sony.com>
+
+        [Curl] Fix DRT crash related to private browsing.
+        https://bugs.webkit.org/show_bug.cgi?id=193816
+
+        Reviewed by Alex Christensen.
+
+        * WebCoreSupport/WebFrameNetworkingContext.cpp:
+        (WebFrameNetworkingContext::ensurePrivateBrowsingSession):
+
 2019-01-28  Ross Kirsling  <ross.kirsling@sony.com>
 
         Remove unnecessary `using namespace WTF`s (or at least restrict their scope).
index f134f3c..a5bb8a7 100644 (file)
@@ -84,6 +84,11 @@ NetworkStorageSession& WebFrameNetworkingContext::ensurePrivateBrowsingSession()
 
     NetworkStorageSessionMap::ensureSession(PAL::SessionID::legacyPrivateSessionID(), base);
 
+#elif USE(CURL)
+    ASSERT(isMainThread());
+
+    NetworkStorageSessionMap::ensureSession(PAL::SessionID::legacyPrivateSessionID());
+
 #endif
     return *NetworkStorageSessionMap::storageSession(PAL::SessionID::legacyPrivateSessionID());
 }