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

Side by Side Diff: content/browser/frame_host/navigator_impl.cc

Issue 464593003: Don't swap out the old RenderFrameHost until the new one commits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase past PlzNavigate CL Created 6 years, 4 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 | Annotate | Revision Log
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/browser/frame_host/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "content/browser/frame_host/frame_tree.h" 9 #include "content/browser/frame_host/frame_tree.h"
10 #include "content/browser/frame_host/frame_tree_node.h" 10 #include "content/browser/frame_host/frame_tree_node.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 // For security, we should never send non-Web-UI URLs to a Web UI renderer. 374 // For security, we should never send non-Web-UI URLs to a Web UI renderer.
375 // Double check that here. 375 // Double check that here.
376 CheckWebUIRendererDoesNotDisplayNormalURL( 376 CheckWebUIRendererDoesNotDisplayNormalURL(
377 dest_render_frame_host, entry.GetURL()); 377 dest_render_frame_host, entry.GetURL());
378 378
379 // Notify observers that we will navigate in this RenderFrame. 379 // Notify observers that we will navigate in this RenderFrame.
380 if (delegate_) 380 if (delegate_)
381 delegate_->AboutToNavigateRenderFrame(dest_render_frame_host); 381 delegate_->AboutToNavigateRenderFrame(dest_render_frame_host);
382 382
383 // Navigate in the desired RenderFrameHost. 383 // Navigate in the desired RenderFrameHost.
384 dest_render_frame_host->Navigate(navigate_params); 384 // We can skip this step in the rare case that this is a transfer navigation
385 // which began in the chosen RenderFrameHost, since the request has already
386 // been issued. In that case, simply resume the response.
387 bool is_transfer_to_same =
388 navigate_params.transferred_request_child_id != -1 &&
389 navigate_params.transferred_request_child_id ==
390 dest_render_frame_host->GetProcess()->GetID();
391 if (!is_transfer_to_same) {
392 dest_render_frame_host->Navigate(navigate_params);
393 } else {
394 // No need to navigate again. Just resume the deferred request.
395 dest_render_frame_host->GetProcess()->ResumeDeferredNavigation(
396 GlobalRequestID(navigate_params.transferred_request_child_id,
397 navigate_params.transferred_request_request_id));
398 }
385 399
386 // Make sure no code called via RFH::Navigate clears the pending entry. 400 // Make sure no code called via RFH::Navigate clears the pending entry.
387 CHECK_EQ(controller_->GetPendingEntry(), &entry); 401 CHECK_EQ(controller_->GetPendingEntry(), &entry);
388 402
389 if (entry.GetPageID() == -1) { 403 if (entry.GetPageID() == -1) {
390 // HACK!! This code suppresses javascript: URLs from being added to 404 // HACK!! This code suppresses javascript: URLs from being added to
391 // session history, which is what we want to do for javascript: URLs that 405 // session history, which is what we want to do for javascript: URLs that
392 // do not generate content. What we really need is a message from the 406 // do not generate content. What we really need is a message from the
393 // renderer telling us that a new page was not created. The same message 407 // renderer telling us that a new page was not created. The same message
394 // could be used for mailto: URLs and the like. 408 // could be used for mailto: URLs and the like.
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 controller_->GetBrowserContext(), url); 681 controller_->GetBrowserContext(), url);
668 if ((enabled_bindings & BINDINGS_POLICY_WEB_UI) && 682 if ((enabled_bindings & BINDINGS_POLICY_WEB_UI) &&
669 !is_allowed_in_web_ui_renderer) { 683 !is_allowed_in_web_ui_renderer) {
670 // Log the URL to help us diagnose any future failures of this CHECK. 684 // Log the URL to help us diagnose any future failures of this CHECK.
671 GetContentClient()->SetActiveURL(url); 685 GetContentClient()->SetActiveURL(url);
672 CHECK(0); 686 CHECK(0);
673 } 687 }
674 } 688 }
675 689
676 } // namespace content 690 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl_unittest.cc ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698