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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/string_number_conversions.h" // Temporary | 10 #include "base/strings/string_number_conversions.h" // Temporary |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 CreateNavigationEntry( | 699 CreateNavigationEntry( |
700 params.url, | 700 params.url, |
701 params.referrer, | 701 params.referrer, |
702 params.transition_type, | 702 params.transition_type, |
703 params.is_renderer_initiated, | 703 params.is_renderer_initiated, |
704 params.extra_headers, | 704 params.extra_headers, |
705 browser_context_)); | 705 browser_context_)); |
706 if (params.frame_tree_node_id != -1) | 706 if (params.frame_tree_node_id != -1) |
707 entry->set_frame_tree_node_id(params.frame_tree_node_id); | 707 entry->set_frame_tree_node_id(params.frame_tree_node_id); |
708 if (params.redirect_chain.size() > 0) | 708 if (params.redirect_chain.size() > 0) |
709 entry->set_redirect_chain(params.redirect_chain); | 709 entry->SetRedirectChain(params.redirect_chain); |
710 if (params.should_replace_current_entry) | 710 if (params.should_replace_current_entry) |
711 entry->set_should_replace_entry(true); | 711 entry->set_should_replace_entry(true); |
712 entry->set_should_clear_history_list(params.should_clear_history_list); | 712 entry->set_should_clear_history_list(params.should_clear_history_list); |
713 entry->SetIsOverridingUserAgent(override); | 713 entry->SetIsOverridingUserAgent(override); |
714 entry->set_transferred_global_request_id( | 714 entry->set_transferred_global_request_id( |
715 params.transferred_global_request_id); | 715 params.transferred_global_request_id); |
716 entry->SetFrameToNavigate(params.frame_name); | 716 entry->SetFrameToNavigate(params.frame_name); |
717 | 717 |
718 switch (params.load_type) { | 718 switch (params.load_type) { |
719 case LOAD_TYPE_DEFAULT: | 719 case LOAD_TYPE_DEFAULT: |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 DiscardNonCommittedEntriesInternal(); | 820 DiscardNonCommittedEntriesInternal(); |
821 | 821 |
822 // All committed entries should have nonempty content state so WebKit doesn't | 822 // All committed entries should have nonempty content state so WebKit doesn't |
823 // get confused when we go back to them (see the function for details). | 823 // get confused when we go back to them (see the function for details). |
824 DCHECK(params.page_state.IsValid()); | 824 DCHECK(params.page_state.IsValid()); |
825 NavigationEntryImpl* active_entry = | 825 NavigationEntryImpl* active_entry = |
826 NavigationEntryImpl::FromNavigationEntry(GetLastCommittedEntry()); | 826 NavigationEntryImpl::FromNavigationEntry(GetLastCommittedEntry()); |
827 active_entry->SetTimestamp(timestamp); | 827 active_entry->SetTimestamp(timestamp); |
828 active_entry->SetHttpStatusCode(params.http_status_code); | 828 active_entry->SetHttpStatusCode(params.http_status_code); |
829 active_entry->SetPageState(params.page_state); | 829 active_entry->SetPageState(params.page_state); |
| 830 active_entry->SetRedirectChain(params.redirects); |
830 | 831 |
831 // Once it is committed, we no longer need to track several pieces of state on | 832 // Once it is committed, we no longer need to track several pieces of state on |
832 // the entry. | 833 // the entry. |
833 active_entry->ResetForCommit(); | 834 active_entry->ResetForCommit(); |
834 | 835 |
835 // The active entry's SiteInstance should match our SiteInstance. | 836 // The active entry's SiteInstance should match our SiteInstance. |
836 // TODO(creis): This check won't pass for subframes until we create entries | 837 // TODO(creis): This check won't pass for subframes until we create entries |
837 // for subframe navigations. | 838 // for subframe navigations. |
838 if (PageTransitionIsMainFrame(params.transition)) | 839 if (PageTransitionIsMainFrame(params.transition)) |
839 CHECK(active_entry->site_instance() == rfh->GetSiteInstance()); | 840 CHECK(active_entry->site_instance() == rfh->GetSiteInstance()); |
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1735 } | 1736 } |
1736 } | 1737 } |
1737 } | 1738 } |
1738 | 1739 |
1739 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1740 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
1740 const base::Callback<base::Time()>& get_timestamp_callback) { | 1741 const base::Callback<base::Time()>& get_timestamp_callback) { |
1741 get_timestamp_callback_ = get_timestamp_callback; | 1742 get_timestamp_callback_ = get_timestamp_callback; |
1742 } | 1743 } |
1743 | 1744 |
1744 } // namespace content | 1745 } // namespace content |
OLD | NEW |