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

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

Issue 1755733002: Revert of Solidify Entry discarding logic (NavigationHandle keeps its ID) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 /* 5 /*
6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "cc/base/switches.h" 50 #include "cc/base/switches.h"
51 #include "components/mime_util/mime_util.h" 51 #include "components/mime_util/mime_util.h"
52 #include "content/browser/bad_message.h" 52 #include "content/browser/bad_message.h"
53 #include "content/browser/browser_url_handler_impl.h" 53 #include "content/browser/browser_url_handler_impl.h"
54 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" 54 #include "content/browser/dom_storage/dom_storage_context_wrapper.h"
55 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 55 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
56 #include "content/browser/frame_host/debug_urls.h" 56 #include "content/browser/frame_host/debug_urls.h"
57 #include "content/browser/frame_host/interstitial_page_impl.h" 57 #include "content/browser/frame_host/interstitial_page_impl.h"
58 #include "content/browser/frame_host/navigation_entry_impl.h" 58 #include "content/browser/frame_host/navigation_entry_impl.h"
59 #include "content/browser/frame_host/navigation_entry_screenshot_manager.h" 59 #include "content/browser/frame_host/navigation_entry_screenshot_manager.h"
60 #include "content/browser/frame_host/navigation_handle_impl.h"
61 #include "content/browser/frame_host/navigator.h" 60 #include "content/browser/frame_host/navigator.h"
62 #include "content/browser/renderer_host/render_view_host_impl.h" // Temporary 61 #include "content/browser/renderer_host/render_view_host_impl.h" // Temporary
63 #include "content/browser/site_instance_impl.h" 62 #include "content/browser/site_instance_impl.h"
64 #include "content/common/frame_messages.h" 63 #include "content/common/frame_messages.h"
65 #include "content/common/site_isolation_policy.h" 64 #include "content/common/site_isolation_policy.h"
66 #include "content/common/ssl_status_serialization.h" 65 #include "content/common/ssl_status_serialization.h"
67 #include "content/common/view_messages.h" 66 #include "content/common/view_messages.h"
68 #include "content/public/browser/browser_context.h" 67 #include "content/public/browser/browser_context.h"
69 #include "content/public/browser/content_browser_client.h" 68 #include "content/public/browser/content_browser_client.h"
70 #include "content/public/browser/invalidate_type.h" 69 #include "content/public/browser/invalidate_type.h"
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 return NAVIGATION_TYPE_EXISTING_PAGE; 1091 return NAVIGATION_TYPE_EXISTING_PAGE;
1093 } 1092 }
1094 1093
1095 void NavigationControllerImpl::RendererDidNavigateToNewPage( 1094 void NavigationControllerImpl::RendererDidNavigateToNewPage(
1096 RenderFrameHostImpl* rfh, 1095 RenderFrameHostImpl* rfh,
1097 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, 1096 const FrameHostMsg_DidCommitProvisionalLoad_Params& params,
1098 bool replace_entry) { 1097 bool replace_entry) {
1099 scoped_ptr<NavigationEntryImpl> new_entry; 1098 scoped_ptr<NavigationEntryImpl> new_entry;
1100 bool update_virtual_url; 1099 bool update_virtual_url;
1101 // Only make a copy of the pending entry if it is appropriate for the new page 1100 // Only make a copy of the pending entry if it is appropriate for the new page
1102 // that was just loaded. Verify this by checking if the entry corresponds 1101 // that was just loaded. We verify this at a coarse grain by checking that
1103 // to the current navigation handle. Note that in some tests the render frame 1102 // the SiteInstance hasn't been assigned to something else, and by making sure
1104 // host does not have a valid handle. Additionally, coarsely check that: 1103 // that the pending entry was intended as a new entry (rather than being a
1105 // 1. The SiteInstance hasn't been assigned to something else. 1104 // history navigation that was interrupted by an unrelated, renderer-initiated
1106 // 2. The pending entry was intended as a new entry, rather than being a 1105 // navigation).
1107 // history navigation that was interrupted by an unrelated, 1106 if (pending_entry_ && pending_entry_index_ == -1 &&
1108 // renderer-initiated navigation.
1109 // TODO(csharrison): Investigate whether we can remove some of the coarser
1110 // checks.
1111 NavigationHandleImpl* handle = rfh->navigation_handle();
1112 if (pending_entry_ && handle &&
1113 handle->pending_nav_entry_id() == pending_entry_->GetUniqueID() &&
1114 pending_entry_index_ == -1 &&
1115 (!pending_entry_->site_instance() || 1107 (!pending_entry_->site_instance() ||
1116 pending_entry_->site_instance() == rfh->GetSiteInstance())) { 1108 pending_entry_->site_instance() == rfh->GetSiteInstance())) {
1117 new_entry = pending_entry_->Clone(); 1109 new_entry = pending_entry_->Clone();
1118 1110
1119 update_virtual_url = new_entry->update_virtual_url_with_url(); 1111 update_virtual_url = new_entry->update_virtual_url_with_url();
1120 } else { 1112 } else {
1121 new_entry = make_scoped_ptr(new NavigationEntryImpl); 1113 new_entry = make_scoped_ptr(new NavigationEntryImpl);
1122 1114
1123 // Find out whether the new entry needs to update its virtual URL on URL 1115 // Find out whether the new entry needs to update its virtual URL on URL
1124 // change and set up the entry accordingly. This is needed to correctly 1116 // change and set up the entry accordingly. This is needed to correctly
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
2071 } 2063 }
2072 } 2064 }
2073 } 2065 }
2074 2066
2075 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 2067 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
2076 const base::Callback<base::Time()>& get_timestamp_callback) { 2068 const base::Callback<base::Time()>& get_timestamp_callback) {
2077 get_timestamp_callback_ = get_timestamp_callback; 2069 get_timestamp_callback_ = get_timestamp_callback;
2078 } 2070 }
2079 2071
2080 } // namespace content 2072 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698