Diff
Modified: trunk/LayoutTests/ChangeLog (225939 => 225940)
--- trunk/LayoutTests/ChangeLog 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/LayoutTests/ChangeLog 2017-12-14 23:59:40 UTC (rev 225940)
@@ -1,3 +1,20 @@
+2017-12-14 Chris Dumez <[email protected]>
+
+ self.importScripts() should obey updateViaCache inside service workers
+ https://bugs.webkit.org/show_bug.cgi?id=180826
+
+ Reviewed by Youenn Fablet.
+
+ Add layout test coverage.
+
+ * http/tests/workers/service/registration-updateViaCache-all-importScripts-expected.txt: Added.
+ * http/tests/workers/service/registration-updateViaCache-all-importScripts.html: Added.
+ * http/tests/workers/service/registration-updateViaCache-imports-importScripts-expected.txt: Added.
+ * http/tests/workers/service/registration-updateViaCache-imports-importScripts.html: Added.
+ * http/tests/workers/service/registration-updateViaCache-none-importScripts-expected.txt: Added.
+ * http/tests/workers/service/registration-updateViaCache-none-importScripts.html: Added.
+ * http/tests/workers/service/resources/import-cacheable-script-worker.js: Added.
+
2017-12-14 John Wilander <[email protected]>
Storage Access API: Implement frame-specific access in the document.cookie layer
Added: trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-all-importScripts-expected.txt (0 => 225940)
--- trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-all-importScripts-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-all-importScripts-expected.txt 2017-12-14 23:59:40 UTC (rev 225940)
@@ -0,0 +1,2 @@
+PASS: importScripts() loaded the script came from the network cache
+
Added: trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-all-importScripts.html (0 => 225940)
--- trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-all-importScripts.html (rev 0)
+++ trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-all-importScripts.html 2017-12-14 23:59:40 UTC (rev 225940)
@@ -0,0 +1,43 @@
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+
+function getRandomIdFromWorker(worker)
+{
+ worker.postMessage("getRandomId");
+ return new Promise(function(resolve) {
+ navigator.serviceWorker.addEventListener('message', function(e) {
+ resolve(e.data);
+ });
+ });
+}
+
+async function test()
+{
+ try {
+ let registration = await navigator.serviceWorker.register("resources/import-cacheable-script-worker.js", { updateViaCache: "all" });
+ let worker1 = registration.installing;
+ await waitForState(worker1, "activated");
+ let randomId1 = await getRandomIdFromWorker(worker1);
+
+ await registration.update();
+ let worker2 = registration.installing;
+ await waitForState(worker2, "activated");
+ let randomId2 = await getRandomIdFromWorker(worker2);
+
+ if (randomId1 === randomId2)
+ log("PASS: importScripts() loaded the script came from the network cache");
+ else
+ log("FAIL: importScripts() did not load the script from the network cache");
+ } catch(e) {
+ log("Got exception: " + e);
+ }
+ finishSWTest();
+}
+test();
+</script>
+</body>
+</html>
Added: trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-imports-importScripts-expected.txt (0 => 225940)
--- trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-imports-importScripts-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-imports-importScripts-expected.txt 2017-12-14 23:59:40 UTC (rev 225940)
@@ -0,0 +1,2 @@
+PASS: importScripts() loaded the script came from the network cache
+
Added: trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-imports-importScripts.html (0 => 225940)
--- trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-imports-importScripts.html (rev 0)
+++ trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-imports-importScripts.html 2017-12-14 23:59:40 UTC (rev 225940)
@@ -0,0 +1,43 @@
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+
+function getRandomIdFromWorker(worker)
+{
+ worker.postMessage("getRandomId");
+ return new Promise(function(resolve) {
+ navigator.serviceWorker.addEventListener('message', function(e) {
+ resolve(e.data);
+ });
+ });
+}
+
+async function test()
+{
+ try {
+ let registration = await navigator.serviceWorker.register("resources/import-cacheable-script-worker.js", { updateViaCache: "imports" });
+ let worker1 = registration.installing;
+ await waitForState(worker1, "activated");
+ let randomId1 = await getRandomIdFromWorker(worker1);
+
+ await registration.update();
+ let worker2 = registration.installing;
+ await waitForState(worker2, "activated");
+ let randomId2 = await getRandomIdFromWorker(worker2);
+
+ if (randomId1 === randomId2)
+ log("PASS: importScripts() loaded the script came from the network cache");
+ else
+ log("FAIL: importScripts() did not load the script from the network cache");
+ } catch(e) {
+ log("Got exception: " + e);
+ }
+ finishSWTest();
+}
+test();
+</script>
+</body>
+</html>
Added: trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-none-importScripts-expected.txt (0 => 225940)
--- trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-none-importScripts-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-none-importScripts-expected.txt 2017-12-14 23:59:40 UTC (rev 225940)
@@ -0,0 +1,2 @@
+PASS: importScripts() did not load the script from the network cache
+
Added: trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-none-importScripts.html (0 => 225940)
--- trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-none-importScripts.html (rev 0)
+++ trunk/LayoutTests/http/tests/workers/service/registration-updateViaCache-none-importScripts.html 2017-12-14 23:59:40 UTC (rev 225940)
@@ -0,0 +1,43 @@
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+
+function getRandomIdFromWorker(worker)
+{
+ worker.postMessage("getRandomId");
+ return new Promise(function(resolve) {
+ navigator.serviceWorker.addEventListener('message', function(e) {
+ resolve(e.data);
+ });
+ });
+}
+
+async function test()
+{
+ try {
+ let registration = await navigator.serviceWorker.register("resources/import-cacheable-script-worker.js", { updateViaCache: "none" });
+ let worker1 = registration.installing;
+ await waitForState(worker1, "activated");
+ let randomId1 = await getRandomIdFromWorker(worker1);
+
+ await registration.update();
+ let worker2 = registration.installing;
+ await waitForState(worker2, "activated");
+ let randomId2 = await getRandomIdFromWorker(worker2);
+
+ if (randomId1 === randomId2)
+ log("FAIL: importScripts() loaded the script came from the network cache");
+ else
+ log("PASS: importScripts() did not load the script from the network cache");
+ } catch(e) {
+ log("Got exception: " + e);
+ }
+ finishSWTest();
+}
+test();
+</script>
+</body>
+</html>
Added: trunk/LayoutTests/http/tests/workers/service/resources/import-cacheable-script-worker.js (0 => 225940)
--- trunk/LayoutTests/http/tests/workers/service/resources/import-cacheable-script-worker.js (rev 0)
+++ trunk/LayoutTests/http/tests/workers/service/resources/import-cacheable-script-worker.js 2017-12-14 23:59:40 UTC (rev 225940)
@@ -0,0 +1,2 @@
+importScripts("cacheable-script-worker.php");
+
Modified: trunk/Source/WebCore/ChangeLog (225939 => 225940)
--- trunk/Source/WebCore/ChangeLog 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebCore/ChangeLog 2017-12-14 23:59:40 UTC (rev 225940)
@@ -1,3 +1,34 @@
+2017-12-14 Chris Dumez <[email protected]>
+
+ self.importScripts() should obey updateViaCache inside service workers
+ https://bugs.webkit.org/show_bug.cgi?id=180826
+
+ Reviewed by Youenn Fablet.
+
+ self.importScripts() should obey updateViaCache inside service workers, as per:
+ - https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts
+
+ Tests: http/tests/workers/service/registration-updateViaCache-all-importScripts.html
+ http/tests/workers/service/registration-updateViaCache-imports-importScripts.html
+ http/tests/workers/service/registration-updateViaCache-none-importScripts.html
+
+ * workers/WorkerGlobalScope.cpp:
+ (WebCore::WorkerGlobalScope::importScripts):
+ * workers/WorkerScriptLoader.cpp:
+ (WebCore::WorkerScriptLoader::loadSynchronously):
+ * workers/WorkerScriptLoader.h:
+ * workers/service/SWClientConnection.cpp:
+ (WebCore::SWClientConnection::setRegistrationLastUpdateTime):
+ * workers/service/SWClientConnection.h:
+ * workers/service/ServiceWorkerRegistration.cpp:
+ (WebCore::ServiceWorkerRegistration::lastUpdateTime const):
+ (WebCore::ServiceWorkerRegistration::setLastUpdateTime):
+ * workers/service/ServiceWorkerRegistration.h:
+ * workers/service/server/SWServer.h:
+ * workers/service/server/SWServerRegistration.cpp:
+ (WebCore::SWServerRegistration::setLastUpdateTime):
+ * workers/service/server/SWServerRegistration.h:
+
2017-12-14 Yusuke Suzuki <[email protected]>
Drop Thread::tryCreate
Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.cpp (225939 => 225940)
--- trunk/Source/WebCore/workers/WorkerGlobalScope.cpp 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.cpp 2017-12-14 23:59:40 UTC (rev 225940)
@@ -38,6 +38,7 @@
#include "ScriptSourceCode.h"
#include "SecurityOrigin.h"
#include "SecurityOriginPolicy.h"
+#include "ServiceWorkerGlobalScope.h"
#include "SocketProvider.h"
#include "WorkerInspectorController.h"
#include "WorkerLoaderProxy.h"
@@ -261,6 +262,20 @@
completedURLs.uncheckedAppend(WTFMove(url));
}
+ FetchOptions::Cache cachePolicy = FetchOptions::Cache::Default;
+
+#if ENABLE(SERVICE_WORKER)
+ if (is<ServiceWorkerGlobalScope>(*this)) {
+ // FIXME: Fully implement https://w3c.github.io/ServiceWorker/#importscripts.
+ auto& serviceWorkerGlobalScope = downcast<ServiceWorkerGlobalScope>(*this);
+ auto& registration = serviceWorkerGlobalScope.registration();
+ if (registration.updateViaCache() == ServiceWorkerUpdateViaCache::None
+ || (registration.lastUpdateTime() && (WallTime::now() - registration.lastUpdateTime()) > 86400_s)) {
+ cachePolicy = FetchOptions::Cache::NoCache;
+ }
+ }
+#endif
+
for (auto& url : completedURLs) {
// FIXME: Convert this to check the isolated world's Content Security Policy once webkit.org/b/104520 is solved.
bool shouldBypassMainWorldContentSecurityPolicy = this->shouldBypassMainWorldContentSecurityPolicy();
@@ -268,7 +283,7 @@
return Exception { NetworkError };
auto scriptLoader = WorkerScriptLoader::create();
- scriptLoader->loadSynchronously(this, url, FetchOptions::Mode::NoCors, shouldBypassMainWorldContentSecurityPolicy ? ContentSecurityPolicyEnforcement::DoNotEnforce : ContentSecurityPolicyEnforcement::EnforceScriptSrcDirective, resourceRequestIdentifier());
+ scriptLoader->loadSynchronously(this, url, FetchOptions::Mode::NoCors, cachePolicy, shouldBypassMainWorldContentSecurityPolicy ? ContentSecurityPolicyEnforcement::DoNotEnforce : ContentSecurityPolicyEnforcement::EnforceScriptSrcDirective, resourceRequestIdentifier());
// If the fetching attempt failed, throw a NetworkError exception and abort all these steps.
if (scriptLoader->failed())
Modified: trunk/Source/WebCore/workers/WorkerScriptLoader.cpp (225939 => 225940)
--- trunk/Source/WebCore/workers/WorkerScriptLoader.cpp 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebCore/workers/WorkerScriptLoader.cpp 2017-12-14 23:59:40 UTC (rev 225940)
@@ -43,7 +43,7 @@
WorkerScriptLoader::~WorkerScriptLoader() = default;
-void WorkerScriptLoader::loadSynchronously(ScriptExecutionContext* scriptExecutionContext, const URL& url, FetchOptions::Mode mode, ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement, const String& initiatorIdentifier)
+void WorkerScriptLoader::loadSynchronously(ScriptExecutionContext* scriptExecutionContext, const URL& url, FetchOptions::Mode mode, FetchOptions::Cache cachePolicy, ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement, const String& initiatorIdentifier)
{
ASSERT(scriptExecutionContext);
auto& workerGlobalScope = downcast<WorkerGlobalScope>(*scriptExecutionContext);
@@ -62,6 +62,7 @@
ThreadableLoaderOptions options;
options.credentials = FetchOptions::Credentials::Include;
options.mode = mode;
+ options.cache = cachePolicy;
options.sendLoadCallbacks = SendCallbacks;
options.contentSecurityPolicyEnforcement = contentSecurityPolicyEnforcement;
#if ENABLE(SERVICE_WORKER)
Modified: trunk/Source/WebCore/workers/WorkerScriptLoader.h (225939 => 225940)
--- trunk/Source/WebCore/workers/WorkerScriptLoader.h 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebCore/workers/WorkerScriptLoader.h 2017-12-14 23:59:40 UTC (rev 225940)
@@ -52,7 +52,7 @@
return adoptRef(*new WorkerScriptLoader);
}
- void loadSynchronously(ScriptExecutionContext*, const URL&, FetchOptions::Mode, ContentSecurityPolicyEnforcement, const String& initiatorIdentifier);
+ void loadSynchronously(ScriptExecutionContext*, const URL&, FetchOptions::Mode, FetchOptions::Cache, ContentSecurityPolicyEnforcement, const String& initiatorIdentifier);
void loadAsynchronously(ScriptExecutionContext*, const URL&, FetchOptions::Mode, FetchOptions::Cache, ContentSecurityPolicyEnforcement, const String& initiatorIdentifier, WorkerScriptLoaderClient*);
void notifyError();
Modified: trunk/Source/WebCore/workers/service/SWClientConnection.cpp (225939 => 225940)
--- trunk/Source/WebCore/workers/service/SWClientConnection.cpp 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebCore/workers/service/SWClientConnection.cpp 2017-12-14 23:59:40 UTC (rev 225940)
@@ -207,6 +207,27 @@
}
}
+void SWClientConnection::setRegistrationLastUpdateTime(ServiceWorkerRegistrationIdentifier identifier, WallTime lastUpdateTime)
+{
+ ASSERT(isMainThread());
+
+ SWContextManager::singleton().forEachServiceWorkerThread([identifier, lastUpdateTime] (auto& workerThread) {
+ workerThread.thread().runLoop().postTask([identifier, lastUpdateTime](ScriptExecutionContext& context) {
+ if (auto* container = context.serviceWorkerContainer()) {
+ if (auto* registration = container->registration(identifier))
+ registration->setLastUpdateTime(lastUpdateTime);
+ }
+ });
+ });
+
+ for (auto* document : Document::allDocuments()) {
+ if (auto* container = document->serviceWorkerContainer()) {
+ if (auto* registration = container->registration(identifier))
+ registration->setLastUpdateTime(lastUpdateTime);
+ }
+ }
+}
+
void SWClientConnection::notifyClientsOfControllerChange(const HashSet<DocumentIdentifier>& contextIdentifiers, ServiceWorkerData&& newController)
{
ASSERT(isMainThread());
Modified: trunk/Source/WebCore/workers/service/SWClientConnection.h (225939 => 225940)
--- trunk/Source/WebCore/workers/service/SWClientConnection.h 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebCore/workers/service/SWClientConnection.h 2017-12-14 23:59:40 UTC (rev 225940)
@@ -94,6 +94,7 @@
WEBCORE_EXPORT void updateRegistrationState(ServiceWorkerRegistrationIdentifier, ServiceWorkerRegistrationState, const std::optional<ServiceWorkerData>&);
WEBCORE_EXPORT void updateWorkerState(ServiceWorkerIdentifier, ServiceWorkerState);
WEBCORE_EXPORT void fireUpdateFoundEvent(ServiceWorkerRegistrationIdentifier);
+ WEBCORE_EXPORT void setRegistrationLastUpdateTime(ServiceWorkerRegistrationIdentifier, WallTime);
WEBCORE_EXPORT void notifyClientsOfControllerChange(const HashSet<DocumentIdentifier>& contextIdentifiers, ServiceWorkerData&& newController);
WEBCORE_EXPORT void clearPendingJobs();
Modified: trunk/Source/WebCore/workers/service/ServiceWorkerRegistration.cpp (225939 => 225940)
--- trunk/Source/WebCore/workers/service/ServiceWorkerRegistration.cpp 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerRegistration.cpp 2017-12-14 23:59:40 UTC (rev 225940)
@@ -112,6 +112,16 @@
return m_registrationData.updateViaCache;
}
+WallTime ServiceWorkerRegistration::lastUpdateTime() const
+{
+ return m_registrationData.lastUpdateTime;
+}
+
+void ServiceWorkerRegistration::setLastUpdateTime(WallTime lastUpdateTime)
+{
+ m_registrationData.lastUpdateTime = lastUpdateTime;
+}
+
void ServiceWorkerRegistration::update(Ref<DeferredPromise>&& promise)
{
if (m_isStopped) {
Modified: trunk/Source/WebCore/workers/service/ServiceWorkerRegistration.h (225939 => 225940)
--- trunk/Source/WebCore/workers/service/ServiceWorkerRegistration.h 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerRegistration.h 2017-12-14 23:59:40 UTC (rev 225940)
@@ -56,6 +56,9 @@
const String& scope() const;
ServiceWorkerUpdateViaCache updateViaCache() const;
+ WallTime lastUpdateTime() const;
+ void setLastUpdateTime(WallTime);
+
void update(Ref<DeferredPromise>&&);
void unregister(Ref<DeferredPromise>&&);
Modified: trunk/Source/WebCore/workers/service/server/SWServer.cpp (225939 => 225940)
--- trunk/Source/WebCore/workers/service/server/SWServer.cpp 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebCore/workers/service/server/SWServer.cpp 2017-12-14 23:59:40 UTC (rev 225940)
@@ -116,7 +116,9 @@
// Pages should not have been able to make a new registration to this key while the import was still taking place.
ASSERT(!m_registrations.contains(data.registration.key));
- addRegistration(std::make_unique<SWServerRegistration>(*this, data.registration.key, data.registration.updateViaCache, data.registration.scopeURL, data.scriptURL));
+ auto registration = std::make_unique<SWServerRegistration>(*this, data.registration.key, data.registration.updateViaCache, data.registration.scopeURL, data.scriptURL);
+ registration->setLastUpdateTime(data.registration.lastUpdateTime);
+ addRegistration(WTFMove(registration));
tryInstallContextData(WTFMove(data));
}
Modified: trunk/Source/WebCore/workers/service/server/SWServer.h (225939 => 225940)
--- trunk/Source/WebCore/workers/service/server/SWServer.h 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebCore/workers/service/server/SWServer.h 2017-12-14 23:59:40 UTC (rev 225940)
@@ -82,6 +82,7 @@
virtual void updateRegistrationStateInClient(ServiceWorkerRegistrationIdentifier, ServiceWorkerRegistrationState, const std::optional<ServiceWorkerData>&) = 0;
virtual void updateWorkerStateInClient(ServiceWorkerIdentifier, ServiceWorkerState) = 0;
virtual void fireUpdateFoundEvent(ServiceWorkerRegistrationIdentifier) = 0;
+ virtual void setRegistrationLastUpdateTime(ServiceWorkerRegistrationIdentifier, WallTime) = 0;
virtual void notifyClientsOfControllerChange(const HashSet<DocumentIdentifier>& contextIdentifiers, const ServiceWorkerData& newController) = 0;
virtual void registrationReady(uint64_t registrationReadyRequestIdentifier, ServiceWorkerRegistrationData&&) = 0;
Modified: trunk/Source/WebCore/workers/service/server/SWServerRegistration.cpp (225939 => 225940)
--- trunk/Source/WebCore/workers/service/server/SWServerRegistration.cpp 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebCore/workers/service/server/SWServerRegistration.cpp 2017-12-14 23:59:40 UTC (rev 225940)
@@ -102,6 +102,14 @@
});
}
+void SWServerRegistration::setLastUpdateTime(WallTime time)
+{
+ m_lastUpdateTime = time;
+ forEachConnection([&](auto& connection) {
+ connection.setRegistrationLastUpdateTime(identifier(), time);
+ });
+}
+
void SWServerRegistration::fireUpdateFoundEvent()
{
forEachConnection([&](auto& connection) {
Modified: trunk/Source/WebCore/workers/service/server/SWServerRegistration.h (225939 => 225940)
--- trunk/Source/WebCore/workers/service/server/SWServerRegistration.h 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebCore/workers/service/server/SWServerRegistration.h 2017-12-14 23:59:40 UTC (rev 225940)
@@ -60,7 +60,7 @@
bool isUninstalling() const { return m_uninstalling; }
void setIsUninstalling(bool);
- void setLastUpdateTime(WallTime time) { m_lastUpdateTime = time; }
+ void setLastUpdateTime(WallTime);
WallTime lastUpdateTime() const { return m_lastUpdateTime; }
ServiceWorkerUpdateViaCache updateViaCache() const { return m_updateViaCache; }
Modified: trunk/Source/WebKit/ChangeLog (225939 => 225940)
--- trunk/Source/WebKit/ChangeLog 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebKit/ChangeLog 2017-12-14 23:59:40 UTC (rev 225940)
@@ -1,3 +1,15 @@
+2017-12-14 Chris Dumez <[email protected]>
+
+ self.importScripts() should obey updateViaCache inside service workers
+ https://bugs.webkit.org/show_bug.cgi?id=180826
+
+ Reviewed by Youenn Fablet.
+
+ * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
+ (WebKit::WebSWServerConnection::setRegistrationLastUpdateTime):
+ * StorageProcess/ServiceWorker/WebSWServerConnection.h:
+ * WebProcess/Storage/WebSWClientConnection.messages.in:
+
2017-12-14 Yusuke Suzuki <[email protected]>
Drop Thread::tryCreate
Modified: trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp (225939 => 225940)
--- trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp 2017-12-14 23:59:40 UTC (rev 225940)
@@ -106,6 +106,11 @@
send(Messages::WebSWClientConnection::FireUpdateFoundEvent(identifier));
}
+void WebSWServerConnection::setRegistrationLastUpdateTime(ServiceWorkerRegistrationIdentifier identifier, WallTime lastUpdateTime)
+{
+ send(Messages::WebSWClientConnection::SetRegistrationLastUpdateTime(identifier, lastUpdateTime));
+}
+
void WebSWServerConnection::notifyClientsOfControllerChange(const HashSet<DocumentIdentifier>& contextIdentifiers, const ServiceWorkerData& newController)
{
send(Messages::WebSWClientConnection::NotifyClientsOfControllerChange(contextIdentifiers, newController));
Modified: trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h (225939 => 225940)
--- trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h 2017-12-14 23:59:40 UTC (rev 225940)
@@ -78,6 +78,7 @@
void updateRegistrationStateInClient(WebCore::ServiceWorkerRegistrationIdentifier, WebCore::ServiceWorkerRegistrationState, const std::optional<WebCore::ServiceWorkerData>&) final;
void updateWorkerStateInClient(WebCore::ServiceWorkerIdentifier, WebCore::ServiceWorkerState) final;
void fireUpdateFoundEvent(WebCore::ServiceWorkerRegistrationIdentifier) final;
+ void setRegistrationLastUpdateTime(WebCore::ServiceWorkerRegistrationIdentifier, WallTime) final;
void notifyClientsOfControllerChange(const HashSet<WebCore::DocumentIdentifier>& contextIdentifiers, const WebCore::ServiceWorkerData& newController);
void registrationReady(uint64_t registrationReadyRequestIdentifier, WebCore::ServiceWorkerRegistrationData&&) final;
Modified: trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.messages.in (225939 => 225940)
--- trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.messages.in 2017-12-14 23:54:21 UTC (rev 225939)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.messages.in 2017-12-14 23:59:40 UTC (rev 225940)
@@ -31,6 +31,7 @@
UpdateRegistrationState(WebCore::ServiceWorkerRegistrationIdentifier identifier, enum WebCore::ServiceWorkerRegistrationState state, std::optional<WebCore::ServiceWorkerData> serviceWorkerIdentifier)
UpdateWorkerState(WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, enum WebCore::ServiceWorkerState state)
FireUpdateFoundEvent(WebCore::ServiceWorkerRegistrationIdentifier identifier)
+ SetRegistrationLastUpdateTime(WebCore::ServiceWorkerRegistrationIdentifier identifier, WallTime lastUpdateTime)
NotifyClientsOfControllerChange(HashSet<WebCore::DocumentIdentifier> contextIdentifiers, struct WebCore::ServiceWorkerData newController)
SetSWOriginTableIsImported()