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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/id_map.h" | 11 #include "base/id_map.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "content/child/webmessageportchannel_impl.h" |
13 #include "content/common/service_worker/service_worker_types.h" | 14 #include "content/common/service_worker/service_worker_types.h" |
14 #include "third_party/WebKit/public/platform/WebServiceWorkerClientsInfo.h" | 15 #include "third_party/WebKit/public/platform/WebServiceWorkerClientsInfo.h" |
15 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" | 16 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" |
16 | 17 |
17 namespace blink { | 18 namespace blink { |
18 class WebServiceWorkerContextProxy; | 19 class WebServiceWorkerContextProxy; |
19 } | 20 } |
20 | 21 |
21 namespace IPC { | 22 namespace IPC { |
22 class Message; | 23 class Message; |
(...skipping 19 matching lines...) Expand all Loading... |
42 void DidHandleActivateEvent(int request_id, | 43 void DidHandleActivateEvent(int request_id, |
43 blink::WebServiceWorkerEventResult); | 44 blink::WebServiceWorkerEventResult); |
44 void DidHandleInstallEvent(int request_id, | 45 void DidHandleInstallEvent(int request_id, |
45 blink::WebServiceWorkerEventResult result); | 46 blink::WebServiceWorkerEventResult result); |
46 void DidHandleFetchEvent(int request_id, | 47 void DidHandleFetchEvent(int request_id, |
47 ServiceWorkerFetchEventResult result, | 48 ServiceWorkerFetchEventResult result, |
48 const ServiceWorkerResponse& response); | 49 const ServiceWorkerResponse& response); |
49 void DidHandleSyncEvent(int request_id); | 50 void DidHandleSyncEvent(int request_id); |
50 void GetClientDocuments( | 51 void GetClientDocuments( |
51 blink::WebServiceWorkerClientsCallbacks* callbacks); | 52 blink::WebServiceWorkerClientsCallbacks* callbacks); |
| 53 void PostMessageToDocument(int client_id, |
| 54 const base::string16& message, |
| 55 const std::vector<int>& message_port_ids); |
52 | 56 |
53 private: | 57 private: |
54 typedef IDMap<blink::WebServiceWorkerClientsCallbacks, IDMapOwnPointer> | 58 typedef IDMap<blink::WebServiceWorkerClientsCallbacks, IDMapOwnPointer> |
55 ClientsCallbacksMap; | 59 ClientsCallbacksMap; |
56 | 60 |
57 // Send a message to the browser. | 61 // Send a message to the browser. |
58 void Send(IPC::Message* message); | 62 void Send(IPC::Message* message); |
59 | 63 |
60 void OnActivateEvent(int request_id); | 64 void OnActivateEvent(int request_id); |
61 void OnInstallEvent(int request_id, int active_version_id); | 65 void OnInstallEvent(int request_id, int active_version_id); |
(...skipping 22 matching lines...) Expand all Loading... |
84 | 88 |
85 // Pending callbacks for GetClientDocuments(). | 89 // Pending callbacks for GetClientDocuments(). |
86 ClientsCallbacksMap pending_clients_callbacks_; | 90 ClientsCallbacksMap pending_clients_callbacks_; |
87 | 91 |
88 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); | 92 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); |
89 }; | 93 }; |
90 | 94 |
91 } // namespace content | 95 } // namespace content |
92 | 96 |
93 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ | 97 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
OLD | NEW |