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