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

Side by Side Diff: content/common/navigation_params.cc

Issue 1222203004: PlzNavigate: Do not send synchronous navigations from the renderer to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change test Created 5 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/common/navigation_params.h" 5 #include "content/common/navigation_params.h"
6 6
7 #include "base/memory/ref_counted_memory.h" 7 #include "base/memory/ref_counted_memory.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 // static
12 bool CommonNavigationParams::ShouldMakeNetworkRequest(const GURL& url) {
13 // Data and Javascript urls should not make network requests.
14 // TODO(clamy): same document navigations should not make network requests.
clamy 2015/07/03 11:41:44 Please add a DCHECK that browser-side navigation i
Fabrice (no longer in Chrome) 2015/07/03 14:55:35 Similar checks in the code are CHECKS and not DCHE
15 return !url.SchemeIs(url::kDataScheme) && url != GURL(url::kAboutBlankURL) &&
16 !url.SchemeIs(url::kJavaScriptScheme);
17 }
18
11 CommonNavigationParams::CommonNavigationParams() 19 CommonNavigationParams::CommonNavigationParams()
12 : transition(ui::PAGE_TRANSITION_LINK), 20 : transition(ui::PAGE_TRANSITION_LINK),
13 navigation_type(FrameMsg_Navigate_Type::NORMAL), 21 navigation_type(FrameMsg_Navigate_Type::NORMAL),
14 allow_download(true), 22 allow_download(true),
15 report_type(FrameMsg_UILoadMetricsReportType::NO_REPORT) { 23 report_type(FrameMsg_UILoadMetricsReportType::NO_REPORT) {
16 } 24 }
17 25
18 CommonNavigationParams::CommonNavigationParams( 26 CommonNavigationParams::CommonNavigationParams(
19 const GURL& url, 27 const GURL& url,
20 const Referrer& referrer, 28 const Referrer& referrer,
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 const RequestNavigationParams& request_params) 144 const RequestNavigationParams& request_params)
137 : common_params(common_params), 145 : common_params(common_params),
138 start_params(start_params), 146 start_params(start_params),
139 request_params(request_params) { 147 request_params(request_params) {
140 } 148 }
141 149
142 NavigationParams::~NavigationParams() { 150 NavigationParams::~NavigationParams() {
143 } 151 }
144 152
145 } // namespace content 153 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698