Changeset 249817 in webkit


Ignore:
Timestamp:
Sep 12, 2019 3:12:25 PM (5 years ago)
Author:
Chris Dumez
Message:

[WKTR] Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED()
https://bugs.webkit.org/show_bug.cgi?id=201546

Reviewed by Alex Christensen.

Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED() from WebKitTestRunner as it does not do
the right thing for WebKit2 and tests have been rewritten to not use it.

Source/WebCore:

  • page/PageGroup.cpp:

(WebCore::PageGroup::addPage):
(WebCore::PageGroup::setSessionIDForTesting): Deleted.

  • page/PageGroup.h:

(): Deleted.

Source/WebKit:

  • NetworkProcess/NetworkConnectionToWebProcess.cpp:

(WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): Deleted.

  • NetworkProcess/NetworkConnectionToWebProcess.h:
  • NetworkProcess/NetworkConnectionToWebProcess.messages.in:
  • WebProcess/InjectedBundle/API/c/WKBundle.cpp:

(WKBundleSetPrivateBrowsingEnabled): Deleted.

  • WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
  • WebProcess/InjectedBundle/InjectedBundle.cpp:

(WebKit::InjectedBundle::setPrivateBrowsingEnabled): Deleted.

  • WebProcess/InjectedBundle/InjectedBundle.h:
  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess): Deleted.

  • WebProcess/WebProcess.h:
  • WebProcess/WebStorage/StorageNamespaceImpl.cpp:

(WebKit::StorageNamespaceImpl::setSessionIDForTesting):

Tools:

  • WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::setPrivateBrowsingEnabled_DEPRECATED): Deleted.

  • WebKitTestRunner/InjectedBundle/TestRunner.h:
Location:
trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r249778 r249817  
    477477### START OF (5) Features that are not supported when NetworkProcess is enabled (i.e. they only work on Mountain Lion, and not on newer OS versions).
    478478
    479 # https://bugs.webkit.org/show_bug.cgi?id=115274
    480 # PPT: testRunner.setPrivateBrowsingEnabled_DEPRECATED() doesn't work with NetworkProcess
    481 http/tests/security/appcache-in-private-browsing.html [ Skip ]
    482 http/tests/security/appcache-switching-private-browsing.html [ Skip ]
    483 http/tests/security/cookies/first-party-cookie-allow-xslt.xml [ Skip ]
    484 http/tests/security/cookies/third-party-cookie-blocking-xslt.xml [ Skip ]
    485 http/tests/security/cross-origin-plugin-private-browsing-toggled-allowed.html [ Skip ]
    486 http/tests/security/cross-origin-plugin-private-browsing-toggled.html [ Skip ]
    487 http/tests/security/storage-blocking-loosened-private-browsing-plugin.html [ Skip ]
    488 http/tests/security/storage-blocking-strengthened-private-browsing-plugin.html [ Skip ]
    489 plugins/private-browsing-mode-2.html [ Skip ]
    490 storage/websql/private-browsing-noread-nowrite.html [ Skip ]
    491 
    492479# There is no network load scheduling or prioritization with NetworkProcess.
    493480webkit.org/b/123431 http/tests/css/link-css-disabled-value-with-slow-loading-sheet-in-error.html [ Pass Failure ]
  • trunk/LayoutTests/platform/wk2/TestExpectations

    r249778 r249817  
    8888platform/mac/fast/text/attributed-substring-from-range.html
    8989platform/mac/fast/text/justified-text-rect.html
     90
     91# https://bugs.webkit.org/show_bug.cgi?id=115274
     92# testRunner.setPrivateBrowsingEnabled_DEPRECATED() doesn't work with NetworkProcess and is WebKitLegacy only.
     93http/tests/security/appcache-in-private-browsing.html [ Skip ]
     94http/tests/security/appcache-switching-private-browsing.html [ Skip ]
     95http/tests/security/cookies/first-party-cookie-allow-xslt.xml [ Skip ]
     96http/tests/security/cookies/third-party-cookie-blocking-xslt.xml [ Skip ]
     97http/tests/security/cross-origin-plugin-private-browsing-toggled-allowed.html [ Skip ]
     98http/tests/security/cross-origin-plugin-private-browsing-toggled.html [ Skip ]
     99http/tests/security/storage-blocking-loosened-private-browsing-plugin.html [ Skip ]
     100http/tests/security/storage-blocking-strengthened-private-browsing-plugin.html [ Skip ]
     101plugins/private-browsing-mode-2.html [ Skip ]
     102storage/websql/private-browsing-noread-nowrite.html [ Skip ]
    90103
    91104# [WebKit2] WebKitTestRunner doesn't support emulating pressing a tab key during IME composition
  • trunk/Source/WebCore/ChangeLog

    r249816 r249817  
     12019-09-12  Chris Dumez  <cdumez@apple.com>
     2
     3        [WKTR] Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED()
     4        https://bugs.webkit.org/show_bug.cgi?id=201546
     5
     6        Reviewed by Alex Christensen.
     7
     8        Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED() from WebKitTestRunner as it does not do
     9        the right thing for WebKit2 and tests have been rewritten to not use it.
     10
     11        * page/PageGroup.cpp:
     12        (WebCore::PageGroup::addPage):
     13        (WebCore::PageGroup::setSessionIDForTesting): Deleted.
     14        * page/PageGroup.h:
     15        (): Deleted.
     16
    1172019-09-12  Saam Barati  <sbarati@apple.com>
    218
  • trunk/Source/WebCore/page/PageGroup.cpp

    r249575 r249817  
    9494    ASSERT(!m_pages.contains(&page));
    9595    m_pages.add(&page);
    96    
    97     if (m_isLegacyPrivateBrowsingEnabledForTesting)
    98         page.setSessionID(PAL::SessionID::legacyPrivateSessionID());
    9996}
    10097
     
    127124#endif
    128125
    129 void PageGroup::setSessionIDForTesting(const PAL::SessionID& sessionID)
    130 {
    131     bool legacyPrivate = sessionID == PAL::SessionID::legacyPrivateSessionID();
    132     if (m_isLegacyPrivateBrowsingEnabledForTesting == legacyPrivate)
    133         return;
    134 
    135     m_isLegacyPrivateBrowsingEnabledForTesting = legacyPrivate;
    136    
    137     for (auto* page : m_pages)
    138         page->setSessionID(sessionID);
    139 }
    140 
    141126} // namespace WebCore
  • trunk/Source/WebCore/page/PageGroup.h

    r249575 r249817  
    6363#endif
    6464
    65     WEBCORE_EXPORT void setSessionIDForTesting(const PAL::SessionID&);
    66 
    6765private:
    6866    String m_name;
     
    7472    std::unique_ptr<CaptionUserPreferences> m_captionPreferences;
    7573#endif
    76 
    77     bool m_isLegacyPrivateBrowsingEnabledForTesting { false };
    7874};
    7975
  • trunk/Source/WebKit/ChangeLog

    r249815 r249817  
     12019-09-12  Chris Dumez  <cdumez@apple.com>
     2
     3        [WKTR] Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED()
     4        https://bugs.webkit.org/show_bug.cgi?id=201546
     5
     6        Reviewed by Alex Christensen.
     7
     8        Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED() from WebKitTestRunner as it does not do
     9        the right thing for WebKit2 and tests have been rewritten to not use it.
     10
     11        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
     12        (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): Deleted.
     13        * NetworkProcess/NetworkConnectionToWebProcess.h:
     14        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
     15        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
     16        (WKBundleSetPrivateBrowsingEnabled): Deleted.
     17        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
     18        * WebProcess/InjectedBundle/InjectedBundle.cpp:
     19        (WebKit::InjectedBundle::setPrivateBrowsingEnabled): Deleted.
     20        * WebProcess/InjectedBundle/InjectedBundle.h:
     21        * WebProcess/WebProcess.cpp:
     22        (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess): Deleted.
     23        * WebProcess/WebProcess.h:
     24        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
     25        (WebKit::StorageNamespaceImpl::setSessionIDForTesting):
     26
    1272019-09-12  Adrian Perez de Castro  <aperez@igalia.com>
    228
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp

    r249801 r249817  
    680680}
    681681
    682 void NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession()
    683 {
    684     m_networkProcess->addWebsiteDataStore(WebsiteDataStoreParameters::legacyPrivateSessionParameters());
    685 }
    686 
    687682#if ENABLE(RESOURCE_LOAD_STATISTICS)
    688683void NetworkConnectionToWebProcess::removeStorageAccessForFrame(PAL::SessionID sessionID, FrameIdentifier frameID, PageIdentifier pageID)
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h

    r249801 r249817  
    202202    void createSocketChannel(PAL::SessionID, const WebCore::ResourceRequest&, const String& protocol, uint64_t identifier);
    203203
    204     void ensureLegacyPrivateBrowsingSession();
    205 
    206204#if ENABLE(INDEXED_DATABASE)
    207205    // Messages handlers (Modern IDB).
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in

    r249801 r249817  
    5656    CreateSocketChannel(PAL::SessionID sessionID, WebCore::ResourceRequest request, String protocol, uint64_t identifier)
    5757
    58     EnsureLegacyPrivateBrowsingSession()
    59 
    6058#if ENABLE(RESOURCE_LOAD_STATISTICS)
    6159    RemoveStorageAccessForFrame(PAL::SessionID sessionID, WebCore::FrameIdentifier frameID, WebCore::PageIdentifier pageID);
  • trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp

    r249702 r249817  
    167167}
    168168
    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 }
    173 
    174169void WKBundleSetPopupBlockingEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)
    175170{
  • trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h

    r249702 r249817  
    5050WK_EXPORT void WKBundleSetFrameFlatteningEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
    5151WK_EXPORT void WKBundleSetJavaScriptCanAccessClipboard(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
    52 WK_EXPORT void WKBundleSetPrivateBrowsingEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, WKBundlePageRef pageRef, bool enabled);
    5352WK_EXPORT void WKBundleSetPopupBlockingEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
    5453WK_EXPORT void WKBundleSetAuthorAndUserStylesEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
  • trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp

    r249575 r249817  
    347347}
    348348
    349 void InjectedBundle::setPrivateBrowsingEnabled(WebPageGroupProxy* pageGroup, WebPage* page, bool enabled)
    350 {
    351     ASSERT(!hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies));
    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;
    359         WebProcess::singleton().ensureLegacyPrivateBrowsingSessionInNetworkProcess();
    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);
    367 
    368     auto webStorageNameSpaceProvider = WebStorageNamespaceProvider::getOrCreate(*pageGroup);
    369     webStorageNameSpaceProvider->setSessionIDForTesting(newSessionID);
    370 }
    371 
    372349void InjectedBundle::setPopupBlockingEnabled(WebPageGroupProxy* pageGroup, bool enabled)
    373350{
  • trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h

    r249575 r249817  
    106106    void setPluginsEnabled(WebPageGroupProxy*, bool);
    107107    void setJavaScriptCanAccessClipboard(WebPageGroupProxy*, bool);
    108     void setPrivateBrowsingEnabled(WebPageGroupProxy*, WebPage*, bool);
    109108    void setPopupBlockingEnabled(WebPageGroupProxy*, bool);
    110109    void setAuthorAndUserStylesEnabled(WebPageGroupProxy*, bool);
     
    175174    std::unique_ptr<API::InjectedBundle::Client> m_client;
    176175
    177     Optional<PAL::SessionID> m_initialSessionID;
    178 
    179176#if PLATFORM(COCOA)
    180177    RetainPtr<WKWebProcessBundleParameters> m_bundleParameters;
  • trunk/Source/WebKit/WebProcess/WebProcess.cpp

    r249801 r249817  
    600600}
    601601
    602 void WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess()
    603 {
    604     ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::EnsureLegacyPrivateBrowsingSession(), 0);
    605 }
    606 
    607602#if ENABLE(NETSCAPE_PLUGIN_API)
    608603PluginProcessConnectionManager& WebProcess::pluginProcessConnectionManager()
  • trunk/Source/WebKit/WebProcess/WebProcess.h

    r249801 r249817  
    208208    void setCacheModel(CacheModel);
    209209
    210     void ensureLegacyPrivateBrowsingSessionInNetworkProcess();
    211 
    212210    void pageDidEnterWindow(WebCore::PageIdentifier);
    213211    void pageWillLeaveWindow(WebCore::PageIdentifier);
  • trunk/Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.cpp

    r249435 r249817  
    123123}
    124124
    125 void StorageNamespaceImpl::setSessionIDForTesting(PAL::SessionID sessionID)
     125void StorageNamespaceImpl::setSessionIDForTesting(PAL::SessionID)
    126126{
    127     m_sessionID = sessionID;
    128     for (auto storageAreaMap : m_storageAreaMaps.values())
    129         storageAreaMap->disconnect();
     127    ASSERT_NOT_REACHED();
    130128}
    131129
  • trunk/Tools/ChangeLog

    r249812 r249817  
     12019-09-12  Chris Dumez  <cdumez@apple.com>
     2
     3        [WKTR] Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED()
     4        https://bugs.webkit.org/show_bug.cgi?id=201546
     5
     6        Reviewed by Alex Christensen.
     7
     8        Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED() from WebKitTestRunner as it does not do
     9        the right thing for WebKit2 and tests have been rewritten to not use it.
     10
     11        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
     12        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
     13        (WTR::TestRunner::setPrivateBrowsingEnabled_DEPRECATED): Deleted.
     14        * WebKitTestRunner/InjectedBundle/TestRunner.h:
     15
    1162019-09-12  Brady Eidson  <beidson@apple.com>
    217
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl

    r249702 r249817  
    105105    void setIgnoresViewportScaleLimits(boolean value);
    106106    void setShouldDownloadUndisplayableMIMETypes(boolean value);
    107    
    108     // DEPRECATED: Use <!-- webkit-test-runner [ useEphemeralSession=true ] --> instead, or
    109     // testRunner.setShouldSwapToEphemeralSessionOnNextNavigation() / testRunner.setShouldSwapToDefaultSessionOnNextNavigation().
    110     void setPrivateBrowsingEnabled_DEPRECATED(boolean value);
    111107
    112108    // Special DOM functions.
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp

    r249702 r249817  
    498498    WKBundleSetAllowUniversalAccessFromFileURLs(m_bundle, m_pageGroup, true);
    499499    WKBundleSetJavaScriptCanAccessClipboard(m_bundle, m_pageGroup, true);
    500     WKBundleSetPrivateBrowsingEnabled(m_bundle, m_pageGroup, page()->page(), false);
    501500    WKBundleSetAuthorAndUserStylesEnabled(m_bundle, m_pageGroup, true);
    502501    WKBundleSetFrameFlatteningEnabled(m_bundle, m_pageGroup, false);
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp

    r249702 r249817  
    550550}
    551551
    552 void TestRunner::setPrivateBrowsingEnabled_DEPRECATED(bool enabled)
    553 {
    554     auto& injectedBundle = InjectedBundle::singleton();
    555     WKBundleSetPrivateBrowsingEnabled(injectedBundle.bundle(), injectedBundle.pageGroup(), injectedBundle.page()->page(), enabled);
    556 }
    557 
    558552void TestRunner::setPopupBlockingEnabled(bool enabled)
    559553{
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h

    r249702 r249817  
    113113    void setPluginsEnabled(bool);
    114114    void setJavaScriptCanAccessClipboard(bool);
    115     void setPrivateBrowsingEnabled_DEPRECATED(bool);
    116115    void setPopupBlockingEnabled(bool);
    117116    void setAuthorAndUserStylesEnabled(bool);
Note: See TracChangeset for help on using the changeset viewer.