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" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "content/common/service_worker/service_worker_status_code.h" | 13 #include "content/common/service_worker/service_worker_status_code.h" |
| 14 #include "content/common/service_worker/service_worker_types.h" |
14 #include "content/public/common/resource_type.h" | 15 #include "content/public/common/resource_type.h" |
15 #include "net/url_request/url_request_job_factory.h" | 16 #include "net/url_request/url_request_job_factory.h" |
16 | 17 |
17 namespace net { | 18 namespace net { |
18 class NetworkDelegate; | 19 class NetworkDelegate; |
19 class URLRequest; | 20 class URLRequest; |
20 class URLRequestInterceptor; | 21 class URLRequestInterceptor; |
21 } | 22 } |
22 | 23 |
23 namespace storage { | 24 namespace storage { |
(...skipping 18 matching lines...) Expand all Loading... |
42 // has some precedence, it might be better to attach this handler in a more | 43 // has some precedence, it might be better to attach this handler in a more |
43 // explicit way within content layer, e.g. have ResourceRequestInfoImpl | 44 // explicit way within content layer, e.g. have ResourceRequestInfoImpl |
44 // own it. | 45 // own it. |
45 static void InitializeHandler( | 46 static void InitializeHandler( |
46 net::URLRequest* request, | 47 net::URLRequest* request, |
47 ServiceWorkerContextWrapper* context_wrapper, | 48 ServiceWorkerContextWrapper* context_wrapper, |
48 storage::BlobStorageContext* blob_storage_context, | 49 storage::BlobStorageContext* blob_storage_context, |
49 int process_id, | 50 int process_id, |
50 int provider_id, | 51 int provider_id, |
51 bool skip_service_worker, | 52 bool skip_service_worker, |
| 53 FetchRequestMode request_mode, |
52 ResourceType resource_type, | 54 ResourceType resource_type, |
53 scoped_refptr<ResourceRequestBody> body); | 55 scoped_refptr<ResourceRequestBody> body); |
54 | 56 |
55 // Returns the handler attached to |request|. This may return NULL | 57 // Returns the handler attached to |request|. This may return NULL |
56 // if no handler is attached. | 58 // if no handler is attached. |
57 static ServiceWorkerRequestHandler* GetHandler( | 59 static ServiceWorkerRequestHandler* GetHandler( |
58 net::URLRequest* request); | 60 net::URLRequest* request); |
59 | 61 |
60 // Creates a protocol interceptor for ServiceWorker. | 62 // Creates a protocol interceptor for ServiceWorker. |
61 static scoped_ptr<net::URLRequestInterceptor> CreateInterceptor(); | 63 static scoped_ptr<net::URLRequestInterceptor> CreateInterceptor(); |
(...skipping 24 matching lines...) Expand all Loading... |
86 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; | 88 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; |
87 ResourceType resource_type_; | 89 ResourceType resource_type_; |
88 | 90 |
89 private: | 91 private: |
90 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); | 92 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); |
91 }; | 93 }; |
92 | 94 |
93 } // namespace content | 95 } // namespace content |
94 | 96 |
95 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ | 97 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ |
OLD | NEW |