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

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: Review comments 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 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.
nasko 2015/07/06 11:06:16 The comment talks about synchronous navigations, y
Fabrice (no longer in Chrome) 2015/07/06 12:45:41 Updated this comment too, WDYT?
4333 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 4333 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
4334 switches::kEnableBrowserSideNavigation) && 4334 switches::kEnableBrowserSideNavigation) &&
4335 info.urlRequest.checkForBrowserSideNavigation()) { 4335 info.urlRequest.checkForBrowserSideNavigation() &&
4336 ShouldMakeNetworkRequestForURL(url)) {
4336 BeginNavigation(&info.urlRequest); 4337 BeginNavigation(&info.urlRequest);
4337 return blink::WebNavigationPolicyIgnore; 4338 return blink::WebNavigationPolicyIgnore;
4338 } 4339 }
4339 4340
4340 return info.defaultPolicy; 4341 return info.defaultPolicy;
4341 } 4342 }
4342 4343
4343 void RenderFrameImpl::OpenURL(WebFrame* frame, 4344 void RenderFrameImpl::OpenURL(WebFrame* frame,
4344 const GURL& url, 4345 const GURL& url,
4345 const Referrer& referrer, 4346 const Referrer& referrer,
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
5002 cdm_manager_ 5003 cdm_manager_
5003 #endif 5004 #endif
5004 )); 5005 ));
5005 #endif // defined(ENABLE_MOJO_MEDIA) 5006 #endif // defined(ENABLE_MOJO_MEDIA)
5006 } 5007 }
5007 5008
5008 return cdm_factory_.get(); 5009 return cdm_factory_.get();
5009 } 5010 }
5010 5011
5011 } // namespace content 5012 } // namespace content
OLDNEW
« content/common/navigation_params.cc ('K') | « content/common/navigation_params.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698