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/command_line.h" | |
7 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
9 #include "content/public/common/content_switches.h" | |
8 | 10 |
9 namespace content { | 11 namespace content { |
10 | 12 |
13 bool ShouldMakeNetworkRequestForURL(const GURL& url) { | |
14 // Data and Javascript urls should not make network requests. | |
nasko
2015/07/06 11:06:16
If the comment is aiming to list the cases for no
Fabrice (no longer in Chrome)
2015/07/06 12:45:09
I modified the comment to clarify.
| |
15 // TODO(clamy): same document navigations should not make network requests. | |
16 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | |
clamy
2015/07/03 15:02:23
nit: put the check above the comments, as they rel
Fabrice (no longer in Chrome)
2015/07/06 12:45:09
Done.
| |
17 switches::kEnableBrowserSideNavigation)); | |
18 return !url.SchemeIs(url::kDataScheme) && url != GURL(url::kAboutBlankURL) && | |
19 !url.SchemeIs(url::kJavaScriptScheme); | |
20 } | |
21 | |
11 CommonNavigationParams::CommonNavigationParams() | 22 CommonNavigationParams::CommonNavigationParams() |
12 : transition(ui::PAGE_TRANSITION_LINK), | 23 : transition(ui::PAGE_TRANSITION_LINK), |
13 navigation_type(FrameMsg_Navigate_Type::NORMAL), | 24 navigation_type(FrameMsg_Navigate_Type::NORMAL), |
14 allow_download(true), | 25 allow_download(true), |
15 report_type(FrameMsg_UILoadMetricsReportType::NO_REPORT) { | 26 report_type(FrameMsg_UILoadMetricsReportType::NO_REPORT) { |
16 } | 27 } |
17 | 28 |
18 CommonNavigationParams::CommonNavigationParams( | 29 CommonNavigationParams::CommonNavigationParams( |
19 const GURL& url, | 30 const GURL& url, |
20 const Referrer& referrer, | 31 const Referrer& referrer, |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 const RequestNavigationParams& request_params) | 147 const RequestNavigationParams& request_params) |
137 : common_params(common_params), | 148 : common_params(common_params), |
138 start_params(start_params), | 149 start_params(start_params), |
139 request_params(request_params) { | 150 request_params(request_params) { |
140 } | 151 } |
141 | 152 |
142 NavigationParams::~NavigationParams() { | 153 NavigationParams::~NavigationParams() { |
143 } | 154 } |
144 | 155 |
145 } // namespace content | 156 } // namespace content |
OLD | NEW |