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

Side by Side Diff: content/browser/service_worker/service_worker_request_handler.cc

Issue 2960703003: Add a feature flag for network service and about:flags entry for it. (Closed)
Patch Set: merge Created 3 years, 5 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 #include "content/browser/service_worker/service_worker_request_handler.h" 5 #include "content/browser/service_worker/service_worker_request_handler.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "content/browser/loader/url_loader_request_handler.h" 12 #include "content/browser/loader/url_loader_request_handler.h"
13 #include "content/browser/service_worker/service_worker_context_core.h" 13 #include "content/browser/service_worker/service_worker_context_core.h"
14 #include "content/browser/service_worker/service_worker_context_wrapper.h" 14 #include "content/browser/service_worker/service_worker_context_wrapper.h"
15 #include "content/browser/service_worker/service_worker_navigation_handle_core.h " 15 #include "content/browser/service_worker/service_worker_navigation_handle_core.h "
16 #include "content/browser/service_worker/service_worker_provider_host.h" 16 #include "content/browser/service_worker/service_worker_provider_host.h"
17 #include "content/browser/service_worker/service_worker_registration.h" 17 #include "content/browser/service_worker/service_worker_registration.h"
18 #include "content/browser/service_worker/service_worker_url_request_job.h" 18 #include "content/browser/service_worker/service_worker_url_request_job.h"
19 #include "content/common/service_worker/service_worker_types.h" 19 #include "content/common/service_worker/service_worker_types.h"
20 #include "content/common/service_worker/service_worker_utils.h" 20 #include "content/common/service_worker/service_worker_utils.h"
21 #include "content/public/browser/resource_context.h" 21 #include "content/public/browser/resource_context.h"
22 #include "content/public/common/browser_side_navigation_policy.h" 22 #include "content/public/common/browser_side_navigation_policy.h"
23 #include "content/public/common/child_process_host.h" 23 #include "content/public/common/child_process_host.h"
24 #include "content/public/common/content_features.h"
24 #include "content/public/common/content_switches.h" 25 #include "content/public/common/content_switches.h"
25 #include "content/public/common/origin_util.h" 26 #include "content/public/common/origin_util.h"
26 #include "content/public/common/resource_request_body.h" 27 #include "content/public/common/resource_request_body.h"
27 #include "ipc/ipc_message.h" 28 #include "ipc/ipc_message.h"
28 #include "net/base/url_util.h" 29 #include "net/base/url_util.h"
29 #include "net/url_request/url_request.h" 30 #include "net/url_request/url_request.h"
30 #include "net/url_request/url_request_interceptor.h" 31 #include "net/url_request/url_request_interceptor.h"
31 #include "storage/browser/blob/blob_storage_context.h" 32 #include "storage/browser/blob/blob_storage_context.h"
32 33
33 namespace content { 34 namespace content {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 ServiceWorkerNavigationHandleCore* navigation_handle_core, 124 ServiceWorkerNavigationHandleCore* navigation_handle_core,
124 storage::BlobStorageContext* blob_storage_context, 125 storage::BlobStorageContext* blob_storage_context,
125 bool skip_service_worker, 126 bool skip_service_worker,
126 ResourceType resource_type, 127 ResourceType resource_type,
127 RequestContextType request_context_type, 128 RequestContextType request_context_type,
128 RequestContextFrameType frame_type, 129 RequestContextFrameType frame_type,
129 bool is_parent_frame_secure, 130 bool is_parent_frame_secure,
130 scoped_refptr<ResourceRequestBody> body, 131 scoped_refptr<ResourceRequestBody> body,
131 const base::Callback<WebContents*(void)>& web_contents_getter) { 132 const base::Callback<WebContents*(void)>& web_contents_getter) {
132 DCHECK(IsBrowserSideNavigationEnabled() && 133 DCHECK(IsBrowserSideNavigationEnabled() &&
133 base::CommandLine::ForCurrentProcess()->HasSwitch( 134 base::FeatureList::IsEnabled(features::kNetworkService));
134 switches::kEnableNetworkService));
135 DCHECK(navigation_handle_core); 135 DCHECK(navigation_handle_core);
136 136
137 // Create the handler even for insecure HTTP since it's used in the 137 // Create the handler even for insecure HTTP since it's used in the
138 // case of redirect to HTTPS. 138 // case of redirect to HTTPS.
139 if (!resource_request.url.SchemeIsHTTPOrHTTPS() && 139 if (!resource_request.url.SchemeIsHTTPOrHTTPS() &&
140 !OriginCanAccessServiceWorkers(resource_request.url)) { 140 !OriginCanAccessServiceWorkers(resource_request.url)) {
141 return nullptr; 141 return nullptr;
142 } 142 }
143 143
144 if (!navigation_handle_core->context_wrapper() || 144 if (!navigation_handle_core->context_wrapper() ||
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 ResourceType resource_type) 295 ResourceType resource_type)
296 : context_(context), 296 : context_(context),
297 provider_host_(provider_host), 297 provider_host_(provider_host),
298 blob_storage_context_(blob_storage_context), 298 blob_storage_context_(blob_storage_context),
299 resource_type_(resource_type), 299 resource_type_(resource_type),
300 old_process_id_(0), 300 old_process_id_(0),
301 old_provider_id_(kInvalidServiceWorkerProviderId) { 301 old_provider_id_(kInvalidServiceWorkerProviderId) {
302 } 302 }
303 303
304 } // namespace content 304 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_manager/service_manager_context.cc ('k') | content/browser/service_worker/service_worker_version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698