OLD | NEW |
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 Loading... |
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" |
60 #include "content/browser/frame_host/navigator.h" | 61 #include "content/browser/frame_host/navigator.h" |
61 #include "content/browser/renderer_host/render_view_host_impl.h" // Temporary | 62 #include "content/browser/renderer_host/render_view_host_impl.h" // Temporary |
62 #include "content/browser/site_instance_impl.h" | 63 #include "content/browser/site_instance_impl.h" |
63 #include "content/common/frame_messages.h" | 64 #include "content/common/frame_messages.h" |
64 #include "content/common/site_isolation_policy.h" | 65 #include "content/common/site_isolation_policy.h" |
65 #include "content/common/ssl_status_serialization.h" | 66 #include "content/common/ssl_status_serialization.h" |
66 #include "content/common/view_messages.h" | 67 #include "content/common/view_messages.h" |
67 #include "content/public/browser/browser_context.h" | 68 #include "content/public/browser/browser_context.h" |
68 #include "content/public/browser/content_browser_client.h" | 69 #include "content/public/browser/content_browser_client.h" |
69 #include "content/public/browser/invalidate_type.h" | 70 #include "content/public/browser/invalidate_type.h" |
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 return NAVIGATION_TYPE_EXISTING_PAGE; | 1092 return NAVIGATION_TYPE_EXISTING_PAGE; |
1092 } | 1093 } |
1093 | 1094 |
1094 void NavigationControllerImpl::RendererDidNavigateToNewPage( | 1095 void NavigationControllerImpl::RendererDidNavigateToNewPage( |
1095 RenderFrameHostImpl* rfh, | 1096 RenderFrameHostImpl* rfh, |
1096 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, | 1097 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
1097 bool replace_entry) { | 1098 bool replace_entry) { |
1098 scoped_ptr<NavigationEntryImpl> new_entry; | 1099 scoped_ptr<NavigationEntryImpl> new_entry; |
1099 bool update_virtual_url; | 1100 bool update_virtual_url; |
1100 // Only make a copy of the pending entry if it is appropriate for the new page | 1101 // Only make a copy of the pending entry if it is appropriate for the new page |
1101 // that was just loaded. We verify this at a coarse grain by checking that | 1102 // that was just loaded. Verify this by checking if the entry corresponds |
1102 // the SiteInstance hasn't been assigned to something else, and by making sure | 1103 // to the current navigation handle. Note that in some tests the render frame |
1103 // that the pending entry was intended as a new entry (rather than being a | 1104 // host does not have a valid handle. Additionally, coarsely check that: |
1104 // history navigation that was interrupted by an unrelated, renderer-initiated | 1105 // 1. The SiteInstance hasn't been assigned to something else. |
1105 // navigation). | 1106 // 2. The pending entry was intended as a new entry, rather than being a |
1106 if (pending_entry_ && pending_entry_index_ == -1 && | 1107 // history navigation that was interrupted by an unrelated, |
| 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 && |
1107 (!pending_entry_->site_instance() || | 1115 (!pending_entry_->site_instance() || |
1108 pending_entry_->site_instance() == rfh->GetSiteInstance())) { | 1116 pending_entry_->site_instance() == rfh->GetSiteInstance())) { |
1109 new_entry = pending_entry_->Clone(); | 1117 new_entry = pending_entry_->Clone(); |
1110 | 1118 |
1111 update_virtual_url = new_entry->update_virtual_url_with_url(); | 1119 update_virtual_url = new_entry->update_virtual_url_with_url(); |
1112 } else { | 1120 } else { |
1113 new_entry = make_scoped_ptr(new NavigationEntryImpl); | 1121 new_entry = make_scoped_ptr(new NavigationEntryImpl); |
1114 | 1122 |
1115 // Find out whether the new entry needs to update its virtual URL on URL | 1123 // Find out whether the new entry needs to update its virtual URL on URL |
1116 // change and set up the entry accordingly. This is needed to correctly | 1124 // change and set up the entry accordingly. This is needed to correctly |
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2062 } | 2070 } |
2063 } | 2071 } |
2064 } | 2072 } |
2065 | 2073 |
2066 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2074 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
2067 const base::Callback<base::Time()>& get_timestamp_callback) { | 2075 const base::Callback<base::Time()>& get_timestamp_callback) { |
2068 get_timestamp_callback_ = get_timestamp_callback; | 2076 get_timestamp_callback_ = get_timestamp_callback; |
2069 } | 2077 } |
2070 | 2078 |
2071 } // namespace content | 2079 } // namespace content |
OLD | NEW |