| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 class BlobStorageContext; | 29 class BlobStorageContext; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace content { | 32 namespace content { |
| 33 | 33 |
| 34 class ResourceContext; | 34 class ResourceContext; |
| 35 class ResourceMessageFilter; | 35 class ResourceMessageFilter; |
| 36 class ResourceRequestBodyImpl; | 36 class ResourceRequestBodyImpl; |
| 37 class ServiceWorkerContextCore; | 37 class ServiceWorkerContextCore; |
| 38 class ServiceWorkerContextWrapper; | 38 class ServiceWorkerContextWrapper; |
| 39 class ServiceWorkerNavigationHandleCore; | |
| 40 class ServiceWorkerProviderHost; | 39 class ServiceWorkerProviderHost; |
| 41 | 40 |
| 42 // Abstract base class for routing network requests to ServiceWorkers. | 41 // Abstract base class for routing network requests to ServiceWorkers. |
| 43 // Created one per URLRequest and attached to each request. | 42 // Created one per URLRequest and attached to each request. |
| 44 class CONTENT_EXPORT ServiceWorkerRequestHandler | 43 class CONTENT_EXPORT ServiceWorkerRequestHandler |
| 45 : public base::SupportsUserData::Data { | 44 : public base::SupportsUserData::Data { |
| 46 public: | 45 public: |
| 47 // PlzNavigate | |
| 48 // Attaches a newly created handler if the given |request| needs to be handled | |
| 49 // by ServiceWorker. | |
| 50 static void InitializeForNavigation( | |
| 51 net::URLRequest* request, | |
| 52 ServiceWorkerNavigationHandleCore* navigation_handle_core, | |
| 53 storage::BlobStorageContext* blob_storage_context, | |
| 54 bool skip_service_worker, | |
| 55 ResourceType resource_type, | |
| 56 RequestContextType request_context_type, | |
| 57 RequestContextFrameType frame_type, | |
| 58 scoped_refptr<ResourceRequestBodyImpl> body); | |
| 59 | |
| 60 // Attaches a newly created handler if the given |request| needs to | 46 // Attaches a newly created handler if the given |request| needs to |
| 61 // be handled by ServiceWorker. | 47 // be handled by ServiceWorker. |
| 62 // TODO(kinuko): While utilizing UserData to attach data to URLRequest | 48 // TODO(kinuko): While utilizing UserData to attach data to URLRequest |
| 63 // has some precedence, it might be better to attach this handler in a more | 49 // has some precedence, it might be better to attach this handler in a more |
| 64 // explicit way within content layer, e.g. have ResourceRequestInfoImpl | 50 // explicit way within content layer, e.g. have ResourceRequestInfoImpl |
| 65 // own it. | 51 // own it. |
| 66 static void InitializeHandler( | 52 static void InitializeHandler( |
| 67 net::URLRequest* request, | 53 net::URLRequest* request, |
| 68 ServiceWorkerContextWrapper* context_wrapper, | 54 ServiceWorkerContextWrapper* context_wrapper, |
| 69 storage::BlobStorageContext* blob_storage_context, | 55 storage::BlobStorageContext* blob_storage_context, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 std::unique_ptr<ServiceWorkerProviderHost> host_for_cross_site_transfer_; | 114 std::unique_ptr<ServiceWorkerProviderHost> host_for_cross_site_transfer_; |
| 129 int old_process_id_; | 115 int old_process_id_; |
| 130 int old_provider_id_; | 116 int old_provider_id_; |
| 131 | 117 |
| 132 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); | 118 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); |
| 133 }; | 119 }; |
| 134 | 120 |
| 135 } // namespace content | 121 } // namespace content |
| 136 | 122 |
| 137 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ | 123 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ |
| OLD | NEW |