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 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 DCHECK(params.page_state.IsValid()); | 903 DCHECK(params.page_state.IsValid()); |
904 NavigationEntryImpl* active_entry = GetLastCommittedEntry(); | 904 NavigationEntryImpl* active_entry = GetLastCommittedEntry(); |
905 active_entry->SetTimestamp(timestamp); | 905 active_entry->SetTimestamp(timestamp); |
906 active_entry->SetHttpStatusCode(params.http_status_code); | 906 active_entry->SetHttpStatusCode(params.http_status_code); |
907 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) { | 907 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) { |
908 // Update the frame-specific PageState. | 908 // Update the frame-specific PageState. |
909 FrameNavigationEntry* frame_entry = | 909 FrameNavigationEntry* frame_entry = |
910 active_entry->GetFrameEntry(rfh->frame_tree_node()); | 910 active_entry->GetFrameEntry(rfh->frame_tree_node()); |
911 // We may not find a frame_entry in some cases; ignore the PageState if so. | 911 // We may not find a frame_entry in some cases; ignore the PageState if so. |
912 // TODO(creis): Remove the "if" once https://crbug.com/522193 is fixed. | 912 // TODO(creis): Remove the "if" once https://crbug.com/522193 is fixed. |
913 if (frame_entry) | 913 if (frame_entry) { |
914 frame_entry->set_page_state(params.page_state); | 914 frame_entry->set_page_state(params.page_state); |
| 915 active_entry->UpdatePageState(); |
| 916 } |
915 } else { | 917 } else { |
916 active_entry->SetPageState(params.page_state); | 918 active_entry->SetPageState(params.page_state); |
917 } | 919 } |
918 active_entry->SetRedirectChain(params.redirects); | 920 active_entry->SetRedirectChain(params.redirects); |
919 | 921 |
920 // Use histogram to track memory impact of redirect chain because it's now | 922 // Use histogram to track memory impact of redirect chain because it's now |
921 // not cleared for committed entries. | 923 // not cleared for committed entries. |
922 size_t redirect_chain_size = 0; | 924 size_t redirect_chain_size = 0; |
923 for (size_t i = 0; i < params.redirects.size(); ++i) { | 925 for (size_t i = 0; i < params.redirects.size(); ++i) { |
924 redirect_chain_size += params.redirects[i].spec().length(); | 926 redirect_chain_size += params.redirects[i].spec().length(); |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1840 FrameLoadVector* different_document_loads) { | 1842 FrameLoadVector* different_document_loads) { |
1841 DCHECK(pending_entry_); | 1843 DCHECK(pending_entry_); |
1842 DCHECK_GE(last_committed_entry_index_, 0); | 1844 DCHECK_GE(last_committed_entry_index_, 0); |
1843 FrameNavigationEntry* new_item = pending_entry_->GetFrameEntry(frame); | 1845 FrameNavigationEntry* new_item = pending_entry_->GetFrameEntry(frame); |
1844 FrameNavigationEntry* old_item = | 1846 FrameNavigationEntry* old_item = |
1845 GetLastCommittedEntry()->GetFrameEntry(frame); | 1847 GetLastCommittedEntry()->GetFrameEntry(frame); |
1846 if (!new_item) | 1848 if (!new_item) |
1847 return; | 1849 return; |
1848 | 1850 |
1849 // Schedule a load in this frame if the new item isn't for the same item | 1851 // Schedule a load in this frame if the new item isn't for the same item |
1850 // sequence number in the same SiteInstance. | 1852 // sequence number in the same SiteInstance. Newly restored items may not have |
1851 // TODO(creis): Handle null SiteInstances during session restore. | 1853 // a SiteInstance yet, in which case it will be assigned on first commit. |
1852 if (!old_item || | 1854 if (!old_item || |
1853 new_item->item_sequence_number() != old_item->item_sequence_number() || | 1855 new_item->item_sequence_number() != old_item->item_sequence_number() || |
1854 new_item->site_instance() != old_item->site_instance()) { | 1856 (new_item->site_instance() != nullptr && |
| 1857 new_item->site_instance() != old_item->site_instance())) { |
1855 if (old_item && | 1858 if (old_item && |
1856 new_item->document_sequence_number() == | 1859 new_item->document_sequence_number() == |
1857 old_item->document_sequence_number()) { | 1860 old_item->document_sequence_number()) { |
1858 same_document_loads->push_back(std::make_pair(frame, new_item)); | 1861 same_document_loads->push_back(std::make_pair(frame, new_item)); |
1859 } else { | 1862 } else { |
1860 different_document_loads->push_back(std::make_pair(frame, new_item)); | 1863 different_document_loads->push_back(std::make_pair(frame, new_item)); |
1861 } | 1864 } |
1862 return; | 1865 return; |
1863 } | 1866 } |
1864 | 1867 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2031 } | 2034 } |
2032 } | 2035 } |
2033 } | 2036 } |
2034 | 2037 |
2035 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2038 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
2036 const base::Callback<base::Time()>& get_timestamp_callback) { | 2039 const base::Callback<base::Time()>& get_timestamp_callback) { |
2037 get_timestamp_callback_ = get_timestamp_callback; | 2040 get_timestamp_callback_ = get_timestamp_callback; |
2038 } | 2041 } |
2039 | 2042 |
2040 } // namespace content | 2043 } // namespace content |
OLD | NEW |