Changeset 226510 in webkit
- Timestamp:
- Jan 8, 2018 6:43:50 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r226507 r226510 1 2018-01-08 Youenn Fablet <youenn@apple.com> 2 3 navigator.onLine does not work inside service workers 4 https://bugs.webkit.org/show_bug.cgi?id=181079 5 <rdar://problem/36178606> 6 7 Reviewed by Darin Adler. 8 9 * http/wpt/service-workers/online-worker.js: Added. 10 (async.waitForOnlineEvent): 11 (async.doTest): 12 * http/wpt/service-workers/online.https-expected.txt: Added. 13 * http/wpt/service-workers/online.https.html: Added. 14 1 15 2018-01-08 Youenn Fablet <youenn@apple.com> 2 16 -
trunk/Source/WebCore/CMakeLists.txt
r226332 r226510 1550 1550 testing/MockContentFilterSettings.idl 1551 1551 testing/MockPageOverlay.idl 1552 testing/ServiceWorkerInternals.idl 1552 1553 testing/TypeConversions.idl 1553 1554 ) … … 1569 1570 testing/MockPageOverlay.cpp 1570 1571 testing/MockPageOverlayClient.cpp 1571 1572 testing/ServiceWorkerInternals.cpp 1572 1573 testing/js/WebCoreTestSupport.cpp 1573 1574 ) -
trunk/Source/WebCore/ChangeLog
r226509 r226510 1 2018-01-08 Youenn Fablet <youenn@apple.com> 2 3 navigator.onLine does not work inside service workers 4 https://bugs.webkit.org/show_bug.cgi?id=181079 5 <rdar://problem/36178606> 6 7 Reviewed by Darin Adler. 8 9 Test: http/wpt/service-workers/online.https.html 10 11 Added support for onLine by reusing a similar implementation as regular workers. 12 Added ServiceWorkerInternals as an interface for an object exposed as self.internals in WTR. 13 This object has currently one method to trigger change in the online/offline status. 14 This allows writing a test for the onLine feature. 15 16 Note that self.internals is inserted asynchronously after the script was evaluated. 17 When writing a worker script using self.internals, one must make sure to use self.internals when initialized. 18 online-worker.js for instance makes use of self.internals in a postMessage callback. 19 20 * CMakeLists.txt: 21 * DerivedSources.make: 22 * WebCore.xcodeproj/project.pbxproj: 23 * bindings/js/WorkerScriptController.h: 24 * dom/ScriptExecutionContext.h: 25 * testing/ServiceWorkerInternals.cpp: Added. 26 (WebCore::ServiceWorkerInternals::ServiceWorkerInternals): 27 (WebCore::ServiceWorkerInternals::setOnline): 28 * testing/ServiceWorkerInternals.h: Added. 29 * testing/ServiceWorkerInternals.idl: Added. 30 * testing/js/WebCoreTestSupport.cpp: 31 (WebCoreTestSupport::setupNewlyCreateServiceWorker): 32 * testing/js/WebCoreTestSupport.h: 33 * workers/service/context/SWContextManager.cpp: 34 (WebCore::SWContextManager::registerServiceWorkerThreadForInstall): 35 (WebCore::SWContextManager::startedServiceWorker): 36 * workers/service/context/SWContextManager.h: 37 (WebCore::SWContextManager::setServiceWorkerCreationCallback): 38 (WebCore::SWContextManager::workerByID): 39 * workers/service/context/ServiceWorkerThread.cpp: 40 (WebCore::ServiceWorkerThread::ServiceWorkerThread): 41 * workers/service/context/ServiceWorkerThreadProxy.cpp: 42 (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy): 43 (WebCore::ServiceWorkerThreadProxy::~ServiceWorkerThreadProxy): 44 (WebCore::ServiceWorkerThreadProxy::networkStateChanged): 45 (WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange): 46 * workers/service/context/ServiceWorkerThreadProxy.h: 47 1 48 2018-01-08 Zan Dobersek <zdobersek@igalia.com> 2 49 -
trunk/Source/WebCore/DerivedSources.make
r226332 r226510 941 941 $(WebCore)/testing/MockPaymentAddress.idl \ 942 942 $(WebCore)/testing/MockPaymentCoordinator.idl \ 943 $(WebCore)/testing/ServiceWorkerInternals.idl \ 943 944 $(WebCore)/testing/TypeConversions.idl \ 944 945 $(WebCore)/workers/AbstractWorker.idl \ -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r226468 r226510 1025 1025 417DA6DA13734E6E007C57FB /* Internals.h in Headers */ = {isa = PBXBuildFile; fileRef = 417DA4CE13734326007C57FB /* Internals.h */; }; 1026 1026 417DA71D13735DFA007C57FB /* JSInternals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 417DA71B13735DFA007C57FB /* JSInternals.cpp */; }; 1027 427DA71D13735DFA007C57FB /* JSServiceWorkerInternals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 427DA71B13735DFA007C57FB /* JSServiceWorkerInternals.cpp */; }; 1027 1028 417DA71E13735DFA007C57FB /* JSInternals.h in Headers */ = {isa = PBXBuildFile; fileRef = 417DA71C13735DFA007C57FB /* JSInternals.h */; }; 1029 427DA71E13735DFA007C57FB /* JSServiceWorkerInternals.h in Headers */ = {isa = PBXBuildFile; fileRef = 427DA71C13735DFA007C57FB /* JSServiceWorkerInternals.h */; }; 1030 417F0D821FFEE979008EF303 /* ServiceWorkerInternals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 417F0D801FFEE14F008EF303 /* ServiceWorkerInternals.cpp */; }; 1028 1031 41815C1E138319830057AAA4 /* WebCoreTestSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41815C1C138319830057AAA4 /* WebCoreTestSupport.cpp */; }; 1029 1032 41815C1F138319830057AAA4 /* WebCoreTestSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 41815C1D138319830057AAA4 /* WebCoreTestSupport.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 7026 7029 417DA6D013734E02007C57FB /* libWebCoreTestSupport.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libWebCoreTestSupport.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; 7027 7030 417DA71B13735DFA007C57FB /* JSInternals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInternals.cpp; sourceTree = "<group>"; }; 7031 427DA71B13735DFA007C57FB /* JSServiceWorkerInternals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSServiceWorkerInternals.cpp; sourceTree = "<group>"; }; 7028 7032 417DA71C13735DFA007C57FB /* JSInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInternals.h; sourceTree = "<group>"; }; 7033 427DA71C13735DFA007C57FB /* JSServiceWorkerInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSServiceWorkerInternals.h; sourceTree = "<group>"; }; 7034 417F0D7E1FFEE14E008EF303 /* ServiceWorkerInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceWorkerInternals.h; sourceTree = "<group>"; }; 7035 417F0D801FFEE14F008EF303 /* ServiceWorkerInternals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceWorkerInternals.cpp; sourceTree = "<group>"; }; 7036 417F0D811FFEE150008EF303 /* ServiceWorkerInternals.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ServiceWorkerInternals.idl; sourceTree = "<group>"; }; 7029 7037 41813F9113818AD60057AAA4 /* Internals.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Internals.idl; sourceTree = "<group>"; }; 7030 7038 41815C1C138319830057AAA4 /* WebCoreTestSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreTestSupport.cpp; sourceTree = "<group>"; }; … … 16397 16405 A14061891E2ECA0A0032B34E /* MockPreviewLoaderClient.cpp */, 16398 16406 A140618A1E2ECA0A0032B34E /* MockPreviewLoaderClient.h */, 16407 417F0D801FFEE14F008EF303 /* ServiceWorkerInternals.cpp */, 16408 417F0D7E1FFEE14E008EF303 /* ServiceWorkerInternals.h */, 16409 417F0D811FFEE150008EF303 /* ServiceWorkerInternals.idl */, 16399 16410 EB081CD81696084400553730 /* TypeConversions.h */, 16400 16411 EB081CD91696084400553730 /* TypeConversions.idl */, … … 16429 16440 A146D3191F99BCBB00D29196 /* JSMockPaymentCoordinator.cpp */, 16430 16441 A146D3181F99BCBA00D29196 /* JSMockPaymentCoordinator.h */, 16442 427DA71B13735DFA007C57FB /* JSServiceWorkerInternals.cpp */, 16443 427DA71C13735DFA007C57FB /* JSServiceWorkerInternals.h */, 16431 16444 EBF5121A1696496C0056BD25 /* JSTypeConversions.cpp */, 16432 16445 EBF5121B1696496C0056BD25 /* JSTypeConversions.h */, … … 26171 26184 A146D3231F99D0EF00D29196 /* JSMockPaymentAddress.h in Headers */, 26172 26185 A146D31B1F99BCFB00D29196 /* JSMockPaymentCoordinator.h in Headers */, 26186 427DA71E13735DFA007C57FB /* JSServiceWorkerInternals.h in Headers */, 26173 26187 EBF5121D1696496C0056BD25 /* JSTypeConversions.h in Headers */, 26174 26188 CDC26B41160A8CCE0026757B /* LegacyMockCDM.h in Headers */, … … 30464 30478 A146D3221F99D0EC00D29196 /* JSMockPaymentAddress.cpp in Sources */, 30465 30479 A146D31A1F99BCF800D29196 /* JSMockPaymentCoordinator.cpp in Sources */, 30480 427DA71D13735DFA007C57FB /* JSServiceWorkerInternals.cpp in Sources */, 30466 30481 EBF5121C1696496C0056BD25 /* JSTypeConversions.cpp in Sources */, 30467 30482 CDC26B40160A8CC60026757B /* LegacyMockCDM.cpp in Sources */, … … 30477 30492 A140618B1E2ECA0A0032B34E /* MockPreviewLoaderClient.cpp in Sources */, 30478 30493 AA5F3B8F16CC4B3900455EB0 /* PlatformSpeechSynthesizerMock.cpp in Sources */, 30494 417F0D821FFEE979008EF303 /* ServiceWorkerInternals.cpp in Sources */, 30479 30495 DE7710861FA2F0D600460016 /* WebArchiveDumpSupport.mm in Sources */, 30480 30496 41815C1E138319830057AAA4 /* WebCoreTestSupport.cpp in Sources */, -
trunk/Source/WebCore/bindings/js/WorkerScriptController.h
r224295 r226510 95 95 initScript(); 96 96 } 97 void initScript();97 WEBCORE_EXPORT void initScript(); 98 98 99 99 RefPtr<JSC::VM> m_vm; -
trunk/Source/WebCore/dom/ScriptExecutionContext.h
r226274 r226510 236 236 } 237 237 238 JSC::ExecState* execState();238 WEBCORE_EXPORT JSC::ExecState* execState(); 239 239 240 240 WEBCORE_EXPORT String domainForCachePartition() const; -
trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp
r223476 r226510 33 33 #include "JSDocument.h" 34 34 #include "JSInternals.h" 35 #include "JSServiceWorkerInternals.h" 36 #include "JSWorkerGlobalScope.h" 35 37 #include "LogInitialization.h" 36 38 #include "MockGamepadProvider.h" 37 39 #include "Page.h" 40 #include "SWContextManager.h" 41 #include "ServiceWorkerGlobalScope.h" 38 42 #include "URLParser.h" 39 43 #include "WheelEventTestTrigger.h" … … 181 185 } 182 186 183 } 187 void setupNewlyCreatedServiceWorker(uint64_t serviceWorkerIdentifier) 188 { 189 #if ENABLE(SERVICE_WORKER) 190 auto identifier = makeObjectIdentifier<ServiceWorkerIdentifierType>(serviceWorkerIdentifier); 191 SWContextManager::singleton().postTaskToServiceWorker(identifier, [identifier] (ServiceWorkerGlobalScope& globalScope) { 192 auto* script = globalScope.script(); 193 if (!script) 194 return; 195 196 auto& state = *globalScope.execState(); 197 JSLockHolder locker(state.vm()); 198 auto* contextWrapper = script->workerGlobalScopeWrapper(); 199 contextWrapper->putDirect(state.vm(), Identifier::fromString(&state, Internals::internalsId), toJS(&state, contextWrapper, ServiceWorkerInternals::create(identifier))); 200 }); 201 #endif 202 } 203 204 } -
trunk/Source/WebCore/testing/js/WebCoreTestSupport.h
r208668 r226510 64 64 void setMockGamepadButtonValue(unsigned index, unsigned buttonIndex, double value) TEST_SUPPORT_EXPORT; 65 65 66 void setupNewlyCreatedServiceWorker(uint64_t serviceWorkerIdentifier) TEST_SUPPORT_EXPORT; 67 66 68 } // namespace WebCoreTestSupport -
trunk/Source/WebCore/workers/service/context/SWContextManager.cpp
r226399 r226510 59 59 60 60 threadProxy->thread().start([jobDataIdentifier, serviceWorkerIdentifier](const String& exceptionMessage) { 61 SWContextManager::singleton(). connection()->serviceWorkerStartedWithMessage(jobDataIdentifier, serviceWorkerIdentifier, exceptionMessage);61 SWContextManager::singleton().startedServiceWorker(jobDataIdentifier, serviceWorkerIdentifier, exceptionMessage); 62 62 }); 63 } 64 65 void SWContextManager::startedServiceWorker(std::optional<ServiceWorkerJobDataIdentifier> jobDataIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, const String& exceptionMessage) 66 { 67 connection()->serviceWorkerStartedWithMessage(jobDataIdentifier, serviceWorkerIdentifier, exceptionMessage); 68 if (m_serviceWorkerCreationCallback) 69 m_serviceWorkerCreationCallback(serviceWorkerIdentifier.toUInt64()); 63 70 } 64 71 -
trunk/Source/WebCore/workers/service/context/SWContextManager.h
r226274 r226510 77 77 WEBCORE_EXPORT bool postTaskToServiceWorker(ServiceWorkerIdentifier, WTF::Function<void(ServiceWorkerGlobalScope&)>&&); 78 78 79 using ServiceWorkerCreationCallback = void(uint64_t); 80 void setServiceWorkerCreationCallback(ServiceWorkerCreationCallback* callback) { m_serviceWorkerCreationCallback = callback; } 81 82 ServiceWorkerThreadProxy* workerByID(ServiceWorkerIdentifier identifier) { return m_workerMap.get(identifier); } 83 79 84 private: 80 85 SWContextManager() = default; 81 86 87 void startedServiceWorker(std::optional<ServiceWorkerJobDataIdentifier>, ServiceWorkerIdentifier, const String& exceptionMessage); 88 82 89 HashMap<ServiceWorkerIdentifier, RefPtr<ServiceWorkerThreadProxy>> m_workerMap; 83 90 std::unique_ptr<Connection> m_connection; 91 ServiceWorkerCreationCallback* m_serviceWorkerCreationCallback { nullptr }; 84 92 }; 85 93 -
trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp
r226191 r226510 34 34 #include "ExtendableMessageEvent.h" 35 35 #include "JSDOMPromise.h" 36 #include "NetworkStateNotifier.h" 36 37 #include "SecurityOrigin.h" 37 38 #include "ServiceWorkerFetch.h" … … 68 69 // FIXME: Use a valid WorkerReportingProxy 69 70 // FIXME: Use a valid WorkerObjectProxy 70 // FIXME: Use a valid isOnline flag71 71 // FIXME: Use valid runtime flags 72 72 73 73 ServiceWorkerThread::ServiceWorkerThread(const ServiceWorkerContextData& data, PAL::SessionID, String&& userAgent, WorkerLoaderProxy& loaderProxy, WorkerDebuggerProxy& debuggerProxy, IDBClient::IDBConnectionProxy* idbConnectionProxy, SocketProvider* socketProvider) 74 : WorkerThread(data.scriptURL, "serviceworker:" + Inspector::IdentifiersFactory::createIdentifier(), WTFMove(userAgent), /* isOnline */ false, data.script, loaderProxy, debuggerProxy, DummyServiceWorkerThreadProxy::shared(), WorkerThreadStartMode::Normal, ContentSecurityPolicyResponseHeaders { }, false, SecurityOrigin::create(data.scriptURL).get(), MonotonicTime::now(), idbConnectionProxy, socketProvider, JSC::RuntimeFlags::createAllEnabled(), SessionID::defaultSessionID())74 : WorkerThread(data.scriptURL, "serviceworker:" + Inspector::IdentifiersFactory::createIdentifier(), WTFMove(userAgent), NetworkStateNotifier::singleton().onLine(), data.script, loaderProxy, debuggerProxy, DummyServiceWorkerThreadProxy::shared(), WorkerThreadStartMode::Normal, ContentSecurityPolicyResponseHeaders { }, false, SecurityOrigin::create(data.scriptURL).get(), MonotonicTime::now(), idbConnectionProxy, socketProvider, JSC::RuntimeFlags::createAllEnabled(), SessionID::defaultSessionID()) 75 75 , m_data(data.isolatedCopy()) 76 76 , m_workerObjectProxy(DummyServiceWorkerThreadProxy::shared()) -
trunk/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp
r226399 r226510 78 78 } 79 79 80 static HashSet<ServiceWorkerThreadProxy*>& allServiceWorkerThreadProxies() 81 { 82 static NeverDestroyed<HashSet<ServiceWorkerThreadProxy*>> set; 83 return set; 84 } 85 80 86 ServiceWorkerThreadProxy::ServiceWorkerThreadProxy(PageConfiguration&& pageConfiguration, const ServiceWorkerContextData& data, PAL::SessionID sessionID, String&& userAgent, CacheStorageProvider& cacheStorageProvider, SecurityOrigin::StorageBlockingPolicy storageBlockingPolicy) 81 87 : m_page(createPageForServiceWorker(WTFMove(pageConfiguration), data, storageBlockingPolicy)) … … 86 92 , m_inspectorProxy(*this) 87 93 { 94 static bool addedListener; 95 if (!addedListener) { 96 NetworkStateNotifier::singleton().addListener(&networkStateChanged); 97 addedListener = true; 98 } 99 100 ASSERT(!allServiceWorkerThreadProxies().contains(this)); 101 allServiceWorkerThreadProxies().add(this); 102 88 103 #if ENABLE(REMOTE_INSPECTOR) 89 104 m_remoteDebuggable = std::make_unique<ServiceWorkerDebuggable>(*this, data); … … 91 106 m_remoteDebuggable->init(); 92 107 #endif 108 } 109 110 ServiceWorkerThreadProxy::~ServiceWorkerThreadProxy() 111 { 112 ASSERT(allServiceWorkerThreadProxies().contains(this)); 113 allServiceWorkerThreadProxies().remove(this); 93 114 } 94 115 … … 142 163 } 143 164 165 void ServiceWorkerThreadProxy::networkStateChanged(bool isOnLine) 166 { 167 for (auto* proxy : allServiceWorkerThreadProxies()) 168 proxy->notifyNetworkStateChange(isOnLine); 169 } 170 171 void ServiceWorkerThreadProxy::notifyNetworkStateChange(bool isOnline) 172 { 173 if (m_isTerminatingOrTerminated) 174 return; 175 176 postTaskForModeToWorkerGlobalScope([isOnline] (ScriptExecutionContext& context) { 177 auto& globalScope = downcast<WorkerGlobalScope>(context); 178 globalScope.setIsOnline(isOnline); 179 globalScope.dispatchEvent(Event::create(isOnline ? eventNames().onlineEvent : eventNames().offlineEvent, false, false)); 180 }, WorkerRunLoop::defaultMode()); 181 } 182 144 183 } // namespace WebCore 145 184 -
trunk/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h
r226399 r226510 55 55 return adoptRef(*new ServiceWorkerThreadProxy(std::forward<Args>(args)...)); 56 56 } 57 ~ServiceWorkerThreadProxy(); 57 58 58 59 ServiceWorkerIdentifier identifier() const { return m_serviceWorkerThread->identifier(); } … … 65 66 WEBCORE_EXPORT std::unique_ptr<FetchLoader> createBlobLoader(FetchLoaderClient&, const URL&); 66 67 68 // Public only for testing purposes. 69 WEBCORE_TESTSUPPORT_EXPORT void notifyNetworkStateChange(bool isOnline); 70 67 71 private: 68 72 WEBCORE_EXPORT ServiceWorkerThreadProxy(PageConfiguration&&, const ServiceWorkerContextData&, PAL::SessionID, String&& userAgent, CacheStorageProvider&, SecurityOrigin::StorageBlockingPolicy); 73 74 WEBCORE_EXPORT static void networkStateChanged(bool isOnLine); 69 75 70 76 // WorkerLoaderProxy -
trunk/Source/WebKit/ChangeLog
r226499 r226510 1 2018-01-08 Youenn Fablet <youenn@apple.com> 2 3 navigator.onLine does not work inside service workers 4 https://bugs.webkit.org/show_bug.cgi?id=181079 5 <rdar://problem/36178606> 6 7 Reviewed by Darin Adler. 8 9 Added support for a callback called for each service worker proxy creation. 10 Callback is used by WTR to inject a self.internals object used for testing. 11 12 * WebProcess/InjectedBundle/API/c/WKBundle.cpp: 13 (WKBundleSetServiceWorkerProxyCreationCallback): 14 * WebProcess/InjectedBundle/API/c/WKBundle.h: 15 * WebProcess/InjectedBundle/InjectedBundle.cpp: 16 (WebKit::InjectedBundle::setServiceWorkerProxyCreationCallback): 17 * WebProcess/InjectedBundle/InjectedBundle.h: 18 1 19 2018-01-07 David Kilzer <ddkilzer@apple.com> 2 20 -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp
r223565 r226510 41 41 #include <WebCore/DatabaseTracker.h> 42 42 #include <WebCore/ResourceLoadObserver.h> 43 #include <WebCore/ServiceWorkerThreadProxy.h> 43 44 44 45 using namespace WebCore; … … 53 54 { 54 55 toImpl(bundleRef)->setClient(std::make_unique<InjectedBundleClient>(wkClient)); 56 } 57 58 void WKBundleSetServiceWorkerProxyCreationCallback(WKBundleRef bundleRef, void (*callback)(uint64_t)) 59 { 60 toImpl(bundleRef)->setServiceWorkerProxyCreationCallback(callback); 55 61 } 56 62 -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.h
r188279 r226510 72 72 73 73 WK_EXPORT void WKBundleSetClient(WKBundleRef bundle, WKBundleClientBase* client); 74 WK_EXPORT void WKBundleSetServiceWorkerProxyCreationCallback(WKBundleRef bundle, void (*)(uint64_t)); 74 75 75 76 WK_EXPORT void WKBundlePostMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody); -
trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp
r226211 r226510 71 71 #include <WebCore/ResourceHandle.h> 72 72 #include <WebCore/RuntimeEnabledFeatures.h> 73 #include <WebCore/SWContextManager.h> 73 74 #include <WebCore/ScriptController.h> 74 75 #include <WebCore/SecurityOrigin.h> … … 117 118 else 118 119 m_client = WTFMove(client); 120 } 121 122 void InjectedBundle::setServiceWorkerProxyCreationCallback(void (*callback)(uint64_t)) 123 { 124 #if ENABLE(SERVICE_WORKER) 125 SWContextManager::singleton().setServiceWorkerCreationCallback(callback); 126 #endif 119 127 } 120 128 -
trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h
r225926 r226510 88 88 void postMessage(const String&, API::Object*); 89 89 void postSynchronousMessage(const String&, API::Object*, RefPtr<API::Object>& returnData); 90 void setServiceWorkerProxyCreationCallback(void (*)(uint64_t)); 90 91 91 92 WebConnection* webConnectionToUIProcess() const; -
trunk/Tools/ChangeLog
r226493 r226510 1 2018-01-08 Youenn Fablet <youenn@apple.com> 2 3 navigator.onLine does not work inside service workers 4 https://bugs.webkit.org/show_bug.cgi?id=181079 5 <rdar://problem/36178606> 6 7 Reviewed by Darin Adler. 8 9 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 10 (WTR::InjectedBundle::initialize): Setting service worker creation callback to inject ServiceWorkerInternals object. 11 1 12 2018-01-07 Saam Barati <sbarati@apple.com> 2 13 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r225598 r226510 98 98 }; 99 99 WKBundleSetClient(m_bundle, &client.base); 100 100 WKBundleSetServiceWorkerProxyCreationCallback(m_bundle, WebCoreTestSupport::setupNewlyCreatedServiceWorker); 101 101 platformInitialize(initializationUserData); 102 102
Note: See TracChangeset
for help on using the changeset viewer.