Changeset 251439 in webkit


Ignore:
Timestamp:
Oct 22, 2019, 10:09:59 AM (6 years ago)
Author:
achristensen@apple.com
Message:

Remove mayHaveServiceWorkerRegisteredForOrigin
https://bugs.webkit.org/show_bug.cgi?id=203055

Patch by youenn fablet <youenn@apple.com> on 2019-10-22
Reviewed by Alex Christensen.

Source/WebCore:

Remove ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin and existingServiceWorkerConnection since they are no longer useful.
Creation of a service worker connection no longer requires any additional IPC once network connection is created.
Covered by existing tests.

  • dom/Document.cpp:

(WebCore::Document::resume):

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::matchRegistration):
(WebCore::DocumentLoader::commitData):

  • testing/Internals.cpp:

(WebCore::Internals::terminateServiceWorker):

  • testing/Internals.h:
  • testing/Internals.idl:
  • workers/service/SWClientConnection.h:
  • workers/service/ServiceWorkerProvider.cpp:
  • workers/service/ServiceWorkerProvider.h:
  • workers/service/WorkerSWClientConnection.cpp:
  • workers/service/WorkerSWClientConnection.h:

Source/WebKit:

This optimization was used for ensuring we would not create a storage process when no service worker registration is stored on disk.
Now that we do not have a storage process and we are doing registration matching direclty in network process, we can safely remove that optimization.
We also move the throttle state handling in WK2 layer. This allows us to not create a network process connection to update throttle state until
there is a network process connection. This allows continuing passing an API test checking network process connections after crashes.

  • Shared/WebPageCreationParameters.cpp:

(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):

  • Shared/WebPageCreationParameters.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::creationParameters):

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
(WebKit::WebProcessPool::updateServiceWorkerUserAgent):

  • UIProcess/WebProcessPool.h:
  • WebProcess/Network/NetworkProcessConnection.h:
  • WebProcess/Storage/WebSWClientConnection.h:
  • WebProcess/Storage/WebServiceWorkerProvider.cpp:

(WebKit::WebServiceWorkerProvider::serviceWorkerConnection):
(WebKit::WebServiceWorkerProvider::updateThrottleState):

  • WebProcess/Storage/WebServiceWorkerProvider.h:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::m_textAutoSizingAdjustmentTimer):
(WebKit::WebPage::updateThrottleState):

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

Remove obsolete test.

Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r251437 r251439  
     12019-10-22  youenn fablet  <youenn@apple.com>
     2
     3        Remove mayHaveServiceWorkerRegisteredForOrigin
     4        https://bugs.webkit.org/show_bug.cgi?id=203055
     5
     6        Reviewed by Alex Christensen.
     7
     8        Remove ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin and existingServiceWorkerConnection since they are no longer useful.
     9        Creation of a service worker connection no longer requires any additional IPC once network connection is created.
     10        Covered by existing tests.
     11
     12        * dom/Document.cpp:
     13        (WebCore::Document::resume):
     14        * loader/DocumentLoader.cpp:
     15        (WebCore::DocumentLoader::matchRegistration):
     16        (WebCore::DocumentLoader::commitData):
     17        * testing/Internals.cpp:
     18        (WebCore::Internals::terminateServiceWorker):
     19        * testing/Internals.h:
     20        * testing/Internals.idl:
     21        * workers/service/SWClientConnection.h:
     22        * workers/service/ServiceWorkerProvider.cpp:
     23        * workers/service/ServiceWorkerProvider.h:
     24        * workers/service/WorkerSWClientConnection.cpp:
     25        * workers/service/WorkerSWClientConnection.h:
     26
    1272019-10-21  Simon Fraser  <simon.fraser@apple.com>
    228
  • trunk/Source/WebCore/dom/Document.cpp

    r251425 r251439  
    52385238#if ENABLE(SERVICE_WORKER)
    52395239    if (RuntimeEnabledFeatures::sharedFeatures().serviceWorkerEnabled() && reason == ReasonForSuspension::BackForwardCache)
    5240         setServiceWorkerConnection(ServiceWorkerProvider::singleton().existingServiceWorkerConnection());
     5240        setServiceWorkerConnection(&ServiceWorkerProvider::singleton().serviceWorkerConnection());
    52415241#endif
    52425242}
  • trunk/Source/WebCore/loader/DocumentLoader.cpp

    r251409 r251439  
    506506
    507507    auto origin = (!m_frame->isMainFrame() && m_frame->document()) ? m_frame->document()->topOrigin().data() : SecurityOriginData::fromURL(url);
    508     auto& provider = ServiceWorkerProvider::singleton();
    509     if (!provider.mayHaveServiceWorkerRegisteredForOrigin(origin)) {
     508    if (!ServiceWorkerProvider::singleton().serviceWorkerConnection().mayHaveServiceWorkerRegisteredForOrigin(origin)) {
    510509        callback(WTF::nullopt);
    511510        return;
     
    10621061
    10631062            if (m_frame->document()->activeServiceWorker() || LegacySchemeRegistry::canServiceWorkersHandleURLScheme(m_frame->document()->url().protocol().toStringWithoutCopying()))
    1064                 m_frame->document()->setServiceWorkerConnection(ServiceWorkerProvider::singleton().existingServiceWorkerConnection());
     1063                m_frame->document()->setServiceWorkerConnection(&ServiceWorkerProvider::singleton().serviceWorkerConnection());
    10651064
    10661065            // We currently unregister the temporary service worker client since we now registered the real document.
  • trunk/Source/WebCore/testing/Internals.cpp

    r251425 r251439  
    50275027    ServiceWorkerProvider::singleton().serviceWorkerConnection().syncTerminateWorker(worker.identifier());
    50285028}
    5029 
    5030 bool Internals::hasServiceWorkerConnection()
    5031 {
    5032     if (!contextDocument())
    5033         return false;
    5034 
    5035     return ServiceWorkerProvider::singleton().existingServiceWorkerConnection();
    5036 }
    50375029#endif
    50385030
  • trunk/Source/WebCore/testing/Internals.h

    r251425 r251439  
    766766    void hasServiceWorkerRegistration(const String& clientURL, HasRegistrationPromise&&);
    767767    void terminateServiceWorker(ServiceWorker&);
    768     bool hasServiceWorkerConnection();
    769768#endif
    770769
  • trunk/Source/WebCore/testing/Internals.idl

    r251425 r251439  
    757757    [Conditional=SERVICE_WORKER] Promise<boolean> hasServiceWorkerRegistration(DOMString scopeURL);
    758758    [Conditional=SERVICE_WORKER] void terminateServiceWorker(ServiceWorker worker);
    759     [Conditional=SERVICE_WORKER] boolean hasServiceWorkerConnection();
    760759
    761760    [CallWith=Document, Conditional=APPLE_PAY] readonly attribute MockPaymentCoordinator mockPaymentCoordinator;
  • trunk/Source/WebCore/workers/service/SWClientConnection.h

    r249526 r251439  
    8686    virtual void finishFetchingScriptInServer(const ServiceWorkerFetchResult&) = 0;
    8787
    88     virtual bool isThrottleable() const = 0;
    89     virtual void updateThrottleState() = 0;
    90 
    9188    virtual void storeRegistrationsOnDiskForTesting(CompletionHandler<void()>&& callback) { callback(); }
    9289
  • trunk/Source/WebCore/workers/service/ServiceWorkerProvider.cpp

    r251067 r251439  
    5555}
    5656
    57 bool ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin(const SecurityOriginData& origin)
    58 {
    59     auto* connection = existingServiceWorkerConnection();
    60     if (!connection)
    61         return m_mayHaveRegisteredServiceWorkers;
    62 
    63     return connection->mayHaveServiceWorkerRegisteredForOrigin(origin);
    64 }
    65 
    6657void ServiceWorkerProvider::registerServiceWorkerClients()
    6758{
  • trunk/Source/WebCore/workers/service/ServiceWorkerProvider.h

    r250287 r251439  
    4141    static void setSharedProvider(ServiceWorkerProvider&);
    4242
    43     bool mayHaveServiceWorkerRegisteredForOrigin(const SecurityOriginData&);
    44     virtual SWClientConnection* existingServiceWorkerConnection() = 0;
    4543    virtual SWClientConnection& serviceWorkerConnection() = 0;
    4644
  • trunk/Source/WebCore/workers/service/WorkerSWClientConnection.cpp

    r250104 r251439  
    185185}
    186186
    187 bool WorkerSWClientConnection::isThrottleable() const
    188 {
    189     return true;
    190 }
    191 
    192 void WorkerSWClientConnection::updateThrottleState()
    193 {
    194 }
    195 
    196187void WorkerSWClientConnection::scheduleJob(DocumentOrWorkerIdentifier identifier, const ServiceWorkerJobData& data)
    197188{
  • trunk/Source/WebCore/workers/service/WorkerSWClientConnection.h

    r250104 r251439  
    5656    void unregisterServiceWorkerClient(DocumentIdentifier) final;
    5757    void finishFetchingScriptInServer(const ServiceWorkerFetchResult&) final;
    58     bool isThrottleable() const final;
    59     void updateThrottleState() final;
    6058    void scheduleJobInServer(const ServiceWorkerJobData&) final;
    6159    void scheduleJob(DocumentOrWorkerIdentifier, const ServiceWorkerJobData&) final;
  • trunk/Source/WebKit/ChangeLog

    r251438 r251439  
     12019-10-22  youenn fablet  <youenn@apple.com>
     2
     3        Remove mayHaveServiceWorkerRegisteredForOrigin
     4        https://bugs.webkit.org/show_bug.cgi?id=203055
     5
     6        Reviewed by Alex Christensen.
     7
     8        This optimization was used for ensuring we would not create a storage process when no service worker registration is stored on disk.
     9        Now that we do not have a storage process and we are doing registration matching direclty in network process, we can safely remove that optimization.
     10        We also move the throttle state handling in WK2 layer. This allows us to not create a network process connection to update throttle state until
     11        there is a network process connection. This allows continuing passing an API test checking network process connections after crashes.
     12
     13        * Shared/WebPageCreationParameters.cpp:
     14        (WebKit::WebPageCreationParameters::encode const):
     15        (WebKit::WebPageCreationParameters::decode):
     16        * Shared/WebPageCreationParameters.h:
     17        * UIProcess/WebPageProxy.cpp:
     18        (WebKit::WebPageProxy::creationParameters):
     19        * UIProcess/WebProcessPool.cpp:
     20        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
     21        (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
     22        * UIProcess/WebProcessPool.h:
     23        * WebProcess/Network/NetworkProcessConnection.h:
     24        * WebProcess/Storage/WebSWClientConnection.h:
     25        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
     26        (WebKit::WebServiceWorkerProvider::serviceWorkerConnection):
     27        (WebKit::WebServiceWorkerProvider::updateThrottleState):
     28        * WebProcess/Storage/WebServiceWorkerProvider.h:
     29        * WebProcess/WebPage/WebPage.cpp:
     30        (WebKit::m_textAutoSizingAdjustmentTimer):
     31        (WebKit::WebPage::updateThrottleState):
     32
    1332019-10-22  Yury Semikhatsky  <yurys@chromium.org>
    234
  • trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp

    r249939 r251439  
    118118    encoder << applicationManifest;
    119119#endif
    120 #if ENABLE(SERVICE_WORKER)
    121     encoder << hasRegisteredServiceWorkers;
    122 #endif
    123120    encoder << needsFontAttributes;
    124121    encoder << iceCandidateFilteringEnabled;
     
    344341    parameters.applicationManifest = WTFMove(*applicationManifest);
    345342#endif
    346 #if ENABLE(SERVICE_WORKER)
    347     if (!decoder.decode(parameters.hasRegisteredServiceWorkers))
    348         return WTF::nullopt;
    349 #endif
    350 
    351343    if (!decoder.decode(parameters.needsFontAttributes))
    352344        return WTF::nullopt;
  • trunk/Source/WebKit/Shared/WebPageCreationParameters.h

    r249939 r251439  
    183183#endif
    184184
    185 #if ENABLE(SERVICE_WORKER)
    186     bool hasRegisteredServiceWorkers { true };
    187 #endif
    188 
    189185    bool needsFontAttributes { false };
    190186
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r251388 r251439  
    73857385#endif
    73867386
    7387 #if ENABLE(SERVICE_WORKER)
    7388     parameters.hasRegisteredServiceWorkers = process.processPool().mayHaveRegisteredServiceWorkers(process.websiteDataStore());
    7389 #endif
    7390 
    73917387    parameters.needsFontAttributes = m_needsFontAttributes;
    73927388    parameters.backgroundColor = m_backgroundColor;
  • trunk/Source/WebKit/UIProcess/WebProcessPool.cpp

    r251384 r251439  
    692692    ASSERT_UNUSED(proxy, &proxy == m_networkProcess.get());
    693693
    694     m_mayHaveRegisteredServiceWorkers.clear();
    695 
    696694    auto* websiteDataStore = WebsiteDataStore::existingNonDefaultDataStoreForSessionID(sessionID);
    697695
     
    12641262    for (auto* serviceWorkerProcess : m_serviceWorkerProcesses.values())
    12651263        serviceWorkerProcess->setServiceWorkerUserAgent(m_serviceWorkerUserAgent);
    1266 }
    1267 
    1268 bool WebProcessPool::mayHaveRegisteredServiceWorkers(const WebsiteDataStore& store)
    1269 {
    1270     if (!m_serviceWorkerProcesses.isEmpty())
    1271         return true;
    1272 
    1273     String serviceWorkerRegistrationDirectory = store.resolvedServiceWorkerRegistrationDirectory();
    1274     if (serviceWorkerRegistrationDirectory.isEmpty())
    1275         serviceWorkerRegistrationDirectory = WebsiteDataStore::defaultServiceWorkerRegistrationDirectory();
    1276 
    1277     return m_mayHaveRegisteredServiceWorkers.ensure(serviceWorkerRegistrationDirectory, [&] {
    1278         // FIXME: Make this computation on a background thread.
    1279         return FileSystem::fileExists(WebCore::serviceWorkerRegistrationDatabaseFilename(serviceWorkerRegistrationDirectory));
    1280     }).iterator->value;
    12811264}
    12821265#endif
  • trunk/Source/WebKit/UIProcess/WebProcessPool.h

    r251181 r251439  
    394394    bool allowsAnySSLCertificateForServiceWorker() const { return m_allowsAnySSLCertificateForServiceWorker; }
    395395    void updateServiceWorkerUserAgent(const String& userAgent);
    396     bool mayHaveRegisteredServiceWorkers(const WebsiteDataStore&);
    397396#endif
    398397
     
    613612    String m_serviceWorkerUserAgent;
    614613    Optional<WebPreferencesStore> m_serviceWorkerPreferences;
    615     HashMap<String, bool> m_mayHaveRegisteredServiceWorkers;
    616614#endif
    617615
  • trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h

    r251361 r251439  
    7373
    7474#if ENABLE(SERVICE_WORKER)
    75     WebSWClientConnection* existingServiceWorkerConnection() { return m_swConnection.get(); }
    7675    WebSWClientConnection& serviceWorkerConnection();
    7776#endif
  • trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h

    r251409 r251439  
    6565    void syncTerminateWorker(WebCore::ServiceWorkerIdentifier) final;
    6666
     67    bool isThrottleable() const { return m_isThrottleable; }
     68    void updateThrottleState();
     69
    6770private:
    6871    WebSWClientConnection();
     
    8588
    8689    void didResolveRegistrationPromise(const WebCore::ServiceWorkerRegistrationKey&) final;
    87     void updateThrottleState() final;
    88     bool isThrottleable() const final { return m_isThrottleable; }
    8990    void storeRegistrationsOnDiskForTesting(CompletionHandler<void()>&&) final;
    9091
  • trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp

    r251124 r251439  
    5656WebCore::SWClientConnection& WebServiceWorkerProvider::serviceWorkerConnection()
    5757{
     58    ASSERT(RuntimeEnabledFeatures::sharedFeatures().serviceWorkerEnabled());
    5859    return WebProcess::singleton().ensureNetworkProcessConnection().serviceWorkerConnection();
    5960}
    6061
    61 WebCore::SWClientConnection* WebServiceWorkerProvider::existingServiceWorkerConnection()
     62void WebServiceWorkerProvider::updateThrottleState(bool isThrottleable)
    6263{
    6364    auto* networkProcessConnection = WebProcess::singleton().existingNetworkProcessConnection();
    6465    if (!networkProcessConnection)
    65         return nullptr;
    66     return networkProcessConnection->existingServiceWorkerConnection();
     66        return;
     67    auto& connection = networkProcessConnection->serviceWorkerConnection();
     68    if (isThrottleable != connection.isThrottleable())
     69        connection.updateThrottleState();
    6770}
    6871
  • trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h

    r251124 r251439  
    4242
    4343    void didReceiveServiceWorkerClientRegistrationMatch(IPC::Connection&, IPC::Decoder&);
     44    void updateThrottleState(bool isThrottleable);
    4445
    4546private:
     
    4748    WebServiceWorkerProvider();
    4849
    49     WebCore::SWClientConnection* existingServiceWorkerConnection() final;
    5050    WebCore::SWClientConnection& serviceWorkerConnection() final;
    5151}; // class WebServiceWorkerProvider
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r251425 r251439  
    120120#include "WebProcessProxyMessages.h"
    121121#include "WebProgressTrackerClient.h"
     122#include "WebServiceWorkerProvider.h"
    122123#include "WebSocketProvider.h"
    123124#include "WebSpeechSynthesisClient.h"
     
    218219#include <WebCore/ScriptController.h>
    219220#include <WebCore/SerializedScriptValue.h>
    220 #include <WebCore/ServiceWorkerProvider.h>
    221221#include <WebCore/Settings.h>
    222222#include <WebCore/ShadowRoot.h>
     
    652652#endif
    653653
    654 #if ENABLE(SERVICE_WORKER)
    655     if (parameters.hasRegisteredServiceWorkers)
    656         ServiceWorkerProvider::singleton().setMayHaveRegisteredServiceWorkers();
    657 #endif
    658 
    659654    m_needsFontAttributes = parameters.needsFontAttributes;
    660655
     
    793788
    794789#if ENABLE(SERVICE_WORKER)
    795     RunLoop::main().dispatch([isThrottleable] {
    796         if (auto* connection = ServiceWorkerProvider::singleton().existingServiceWorkerConnection()) {
    797             if (isThrottleable != connection->isThrottleable())
    798                 connection->updateThrottleState();
    799         }
    800     });
     790    if (RuntimeEnabledFeatures::sharedFeatures().serviceWorkerEnabled()) {
     791        RunLoop::main().dispatch([isThrottleable] {
     792            WebServiceWorkerProvider::singleton().updateThrottleState(isThrottleable);
     793        });
     794    }
    801795#endif
    802796}
  • trunk/Tools/ChangeLog

    r251432 r251439  
     12019-10-22  youenn fablet  <youenn@apple.com>
     2
     3        Remove mayHaveServiceWorkerRegisteredForOrigin
     4        https://bugs.webkit.org/show_bug.cgi?id=203055
     5
     6        Reviewed by Alex Christensen.
     7
     8        * TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
     9        Remove obsolete test.
     10
    1112019-10-22  Antti Koivisto  <antti@apple.com>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm

    r251409 r251439  
    867867static const char* regularPageWithConnectionBytes = R"SWRESOURCE(
    868868<script>
    869 var result = window.internals.hasServiceWorkerConnection() ? "PASS" : "FAIL";
    870 window.webkit.messageHandlers.regularPage.postMessage(result);
     869window.webkit.messageHandlers.regularPage.postMessage("PASS");
    871870</script>
    872871)SWRESOURCE";
     
    10451044    // Make sure that loading this page did start the service worker process.
    10461045    EXPECT_EQ(1u, webView.get().configuration.processPool._serviceWorkerProcessCount);
    1047 
    1048     [[configuration websiteDataStore] removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() {
    1049         done = true;
    1050     }];
    1051     TestWebKitAPI::Util::run(&done);
    1052     done = false;
    1053 }
    1054 
    1055 TEST(ServiceWorkers, HasServiceWorkerRegistrationBit)
    1056 {
    1057     [WKWebsiteDataStore _allowWebsiteDataRecordsForAllOrigins];
    1058 
    1059     RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
    1060     setConfigurationInjectedBundlePath(configuration.get());
    1061 
    1062     done = false;
    1063 
    1064     [[configuration websiteDataStore] removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() {
    1065         done = true;
    1066     }];
    1067     TestWebKitAPI::Util::run(&done);
    1068     done = false;
    1069 
    1070     [[configuration websiteDataStore] fetchDataRecordsOfTypes:[NSSet setWithObject:WKWebsiteDataTypeServiceWorkerRegistrations] completionHandler:^(NSArray<WKWebsiteDataRecord *> *websiteDataRecords) {
    1071 
    1072         done = true;
    1073     }];
    1074     TestWebKitAPI::Util::run(&done);
    1075     done = false;
    1076 
    1077     RetainPtr<SWMessageHandler> messageHandler = adoptNS([[SWMessageHandler alloc] init]);
    1078     [[configuration userContentController] addScriptMessageHandler:messageHandler.get() name:@"sw"];
    1079     RetainPtr<RegularPageMessageHandler> regularPageMessageHandler = adoptNS([[RegularPageMessageHandler alloc] init]);
    1080     [[configuration userContentController] addScriptMessageHandler:regularPageMessageHandler.get() name:@"regularPage"];
    1081 
    1082     ServiceWorkerTCPServer server({
    1083         { "text/html", mainBytesWithScope },
    1084         { "application/javascript", scriptBytes },
    1085     }, {
    1086         { "text/html", regularPageWithConnectionBytes },
    1087     }, {
    1088         { "text/html", regularPageWithConnectionBytes }
    1089     });
    1090 
    1091     RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
    1092 
    1093     // Load a page that registers a service worker.
    1094     [webView loadRequest:server.request()];
    1095     TestWebKitAPI::Util::run(&done);
    1096     done = false;
    1097     webView = nullptr;
    1098 
    1099     // Now that a sw is registered, let's create a new configuration and try loading a regular page
    1100     RetainPtr<WKWebViewConfiguration> newConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
    1101     setConfigurationInjectedBundlePath(newConfiguration.get());
    1102 
    1103     [[newConfiguration userContentController] addScriptMessageHandler:messageHandler.get() name:@"sw"];
    1104     [[newConfiguration userContentController] addScriptMessageHandler:regularPageMessageHandler.get() name:@"regularPage"];
    1105 
    1106     newConfiguration.get().websiteDataStore = [WKWebsiteDataStore nonPersistentDataStore];
    1107     [newConfiguration.get().websiteDataStore _setServiceWorkerRegistrationDirectory: @"~/nonexistingfolder"];
    1108 
    1109     webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:newConfiguration.get()]);
    1110     [webView loadRequest:server.request()];
    1111     TestWebKitAPI::Util::run(&done);
    1112     done = false;
    1113 
    1114     // Let's use the web site data store that has service worker and load a page.
    1115     newConfiguration.get().websiteDataStore = [configuration websiteDataStore];
    1116 
    1117     webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:newConfiguration.get()]);
    1118     EXPECT_EQ(2u, webView.get().configuration.processPool._webProcessCountIgnoringPrewarmed);
    1119     [webView loadRequest:server.request()];
    1120     TestWebKitAPI::Util::run(&done);
    1121     done = false;
    1122 
    1123     // Make sure that loading the simple page did not start the service worker process.
    1124     EXPECT_EQ(2u, webView.get().configuration.processPool._webProcessCountIgnoringPrewarmed);
    11251046
    11261047    [[configuration websiteDataStore] removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() {
Note: See TracChangeset for help on using the changeset viewer.