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 <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "content/browser/service_worker/service_worker_registration.h" | 13 #include "content/browser/service_worker/service_worker_registration.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/common/service_worker/service_worker_types.h" | 15 #include "content/common/service_worker/service_worker_types.h" |
16 #include "content/public/common/resource_type.h" | 16 #include "content/public/common/resource_type.h" |
17 | 17 |
18 namespace IPC { | 18 namespace IPC { |
19 class Sender; | 19 class Sender; |
20 } | 20 } |
21 | 21 |
22 namespace webkit_blob { | 22 namespace storage { |
23 class BlobStorageContext; | 23 class BlobStorageContext; |
24 } | 24 } |
25 | 25 |
26 namespace content { | 26 namespace content { |
27 | 27 |
28 class ServiceWorkerContextCore; | 28 class ServiceWorkerContextCore; |
29 class ServiceWorkerDispatcherHost; | 29 class ServiceWorkerDispatcherHost; |
30 class ServiceWorkerRequestHandler; | 30 class ServiceWorkerRequestHandler; |
31 class ServiceWorkerVersion; | 31 class ServiceWorkerVersion; |
32 | 32 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 void UnassociateRegistration(); | 85 void UnassociateRegistration(); |
86 | 86 |
87 // Returns false if the version is not in the expected STARTING in our | 87 // Returns false if the version is not in the expected STARTING in our |
88 // process state. That would be indicative of a bad IPC message. | 88 // process state. That would be indicative of a bad IPC message. |
89 bool SetHostedVersionId(int64 versions_id); | 89 bool SetHostedVersionId(int64 versions_id); |
90 | 90 |
91 // Returns a handler for a request, the handler may return NULL if | 91 // Returns a handler for a request, the handler may return NULL if |
92 // the request doesn't require special handling. | 92 // the request doesn't require special handling. |
93 scoped_ptr<ServiceWorkerRequestHandler> CreateRequestHandler( | 93 scoped_ptr<ServiceWorkerRequestHandler> CreateRequestHandler( |
94 ResourceType resource_type, | 94 ResourceType resource_type, |
95 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context); | 95 base::WeakPtr<storage::BlobStorageContext> blob_storage_context); |
96 | 96 |
97 // Returns true if |registration| can be associated with this provider. | 97 // Returns true if |registration| can be associated with this provider. |
98 bool CanAssociateRegistration(ServiceWorkerRegistration* registration); | 98 bool CanAssociateRegistration(ServiceWorkerRegistration* registration); |
99 | 99 |
100 // Returns true if the context referred to by this host (i.e. |context_|) is | 100 // Returns true if the context referred to by this host (i.e. |context_|) is |
101 // still alive. | 101 // still alive. |
102 bool IsContextAlive(); | 102 bool IsContextAlive(); |
103 | 103 |
104 // Dispatches message event to the document. | 104 // Dispatches message event to the document. |
105 void PostMessage(const base::string16& message, | 105 void PostMessage(const base::string16& message, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; | 155 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; |
156 base::WeakPtr<ServiceWorkerContextCore> context_; | 156 base::WeakPtr<ServiceWorkerContextCore> context_; |
157 ServiceWorkerDispatcherHost* dispatcher_host_; | 157 ServiceWorkerDispatcherHost* dispatcher_host_; |
158 | 158 |
159 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); | 159 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); |
160 }; | 160 }; |
161 | 161 |
162 } // namespace content | 162 } // namespace content |
163 | 163 |
164 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 164 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
OLD | NEW |