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 <string> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "base/id_map.h" | 12 #include "base/id_map.h" |
12 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
13 #include "content/child/webmessageportchannel_impl.h" | 14 #include "content/child/webmessageportchannel_impl.h" |
14 #include "content/common/service_worker/service_worker_types.h" | 15 #include "content/common/service_worker/service_worker_types.h" |
15 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" | 16 #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" |
16 #include "third_party/WebKit/public/platform/WebServiceWorkerClientsInfo.h" | 17 #include "third_party/WebKit/public/platform/WebServiceWorkerClientsInfo.h" |
17 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" | 18 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 typedef IDMap<blink::WebServiceWorkerClientsCallbacks, IDMapOwnPointer> | 61 typedef IDMap<blink::WebServiceWorkerClientsCallbacks, IDMapOwnPointer> |
61 ClientsCallbacksMap; | 62 ClientsCallbacksMap; |
62 | 63 |
63 // Send a message to the browser. | 64 // Send a message to the browser. |
64 void Send(IPC::Message* message); | 65 void Send(IPC::Message* message); |
65 | 66 |
66 void OnActivateEvent(int request_id); | 67 void OnActivateEvent(int request_id); |
67 void OnInstallEvent(int request_id, int active_version_id); | 68 void OnInstallEvent(int request_id, int active_version_id); |
68 void OnFetchEvent(int request_id, const ServiceWorkerFetchRequest& request); | 69 void OnFetchEvent(int request_id, const ServiceWorkerFetchRequest& request); |
69 void OnSyncEvent(int request_id); | 70 void OnSyncEvent(int request_id); |
| 71 void OnPushEvent(int request_id, const std::string& data); |
70 void OnPostMessage(const base::string16& message, | 72 void OnPostMessage(const base::string16& message, |
71 const std::vector<int>& sent_message_port_ids, | 73 const std::vector<int>& sent_message_port_ids, |
72 const std::vector<int>& new_routing_ids); | 74 const std::vector<int>& new_routing_ids); |
73 void OnDidGetClientDocuments( | 75 void OnDidGetClientDocuments( |
74 int request_id, const std::vector<int>& client_ids); | 76 int request_id, const std::vector<int>& client_ids); |
75 | 77 |
76 // Get routing_id for sending message to the ServiceWorkerVersion | 78 // Get routing_id for sending message to the ServiceWorkerVersion |
77 // in the browser process. | 79 // in the browser process. |
78 int GetRoutingID() const; | 80 int GetRoutingID() const; |
79 | 81 |
(...skipping 10 matching lines...) Expand all Loading... |
90 | 92 |
91 // Pending callbacks for GetClientDocuments(). | 93 // Pending callbacks for GetClientDocuments(). |
92 ClientsCallbacksMap pending_clients_callbacks_; | 94 ClientsCallbacksMap pending_clients_callbacks_; |
93 | 95 |
94 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); | 96 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); |
95 }; | 97 }; |
96 | 98 |
97 } // namespace content | 99 } // namespace content |
98 | 100 |
99 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ | 101 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
OLD | NEW |