Changeset 150537 in webkit
- Timestamp:
- May 22, 2013 1:50:44 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r150532 r150537 1 2013-05-22 Alexey Proskuryakov <ap@apple.com> 2 3 Crashes in NetworkProcess due to incorrect private browsing session tracking 4 https://bugs.webkit.org/show_bug.cgi?id=116628 5 6 Reviewed by Brady Eidson. 7 8 The current API for private browsing makes it extremely difficult to track sessions. 9 Private browsing is enabled via WKPreferences, but the session is shared, so it 10 has to be maintained while there is any chance that any page group anywhere still 11 needs it. 12 13 This patch fixes some of the issues, but ultimately, I think that we'll just need 14 to deprecate and replace the API. 15 16 * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::storageSession): 17 There are valid scenarios where privateBrowsingEnabled is true, but there is no 18 private browsing session. Handle that without crashing, although this unfortunately 19 means that it will be harder to spot logic errors when using a wrong session. 20 (WebKit::NetworkConnectionToWebProcess::registerBlobURL): Removed an obsolete FIXME. 21 22 * NetworkProcess/mac/RemoteNetworkingContext.h: Changed privateBrowsingSession() 23 to return a pointer, as no caller could know when it was safe to call it. 24 25 * NetworkProcess/mac/RemoteNetworkingContext.mm: 26 (WebKit::RemoteNetworkingContext::storageSession): Handle the case where private 27 browsing session is unexpectedly missing without crashing. 28 (WebKit::RemoteNetworkingContext::privateBrowsingSession): Changed to return a pointer. 29 30 * UIProcess/WebContext.cpp: (WebKit::WebContext::ensureNetworkProcess): 31 Actually initialize privateBrowsingEnabled creation parameter. It would be very 32 difficult to figure out 100% reliably whether NetworkProcess needs a private browsing 33 session with the current API, but for existing clients, looking at 34 m_privateBrowsingEnterCount is good enough. Certainly better than not initializing. 35 36 * WebProcess/InjectedBundle/InjectedBundle.cpp: 37 (WebKit::InjectedBundle::setPrivateBrowsingEnabled): Added a FIXME. 38 1 39 2013-05-22 Tim Horton <timothy_horton@apple.com> 2 40 -
trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp
r149848 r150537 157 157 static NetworkStorageSession& storageSession(bool privateBrowsingEnabled) 158 158 { 159 return privateBrowsingEnabled ? RemoteNetworkingContext::privateBrowsingSession() : NetworkStorageSession::defaultStorageSession(); 159 if (privateBrowsingEnabled) { 160 NetworkStorageSession* privateSession = RemoteNetworkingContext::privateBrowsingSession(); 161 if (privateSession) 162 return *privateSession; 163 // Some requests with private browsing mode requested may still be coming shortly after NetworkProcess was told to destroy its session. 164 // FIXME: Find a way to track private browsing sessions more rigorously. 165 LOG_ERROR("Private browsing was requested, but there was no session for it. Please file a bug unless you just disabled private browsing, in which case it's an expected race."); 166 } 167 return NetworkStorageSession::defaultStorageSession(); 160 168 } 161 169 … … 209 217 void NetworkConnectionToWebProcess::registerBlobURL(const KURL& url, const BlobRegistrationData& data) 210 218 { 211 // FIXME: unregister all URLs when process connection closes.212 213 219 Vector<RefPtr<SandboxExtension>> extensions; 214 220 for (size_t i = 0, count = data.sandboxExtensions().size(); i < count; ++i) { -
trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.h
r146536 r150537 43 43 static void destroyPrivateBrowsingSession(); 44 44 45 static WebCore::NetworkStorageSession & privateBrowsingSession(); // Can only be called when the session exists.45 static WebCore::NetworkStorageSession* privateBrowsingSession(); 46 46 47 47 virtual bool shouldClearReferrerOnHTTPSToHTTPRedirect() const OVERRIDE; -
trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm
r148123 r150537 79 79 { 80 80 if (m_privateBrowsingEnabled) { 81 ASSERT(privateBrowsingStorageSession()); 82 return *privateBrowsingStorageSession(); 81 NetworkStorageSession* privateSession = privateBrowsingStorageSession().get(); 82 if (privateSession) 83 return *privateSession; 84 // Some requests with private browsing mode requested may still be coming shortly after NetworkProcess was told to destroy its session. 85 // FIXME: Find a way to track private browsing sessions more rigorously. 86 LOG_ERROR("Private browsing was requested, but there was no session for it. Please file a bug unless you just disabled private browsing, in which case it's an expected race."); 83 87 } 84 88 … … 86 90 } 87 91 88 NetworkStorageSession &RemoteNetworkingContext::privateBrowsingSession()92 NetworkStorageSession* RemoteNetworkingContext::privateBrowsingSession() 89 93 { 90 ASSERT(privateBrowsingStorageSession()); 91 return *privateBrowsingStorageSession(); 94 return privateBrowsingStorageSession().get(); 92 95 } 93 96 -
trunk/Source/WebKit2/UIProcess/WebContext.cpp
r150314 r150537 374 374 SandboxExtension::createHandleForReadWriteDirectory(parameters.diskCacheDirectory, parameters.diskCacheDirectoryExtensionHandle); 375 375 376 // FIXME: We don't account for private browsing mode being enabled due to a persistent preference in any of active page groups. 377 // This means that clients must re-enable private browsing mode through API on each launch, not relying on preferences. 378 // If the client does not re-enable private browsing on next launch, NetworkProcess will crash. 379 parameters.privateBrowsingEnabled = m_privateBrowsingEnterCount; 380 376 381 parameters.cacheModel = m_cacheModel; 377 382 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
r150282 r150537 304 304 void InjectedBundle::setPrivateBrowsingEnabled(WebPageGroupProxy* pageGroup, bool enabled) 305 305 { 306 // FIXME (NetworkProcess): This test-only function doesn't work with NetworkProcess, <https://bugs.webkit.org/show_bug.cgi?id=115274>. 306 307 #if PLATFORM(MAC) || USE(CFNETWORK) 307 308 if (enabled)
Note: See TracChangeset
for help on using the changeset viewer.