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

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

Issue 814563004: Update a comment with a link to a historic source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 10 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/navigation_controller_impl.cc
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 979b26c1dc5603b12adb1edc1907ea5a08cc41aa..2198e58618056466fbe4f8d2a3fd3d94ac0d3279 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -37,6 +37,7 @@
#include "content/public/browser/user_metrics.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_constants.h"
+#include "content/public/common/content_switches.h"
#include "net/base/escape.h"
#include "net/base/mime_util.h"
#include "net/base/net_util.h"
@@ -1225,7 +1226,22 @@ void NavigationControllerImpl::RendererDidNavigateNewSubframe(
const FrameHostMsg_DidCommitProvisionalLoad_Params& params) {
if (ui::PageTransitionCoreTypeIs(params.transition,
ui::PAGE_TRANSITION_AUTO_SUBFRAME)) {
- // This is not user-initiated. Ignore.
+ // There was a comment here that said, "This is not user-initiated. Ignore."
+ // But this makes no sense; non-user-initiated navigations should be
+ // determined to be of type NAVIGATION_TYPE_AUTO_SUBFRAME and sent to
+ // RendererDidNavigateAutoSubframe below.
+ //
+ // This if clause dates back to https://codereview.chromium.org/115919 and
+ // the handling of immediate redirects. TODO(avi): Is this still valid? I'm
+ // pretty sure that's there's nothing left of that code and that we should
+ // take this out.
+ //
+ // Except for cross-process iframes; this doesn't work yet for them.
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSitePerProcess)) {
+ NOTREACHED();
+ }
+
DiscardNonCommittedEntriesInternal();
return;
}
@@ -1245,6 +1261,9 @@ void NavigationControllerImpl::RendererDidNavigateNewSubframe(
bool NavigationControllerImpl::RendererDidNavigateAutoSubframe(
RenderFrameHost* rfh,
const FrameHostMsg_DidCommitProvisionalLoad_Params& params) {
+ DCHECK(ui::PageTransitionCoreTypeIs(params.transition,
+ ui::PAGE_TRANSITION_AUTO_SUBFRAME));
Avi (use Gerrit) 2015/02/09 22:20:50 Note that this fails on the reload tests because i
Charlie Reis 2015/02/09 22:33:03 It certainly seems strange for this check to fail
+
// We're guaranteed to have a previously committed entry, and we now need to
// handle navigation inside of a subframe in it without creating a new entry.
DCHECK(GetLastCommittedEntry());

Powered by Google App Engine
This is Rietveld 408576698