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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 const base::string16& message, | 84 const base::string16& message, |
85 scoped_ptr<blink::WebMessagePortChannelArray> channels); | 85 scoped_ptr<blink::WebMessagePortChannelArray> channels); |
86 void PostCrossOriginMessageToClient( | 86 void PostCrossOriginMessageToClient( |
87 const blink::WebCrossOriginServiceWorkerClient& client, | 87 const blink::WebCrossOriginServiceWorkerClient& client, |
88 const base::string16& message, | 88 const base::string16& message, |
89 scoped_ptr<blink::WebMessagePortChannelArray> channels); | 89 scoped_ptr<blink::WebMessagePortChannelArray> channels); |
90 void FocusClient(const base::string16& uuid, | 90 void FocusClient(const base::string16& uuid, |
91 blink::WebServiceWorkerClientCallbacks* callback); | 91 blink::WebServiceWorkerClientCallbacks* callback); |
92 void SkipWaiting(blink::WebServiceWorkerSkipWaitingCallbacks* callbacks); | 92 void SkipWaiting(blink::WebServiceWorkerSkipWaitingCallbacks* callbacks); |
93 void ClaimClients(blink::WebServiceWorkerClientsClaimCallbacks* callbacks); | 93 void ClaimClients(blink::WebServiceWorkerClientsClaimCallbacks* callbacks); |
| 94 void StashMessagePort(blink::WebMessagePortChannel* channel, |
| 95 const base::string16& name); |
94 | 96 |
95 // Send a message to the browser. Takes ownership of |message|. | 97 // Send a message to the browser. Takes ownership of |message|. |
96 void Send(IPC::Message* message); | 98 void Send(IPC::Message* message); |
97 | 99 |
98 // Get routing_id for sending message to the ServiceWorkerVersion | 100 // Get routing_id for sending message to the ServiceWorkerVersion |
99 // in the browser process. | 101 // in the browser process. |
100 int GetRoutingID() const; | 102 int GetRoutingID() const; |
101 | 103 |
102 private: | 104 private: |
103 typedef IDMap<blink::WebServiceWorkerClientsCallbacks, IDMapOwnPointer> | 105 typedef IDMap<blink::WebServiceWorkerClientsCallbacks, IDMapOwnPointer> |
(...skipping 22 matching lines...) Expand all Loading... |
126 const NavigatorConnectClient& client); | 128 const NavigatorConnectClient& client); |
127 void OnPostMessage( | 129 void OnPostMessage( |
128 const base::string16& message, | 130 const base::string16& message, |
129 const std::vector<TransferredMessagePort>& sent_message_ports, | 131 const std::vector<TransferredMessagePort>& sent_message_ports, |
130 const std::vector<int>& new_routing_ids); | 132 const std::vector<int>& new_routing_ids); |
131 void OnCrossOriginMessageToWorker( | 133 void OnCrossOriginMessageToWorker( |
132 const NavigatorConnectClient& client, | 134 const NavigatorConnectClient& client, |
133 const base::string16& message, | 135 const base::string16& message, |
134 const std::vector<TransferredMessagePort>& sent_message_ports, | 136 const std::vector<TransferredMessagePort>& sent_message_ports, |
135 const std::vector<int>& new_routing_ids); | 137 const std::vector<int>& new_routing_ids); |
| 138 void OnSendStashedMessagePorts( |
| 139 const std::vector<TransferredMessagePort>& stashed_message_ports, |
| 140 const std::vector<int>& new_routing_ids, |
| 141 const std::vector<base::string16>& port_names); |
136 void OnDidGetClients( | 142 void OnDidGetClients( |
137 int request_id, const std::vector<ServiceWorkerClientInfo>& clients); | 143 int request_id, const std::vector<ServiceWorkerClientInfo>& clients); |
138 void OnOpenWindowResponse(int request_id, | 144 void OnOpenWindowResponse(int request_id, |
139 const ServiceWorkerClientInfo& client); | 145 const ServiceWorkerClientInfo& client); |
140 void OnOpenWindowError(int request_id, const std::string& message); | 146 void OnOpenWindowError(int request_id, const std::string& message); |
141 void OnFocusClientResponse(int request_id, | 147 void OnFocusClientResponse(int request_id, |
142 const ServiceWorkerClientInfo& client); | 148 const ServiceWorkerClientInfo& client); |
143 void OnDidSkipWaiting(int request_id); | 149 void OnDidSkipWaiting(int request_id); |
144 void OnDidClaimClients(int request_id); | 150 void OnDidClaimClients(int request_id); |
145 void OnClaimClientsError(int request_id, | 151 void OnClaimClientsError(int request_id, |
(...skipping 30 matching lines...) Expand all Loading... |
176 std::map<int, base::TimeTicks> install_start_timings_; | 182 std::map<int, base::TimeTicks> install_start_timings_; |
177 std::map<int, base::TimeTicks> notification_click_start_timings_; | 183 std::map<int, base::TimeTicks> notification_click_start_timings_; |
178 std::map<int, base::TimeTicks> push_start_timings_; | 184 std::map<int, base::TimeTicks> push_start_timings_; |
179 | 185 |
180 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); | 186 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); |
181 }; | 187 }; |
182 | 188 |
183 } // namespace content | 189 } // namespace content |
184 | 190 |
185 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ | 191 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
OLD | NEW |