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 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 DiscardNonCommittedEntriesInternal(); | 1420 DiscardNonCommittedEntriesInternal(); |
1421 return; | 1421 return; |
1422 } | 1422 } |
1423 | 1423 |
1424 // Manual subframe navigations just get the current entry cloned so the user | 1424 // Manual subframe navigations just get the current entry cloned so the user |
1425 // can go back or forward to it. The actual subframe information will be | 1425 // can go back or forward to it. The actual subframe information will be |
1426 // stored in the page state for each of those entries. This happens out of | 1426 // stored in the page state for each of those entries. This happens out of |
1427 // band with the actual navigations. | 1427 // band with the actual navigations. |
1428 DCHECK(GetLastCommittedEntry()) << "ClassifyNavigation should guarantee " | 1428 DCHECK(GetLastCommittedEntry()) << "ClassifyNavigation should guarantee " |
1429 << "that a last committed entry exists."; | 1429 << "that a last committed entry exists."; |
1430 NavigationEntryImpl* new_entry = GetLastCommittedEntry()->Clone(); | 1430 |
| 1431 NavigationEntryImpl* new_entry = nullptr; |
| 1432 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1433 switches::kSitePerProcess)) { |
| 1434 // Make sure new_entry takes ownership of frame_entry in a scoped_refptr. |
| 1435 FrameNavigationEntry* frame_entry = new FrameNavigationEntry( |
| 1436 rfh->frame_tree_node()->frame_tree_node_id(), rfh->GetSiteInstance(), |
| 1437 params.url, params.referrer); |
| 1438 new_entry = GetLastCommittedEntry()->CloneAndReplace(rfh->frame_tree_node(), |
| 1439 frame_entry); |
| 1440 CHECK(frame_entry->HasOneRef()); |
| 1441 } else { |
| 1442 new_entry = GetLastCommittedEntry()->Clone(); |
| 1443 } |
| 1444 |
1431 new_entry->SetPageID(params.page_id); | 1445 new_entry->SetPageID(params.page_id); |
1432 InsertOrReplaceEntry(new_entry, false); | 1446 InsertOrReplaceEntry(new_entry, false); |
1433 } | 1447 } |
1434 | 1448 |
1435 bool NavigationControllerImpl::RendererDidNavigateAutoSubframe( | 1449 bool NavigationControllerImpl::RendererDidNavigateAutoSubframe( |
1436 RenderFrameHostImpl* rfh, | 1450 RenderFrameHostImpl* rfh, |
1437 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) { | 1451 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) { |
1438 DCHECK(ui::PageTransitionCoreTypeIs(params.transition, | 1452 DCHECK(ui::PageTransitionCoreTypeIs(params.transition, |
1439 ui::PAGE_TRANSITION_AUTO_SUBFRAME)); | 1453 ui::PAGE_TRANSITION_AUTO_SUBFRAME)); |
1440 | 1454 |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2017 } | 2031 } |
2018 } | 2032 } |
2019 } | 2033 } |
2020 | 2034 |
2021 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2035 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
2022 const base::Callback<base::Time()>& get_timestamp_callback) { | 2036 const base::Callback<base::Time()>& get_timestamp_callback) { |
2023 get_timestamp_callback_ = get_timestamp_callback; | 2037 get_timestamp_callback_ = get_timestamp_callback; |
2024 } | 2038 } |
2025 | 2039 |
2026 } // namespace content | 2040 } // namespace content |
OLD | NEW |