OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // For use by the ServiceWorkerControlleeRequestHandler to disallow | 161 // For use by the ServiceWorkerControlleeRequestHandler to disallow |
162 // new registration association while a navigation is occurring and | 162 // new registration association while a navigation is occurring and |
163 // an existing registration is being looked for. | 163 // an existing registration is being looked for. |
164 void SetAllowAssociation(bool allow) { allow_association_ = allow; } | 164 void SetAllowAssociation(bool allow) { allow_association_ = allow; } |
165 | 165 |
166 // Returns true if the context referred to by this host (i.e. |context_|) is | 166 // Returns true if the context referred to by this host (i.e. |context_|) is |
167 // still alive. | 167 // still alive. |
168 bool IsContextAlive(); | 168 bool IsContextAlive(); |
169 | 169 |
170 // Dispatches message event to the document. | 170 // Dispatches message event to the document. |
171 void PostMessageToClient( | 171 void PostMessageToClient(ServiceWorkerVersion* version, |
172 ServiceWorkerVersion* version, | 172 const base::string16& message, |
173 const base::string16& message, | 173 const std::vector<int>& sent_message_ports); |
174 const std::vector<TransferredMessagePort>& sent_message_ports); | |
175 | 174 |
176 // Adds reference of this host's process to the |pattern|, the reference will | 175 // Adds reference of this host's process to the |pattern|, the reference will |
177 // be removed in destructor. | 176 // be removed in destructor. |
178 void AddScopedProcessReferenceToPattern(const GURL& pattern); | 177 void AddScopedProcessReferenceToPattern(const GURL& pattern); |
179 | 178 |
180 // |registration| claims the document to be controlled. | 179 // |registration| claims the document to be controlled. |
181 void ClaimedByRegistration(ServiceWorkerRegistration* registration); | 180 void ClaimedByRegistration(ServiceWorkerRegistration* registration); |
182 | 181 |
183 // Called by dispatcher host to get the registration for the "ready" property. | 182 // Called by dispatcher host to get the registration for the "ready" property. |
184 // Returns false if there's a completed or ongoing request for the document. | 183 // Returns false if there's a completed or ongoing request for the document. |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 bool allow_association_; | 328 bool allow_association_; |
330 | 329 |
331 std::vector<base::Closure> queued_events_; | 330 std::vector<base::Closure> queued_events_; |
332 | 331 |
333 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); | 332 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); |
334 }; | 333 }; |
335 | 334 |
336 } // namespace content | 335 } // namespace content |
337 | 336 |
338 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 337 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
OLD | NEW |