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

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: add comment to BindServiceRegistry 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/service_worker/service_worker_types.h" 18 #include "content/common/service_worker/service_worker_types.h"
19 #include "ipc/ipc_listener.h" 19 #include "ipc/ipc_listener.h"
20 #include "mojo/application/public/interfaces/service_provider.mojom.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;
28 } 29 }
29 30
(...skipping 34 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 // Called some time after the worker has started. Attempts to use the
76 // ServiceRegistry to connect to services before this method is called are
77 // queued up and will resolve after this method is called.
78 void BindServiceRegistry(
79 mojo::InterfaceRequest<mojo::ServiceProvider> services,
80 mojo::ServiceProviderPtr exposed_services);
81
74 // WebServiceWorkerContextClient overrides. 82 // WebServiceWorkerContextClient overrides.
75 virtual blink::WebURL scope() const; 83 virtual blink::WebURL scope() const;
76 virtual void getClients(const blink::WebServiceWorkerClientQueryOptions&, 84 virtual void getClients(const blink::WebServiceWorkerClientQueryOptions&,
77 blink::WebServiceWorkerClientsCallbacks*); 85 blink::WebServiceWorkerClientsCallbacks*);
78 virtual void openWindow(const blink::WebURL&, 86 virtual void openWindow(const blink::WebURL&,
79 blink::WebServiceWorkerClientCallbacks*); 87 blink::WebServiceWorkerClientCallbacks*);
80 virtual void setCachedMetadata(const blink::WebURL&, 88 virtual void setCachedMetadata(const blink::WebURL&,
81 const char* data, 89 const char* data,
82 size_t size); 90 size_t size);
83 virtual void clearCachedMetadata(const blink::WebURL&); 91 virtual void clearCachedMetadata(const blink::WebURL&);
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 // Initialized on the worker thread in workerContextStarted and 226 // Initialized on the worker thread in workerContextStarted and
219 // destructed on the worker thread in willDestroyWorkerContext. 227 // destructed on the worker thread in willDestroyWorkerContext.
220 scoped_ptr<WorkerContextData> context_; 228 scoped_ptr<WorkerContextData> context_;
221 229
222 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); 230 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient);
223 }; 231 };
224 232
225 } // namespace content 233 } // namespace content
226 234
227 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ 235 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/renderer/service_worker/service_worker_context_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698