Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: content/child/service_worker/web_service_worker_registration_impl.cc

Issue 2443103002: service worker: Implement NavigationPreloadManager.getState (Closed)
Patch Set: rm file added in bad merge Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/child/service_worker/web_service_worker_registration_impl.cc
diff --git a/content/child/service_worker/web_service_worker_registration_impl.cc b/content/child/service_worker/web_service_worker_registration_impl.cc
index 8a00525d973f9817282c3cb6b8010b140bdd9f04..3043e469c8fe4d12e9532829d99ce3302a42f13b 100644
--- a/content/child/service_worker/web_service_worker_registration_impl.cc
+++ b/content/child/service_worker/web_service_worker_registration_impl.cc
@@ -13,6 +13,7 @@
#include "content/child/service_worker/web_service_worker_impl.h"
#include "content/child/service_worker/web_service_worker_provider_impl.h"
#include "content/common/service_worker/service_worker_types.h"
+#include "third_party/WebKit/public/platform/modules/serviceworker/WebNavigationPreloadState.h"
#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerError.h"
#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerRegistrationProxy.h"
@@ -160,6 +161,18 @@ void WebServiceWorkerRegistrationImpl::enableNavigationPreload(
std::move(callbacks));
}
+void WebServiceWorkerRegistrationImpl::getNavigationPreloadState(
+ blink::WebServiceWorkerProvider* provider,
+ std::unique_ptr<WebGetNavigationPreloadStateCallbacks> callbacks) {
+ WebServiceWorkerProviderImpl* provider_impl =
+ static_cast<WebServiceWorkerProviderImpl*>(provider);
+ ServiceWorkerDispatcher* dispatcher =
+ ServiceWorkerDispatcher::GetThreadSpecificInstance();
+ DCHECK(dispatcher);
+ dispatcher->GetNavigationPreloadState(
+ provider_impl->provider_id(), registration_id(), std::move(callbacks));
+}
+
int64_t WebServiceWorkerRegistrationImpl::registration_id() const {
return handle_ref_->registration_id();
}

Powered by Google App Engine
This is Rietveld 408576698