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

Unified Diff: content/renderer/service_worker/service_worker_context_client.h

Issue 2307543002: ServiceWorker: Mojofication of EWInstance::StopWorker (Closed)
Patch Set: Added a check of the status when detached 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/renderer/service_worker/service_worker_context_client.h
diff --git a/content/renderer/service_worker/service_worker_context_client.h b/content/renderer/service_worker/service_worker_context_client.h
index 6d6b246e2fe2be879d4fb46bcbaa13899a46d960..dee330962d212150251d87dae81454be84cb3c63 100644
--- a/content/renderer/service_worker/service_worker_context_client.h
+++ b/content/renderer/service_worker/service_worker_context_client.h
@@ -59,6 +59,7 @@ class ServiceWorkerProviderContext;
class ServiceWorkerContextClient;
class ThreadSafeSender;
class WebServiceWorkerRegistrationImpl;
+class EmbeddedWorkerInstanceClientImpl;
// This class provides access to/from an ServiceWorker's WorkerGlobalScope.
// Unless otherwise noted, all methods are called on the worker thread.
@@ -77,11 +78,13 @@ class ServiceWorkerContextClient
static ServiceWorkerContextClient* ThreadSpecificInstance();
// Called on the main thread.
- ServiceWorkerContextClient(int embedded_worker_id,
- int64_t service_worker_version_id,
- const GURL& service_worker_scope,
- const GURL& script_url,
- int worker_devtools_agent_route_id);
+ ServiceWorkerContextClient(
+ int embedded_worker_id,
+ int64_t service_worker_version_id,
+ const GURL& service_worker_scope,
+ const GURL& script_url,
+ int worker_devtools_agent_route_id,
+ std::unique_ptr<EmbeddedWorkerInstanceClientImpl> embedded_worker);
~ServiceWorkerContextClient() override;
void OnMessageReceived(int thread_id,
@@ -263,6 +266,9 @@ class ServiceWorkerContextClient
// Not owned; this object is destroyed when proxy_ becomes invalid.
blink::WebServiceWorkerContextProxy* proxy_;
+ // Renderer-side object corresponding to WebEmbeddedWorkerInstance
+ std::unique_ptr<EmbeddedWorkerInstanceClientImpl> embedded_worker_client_;
+
// Initialized on the worker thread in workerContextStarted and
// destructed on the worker thread in willDestroyWorkerContext.
std::unique_ptr<WorkerContextData> context_;

Powered by Google App Engine
This is Rietveld 408576698