OLD | NEW |
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 "content/public/common/service_worker_event_status.mojom.h" | 19 #include "content/public/common/service_worker_event_status.mojom.h" |
20 #include "ipc/ipc_listener.h" | 20 #include "ipc/ipc_listener.h" |
21 #include "mojo/application/public/interfaces/service_provider.mojom.h" | 21 #include "mojo/application/public/interfaces/service_provider.mojom.h" |
22 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h" | 22 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h" |
23 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" | 23 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" |
24 #include "third_party/WebKit/public/platform/WebServiceWorkerError.h" | 24 #include "third_party/WebKit/public/platform/WebServiceWorkerError.h" |
25 #include "third_party/WebKit/public/web/WebServiceWorkerContextClient.h" | 25 #include "third_party/WebKit/public/web/WebServiceWorkerContextClient.h" |
| 26 #include "v8/include/v8.h" |
26 | 27 |
27 namespace base { | 28 namespace base { |
28 class SingleThreadTaskRunner; | 29 class SingleThreadTaskRunner; |
29 class TaskRunner; | 30 class TaskRunner; |
30 } | 31 } |
31 | 32 |
32 namespace blink { | 33 namespace blink { |
33 struct WebCircularGeofencingRegion; | 34 struct WebCircularGeofencingRegion; |
34 struct WebCrossOriginServiceWorkerClient; | 35 struct WebCrossOriginServiceWorkerClient; |
35 class WebDataSource; | 36 class WebDataSource; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 const char* data, | 94 const char* data, |
94 size_t size); | 95 size_t size); |
95 virtual void clearCachedMetadata(const blink::WebURL&); | 96 virtual void clearCachedMetadata(const blink::WebURL&); |
96 virtual void workerReadyForInspection(); | 97 virtual void workerReadyForInspection(); |
97 | 98 |
98 // Called on the main thread. | 99 // Called on the main thread. |
99 virtual void workerContextFailedToStart(); | 100 virtual void workerContextFailedToStart(); |
100 | 101 |
101 virtual void workerContextStarted(blink::WebServiceWorkerContextProxy* proxy); | 102 virtual void workerContextStarted(blink::WebServiceWorkerContextProxy* proxy); |
102 virtual void didEvaluateWorkerScript(bool success); | 103 virtual void didEvaluateWorkerScript(bool success); |
| 104 virtual void didInitializeWorkerContext(v8::Local<v8::Context> context, |
| 105 const blink::WebURL& url); |
103 virtual void willDestroyWorkerContext(); | 106 virtual void willDestroyWorkerContext(); |
104 virtual void workerContextDestroyed(); | 107 virtual void workerContextDestroyed(); |
105 virtual void reportException(const blink::WebString& error_message, | 108 virtual void reportException(const blink::WebString& error_message, |
106 int line_number, | 109 int line_number, |
107 int column_number, | 110 int column_number, |
108 const blink::WebString& source_url); | 111 const blink::WebString& source_url); |
109 virtual void reportConsoleMessage(int source, | 112 virtual void reportConsoleMessage(int source, |
110 int level, | 113 int level, |
111 const blink::WebString& message, | 114 const blink::WebString& message, |
112 int line_number, | 115 int line_number, |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // Initialized on the worker thread in workerContextStarted and | 231 // Initialized on the worker thread in workerContextStarted and |
229 // destructed on the worker thread in willDestroyWorkerContext. | 232 // destructed on the worker thread in willDestroyWorkerContext. |
230 scoped_ptr<WorkerContextData> context_; | 233 scoped_ptr<WorkerContextData> context_; |
231 | 234 |
232 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); | 235 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); |
233 }; | 236 }; |
234 | 237 |
235 } // namespace content | 238 } // namespace content |
236 | 239 |
237 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ | 240 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ |
OLD | NEW |