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

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

Issue 825383004: ServiceWorker: Send state change events via SWProviderHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 11 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_provider_host.h
diff --git a/content/browser/service_worker/service_worker_provider_host.h b/content/browser/service_worker/service_worker_provider_host.h
index 9123014273d400004148f897a6ed999799677d5b..03cb0c638d04a2e688e2a9d0843d0bac1efd9da2 100644
--- a/content/browser/service_worker/service_worker_provider_host.h
+++ b/content/browser/service_worker/service_worker_provider_host.h
@@ -115,6 +115,12 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
base::WeakPtr<storage::BlobStorageContext> blob_storage_context,
scoped_refptr<ResourceRequestBody> body);
+ // Creates a ServiceWorkerHandle to retain |version| and returns a
+ // ServiceWorkerInfo with a newly created handle ID. The handle is held in
+ // the dispatcher host until its ref-count becomes zero.
+ ServiceWorkerObjectInfo CreateAndRegisterServiceWorkerHandle(
+ ServiceWorkerVersion* version);
+
// Returns true if |registration| can be associated with this provider.
bool CanAssociateRegistration(ServiceWorkerRegistration* registration);
@@ -155,6 +161,21 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
return dispatcher_host_;
}
+ // Called from ServiceWorkerRegistrationHandle.
+ void SendUpdateFoundMessage(
+ const ServiceWorkerRegistrationObjectInfo& object_info);
+ void SendSetVersionAttributesMessage(
+ int registration_handle_id,
+ ChangedVersionAttributesMask changed_mask,
+ ServiceWorkerVersion* installing_version,
+ ServiceWorkerVersion* waiting_version,
+ ServiceWorkerVersion* active_version);
+
+ // Called from ServiceWorkerHandle.
+ void SendServiceWorkerStateChangedMessage(
+ int worker_handle_id,
+ blink::WebServiceWorkerState state);
+
private:
friend class ServiceWorkerProviderHostTest;
friend class ServiceWorkerWriteToCacheJobTest;

Powered by Google App Engine
This is Rietveld 408576698