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

Side by Side Diff: content/renderer/service_worker/service_worker_context_client.h

Issue 2313653002: ServiceWorker: Exchange InterfaceProviders when starting worker thread (Closed)
Patch Set: Indent Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_
6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ 6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // new instance. 73 // new instance.
74 static ServiceWorkerContextClient* ThreadSpecificInstance(); 74 static ServiceWorkerContextClient* ThreadSpecificInstance();
75 75
76 // Called on the main thread. 76 // Called on the main thread.
77 ServiceWorkerContextClient( 77 ServiceWorkerContextClient(
78 int embedded_worker_id, 78 int embedded_worker_id,
79 int64_t service_worker_version_id, 79 int64_t service_worker_version_id,
80 const GURL& service_worker_scope, 80 const GURL& service_worker_scope,
81 const GURL& script_url, 81 const GURL& script_url,
82 int worker_devtools_agent_route_id, 82 int worker_devtools_agent_route_id,
83 std::unique_ptr<EmbeddedWorkerInstanceClientImpl> embedded_worker); 83 std::unique_ptr<EmbeddedWorkerInstanceClientImpl> embedded_worker_client);
84 ~ServiceWorkerContextClient() override; 84 ~ServiceWorkerContextClient() override;
85 85
86 void OnMessageReceived(int thread_id, 86 void OnMessageReceived(int thread_id,
87 int embedded_worker_id, 87 int embedded_worker_id,
88 const IPC::Message& message); 88 const IPC::Message& message);
89 89
90 // Called some time after the worker has started. 90 // Called some time after the worker has started.
91 void BindInterfaceProviders( 91 void BindInterfaceProviders(
92 shell::mojom::InterfaceProviderRequest request, 92 shell::mojom::InterfaceProviderRequest request,
93 shell::mojom::InterfaceProviderPtr remote_interfaces); 93 shell::mojom::InterfaceProviderPtr remote_interfaces);
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 void OnNavigateClientResponse(int request_id, 238 void OnNavigateClientResponse(int request_id,
239 const ServiceWorkerClientInfo& client); 239 const ServiceWorkerClientInfo& client);
240 void OnNavigateClientError(int request_id, const GURL& url); 240 void OnNavigateClientError(int request_id, const GURL& url);
241 void OnDidSkipWaiting(int request_id); 241 void OnDidSkipWaiting(int request_id);
242 void OnDidClaimClients(int request_id); 242 void OnDidClaimClients(int request_id);
243 void OnClaimClientsError(int request_id, 243 void OnClaimClientsError(int request_id,
244 blink::WebServiceWorkerError::ErrorType error_type, 244 blink::WebServiceWorkerError::ErrorType error_type,
245 const base::string16& message); 245 const base::string16& message);
246 void OnPing(); 246 void OnPing();
247 247
248 void OnDidGetEmbeddedWorkerInstance();
249
248 base::WeakPtr<ServiceWorkerContextClient> GetWeakPtr(); 250 base::WeakPtr<ServiceWorkerContextClient> GetWeakPtr();
249 251
250 const int embedded_worker_id_; 252 const int embedded_worker_id_;
251 const int64_t service_worker_version_id_; 253 const int64_t service_worker_version_id_;
252 const GURL service_worker_scope_; 254 const GURL service_worker_scope_;
253 const GURL script_url_; 255 const GURL script_url_;
254 const int worker_devtools_agent_route_id_; 256 const int worker_devtools_agent_route_id_;
255 scoped_refptr<ThreadSafeSender> sender_; 257 scoped_refptr<ThreadSafeSender> sender_;
256 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; 258 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
257 scoped_refptr<base::TaskRunner> worker_task_runner_; 259 scoped_refptr<base::TaskRunner> worker_task_runner_;
258 260
259 scoped_refptr<ServiceWorkerProviderContext> provider_context_; 261 scoped_refptr<ServiceWorkerProviderContext> provider_context_;
260 262
261 // Not owned; this object is destroyed when proxy_ becomes invalid. 263 // Not owned; this object is destroyed when proxy_ becomes invalid.
262 blink::WebServiceWorkerContextProxy* proxy_; 264 blink::WebServiceWorkerContextProxy* proxy_;
263 265
264 // Remote instance represents EmbeddedWorkerInstance. 266 // Renderer-side object corresponding to WebEmbeddedWorkerInstance
265 std::unique_ptr<EmbeddedWorkerInstanceClientImpl> embedded_worker_; 267 std::unique_ptr<EmbeddedWorkerInstanceClientImpl> embedded_worker_client_;
266 268
267 // Initialized on the worker thread in workerContextStarted and 269 // Initialized on the worker thread in workerContextStarted and
268 // destructed on the worker thread in willDestroyWorkerContext. 270 // destructed on the worker thread in willDestroyWorkerContext.
269 std::unique_ptr<WorkerContextData> context_; 271 std::unique_ptr<WorkerContextData> context_;
270 272
271 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); 273 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient);
272 }; 274 };
273 275
274 } // namespace content 276 } // namespace content
275 277
276 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ 278 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698