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/browser_side_navigation_policy.h" | 10 #include "content/public/common/browser_side_navigation_policy.h" |
11 #include "content/public/common/url_constants.h" | 11 #include "content/public/common/url_constants.h" |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 #include "url/url_constants.h" | 13 #include "url/url_constants.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 // PlzNavigate | 17 // PlzNavigate |
18 bool ShouldMakeNetworkRequestForURL(const GURL& url) { | 18 bool ShouldMakeNetworkRequestForURL(const GURL& url) { |
19 CHECK(IsBrowserSideNavigationEnabled()); | 19 CHECK(IsBrowserSideNavigationEnabled()); |
20 | 20 |
21 // Javascript URLs, about:blank, srcdoc should not send a request | 21 // Javascript URLs, about:blank, srcdoc should not send a request |
22 // to the network stack. | 22 // to the network stack. |
23 // TODO(clamy): same document navigations should not send requests to the | 23 // TODO(clamy): same document navigations should not send requests to the |
24 // network stack. Neither should pushState/popState. | 24 // network stack. Neither should pushState/popState. |
25 return url != GURL(url::kAboutBlankURL) && | 25 return url != url::kAboutBlankURL && !url.SchemeIs(url::kJavaScriptScheme) && |
26 !url.SchemeIs(url::kJavaScriptScheme) && !url.is_empty() && | 26 !url.is_empty() && !url.SchemeIs(url::kContentIDScheme) && |
27 !url.SchemeIs(url::kContentIDScheme) && | 27 url != content::kAboutSrcDocURL; |
28 url != GURL(content::kAboutSrcDocURL); | |
29 } | 28 } |
30 | 29 |
31 CommonNavigationParams::CommonNavigationParams() | 30 CommonNavigationParams::CommonNavigationParams() |
32 : transition(ui::PAGE_TRANSITION_LINK), | 31 : transition(ui::PAGE_TRANSITION_LINK), |
33 navigation_type(FrameMsg_Navigate_Type::NORMAL), | 32 navigation_type(FrameMsg_Navigate_Type::NORMAL), |
34 allow_download(true), | 33 allow_download(true), |
35 should_replace_current_entry(false), | 34 should_replace_current_entry(false), |
36 report_type(FrameMsg_UILoadMetricsReportType::NO_REPORT), | 35 report_type(FrameMsg_UILoadMetricsReportType::NO_REPORT), |
37 lofi_state(LOFI_UNSPECIFIED), | 36 lofi_state(LOFI_UNSPECIFIED), |
38 navigation_start(base::TimeTicks::Now()), | 37 navigation_start(base::TimeTicks::Now()), |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 const RequestNavigationParams& request_params) | 188 const RequestNavigationParams& request_params) |
190 : common_params(common_params), | 189 : common_params(common_params), |
191 start_params(start_params), | 190 start_params(start_params), |
192 request_params(request_params) { | 191 request_params(request_params) { |
193 } | 192 } |
194 | 193 |
195 NavigationParams::~NavigationParams() { | 194 NavigationParams::~NavigationParams() { |
196 } | 195 } |
197 | 196 |
198 } // namespace content | 197 } // namespace content |
OLD | NEW |