RESOLVED FIXED 193816
[Curl] Fix DRT crash related to private browsing.
https://bugs.webkit.org/show_bug.cgi?id=193816
Summary [Curl] Fix DRT crash related to private browsing.
Basuke Suzuki
Reported 2019-01-24 23:56:17 PST
Many tests under storage storage/indexeddb/ have started crash after fetching storageSession from NetworkingContext.
Attachments
Patch (3.29 KB, patch)
2019-01-30 06:03 PST, Takashi Komori
no flags
Patch (3.08 KB, patch)
2019-01-30 23:52 PST, Takashi Komori
no flags
Takashi Komori
Comment 1 2019-01-30 06:03:27 PST
Takashi Komori
Comment 2 2019-01-30 06:20:32 PST
Curl port crashes when DRT tests private browsing mode. This is because lack of inmplementation of WebFrameNetworkingContext::ensurePrivateBrowsingSession() for Curl port. Attached patch fixes it.
Ross Kirsling
Comment 3 2019-01-30 09:48:53 PST
Seems good from my perspective, but I'd want Alex or Michael to give the r+ here.
Michael Catanzaro
Comment 4 2019-01-30 09:57:21 PST
Comment on attachment 360574 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=360574&action=review > Source/WebKitLegacy/WebCoreSupport/NetworkStorageSessionMap.cpp:115 > + addResult.iterator->value = std::make_unique<WebCore::NetworkStorageSession>(sessionID, nullptr); Unrelated: I think you should remove the second parameter from your NetworkStorageSession constructor. It's a curl-specific constructor, and I believe you have to always pass nullptr for it to not crash. :)
Alex Christensen
Comment 5 2019-01-30 10:45:20 PST
Comment on attachment 360574 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=360574&action=review Looks good to me. > Source/WebKitLegacy/WebCoreSupport/NetworkStorageSessionMap.cpp:111 > + auto addResult = globalSessionMap().add(sessionID, nullptr); You could use HashMap::ensure here. > Source/WebKitLegacy/win/WebCoreSupport/WebFrameNetworkingContext.cpp:91 > + if (auto privateSession = NetworkStorageSessionMap::storageSession(PAL::SessionID::legacyPrivateSessionID())) > + return *privateSession; This seems unnecessary.
Takashi Komori
Comment 6 2019-01-30 23:52:56 PST
Takashi Komori
Comment 7 2019-01-30 23:57:57 PST
(In reply to Michael Catanzaro from comment #4) > Unrelated: I think you should remove the second parameter from your > NetworkStorageSession constructor. It's a curl-specific constructor, and I > believe you have to always pass nullptr for it to not crash. :) I agree. I will open another ticket for removing the parameter.
Takashi Komori
Comment 8 2019-01-30 23:58:26 PST
(In reply to Alex Christensen from comment #5) > Comment on attachment 360574 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=360574&action=review > > Looks good to me. > > > Source/WebKitLegacy/WebCoreSupport/NetworkStorageSessionMap.cpp:111 > > + auto addResult = globalSessionMap().add(sessionID, nullptr); > > You could use HashMap::ensure here. > > > Source/WebKitLegacy/win/WebCoreSupport/WebFrameNetworkingContext.cpp:91 > > + if (auto privateSession = NetworkStorageSessionMap::storageSession(PAL::SessionID::legacyPrivateSessionID())) > > + return *privateSession; > > This seems unnecessary. Fixed.
WebKit Commit Bot
Comment 9 2019-01-31 09:04:40 PST
Comment on attachment 360700 [details] Patch Clearing flags on attachment: 360700 Committed r240791: <https://trac.webkit.org/changeset/240791>
WebKit Commit Bot
Comment 10 2019-01-31 09:04:41 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 11 2019-01-31 09:05:29 PST
Note You need to log in before you can comment on or make changes to this bug.