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 #include "content/common/navigation_params.h" | 5 #include "content/common/navigation_params.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "content/common/service_worker/service_worker_types.h" | 9 #include "content/common/service_worker/service_worker_types.h" |
10 #include "content/public/common/appcache_info.h" | 10 #include "content/public/common/appcache_info.h" |
11 #include "content/public/common/browser_side_navigation_policy.h" | 11 #include "content/public/common/browser_side_navigation_policy.h" |
12 #include "content/public/common/url_constants.h" | 12 #include "content/public/common/url_constants.h" |
13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
14 #include "url/url_constants.h" | 14 #include "url/url_constants.h" |
15 #include "url/url_util.h" | 15 #include "url/url_util.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 // PlzNavigate | 19 // PlzNavigate |
20 bool ShouldMakeNetworkRequestForURL(const GURL& url) { | 20 bool ShouldMakeNetworkRequestForURL(const GURL& url) { |
21 CHECK(IsBrowserSideNavigationEnabled()); | 21 CHECK(IsBrowserSideNavigationEnabled()); |
22 | 22 |
23 // Javascript URLs, srcdoc, schemes that don't load data should not send a | 23 // Javascript URLs, srcdoc, schemes that don't load data should not send a |
24 // request to the network stack. | 24 // request to the network stack. |
25 if (url.SchemeIs(url::kJavaScriptScheme) || url.is_empty() || | 25 if (url.SchemeIs(url::kJavaScriptScheme) || url.is_empty() || |
26 url.SchemeIs(url::kContentIDScheme) || url == content::kAboutSrcDocURL) { | 26 url == content::kAboutSrcDocURL) { |
nasko
2017/05/03 17:28:39
The comments in this CL say that "cid:" cannot be
arthursonzogni
2017/05/04 14:26:32
You are right, the "cid:" cannot be encountered ou
nasko
2017/05/04 15:48:18
Would the cid: scheme have a valid URL as the rest
arthursonzogni
2017/05/05 09:07:46
It will not have a valid URL as the rest of the st
| |
27 return false; | 27 return false; |
28 } | 28 } |
29 | 29 |
30 for (const auto& scheme : url::GetEmptyDocumentSchemes()) { | 30 for (const auto& scheme : url::GetEmptyDocumentSchemes()) { |
31 if (url.SchemeIs(scheme)) | 31 if (url.SchemeIs(scheme)) |
32 return false; | 32 return false; |
33 } | 33 } |
34 | 34 |
35 return true; | 35 return true; |
36 } | 36 } |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 const RequestNavigationParams& request_params) | 221 const RequestNavigationParams& request_params) |
222 : common_params(common_params), | 222 : common_params(common_params), |
223 start_params(start_params), | 223 start_params(start_params), |
224 request_params(request_params) { | 224 request_params(request_params) { |
225 } | 225 } |
226 | 226 |
227 NavigationParams::~NavigationParams() { | 227 NavigationParams::~NavigationParams() { |
228 } | 228 } |
229 | 229 |
230 } // namespace content | 230 } // namespace content |
OLD | NEW |