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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2961903003: PageTransition: Remove unreached code. (Closed)
Patch Set: CHECK => DCHECK, Add test. Created 3 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 <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 4924 matching lines...) Expand 10 before | Expand all | Expand 10 after
4935 // This zoom level was merely recorded transiently for this load. We can 4935 // This zoom level was merely recorded transiently for this load. We can
4936 // erase it now. If at some point we reload this page, the browser will 4936 // erase it now. If at some point we reload this page, the browser will
4937 // send us a new, up-to-date zoom level. 4937 // send us a new, up-to-date zoom level.
4938 host_zoom_levels_.erase(host_zoom); 4938 host_zoom_levels_.erase(host_zoom);
4939 } 4939 }
4940 4940
4941 // Update contents MIME type for main frame. 4941 // Update contents MIME type for main frame.
4942 params.contents_mime_type = ds->GetResponse().MimeType().Utf8(); 4942 params.contents_mime_type = ds->GetResponse().MimeType().Utf8();
4943 4943
4944 params.transition = navigation_state->GetTransitionType(); 4944 params.transition = navigation_state->GetTransitionType();
4945 if (!ui::PageTransitionIsMainFrame(params.transition)) { 4945 DCHECK(ui::PageTransitionIsMainFrame(params.transition));
Avi (use Gerrit) 2017/06/28 17:03:18 Just wow. Hoping that this really does hold and w
4946 // If the main frame does a load, it should not be reported as a subframe
4947 // navigation. This can occur in the following case:
4948 // 1. You're on a site with frames.
4949 // 2. You do a subframe navigation. This is stored with transition type
4950 // MANUAL_SUBFRAME.
4951 // 3. You navigate to some non-frame site, say, google.com.
4952 // 4. You navigate back to the page from step 2. Since it was initially
4953 // MANUAL_SUBFRAME, it will be that same transition type here.
4954 // We don't want that, because any navigation that changes the toplevel
4955 // frame should be tracked as a toplevel navigation (this allows us to
4956 // update the URL bar, etc).
4957 params.transition = ui::PAGE_TRANSITION_LINK;
4958 }
4959 4946
4960 // If the page contained a client redirect (meta refresh, document.loc...), 4947 // If the page contained a client redirect (meta refresh, document.loc...),
4961 // set the transition appropriately. 4948 // set the transition appropriately.
4962 if (ds->IsClientRedirect()) { 4949 if (ds->IsClientRedirect()) {
4963 params.transition = ui::PageTransitionFromInt( 4950 params.transition = ui::PageTransitionFromInt(
4964 params.transition | ui::PAGE_TRANSITION_CLIENT_REDIRECT); 4951 params.transition | ui::PAGE_TRANSITION_CLIENT_REDIRECT);
4965 } 4952 }
4966 4953
4967 // Send the user agent override back. 4954 // Send the user agent override back.
4968 params.is_overriding_user_agent = internal_data->is_overriding_user_agent(); 4955 params.is_overriding_user_agent = internal_data->is_overriding_user_agent();
(...skipping 1924 matching lines...) Expand 10 before | Expand all | Expand 10 after
6893 replaces_current_history_item(info.replaces_current_history_item), 6880 replaces_current_history_item(info.replaces_current_history_item),
6894 history_navigation_in_new_child_frame( 6881 history_navigation_in_new_child_frame(
6895 info.is_history_navigation_in_new_child_frame), 6882 info.is_history_navigation_in_new_child_frame),
6896 client_redirect(info.is_client_redirect), 6883 client_redirect(info.is_client_redirect),
6897 triggering_event_info(info.triggering_event_info), 6884 triggering_event_info(info.triggering_event_info),
6898 cache_disabled(info.is_cache_disabled), 6885 cache_disabled(info.is_cache_disabled),
6899 form(info.form), 6886 form(info.form),
6900 source_location(info.source_location) {} 6887 source_location(info.source_location) {}
6901 6888
6902 } // namespace content 6889 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698