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

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

Issue 2451373003: service worker: Implement NavigationPreloadManager.setHeaderValue (Closed)
Patch Set: rebase Created 4 years, 1 month 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 4a43c0802e75cb106ef6a7ea92992a35f6d14683..55584c1346ff54ce24088dae0d5adb7c3f5c24d4 100644
--- a/content/child/service_worker/service_worker_dispatcher.h
+++ b/content/child/service_worker/service_worker_dispatcher.h
@@ -15,6 +15,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
+#include "content/common/service_worker/service_worker_types.h"
#include "content/public/child/worker_thread.h"
#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerError.h"
#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerProvider.h"
@@ -71,6 +72,8 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
blink::WebServiceWorkerRegistration::WebEnableNavigationPreloadCallbacks;
using WebGetNavigationPreloadStateCallbacks = blink::
WebServiceWorkerRegistration::WebGetNavigationPreloadStateCallbacks;
+ using WebSetNavigationPreloadHeaderCallbacks = blink::
+ WebServiceWorkerRegistration::WebSetNavigationPreloadHeaderCallbacks;
ServiceWorkerDispatcher(
ThreadSafeSender* thread_safe_sender,
@@ -118,6 +121,12 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
int provider_id,
int64_t registration_id,
std::unique_ptr<WebGetNavigationPreloadStateCallbacks> callbacks);
+ // Corresponds to NavigationPreloadManager.setHeaderValue.
+ void SetNavigationPreloadHeader(
+ int provider_id,
+ int64_t registration_id,
+ const std::string& value,
+ std::unique_ptr<WebSetNavigationPreloadHeaderCallbacks> 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
@@ -180,6 +189,8 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
IDMap<WebEnableNavigationPreloadCallbacks, IDMapOwnPointer>;
using GetNavigationPreloadStateCallbackMap =
IDMap<WebGetNavigationPreloadStateCallbacks, IDMapOwnPointer>;
+ using SetNavigationPreloadHeaderCallbackMap =
+ IDMap<WebSetNavigationPreloadHeaderCallbacks, IDMapOwnPointer>;
typedef std::map<int, blink::WebServiceWorkerProviderClient*>
ProviderClientMap;
@@ -227,7 +238,8 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
void OnDidEnableNavigationPreload(int thread_id, int request_id);
void OnDidGetNavigationPreloadState(int thread_id,
int request_id,
- bool enabled);
+ const NavigationPreloadState& state);
+ void OnDidSetNavigationPreloadHeader(int thread_id, int request_id);
void OnRegistrationError(int thread_id,
int request_id,
blink::WebServiceWorkerError::ErrorType error_type,
@@ -260,6 +272,11 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
int request_id,
blink::WebServiceWorkerError::ErrorType error_type,
const std::string& message);
+ void OnSetNavigationPreloadHeaderError(
+ 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);
@@ -301,6 +318,8 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
GetRegistrationForReadyCallbackMap get_for_ready_callbacks_;
EnableNavigationPreloadCallbackMap enable_navigation_preload_callbacks_;
GetNavigationPreloadStateCallbackMap get_navigation_preload_state_callbacks_;
+ SetNavigationPreloadHeaderCallbackMap
+ set_navigation_preload_header_callbacks_;
ProviderClientMap provider_clients_;
ProviderContextMap provider_contexts_;
« no previous file with comments | « content/browser/service_worker/service_worker_version.cc ('k') | content/child/service_worker/service_worker_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698