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

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

Issue 1221503003: Add a mojo ServiceRegistry to embedded workers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move creation and destruction of ServiceRegistry to the correct spots on the browser side Created 5 years, 5 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 <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/id_map.h" 12 #include "base/id_map.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "content/child/webmessageportchannel_impl.h" 17 #include "content/child/webmessageportchannel_impl.h"
18 #include "content/common/mojo/service_registry_impl.h"
18 #include "content/common/service_worker/service_worker_types.h" 19 #include "content/common/service_worker/service_worker_types.h"
19 #include "ipc/ipc_listener.h" 20 #include "ipc/ipc_listener.h"
20 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h" 21 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h"
21 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" 22 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h"
22 #include "third_party/WebKit/public/platform/WebServiceWorkerError.h" 23 #include "third_party/WebKit/public/platform/WebServiceWorkerError.h"
23 #include "third_party/WebKit/public/web/WebServiceWorkerContextClient.h" 24 #include "third_party/WebKit/public/web/WebServiceWorkerContextClient.h"
24 25
25 namespace base { 26 namespace base {
26 class SingleThreadTaskRunner; 27 class SingleThreadTaskRunner;
27 class TaskRunner; 28 class TaskRunner;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 int64 service_worker_version_id, 65 int64 service_worker_version_id,
65 const GURL& service_worker_scope, 66 const GURL& service_worker_scope,
66 const GURL& script_url, 67 const GURL& script_url,
67 int worker_devtools_agent_route_id); 68 int worker_devtools_agent_route_id);
68 ~ServiceWorkerContextClient() override; 69 ~ServiceWorkerContextClient() override;
69 70
70 void OnMessageReceived(int thread_id, 71 void OnMessageReceived(int thread_id,
71 int embedded_worker_id, 72 int embedded_worker_id,
72 const IPC::Message& message); 73 const IPC::Message& message);
73 74
75 void BindServiceRegistry(
76 mojo::InterfaceRequest<mojo::ServiceProvider> services,
77 mojo::ServiceProviderPtr exposed_services);
78
74 // WebServiceWorkerContextClient overrides. 79 // WebServiceWorkerContextClient overrides.
75 virtual blink::WebURL scope() const; 80 virtual blink::WebURL scope() const;
76 virtual void getClients(const blink::WebServiceWorkerClientQueryOptions&, 81 virtual void getClients(const blink::WebServiceWorkerClientQueryOptions&,
77 blink::WebServiceWorkerClientsCallbacks*); 82 blink::WebServiceWorkerClientsCallbacks*);
78 virtual void openWindow(const blink::WebURL&, 83 virtual void openWindow(const blink::WebURL&,
79 blink::WebServiceWorkerClientCallbacks*); 84 blink::WebServiceWorkerClientCallbacks*);
80 virtual void setCachedMetadata(const blink::WebURL&, 85 virtual void setCachedMetadata(const blink::WebURL&,
81 const char* data, 86 const char* data,
82 size_t size); 87 size_t size);
83 virtual void clearCachedMetadata(const blink::WebURL&); 88 virtual void clearCachedMetadata(const blink::WebURL&);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 217
213 // Used for incoming messages from the browser for which an outgoing response 218 // Used for incoming messages from the browser for which an outgoing response
214 // back to the browser is expected, the id must be sent back with the 219 // back to the browser is expected, the id must be sent back with the
215 // response. 220 // response.
216 int current_request_id_; 221 int current_request_id_;
217 222
218 // Initialized on the worker thread in workerContextStarted and 223 // Initialized on the worker thread in workerContextStarted and
219 // destructed on the worker thread in willDestroyWorkerContext. 224 // destructed on the worker thread in willDestroyWorkerContext.
220 scoped_ptr<WorkerContextData> context_; 225 scoped_ptr<WorkerContextData> context_;
221 226
227 ServiceRegistryImpl service_registry_;
michaeln 2015/07/15 21:18:52 The ServiceWorkerContextClient is used on multiple
Marijn Kruisselbrink 2015/07/15 21:45:58 Hmm, yeah, that's a good point. I'm not sure if Se
228
222 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); 229 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient);
223 }; 230 };
224 231
225 } // namespace content 232 } // namespace content
226 233
227 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ 234 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698