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 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1386 DiscardNonCommittedEntriesInternal(); | 1386 DiscardNonCommittedEntriesInternal(); |
1387 return; | 1387 return; |
1388 } | 1388 } |
1389 | 1389 |
1390 // Manual subframe navigations just get the current entry cloned so the user | 1390 // Manual subframe navigations just get the current entry cloned so the user |
1391 // can go back or forward to it. The actual subframe information will be | 1391 // can go back or forward to it. The actual subframe information will be |
1392 // stored in the page state for each of those entries. This happens out of | 1392 // stored in the page state for each of those entries. This happens out of |
1393 // band with the actual navigations. | 1393 // band with the actual navigations. |
1394 DCHECK(GetLastCommittedEntry()) << "ClassifyNavigation should guarantee " | 1394 DCHECK(GetLastCommittedEntry()) << "ClassifyNavigation should guarantee " |
1395 << "that a last committed entry exists."; | 1395 << "that a last committed entry exists."; |
1396 NavigationEntryImpl* new_entry = GetLastCommittedEntry()->Clone(); | 1396 |
| 1397 NavigationEntryImpl* new_entry = nullptr; |
| 1398 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1399 switches::kSitePerProcess)) { |
| 1400 // Make sure new_entry takes ownership of frame_entry in a scoped_refptr. |
| 1401 FrameNavigationEntry* frame_entry = new FrameNavigationEntry( |
| 1402 rfh->frame_tree_node()->frame_tree_node_id(), rfh->GetSiteInstance(), |
| 1403 params.url, params.referrer); |
| 1404 new_entry = GetLastCommittedEntry()->CloneAndReplace(rfh->frame_tree_node(), |
| 1405 frame_entry); |
| 1406 CHECK(frame_entry->HasOneRef()); |
| 1407 } else { |
| 1408 new_entry = GetLastCommittedEntry()->Clone(); |
| 1409 } |
| 1410 |
1397 new_entry->SetPageID(params.page_id); | 1411 new_entry->SetPageID(params.page_id); |
1398 InsertOrReplaceEntry(new_entry, false); | 1412 InsertOrReplaceEntry(new_entry, false); |
1399 } | 1413 } |
1400 | 1414 |
1401 bool NavigationControllerImpl::RendererDidNavigateAutoSubframe( | 1415 bool NavigationControllerImpl::RendererDidNavigateAutoSubframe( |
1402 RenderFrameHostImpl* rfh, | 1416 RenderFrameHostImpl* rfh, |
1403 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) { | 1417 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) { |
1404 DCHECK(ui::PageTransitionCoreTypeIs(params.transition, | 1418 DCHECK(ui::PageTransitionCoreTypeIs(params.transition, |
1405 ui::PAGE_TRANSITION_AUTO_SUBFRAME)); | 1419 ui::PAGE_TRANSITION_AUTO_SUBFRAME)); |
1406 | 1420 |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2036 } | 2050 } |
2037 } | 2051 } |
2038 } | 2052 } |
2039 | 2053 |
2040 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2054 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
2041 const base::Callback<base::Time()>& get_timestamp_callback) { | 2055 const base::Callback<base::Time()>& get_timestamp_callback) { |
2042 get_timestamp_callback_ = get_timestamp_callback; | 2056 get_timestamp_callback_ = get_timestamp_callback; |
2043 } | 2057 } |
2044 | 2058 |
2045 } // namespace content | 2059 } // namespace content |
OLD | NEW |