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

Side by Side Diff: content/renderer/render_frame_impl.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: Comment refactoring 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
« no previous file with comments | « content/common/navigation_params.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 4311 matching lines...) Expand 10 before | Expand all | Expand 10 after
4322 info.defaultPolicy == blink::WebNavigationPolicyCurrentTab && 4322 info.defaultPolicy == blink::WebNavigationPolicyCurrentTab &&
4323 // Must be a JavaScript navigation, which appears as "other". 4323 // Must be a JavaScript navigation, which appears as "other".
4324 info.navigationType == blink::WebNavigationTypeOther; 4324 info.navigationType == blink::WebNavigationTypeOther;
4325 4325
4326 if (is_fork) { 4326 if (is_fork) {
4327 // Open the URL via the browser, not via WebKit. 4327 // Open the URL via the browser, not via WebKit.
4328 OpenURL(info.frame, url, Referrer(), info.defaultPolicy); 4328 OpenURL(info.frame, url, Referrer(), info.defaultPolicy);
4329 return blink::WebNavigationPolicyIgnore; 4329 return blink::WebNavigationPolicyIgnore;
4330 } 4330 }
4331 4331
4332 // PlzNavigate: send the request to the browser if needed. 4332 // PlzNavigate: if the navigation is not synchronous, send it to the browser.
4333 // This includes navigations with no request being sent to the network stack.
4333 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 4334 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
4334 switches::kEnableBrowserSideNavigation) && 4335 switches::kEnableBrowserSideNavigation) &&
4335 info.urlRequest.checkForBrowserSideNavigation()) { 4336 info.urlRequest.checkForBrowserSideNavigation() &&
4337 ShouldMakeNetworkRequestForURL(url)) {
4336 BeginNavigation(&info.urlRequest); 4338 BeginNavigation(&info.urlRequest);
4337 return blink::WebNavigationPolicyIgnore; 4339 return blink::WebNavigationPolicyIgnore;
4338 } 4340 }
4339 4341
4340 return info.defaultPolicy; 4342 return info.defaultPolicy;
4341 } 4343 }
4342 4344
4343 void RenderFrameImpl::OpenURL(WebFrame* frame, 4345 void RenderFrameImpl::OpenURL(WebFrame* frame,
4344 const GURL& url, 4346 const GURL& url,
4345 const Referrer& referrer, 4347 const Referrer& referrer,
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
5002 cdm_manager_ 5004 cdm_manager_
5003 #endif 5005 #endif
5004 )); 5006 ));
5005 #endif // defined(ENABLE_MOJO_MEDIA) 5007 #endif // defined(ENABLE_MOJO_MEDIA)
5006 } 5008 }
5007 5009
5008 return cdm_factory_.get(); 5010 return cdm_factory_.get();
5009 } 5011 }
5010 5012
5011 } // namespace content 5013 } // namespace content
OLDNEW
« no previous file with comments | « content/common/navigation_params.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698