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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 52 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
53 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 53 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
54 #include "content/browser/frame_host/debug_urls.h" | 54 #include "content/browser/frame_host/debug_urls.h" |
55 #include "content/browser/frame_host/interstitial_page_impl.h" | 55 #include "content/browser/frame_host/interstitial_page_impl.h" |
56 #include "content/browser/frame_host/navigation_entry_impl.h" | 56 #include "content/browser/frame_host/navigation_entry_impl.h" |
57 #include "content/browser/frame_host/navigation_entry_screenshot_manager.h" | 57 #include "content/browser/frame_host/navigation_entry_screenshot_manager.h" |
58 #include "content/browser/frame_host/navigator.h" | 58 #include "content/browser/frame_host/navigator.h" |
59 #include "content/browser/renderer_host/render_view_host_impl.h" // Temporary | 59 #include "content/browser/renderer_host/render_view_host_impl.h" // Temporary |
60 #include "content/browser/site_instance_impl.h" | 60 #include "content/browser/site_instance_impl.h" |
61 #include "content/common/frame_messages.h" | 61 #include "content/common/frame_messages.h" |
62 #include "content/common/navigation_params.h" | |
62 #include "content/common/site_isolation_policy.h" | 63 #include "content/common/site_isolation_policy.h" |
63 #include "content/common/ssl_status_serialization.h" | 64 #include "content/common/ssl_status_serialization.h" |
64 #include "content/common/view_messages.h" | 65 #include "content/common/view_messages.h" |
65 #include "content/public/browser/browser_context.h" | 66 #include "content/public/browser/browser_context.h" |
66 #include "content/public/browser/content_browser_client.h" | 67 #include "content/public/browser/content_browser_client.h" |
67 #include "content/public/browser/invalidate_type.h" | 68 #include "content/public/browser/invalidate_type.h" |
68 #include "content/public/browser/navigation_details.h" | 69 #include "content/public/browser/navigation_details.h" |
69 #include "content/public/browser/notification_service.h" | 70 #include "content/public/browser/notification_service.h" |
70 #include "content/public/browser/notification_types.h" | 71 #include "content/public/browser/notification_types.h" |
71 #include "content/public/browser/render_widget_host.h" | 72 #include "content/public/browser/render_widget_host.h" |
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1755 // tell the indicated frame where to go. | 1756 // tell the indicated frame where to go. |
1756 if (!SiteIsolationPolicy::UseSubframeNavigationEntries()) { | 1757 if (!SiteIsolationPolicy::UseSubframeNavigationEntries()) { |
1757 FrameNavigationEntry* frame_entry = GetPendingEntry()->GetFrameEntry(root); | 1758 FrameNavigationEntry* frame_entry = GetPendingEntry()->GetFrameEntry(root); |
1758 FrameTreeNode* frame = root; | 1759 FrameTreeNode* frame = root; |
1759 int ftn_id = GetPendingEntry()->frame_tree_node_id(); | 1760 int ftn_id = GetPendingEntry()->frame_tree_node_id(); |
1760 if (ftn_id != -1) { | 1761 if (ftn_id != -1) { |
1761 frame = delegate_->GetFrameTree()->FindByID(ftn_id); | 1762 frame = delegate_->GetFrameTree()->FindByID(ftn_id); |
1762 DCHECK(frame); | 1763 DCHECK(frame); |
1763 } | 1764 } |
1764 return frame->navigator()->NavigateToPendingEntry(frame, *frame_entry, | 1765 return frame->navigator()->NavigateToPendingEntry(frame, *frame_entry, |
1765 reload_type, false); | 1766 reload_type, false, |
1767 LOFI_DEFAULT); | |
nasko
2015/09/04 22:47:42
If all browser initiated navigations start with st
megjablon
2015/09/09 20:54:16
Done.
| |
1766 } | 1768 } |
1767 | 1769 |
1768 // In --site-per-process, we compare FrameNavigationEntries to see which | 1770 // In --site-per-process, we compare FrameNavigationEntries to see which |
1769 // frames in the tree need to be navigated. | 1771 // frames in the tree need to be navigated. |
1770 FrameLoadVector same_document_loads; | 1772 FrameLoadVector same_document_loads; |
1771 FrameLoadVector different_document_loads; | 1773 FrameLoadVector different_document_loads; |
1772 if (GetLastCommittedEntry()) { | 1774 if (GetLastCommittedEntry()) { |
1773 FindFramesToNavigate(root, &same_document_loads, &different_document_loads); | 1775 FindFramesToNavigate(root, &same_document_loads, &different_document_loads); |
1774 } | 1776 } |
1775 | 1777 |
1776 if (same_document_loads.empty() && different_document_loads.empty()) { | 1778 if (same_document_loads.empty() && different_document_loads.empty()) { |
1777 // If we don't have any frames to navigate at this point, either | 1779 // If we don't have any frames to navigate at this point, either |
1778 // (1) there is no previous history entry to compare against, or | 1780 // (1) there is no previous history entry to compare against, or |
1779 // (2) we were unable to match any frames by name. In the first case, | 1781 // (2) we were unable to match any frames by name. In the first case, |
1780 // doing a different document navigation to the root item is the only valid | 1782 // doing a different document navigation to the root item is the only valid |
1781 // thing to do. In the second case, we should have been able to find a | 1783 // thing to do. In the second case, we should have been able to find a |
1782 // frame to navigate based on names if this were a same document | 1784 // frame to navigate based on names if this were a same document |
1783 // navigation, so we can safely assume this is the different document case. | 1785 // navigation, so we can safely assume this is the different document case. |
1784 different_document_loads.push_back( | 1786 different_document_loads.push_back( |
1785 std::make_pair(root, pending_entry_->GetFrameEntry(root))); | 1787 std::make_pair(root, pending_entry_->GetFrameEntry(root))); |
1786 } | 1788 } |
1787 | 1789 |
1788 // If all the frame loads fail, we will discard the pending entry. | 1790 // If all the frame loads fail, we will discard the pending entry. |
1789 bool success = false; | 1791 bool success = false; |
1790 | 1792 |
1791 // Send all the same document frame loads before the different document loads. | 1793 // Send all the same document frame loads before the different document loads. |
1792 for (const auto& item : same_document_loads) { | 1794 for (const auto& item : same_document_loads) { |
1793 FrameTreeNode* frame = item.first; | 1795 FrameTreeNode* frame = item.first; |
1794 success |= frame->navigator()->NavigateToPendingEntry(frame, *item.second, | 1796 success |= frame->navigator()->NavigateToPendingEntry(frame, *item.second, |
1795 reload_type, true); | 1797 reload_type, true, |
1798 LOFI_DEFAULT); | |
1796 } | 1799 } |
1797 for (const auto& item : different_document_loads) { | 1800 for (const auto& item : different_document_loads) { |
1798 FrameTreeNode* frame = item.first; | 1801 FrameTreeNode* frame = item.first; |
1799 success |= frame->navigator()->NavigateToPendingEntry(frame, *item.second, | 1802 success |= frame->navigator()->NavigateToPendingEntry(frame, *item.second, |
1800 reload_type, false); | 1803 reload_type, false, |
1804 LOFI_DEFAULT); | |
1801 } | 1805 } |
1802 return success; | 1806 return success; |
1803 } | 1807 } |
1804 | 1808 |
1805 void NavigationControllerImpl::FindFramesToNavigate( | 1809 void NavigationControllerImpl::FindFramesToNavigate( |
1806 FrameTreeNode* frame, | 1810 FrameTreeNode* frame, |
1807 FrameLoadVector* same_document_loads, | 1811 FrameLoadVector* same_document_loads, |
1808 FrameLoadVector* different_document_loads) { | 1812 FrameLoadVector* different_document_loads) { |
1809 DCHECK(pending_entry_); | 1813 DCHECK(pending_entry_); |
1810 DCHECK_GE(last_committed_entry_index_, 0); | 1814 DCHECK_GE(last_committed_entry_index_, 0); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1998 } | 2002 } |
1999 } | 2003 } |
2000 } | 2004 } |
2001 | 2005 |
2002 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2006 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
2003 const base::Callback<base::Time()>& get_timestamp_callback) { | 2007 const base::Callback<base::Time()>& get_timestamp_callback) { |
2004 get_timestamp_callback_ = get_timestamp_callback; | 2008 get_timestamp_callback_ = get_timestamp_callback; |
2005 } | 2009 } |
2006 | 2010 |
2007 } // namespace content | 2011 } // namespace content |
OLD | NEW |