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

Unified Diff: content/browser/service_worker/service_worker_dispatcher_host.h

Issue 2779763004: Create ServiceWorkerProviderHost before starting worker (Closed)
Patch Set: Rebased Created 3 years, 7 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/browser/service_worker/service_worker_dispatcher_host.h
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.h b/content/browser/service_worker/service_worker_dispatcher_host.h
index f813389a8a09c2c16370bda14de8f2f84771cb8f..742d9fc2c1b4d9e46d1332234a751946aa238c43 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host.h
+++ b/content/browser/service_worker/service_worker_dispatcher_host.h
@@ -42,6 +42,9 @@ struct ServiceWorkerObjectInfo;
struct ServiceWorkerRegistrationObjectInfo;
struct ServiceWorkerVersionAttributes;
+// MessageFilter for service workers. This class receives IPCs to manipulate
+// service workers from the renderer process regardless of hosting page or
+// service worker's context. This can be override only for testing.
class CONTENT_EXPORT ServiceWorkerDispatcherHost
: public mojom::ServiceWorkerDispatcherHost,
public BrowserMessageFilter {
@@ -66,13 +69,22 @@ class CONTENT_EXPORT ServiceWorkerDispatcherHost
// be destroyed.
bool Send(IPC::Message* message) override;
- void RegisterServiceWorkerHandle(std::unique_ptr<ServiceWorkerHandle> handle);
- void RegisterServiceWorkerRegistrationHandle(
+ // Virtual for testing.
+ virtual void RegisterServiceWorkerHandle(
+ std::unique_ptr<ServiceWorkerHandle> handle);
+ // Virtual for testing.
+ virtual void RegisterServiceWorkerRegistrationHandle(
std::unique_ptr<ServiceWorkerRegistrationHandle> handle);
ServiceWorkerHandle* FindServiceWorkerHandle(int provider_id,
int64_t version_id);
+ void GetRegistrationObjectInfoAndVersionAttributes(
+ base::WeakPtr<ServiceWorkerProviderHost> provider_host,
+ ServiceWorkerRegistration* registration,
+ ServiceWorkerRegistrationObjectInfo* info,
+ ServiceWorkerVersionAttributes* attrs);
+
// Returns the existing registration handle whose reference count is
// incremented or a newly created one if it doesn't exist.
ServiceWorkerRegistrationHandle* GetOrCreateRegistrationHandle(
@@ -101,9 +113,6 @@ class CONTENT_EXPORT ServiceWorkerDispatcherHost
// mojom::ServiceWorkerDispatcherHost implementation
void OnProviderCreated(ServiceWorkerProviderHostInfo info) override;
- void OnSetHostedVersionId(int provider_id,
- int64_t version_id,
- int embedded_worker_id) override;
// IPC Message handlers
void OnRegisterServiceWorker(int thread_id,
@@ -192,12 +201,6 @@ class CONTENT_EXPORT ServiceWorkerDispatcherHost
int provider_id,
int64_t registration_handle_id);
- void GetRegistrationObjectInfoAndVersionAttributes(
- base::WeakPtr<ServiceWorkerProviderHost> provider_host,
- ServiceWorkerRegistration* registration,
- ServiceWorkerRegistrationObjectInfo* info,
- ServiceWorkerVersionAttributes* attrs);
-
// Callbacks from ServiceWorkerContextCore
void RegistrationComplete(int thread_id,
int provider_id,

Powered by Google App Engine
This is Rietveld 408576698