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 #include "content/browser/frame_host/navigation_controller_impl.h" | 5 #include "content/browser/frame_host/navigation_controller_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 return false; | 1287 return false; |
1288 } | 1288 } |
1289 | 1289 |
1290 // Update the current navigation entry in case we're going back/forward. | 1290 // Update the current navigation entry in case we're going back/forward. |
1291 if (entry_index != last_committed_entry_index_) { | 1291 if (entry_index != last_committed_entry_index_) { |
1292 last_committed_entry_index_ = entry_index; | 1292 last_committed_entry_index_ = entry_index; |
1293 DiscardNonCommittedEntriesInternal(); | 1293 DiscardNonCommittedEntriesInternal(); |
1294 return true; | 1294 return true; |
1295 } | 1295 } |
1296 | 1296 |
| 1297 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1298 switches::kSitePerProcess)) { |
| 1299 // This may be a "new auto" case where we add a new FrameNavigationEntry, or |
| 1300 // it may be a "history auto" case where we update an existing one. |
| 1301 int64 frame_tree_node_id = rfh->frame_tree_node()->frame_tree_node_id(); |
| 1302 NavigationEntryImpl* last_committed = GetLastCommittedEntry(); |
| 1303 last_committed->AddOrUpdateFrameEntry(frame_tree_node_id, |
| 1304 rfh->GetSiteInstance(), |
| 1305 params.url, |
| 1306 params.referrer); |
| 1307 } |
| 1308 |
1297 // We do not need to discard the pending entry in this case, since we will | 1309 // We do not need to discard the pending entry in this case, since we will |
1298 // not generate commit notifications for this auto-subframe navigation. | 1310 // not generate commit notifications for this auto-subframe navigation. |
1299 return false; | 1311 return false; |
1300 } | 1312 } |
1301 | 1313 |
1302 int NavigationControllerImpl::GetIndexOfEntry( | 1314 int NavigationControllerImpl::GetIndexOfEntry( |
1303 const NavigationEntryImpl* entry) const { | 1315 const NavigationEntryImpl* entry) const { |
1304 const NavigationEntries::const_iterator i(std::find( | 1316 const NavigationEntries::const_iterator i(std::find( |
1305 entries_.begin(), | 1317 entries_.begin(), |
1306 entries_.end(), | 1318 entries_.end(), |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1815 } | 1827 } |
1816 } | 1828 } |
1817 } | 1829 } |
1818 | 1830 |
1819 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1831 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
1820 const base::Callback<base::Time()>& get_timestamp_callback) { | 1832 const base::Callback<base::Time()>& get_timestamp_callback) { |
1821 get_timestamp_callback_ = get_timestamp_callback; | 1833 get_timestamp_callback_ = get_timestamp_callback; |
1822 } | 1834 } |
1823 | 1835 |
1824 } // namespace content | 1836 } // namespace content |
OLD | NEW |