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_SCRIPT_CONTEXT_H_ | 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ | 6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 18 matching lines...) Expand all Loading... |
29 struct WebCrossOriginServiceWorkerClient; | 29 struct WebCrossOriginServiceWorkerClient; |
30 class WebServiceWorkerContextProxy; | 30 class WebServiceWorkerContextProxy; |
31 } | 31 } |
32 | 32 |
33 namespace IPC { | 33 namespace IPC { |
34 class Message; | 34 class Message; |
35 } | 35 } |
36 | 36 |
37 namespace content { | 37 namespace content { |
38 | 38 |
| 39 class EmbeddedWorkerContextClient; |
| 40 class WebServiceWorkerRegistrationImpl; |
39 struct CrossOriginServiceWorkerClient; | 41 struct CrossOriginServiceWorkerClient; |
40 class EmbeddedWorkerContextClient; | |
41 struct PlatformNotificationData; | 42 struct PlatformNotificationData; |
42 | 43 |
43 // TODO(kinuko): This should implement WebServiceWorkerContextClient | 44 // TODO(kinuko): This should implement WebServiceWorkerContextClient |
44 // rather than having EmbeddedWorkerContextClient implement it. | 45 // rather than having EmbeddedWorkerContextClient implement it. |
45 // See the header comment in embedded_worker_context_client.h for the | 46 // See the header comment in embedded_worker_context_client.h for the |
46 // potential EW/SW layering concerns. | 47 // potential EW/SW layering concerns. |
47 class ServiceWorkerScriptContext { | 48 class ServiceWorkerScriptContext { |
48 public: | 49 public: |
49 ServiceWorkerScriptContext( | 50 ServiceWorkerScriptContext( |
50 EmbeddedWorkerContextClient* embedded_context, | 51 EmbeddedWorkerContextClient* embedded_context, |
51 blink::WebServiceWorkerContextProxy* proxy); | 52 blink::WebServiceWorkerContextProxy* proxy); |
52 ~ServiceWorkerScriptContext(); | 53 ~ServiceWorkerScriptContext(); |
53 | 54 |
54 void OnMessageReceived(const IPC::Message& message); | 55 void OnMessageReceived(const IPC::Message& message); |
55 | 56 |
| 57 void SetRegistrationInServiceWorkerGlobalScope( |
| 58 scoped_ptr<WebServiceWorkerRegistrationImpl> registration); |
56 void DidHandleActivateEvent(int request_id, | 59 void DidHandleActivateEvent(int request_id, |
57 blink::WebServiceWorkerEventResult); | 60 blink::WebServiceWorkerEventResult); |
58 void DidHandleInstallEvent(int request_id, | 61 void DidHandleInstallEvent(int request_id, |
59 blink::WebServiceWorkerEventResult result); | 62 blink::WebServiceWorkerEventResult result); |
60 void DidHandleFetchEvent(int request_id, | 63 void DidHandleFetchEvent(int request_id, |
61 ServiceWorkerFetchEventResult result, | 64 ServiceWorkerFetchEventResult result, |
62 const ServiceWorkerResponse& response); | 65 const ServiceWorkerResponse& response); |
63 void DidHandleNotificationClickEvent( | 66 void DidHandleNotificationClickEvent( |
64 int request_id, | 67 int request_id, |
65 blink::WebServiceWorkerEventResult result); | 68 blink::WebServiceWorkerEventResult result); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 std::map<int, base::TimeTicks> install_start_timings_; | 159 std::map<int, base::TimeTicks> install_start_timings_; |
157 std::map<int, base::TimeTicks> notification_click_start_timings_; | 160 std::map<int, base::TimeTicks> notification_click_start_timings_; |
158 std::map<int, base::TimeTicks> push_start_timings_; | 161 std::map<int, base::TimeTicks> push_start_timings_; |
159 | 162 |
160 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); | 163 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); |
161 }; | 164 }; |
162 | 165 |
163 } // namespace content | 166 } // namespace content |
164 | 167 |
165 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ | 168 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
OLD | NEW |