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

Unified Diff: content/child/service_worker/service_worker_dispatcher.h

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/service_worker_dispatcher.h
diff --git a/content/child/service_worker/service_worker_dispatcher.h b/content/child/service_worker/service_worker_dispatcher.h
index ccafedf9ea5d1297ca9709ef20b9377f31ecfc3c..4a43c0802e75cb106ef6a7ea92992a35f6d14683 100644
--- a/content/child/service_worker/service_worker_dispatcher.h
+++ b/content/child/service_worker/service_worker_dispatcher.h
@@ -69,6 +69,8 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
WebServiceWorkerGetRegistrationForReadyCallbacks;
using WebEnableNavigationPreloadCallbacks =
blink::WebServiceWorkerRegistration::WebEnableNavigationPreloadCallbacks;
+ using WebGetNavigationPreloadStateCallbacks = blink::
+ WebServiceWorkerRegistration::WebGetNavigationPreloadStateCallbacks;
ServiceWorkerDispatcher(
ThreadSafeSender* thread_safe_sender,
@@ -111,6 +113,11 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
int64_t registration_id,
bool enable,
std::unique_ptr<WebEnableNavigationPreloadCallbacks> callbacks);
+ // Corresponds to NavigationPreloadManager.getState.
+ void GetNavigationPreloadState(
+ int provider_id,
+ int64_t registration_id,
+ std::unique_ptr<WebGetNavigationPreloadStateCallbacks> callbacks);
// Called when a new provider context for a document is created. Usually
// this happens when a new document is being loaded, and is called much
@@ -171,6 +178,8 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
IDMapOwnPointer> GetRegistrationForReadyCallbackMap;
using EnableNavigationPreloadCallbackMap =
IDMap<WebEnableNavigationPreloadCallbacks, IDMapOwnPointer>;
+ using GetNavigationPreloadStateCallbackMap =
+ IDMap<WebGetNavigationPreloadStateCallbacks, IDMapOwnPointer>;
typedef std::map<int, blink::WebServiceWorkerProviderClient*>
ProviderClientMap;
@@ -216,6 +225,9 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
const ServiceWorkerRegistrationObjectInfo& info,
const ServiceWorkerVersionAttributes& attrs);
void OnDidEnableNavigationPreload(int thread_id, int request_id);
+ void OnDidGetNavigationPreloadState(int thread_id,
+ int request_id,
+ bool enabled);
void OnRegistrationError(int thread_id,
int request_id,
blink::WebServiceWorkerError::ErrorType error_type,
@@ -243,6 +255,11 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
int request_id,
blink::WebServiceWorkerError::ErrorType error_type,
const std::string& message);
+ void OnGetNavigationPreloadStateError(
+ int thread_id,
+ int request_id,
+ blink::WebServiceWorkerError::ErrorType error_type,
+ const std::string& message);
void OnServiceWorkerStateChanged(int thread_id,
int handle_id,
blink::WebServiceWorkerState state);
@@ -283,6 +300,7 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
GetRegistrationsCallbackMap pending_get_registrations_callbacks_;
GetRegistrationForReadyCallbackMap get_for_ready_callbacks_;
EnableNavigationPreloadCallbackMap enable_navigation_preload_callbacks_;
+ GetNavigationPreloadStateCallbackMap get_navigation_preload_state_callbacks_;
ProviderClientMap provider_clients_;
ProviderContextMap provider_contexts_;

Powered by Google App Engine
This is Rietveld 408576698