| 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 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <set> | 13 #include <set> |
| 14 #include <string> | 14 #include <string> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
| 20 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
| 21 #include "base/time/time.h" |
| 21 #include "content/browser/service_worker/service_worker_registration.h" | 22 #include "content/browser/service_worker/service_worker_registration.h" |
| 22 #include "content/common/content_export.h" | 23 #include "content/common/content_export.h" |
| 23 #include "content/common/service_worker/service_worker_types.h" | 24 #include "content/common/service_worker/service_worker_types.h" |
| 24 #include "content/public/common/request_context_frame_type.h" | 25 #include "content/public/common/request_context_frame_type.h" |
| 25 #include "content/public/common/request_context_type.h" | 26 #include "content/public/common/request_context_type.h" |
| 26 #include "content/public/common/resource_type.h" | 27 #include "content/public/common/resource_type.h" |
| 27 | 28 |
| 28 namespace storage { | 29 namespace storage { |
| 29 class BlobStorageContext; | 30 class BlobStorageContext; |
| 30 } | 31 } |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // the request doesn't require special handling. | 201 // the request doesn't require special handling. |
| 201 std::unique_ptr<ServiceWorkerRequestHandler> CreateRequestHandler( | 202 std::unique_ptr<ServiceWorkerRequestHandler> CreateRequestHandler( |
| 202 FetchRequestMode request_mode, | 203 FetchRequestMode request_mode, |
| 203 FetchCredentialsMode credentials_mode, | 204 FetchCredentialsMode credentials_mode, |
| 204 FetchRedirectMode redirect_mode, | 205 FetchRedirectMode redirect_mode, |
| 205 ResourceType resource_type, | 206 ResourceType resource_type, |
| 206 RequestContextType request_context_type, | 207 RequestContextType request_context_type, |
| 207 RequestContextFrameType frame_type, | 208 RequestContextFrameType frame_type, |
| 208 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 209 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
| 209 scoped_refptr<ResourceRequestBodyImpl> body, | 210 scoped_refptr<ResourceRequestBodyImpl> body, |
| 210 bool skip_service_worker); | 211 bool skip_service_worker, |
| 212 base::TimeTicks request_start); |
| 211 | 213 |
| 212 // Used to get a ServiceWorkerObjectInfo to send to the renderer. Finds an | 214 // Used to get a ServiceWorkerObjectInfo to send to the renderer. Finds an |
| 213 // existing ServiceWorkerHandle, and increments its reference count, or else | 215 // existing ServiceWorkerHandle, and increments its reference count, or else |
| 214 // creates a new one (initialized to ref count 1). Returns the | 216 // creates a new one (initialized to ref count 1). Returns the |
| 215 // ServiceWorkerInfo from the handle. The renderer is expected to use | 217 // ServiceWorkerInfo from the handle. The renderer is expected to use |
| 216 // ServiceWorkerHandleReference::Adopt to balance out the ref count. | 218 // ServiceWorkerHandleReference::Adopt to balance out the ref count. |
| 217 ServiceWorkerObjectInfo GetOrCreateServiceWorkerHandle( | 219 ServiceWorkerObjectInfo GetOrCreateServiceWorkerHandle( |
| 218 ServiceWorkerVersion* version); | 220 ServiceWorkerVersion* version); |
| 219 | 221 |
| 220 // Returns true if |registration| can be associated with this provider. | 222 // Returns true if |registration| can be associated with this provider. |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 bool allow_association_; | 408 bool allow_association_; |
| 407 | 409 |
| 408 std::vector<base::Closure> queued_events_; | 410 std::vector<base::Closure> queued_events_; |
| 409 | 411 |
| 410 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); | 412 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); |
| 411 }; | 413 }; |
| 412 | 414 |
| 413 } // namespace content | 415 } // namespace content |
| 414 | 416 |
| 415 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 417 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
| OLD | NEW |