| 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 13 matching lines...) Expand all Loading... |
| 24 #include "content/public/common/request_context_frame_type.h" | 24 #include "content/public/common/request_context_frame_type.h" |
| 25 #include "content/public/common/request_context_type.h" | 25 #include "content/public/common/request_context_type.h" |
| 26 #include "content/public/common/resource_type.h" | 26 #include "content/public/common/resource_type.h" |
| 27 | 27 |
| 28 namespace storage { | 28 namespace storage { |
| 29 class BlobStorageContext; | 29 class BlobStorageContext; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace content { | 32 namespace content { |
| 33 | 33 |
| 34 class MessagePort; |
| 34 class ResourceRequestBodyImpl; | 35 class ResourceRequestBodyImpl; |
| 35 class ServiceWorkerContextCore; | 36 class ServiceWorkerContextCore; |
| 36 class ServiceWorkerDispatcherHost; | 37 class ServiceWorkerDispatcherHost; |
| 37 class ServiceWorkerRequestHandler; | 38 class ServiceWorkerRequestHandler; |
| 38 class ServiceWorkerVersion; | 39 class ServiceWorkerVersion; |
| 39 class WebContents; | 40 class WebContents; |
| 40 | 41 |
| 41 // This class is the browser-process representation of a service worker | 42 // This class is the browser-process representation of a service worker |
| 42 // provider. There are two general types of providers: 1) those for a client | 43 // provider. There are two general types of providers: 1) those for a client |
| 43 // (windows, dedicated workers, or shared workers), and 2) those for hosting a | 44 // (windows, dedicated workers, or shared workers), and 2) those for hosting a |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // an existing registration is being looked for. | 226 // an existing registration is being looked for. |
| 226 void SetAllowAssociation(bool allow) { allow_association_ = allow; } | 227 void SetAllowAssociation(bool allow) { allow_association_ = allow; } |
| 227 | 228 |
| 228 // Returns true if the context referred to by this host (i.e. |context_|) is | 229 // Returns true if the context referred to by this host (i.e. |context_|) is |
| 229 // still alive. | 230 // still alive. |
| 230 bool IsContextAlive(); | 231 bool IsContextAlive(); |
| 231 | 232 |
| 232 // Dispatches message event to the document. | 233 // Dispatches message event to the document. |
| 233 void PostMessageToClient(ServiceWorkerVersion* version, | 234 void PostMessageToClient(ServiceWorkerVersion* version, |
| 234 const base::string16& message, | 235 const base::string16& message, |
| 235 const std::vector<int>& sent_message_ports); | 236 const std::vector<MessagePort>& sent_message_ports); |
| 236 | 237 |
| 237 // Adds reference of this host's process to the |pattern|, the reference will | 238 // Adds reference of this host's process to the |pattern|, the reference will |
| 238 // be removed in destructor. | 239 // be removed in destructor. |
| 239 void AddScopedProcessReferenceToPattern(const GURL& pattern); | 240 void AddScopedProcessReferenceToPattern(const GURL& pattern); |
| 240 | 241 |
| 241 // |registration| claims the document to be controlled. | 242 // |registration| claims the document to be controlled. |
| 242 void ClaimedByRegistration(ServiceWorkerRegistration* registration); | 243 void ClaimedByRegistration(ServiceWorkerRegistration* registration); |
| 243 | 244 |
| 244 // Called by dispatcher host to get the registration for the "ready" property. | 245 // Called by dispatcher host to get the registration for the "ready" property. |
| 245 // Returns false if there's a completed or ongoing request for the document. | 246 // Returns false if there's a completed or ongoing request for the document. |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 bool allow_association_; | 407 bool allow_association_; |
| 407 | 408 |
| 408 std::vector<base::Closure> queued_events_; | 409 std::vector<base::Closure> queued_events_; |
| 409 | 410 |
| 410 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); | 411 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); |
| 411 }; | 412 }; |
| 412 | 413 |
| 413 } // namespace content | 414 } // namespace content |
| 414 | 415 |
| 415 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 416 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
| OLD | NEW |