Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: content/browser/service_worker/service_worker_controllee_request_handler.h

Issue 623663002: [ServiceWorker] pipe RequestContext and FrameType to ServiceWorker. [2/2 chromium] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: request_info.cc Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_CONTROLLEE_REQUEST_HANDLER _H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HANDLER _H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HANDLER _H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HANDLER _H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "content/browser/service_worker/service_worker_request_handler.h" 9 #include "content/browser/service_worker/service_worker_request_handler.h"
10 #include "content/common/service_worker/service_worker_types.h" 10 #include "content/common/service_worker/service_worker_types.h"
11 #include "content/public/common/request_context_frame_type.h"
12 #include "content/public/common/request_context_type.h"
13 #include "content/public/common/resource_type.h"
11 14
12 namespace net { 15 namespace net {
13 class NetworkDelegate; 16 class NetworkDelegate;
14 class URLRequest; 17 class URLRequest;
15 } 18 }
16 19
17 namespace content { 20 namespace content {
18 21
19 class ResourceRequestBody; 22 class ResourceRequestBody;
20 class ServiceWorkerRegistration; 23 class ServiceWorkerRegistration;
21 class ServiceWorkerURLRequestJob; 24 class ServiceWorkerURLRequestJob;
22 class ServiceWorkerVersion; 25 class ServiceWorkerVersion;
23 26
24 // A request handler derivative used to handle requests from 27 // A request handler derivative used to handle requests from
25 // controlled documents. 28 // controlled documents.
26 class CONTENT_EXPORT ServiceWorkerControlleeRequestHandler 29 class CONTENT_EXPORT ServiceWorkerControlleeRequestHandler
27 : public ServiceWorkerRequestHandler { 30 : public ServiceWorkerRequestHandler {
28 public: 31 public:
29 ServiceWorkerControlleeRequestHandler( 32 ServiceWorkerControlleeRequestHandler(
30 base::WeakPtr<ServiceWorkerContextCore> context, 33 base::WeakPtr<ServiceWorkerContextCore> context,
31 base::WeakPtr<ServiceWorkerProviderHost> provider_host, 34 base::WeakPtr<ServiceWorkerProviderHost> provider_host,
32 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, 35 base::WeakPtr<storage::BlobStorageContext> blob_storage_context,
33 FetchRequestMode request_mode, 36 FetchRequestMode request_mode,
34 FetchCredentialsMode credentials_mode, 37 FetchCredentialsMode credentials_mode,
35 ResourceType resource_type, 38 ResourceType resource_type,
39 RequestContextType request_context_type,
40 RequestContextFrameType frame_type,
36 scoped_refptr<ResourceRequestBody> body); 41 scoped_refptr<ResourceRequestBody> body);
37 virtual ~ServiceWorkerControlleeRequestHandler(); 42 virtual ~ServiceWorkerControlleeRequestHandler();
38 43
39 // Called via custom URLRequestJobFactory. 44 // Called via custom URLRequestJobFactory.
40 virtual net::URLRequestJob* MaybeCreateJob( 45 virtual net::URLRequestJob* MaybeCreateJob(
41 net::URLRequest* request, 46 net::URLRequest* request,
42 net::NetworkDelegate* network_delegate) OVERRIDE; 47 net::NetworkDelegate* network_delegate) OVERRIDE;
43 48
44 virtual void GetExtraResponseInfo( 49 virtual void GetExtraResponseInfo(
45 bool* was_fetched_via_service_worker, 50 bool* was_fetched_via_service_worker,
(...skipping 17 matching lines...) Expand all
63 ServiceWorkerRegistration* registration, 68 ServiceWorkerRegistration* registration,
64 ServiceWorkerVersion* version); 69 ServiceWorkerVersion* version);
65 70
66 // For sub resource case. 71 // For sub resource case.
67 void PrepareForSubResource(); 72 void PrepareForSubResource();
68 73
69 bool is_main_resource_load_; 74 bool is_main_resource_load_;
70 scoped_refptr<ServiceWorkerURLRequestJob> job_; 75 scoped_refptr<ServiceWorkerURLRequestJob> job_;
71 FetchRequestMode request_mode_; 76 FetchRequestMode request_mode_;
72 FetchCredentialsMode credentials_mode_; 77 FetchCredentialsMode credentials_mode_;
78 RequestContextType request_context_type_;
79 RequestContextFrameType frame_type_;
73 scoped_refptr<ResourceRequestBody> body_; 80 scoped_refptr<ResourceRequestBody> body_;
74 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_; 81 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_;
75 82
76 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler); 83 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler);
77 }; 84 };
78 85
79 } // namespace content 86 } // namespace content
80 87
81 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND LER_H_ 88 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND LER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698