| 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_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/supports_user_data.h" | 10 #include "base/supports_user_data.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace storage { | 26 namespace storage { |
| 27 class BlobStorageContext; | 27 class BlobStorageContext; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace content { | 30 namespace content { |
| 31 | 31 |
| 32 class ResourceContext; | 32 class ResourceContext; |
| 33 class ResourceRequestBody; | 33 class ResourceRequestBody; |
| 34 class NavigationURLLoaderImplCore; |
| 34 class ServiceWorkerContextCore; | 35 class ServiceWorkerContextCore; |
| 35 class ServiceWorkerContextWrapper; | 36 class ServiceWorkerContextWrapper; |
| 36 class ServiceWorkerProviderHost; | 37 class ServiceWorkerProviderHost; |
| 37 struct ResourceResponseInfo; | 38 struct ResourceResponseInfo; |
| 38 | 39 |
| 39 // Abstract base class for routing network requests to ServiceWorkers. | 40 // Abstract base class for routing network requests to ServiceWorkers. |
| 40 // Created one per URLRequest and attached to each request. | 41 // Created one per URLRequest and attached to each request. |
| 41 class CONTENT_EXPORT ServiceWorkerRequestHandler | 42 class CONTENT_EXPORT ServiceWorkerRequestHandler |
| 42 : public base::SupportsUserData::Data { | 43 : public base::SupportsUserData::Data { |
| 43 public: | 44 public: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 54 int process_id, | 55 int process_id, |
| 55 int provider_id, | 56 int provider_id, |
| 56 bool skip_service_worker, | 57 bool skip_service_worker, |
| 57 FetchRequestMode request_mode, | 58 FetchRequestMode request_mode, |
| 58 FetchCredentialsMode credentials_mode, | 59 FetchCredentialsMode credentials_mode, |
| 59 ResourceType resource_type, | 60 ResourceType resource_type, |
| 60 RequestContextType request_context_type, | 61 RequestContextType request_context_type, |
| 61 RequestContextFrameType frame_type, | 62 RequestContextFrameType frame_type, |
| 62 scoped_refptr<ResourceRequestBody> body); | 63 scoped_refptr<ResourceRequestBody> body); |
| 63 | 64 |
| 65 static void InitializeNavigationHandler( |
| 66 net::URLRequest* request, |
| 67 ServiceWorkerContextWrapper* context_wrapper, |
| 68 storage::BlobStorageContext* blob_storage_context, |
| 69 bool skip_service_worker, |
| 70 bool is_main_frame, |
| 71 scoped_refptr<ResourceRequestBody> body, |
| 72 NavigationURLLoaderImplCore* loader); |
| 73 |
| 64 // Returns the handler attached to |request|. This may return NULL | 74 // Returns the handler attached to |request|. This may return NULL |
| 65 // if no handler is attached. | 75 // if no handler is attached. |
| 66 static ServiceWorkerRequestHandler* GetHandler( | 76 static ServiceWorkerRequestHandler* GetHandler( |
| 67 net::URLRequest* request); | 77 net::URLRequest* request); |
| 68 | 78 |
| 69 // Creates a protocol interceptor for ServiceWorker. | 79 // Creates a protocol interceptor for ServiceWorker. |
| 70 static scoped_ptr<net::URLRequestInterceptor> CreateInterceptor( | 80 static scoped_ptr<net::URLRequestInterceptor> CreateInterceptor( |
| 71 ResourceContext* resource_context); | 81 ResourceContext* resource_context); |
| 72 | 82 |
| 73 // Returns true if the request falls into the scope of a ServiceWorker. | 83 // Returns true if the request falls into the scope of a ServiceWorker. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 scoped_ptr<ServiceWorkerProviderHost> host_for_cross_site_transfer_; | 122 scoped_ptr<ServiceWorkerProviderHost> host_for_cross_site_transfer_; |
| 113 int old_process_id_; | 123 int old_process_id_; |
| 114 int old_provider_id_; | 124 int old_provider_id_; |
| 115 | 125 |
| 116 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); | 126 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); |
| 117 }; | 127 }; |
| 118 | 128 |
| 119 } // namespace content | 129 } // namespace content |
| 120 | 130 |
| 121 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ | 131 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ |
| OLD | NEW |