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

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 1153193011: PlzNavigate: send Javascript urls synchronously to the renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 8219a3d79518bc95ca9ff998a620c0f149838a86..9fcf875bc4be509509a0c90517241ba54c035076 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -821,11 +821,18 @@ void NavigatorImpl::RequestNavigation(
navigation_start, controller_);
frame_tree_node->SetNavigationRequest(navigation_request.Pass());
Fabrice (no longer in Chrome) 2015/05/29 12:37:08 nit: empty line here
clamy 2015/05/29 16:02:06 Done.
+ frame_tree_node->navigation_request()->SetWaitingForRendererResponse();
+
// Have the current renderer execute its beforeUnload event if needed. If it
// is not needed (eg. the renderer is not live), BeginNavigation should get
- // called.
- frame_tree_node->navigation_request()->SetWaitingForRendererResponse();
+ // called. If the navigation does not need to make a network request, then
+ // start it synchronously. This is needed for Javascript urls.
+ if (NavigationRequest::ShouldMakeNetworkRequest(
nasko 2015/05/29 14:17:46 In this particular codepath, it isn't really about
clamy 2015/05/29 16:02:06 Updated the comment.
+ frame_tree_node->navigation_request()->common_params().url)) {
frame_tree_node->current_frame_host()->DispatchBeforeUnload(true);
Fabrice (no longer in Chrome) 2015/05/29 12:37:08 nit: indent is wrong.
clamy 2015/05/29 16:02:06 Done.
+ } else {
+ BeginNavigation(frame_tree_node);
nasko 2015/05/29 14:17:46 Why did data URLs work without this?
clamy 2015/05/29 16:02:06 Apparently no test tries to do a browser-intiated
nasko 2015/06/01 20:38:22 Maybe we should add one : ). I don't see a reason
clamy 2015/06/02 12:28:16 So after further investigation, it appears that we
+ }
}
void NavigatorImpl::BeginNavigation(FrameTreeNode* frame_tree_node) {

Powered by Google App Engine
This is Rietveld 408576698