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

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

Issue 2388023002: service worker: navigation preload basic setters/getters and flag
Patch Set: idl 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 4793971805569f564b5614fc41af600d8283793a..73bb1615c97f0c2ab418179dec69135356c22f7d 100644
--- a/content/child/service_worker/service_worker_dispatcher.h
+++ b/content/child/service_worker/service_worker_dispatcher.h
@@ -16,6 +16,7 @@
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "content/public/child/worker_thread.h"
+#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorker.h"
#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerError.h"
#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerProvider.h"
#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerRegistration.h"
@@ -67,6 +68,10 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
typedef blink::WebServiceWorkerProvider::
WebServiceWorkerGetRegistrationForReadyCallbacks
WebServiceWorkerGetRegistrationForReadyCallbacks;
+ using WebSetNavigationPreloadCallbacks =
+ blink::WebServiceWorker::WebSetNavigationPreloadCallbacks;
+ using WebGetNavigationPreloadCallbacks =
+ blink::WebServiceWorker::WebGetNavigationPreloadCallbacks;
ServiceWorkerDispatcher(
ThreadSafeSender* thread_safe_sender,
@@ -103,6 +108,12 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
int provider_id,
WebServiceWorkerGetRegistrationForReadyCallbacks* callbacks);
+ void SetNavigationPreload(int handle_id,
+ const std::string& value,
+ WebSetNavigationPreloadCallbacks* callback);
+ void GetNavigationPreload(int handle_id,
+ WebGetNavigationPreloadCallbacks* callback);
+
// 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
// earlier than AddScriptClient.
@@ -160,6 +171,10 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
IDMapOwnPointer> GetRegistrationsCallbackMap;
typedef IDMap<WebServiceWorkerGetRegistrationForReadyCallbacks,
IDMapOwnPointer> GetRegistrationForReadyCallbackMap;
+ using GetNavigationPreloadCallbackMap =
+ IDMap<WebGetNavigationPreloadCallbacks, IDMapOwnPointer>;
+ using SetNavigationPreloadCallbackMap =
+ IDMap<WebSetNavigationPreloadCallbacks, IDMapOwnPointer>;
typedef std::map<int, blink::WebServiceWorkerProviderClient*>
ProviderClientMap;
@@ -204,6 +219,11 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
int request_id,
const ServiceWorkerRegistrationObjectInfo& info,
const ServiceWorkerVersionAttributes& attrs);
+ void OnDidGetNavigationPreload(int thread_id,
+ int request_id,
+ bool is_enabled,
+ const std::string& value);
+ void OnDidSetNavigationPreload(int thread_id, int request_id);
void OnRegistrationError(int thread_id,
int request_id,
blink::WebServiceWorkerError::ErrorType error_type,
@@ -265,6 +285,8 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
GetRegistrationCallbackMap pending_get_registration_callbacks_;
GetRegistrationsCallbackMap pending_get_registrations_callbacks_;
GetRegistrationForReadyCallbackMap get_for_ready_callbacks_;
+ GetNavigationPreloadCallbackMap pending_get_navigation_preload_callbacks_;
+ SetNavigationPreloadCallbackMap pending_set_navigation_preload_callbacks_;
ProviderClientMap provider_clients_;
ProviderContextMap provider_contexts_;
« no previous file with comments | « content/browser/service_worker/service_worker_version.h ('k') | content/child/service_worker/service_worker_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698