Changeset 249575 in webkit
- Timestamp:
- Sep 6, 2019, 9:19:50 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r249574 r249575 1 2019-09-06 Alex Christensen <achristensen@webkit.org> 2 3 When disabling legacy private browsing for testing, change the SessionID back to what it was, not the defaultSessionID 4 https://bugs.webkit.org/show_bug.cgi?id=201480 5 6 Reviewed by Youenn Fablet. 7 8 No change in behavior, but this blocks bug 200050 which will make WebKitTestRunner use a persistent, non-default session. 9 Without this change, that change causes lots of test failures because we are switching from the legacy private browsing session 10 to the default session instead of the session we were using. 11 12 * page/Page.cpp: 13 (WebCore::Page::enableLegacyPrivateBrowsing): Deleted. 14 * page/Page.h: 15 * page/PageGroup.cpp: 16 (WebCore::PageGroup::addPage): 17 (WebCore::PageGroup::setSessionIDForTesting): 18 (WebCore::PageGroup::enableLegacyPrivateBrowsingForTesting): Deleted. 19 * page/PageGroup.h: 20 * storage/StorageNamespaceProvider.cpp: 21 (WebCore::StorageNamespaceProvider::setSessionIDForTesting): 22 (WebCore::StorageNamespaceProvider::enableLegacyPrivateBrowsingForTesting): Deleted. 23 * storage/StorageNamespaceProvider.h: 24 1 25 2019-09-06 Youenn Fablet <youenn@apple.com> 2 26 -
trunk/Source/WebCore/page/Page.cpp
r248846 r249575 1677 1677 } 1678 1678 1679 void Page::enableLegacyPrivateBrowsing(bool privateBrowsingEnabled)1680 {1681 // Don't allow changing the legacy private browsing state if we have set a session ID.1682 ASSERT(m_sessionID == PAL::SessionID::defaultSessionID() || m_sessionID == PAL::SessionID::legacyPrivateSessionID());1683 1684 setSessionID(privateBrowsingEnabled ? PAL::SessionID::legacyPrivateSessionID() : PAL::SessionID::defaultSessionID());1685 }1686 1687 1679 void Page::updateIsPlayingMedia(uint64_t sourceElementID) 1688 1680 { -
trunk/Source/WebCore/page/Page.h
r248734 r249575 608 608 WEBCORE_EXPORT PAL::SessionID sessionID() const; 609 609 WEBCORE_EXPORT void setSessionID(PAL::SessionID); 610 WEBCORE_EXPORT void enableLegacyPrivateBrowsing(bool privateBrowsingEnabled);611 610 bool usesEphemeralSession() const { return m_sessionID.isEphemeral(); } 612 611 -
trunk/Source/WebCore/page/PageGroup.cpp
r248846 r249575 96 96 97 97 if (m_isLegacyPrivateBrowsingEnabledForTesting) 98 page. enableLegacyPrivateBrowsing(true);98 page.setSessionID(PAL::SessionID::legacyPrivateSessionID()); 99 99 } 100 100 … … 127 127 #endif 128 128 129 void PageGroup:: enableLegacyPrivateBrowsingForTesting(bool enabled)129 void PageGroup::setSessionIDForTesting(const PAL::SessionID& sessionID) 130 130 { 131 if (m_isLegacyPrivateBrowsingEnabledForTesting == enabled) 131 bool legacyPrivate = sessionID == PAL::SessionID::legacyPrivateSessionID(); 132 if (m_isLegacyPrivateBrowsingEnabledForTesting == legacyPrivate) 132 133 return; 133 134 134 m_isLegacyPrivateBrowsingEnabledForTesting = enabled;135 m_isLegacyPrivateBrowsingEnabledForTesting = legacyPrivate; 135 136 136 137 for (auto* page : m_pages) 137 page-> enableLegacyPrivateBrowsing(enabled);138 page->setSessionID(sessionID); 138 139 } 139 140 -
trunk/Source/WebCore/page/PageGroup.h
r247283 r249575 30 30 #include <wtf/text/WTFString.h> 31 31 32 namespace PAL { 33 class SessionID; 34 } 35 32 36 namespace WebCore { 33 37 … … 59 63 #endif 60 64 61 WEBCORE_EXPORT void enableLegacyPrivateBrowsingForTesting(bool);65 WEBCORE_EXPORT void setSessionIDForTesting(const PAL::SessionID&); 62 66 63 67 private: -
trunk/Source/WebCore/storage/StorageNamespaceProvider.cpp
r248734 r249575 83 83 } 84 84 85 void StorageNamespaceProvider:: enableLegacyPrivateBrowsingForTesting(bool enabled)85 void StorageNamespaceProvider::setSessionIDForTesting(const PAL::SessionID& newSessionID) 86 86 { 87 auto newSessionID = enabled ? PAL::SessionID::legacyPrivateSessionID() : PAL::SessionID::defaultSessionID();88 87 if (m_localStorageNamespace && newSessionID != m_localStorageNamespace->sessionID()) 89 88 m_localStorageNamespace->setSessionIDForTesting(newSessionID); -
trunk/Source/WebCore/storage/StorageNamespaceProvider.h
r248734 r249575 53 53 Ref<StorageArea> localStorageArea(Document&); 54 54 55 WEBCORE_EXPORT void enableLegacyPrivateBrowsingForTesting(bool enabled);55 WEBCORE_EXPORT void setSessionIDForTesting(const PAL::SessionID&); 56 56 57 57 protected: -
trunk/Source/WebKit/ChangeLog
r249569 r249575 1 2019-09-06 Alex Christensen <achristensen@webkit.org> 2 3 When disabling legacy private browsing for testing, change the SessionID back to what it was, not the defaultSessionID 4 https://bugs.webkit.org/show_bug.cgi?id=201480 5 6 Reviewed by Youenn Fablet. 7 8 * WebProcess/InjectedBundle/InjectedBundle.cpp: 9 (WebKit::InjectedBundle::setPrivateBrowsingEnabled): 10 * WebProcess/InjectedBundle/InjectedBundle.h: 11 1 12 2019-09-06 Patrick Griffis <pgriffis@igalia.com> 2 13 -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp
r248846 r249575 167 167 } 168 168 169 void WKBundleSetPrivateBrowsingEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)170 { 171 WebKit::toImpl(bundleRef)->setPrivateBrowsingEnabled(WebKit::toImpl(pageGroupRef), enabled);169 void WKBundleSetPrivateBrowsingEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, WKBundlePageRef pageRef, bool enabled) 170 { 171 WebKit::toImpl(bundleRef)->setPrivateBrowsingEnabled(WebKit::toImpl(pageGroupRef), WebKit::toImpl(pageRef), enabled); 172 172 } 173 173 -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
r246285 r249575 50 50 WK_EXPORT void WKBundleSetFrameFlatteningEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); 51 51 WK_EXPORT void WKBundleSetJavaScriptCanAccessClipboard(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); 52 WK_EXPORT void WKBundleSetPrivateBrowsingEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);52 WK_EXPORT void WKBundleSetPrivateBrowsingEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, WKBundlePageRef pageRef, bool enabled); 53 53 WK_EXPORT void WKBundleSetPopupBlockingEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); 54 54 WK_EXPORT void WKBundleSetAuthorAndUserStylesEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); -
trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp
r249354 r249575 347 347 } 348 348 349 void InjectedBundle::setPrivateBrowsingEnabled(WebPageGroupProxy* pageGroup, bool enabled)349 void InjectedBundle::setPrivateBrowsingEnabled(WebPageGroupProxy* pageGroup, WebPage* page, bool enabled) 350 350 { 351 351 ASSERT(!hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies)); 352 if (enabled) 352 353 PAL::SessionID newSessionID = PAL::SessionID::legacyPrivateSessionID(); 354 if (enabled) { 355 auto currentSessionID = page->corePage()->sessionID(); 356 if (currentSessionID == PAL::SessionID::legacyPrivateSessionID()) 357 return; 358 m_initialSessionID = currentSessionID; 353 359 WebProcess::singleton().ensureLegacyPrivateBrowsingSessionInNetworkProcess(); 354 355 PageGroup::pageGroup(pageGroup->identifier())->enableLegacyPrivateBrowsingForTesting(enabled); 360 } else { 361 if (!m_initialSessionID) 362 return; 363 newSessionID = *std::exchange(m_initialSessionID, WTF::nullopt); 364 } 365 366 PageGroup::pageGroup(pageGroup->identifier())->setSessionIDForTesting(newSessionID); 356 367 357 368 auto webStorageNameSpaceProvider = WebStorageNamespaceProvider::getOrCreate(*pageGroup); 358 webStorageNameSpaceProvider-> enableLegacyPrivateBrowsingForTesting(enabled);369 webStorageNameSpaceProvider->setSessionIDForTesting(newSessionID); 359 370 } 360 371 -
trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h
r246285 r249575 32 32 #include <WebCore/UserContentTypes.h> 33 33 #include <WebCore/UserScriptTypes.h> 34 #include <pal/SessionID.h> 34 35 #include <wtf/RefPtr.h> 35 36 #include <wtf/RetainPtr.h> … … 105 106 void setPluginsEnabled(WebPageGroupProxy*, bool); 106 107 void setJavaScriptCanAccessClipboard(WebPageGroupProxy*, bool); 107 void setPrivateBrowsingEnabled(WebPageGroupProxy*, bool);108 void setPrivateBrowsingEnabled(WebPageGroupProxy*, WebPage*, bool); 108 109 void setPopupBlockingEnabled(WebPageGroupProxy*, bool); 109 110 void setAuthorAndUserStylesEnabled(WebPageGroupProxy*, bool); … … 174 175 std::unique_ptr<API::InjectedBundle::Client> m_client; 175 176 177 Optional<PAL::SessionID> m_initialSessionID; 178 176 179 #if PLATFORM(COCOA) 177 180 RetainPtr<WKWebProcessBundleParameters> m_bundleParameters; -
trunk/Source/WebKitLegacy/mac/ChangeLog
r249571 r249575 1 2019-09-06 Alex Christensen <achristensen@webkit.org> 2 3 When disabling legacy private browsing for testing, change the SessionID back to what it was, not the defaultSessionID 4 https://bugs.webkit.org/show_bug.cgi?id=201480 5 6 Reviewed by Youenn Fablet. 7 8 * WebView/WebView.mm: 9 (-[WebView _preferencesChanged:]): 10 1 11 2019-09-06 Rob Buis <rbuis@igalia.com> 2 12 -
trunk/Source/WebKitLegacy/mac/WebView/WebView.mm
r249571 r249575 2889 2889 settings.setLocalStorageEnabled([preferences localStorageEnabled]); 2890 2890 2891 _private->page-> enableLegacyPrivateBrowsing([preferences privateBrowsingEnabled]);2892 _private->group->storageNamespaceProvider(). enableLegacyPrivateBrowsingForTesting([preferences privateBrowsingEnabled]);2891 _private->page->setSessionID([preferences privateBrowsingEnabled] ? PAL::SessionID::legacyPrivateSessionID() : PAL::SessionID::defaultSessionID()); 2892 _private->group->storageNamespaceProvider().setSessionIDForTesting([preferences privateBrowsingEnabled] ? PAL::SessionID::legacyPrivateSessionID() : PAL::SessionID::defaultSessionID()); 2893 2893 settings.setSansSerifFontFamily([preferences sansSerifFontFamily]); 2894 2894 settings.setSerifFontFamily([preferences serifFontFamily]); -
trunk/Source/WebKitLegacy/win/ChangeLog
r249571 r249575 1 2019-09-06 Alex Christensen <achristensen@webkit.org> 2 3 When disabling legacy private browsing for testing, change the SessionID back to what it was, not the defaultSessionID 4 https://bugs.webkit.org/show_bug.cgi?id=201480 5 6 Reviewed by Youenn Fablet. 7 8 * WebView.cpp: 9 (WebView::notifyPreferencesChanged): 10 1 11 2019-09-06 Rob Buis <rbuis@igalia.com> 2 12 -
trunk/Source/WebKitLegacy/win/WebView.cpp
r249571 r249575 5308 5308 WebFrameNetworkingContext::destroyPrivateBrowsingSession(); 5309 5309 #endif 5310 m_page-> enableLegacyPrivateBrowsing(!!enabled);5310 m_page->setSessionID(!!enabled ? PAL::SessionID::legacyPrivateSessionID() : PAL::SessionID::defaultSessionID()); 5311 5311 5312 5312 hr = preferences->sansSerifFontFamily(&str); -
trunk/Tools/ChangeLog
r249571 r249575 1 2019-09-06 Alex Christensen <achristensen@webkit.org> 2 3 When disabling legacy private browsing for testing, change the SessionID back to what it was, not the defaultSessionID 4 https://bugs.webkit.org/show_bug.cgi?id=201480 5 6 Reviewed by Youenn Fablet. 7 8 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 9 (WTR::InjectedBundle::beginTesting): 10 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 11 (WTR::TestRunner::setPrivateBrowsingEnabled): 12 1 13 2019-09-06 Rob Buis <rbuis@igalia.com> 2 14 -
trunk/Tools/TestWebKitAPI/glib/CMakeLists.txt
r246039 r249575 8 8 9 9 set(WebKitGLibAPITests_INCLUDE_DIRECTORIES 10 ${CMAKE_SOURCE_DIR}/Source11 ${CMAKE_SOURCE_DIR}/Source/WTF12 10 ${FORWARDING_HEADERS_DIR} 13 11 ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r249557 r249575 498 498 WKBundleSetAllowUniversalAccessFromFileURLs(m_bundle, m_pageGroup, true); 499 499 WKBundleSetJavaScriptCanAccessClipboard(m_bundle, m_pageGroup, true); 500 WKBundleSetPrivateBrowsingEnabled(m_bundle, m_pageGroup, false);500 WKBundleSetPrivateBrowsingEnabled(m_bundle, m_pageGroup, page()->page(), false); 501 501 WKBundleSetAuthorAndUserStylesEnabled(m_bundle, m_pageGroup, true); 502 502 WKBundleSetFrameFlatteningEnabled(m_bundle, m_pageGroup, false); -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r249542 r249575 535 535 { 536 536 auto& injectedBundle = InjectedBundle::singleton(); 537 WKBundleSetPrivateBrowsingEnabled(injectedBundle.bundle(), injectedBundle.pageGroup(), enabled);537 WKBundleSetPrivateBrowsingEnabled(injectedBundle.bundle(), injectedBundle.pageGroup(), injectedBundle.page()->page(), enabled); 538 538 } 539 539
Note:
See TracChangeset
for help on using the changeset viewer.