Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: content/browser/web_contents/navigation_controller_impl.cc

Issue 22837005: Add HTTP status code to navigation data structures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bug Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/web_contents/navigation_controller_impl.h" 5 #include "content/browser/web_contents/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 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 // We should not have a pending entry anymore. Clear it again in case any 791 // We should not have a pending entry anymore. Clear it again in case any
792 // error cases above forgot to do so. 792 // error cases above forgot to do so.
793 DiscardNonCommittedEntriesInternal(); 793 DiscardNonCommittedEntriesInternal();
794 794
795 // All committed entries should have nonempty content state so WebKit doesn't 795 // All committed entries should have nonempty content state so WebKit doesn't
796 // get confused when we go back to them (see the function for details). 796 // get confused when we go back to them (see the function for details).
797 DCHECK(params.page_state.IsValid()); 797 DCHECK(params.page_state.IsValid());
798 NavigationEntryImpl* active_entry = 798 NavigationEntryImpl* active_entry =
799 NavigationEntryImpl::FromNavigationEntry(GetLastCommittedEntry()); 799 NavigationEntryImpl::FromNavigationEntry(GetLastCommittedEntry());
800 active_entry->SetTimestamp(timestamp); 800 active_entry->SetTimestamp(timestamp);
801 active_entry->SetHttpStatusCode(params.http_status_code);
801 active_entry->SetPageState(params.page_state); 802 active_entry->SetPageState(params.page_state);
802 // No longer needed since content state will hold the post data if any. 803 // No longer needed since content state will hold the post data if any.
803 active_entry->SetBrowserInitiatedPostData(NULL); 804 active_entry->SetBrowserInitiatedPostData(NULL);
804 805
805 // Once committed, we do not need to track if the entry was initiated by 806 // Once committed, we do not need to track if the entry was initiated by
806 // the renderer. 807 // the renderer.
807 active_entry->set_is_renderer_initiated(false); 808 active_entry->set_is_renderer_initiated(false);
808 809
809 // Once committed, we no longer need to track whether the session history was 810 // Once committed, we no longer need to track whether the session history was
810 // cleared. Navigating to this entry again shouldn't clear it again. 811 // cleared. Navigating to this entry again shouldn't clear it again.
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 } 1685 }
1685 } 1686 }
1686 } 1687 }
1687 1688
1688 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 1689 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
1689 const base::Callback<base::Time()>& get_timestamp_callback) { 1690 const base::Callback<base::Time()>& get_timestamp_callback) {
1690 get_timestamp_callback_ = get_timestamp_callback; 1691 get_timestamp_callback_ = get_timestamp_callback;
1691 } 1692 }
1692 1693
1693 } // namespace content 1694 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698