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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2961903003: PageTransition: Remove unreached code. (Closed)
Patch Set: CHECK => DCHECK, Add test. Created 3 years, 6 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/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 901eb2261a0b4512b4db7645600e3a2c2d0b0864..44efc0967dd62d52e6ae797e037dd169846fb309 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4942,20 +4942,7 @@ void RenderFrameImpl::SendDidCommitProvisionalLoad(
params.contents_mime_type = ds->GetResponse().MimeType().Utf8();
params.transition = navigation_state->GetTransitionType();
- if (!ui::PageTransitionIsMainFrame(params.transition)) {
- // If the main frame does a load, it should not be reported as a subframe
- // navigation. This can occur in the following case:
- // 1. You're on a site with frames.
- // 2. You do a subframe navigation. This is stored with transition type
- // MANUAL_SUBFRAME.
- // 3. You navigate to some non-frame site, say, google.com.
- // 4. You navigate back to the page from step 2. Since it was initially
- // MANUAL_SUBFRAME, it will be that same transition type here.
- // We don't want that, because any navigation that changes the toplevel
- // frame should be tracked as a toplevel navigation (this allows us to
- // update the URL bar, etc).
- params.transition = ui::PAGE_TRANSITION_LINK;
- }
+ DCHECK(ui::PageTransitionIsMainFrame(params.transition));
Avi (use Gerrit) 2017/06/28 17:03:18 Just wow. Hoping that this really does hold and w
// If the page contained a client redirect (meta refresh, document.loc...),
// set the transition appropriately.

Powered by Google App Engine
This is Rietveld 408576698