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

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

Issue 11054025: [Sync] Add HTTP status codes to NavigationEntry and TabNavigation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase onto 11096037 Created 8 years, 2 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 | Annotate | Revision Log
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/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_number_conversions.h" // Temporary 10 #include "base/string_number_conversions.h" // Temporary
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 time_smoother_.GetSmoothedTime(get_timestamp_callback_.Run()); 778 time_smoother_.GetSmoothedTime(get_timestamp_callback_.Run());
779 DVLOG(1) << "Navigation finished at (smoothed) timestamp " 779 DVLOG(1) << "Navigation finished at (smoothed) timestamp "
780 << timestamp.ToInternalValue(); 780 << timestamp.ToInternalValue();
781 781
782 // All committed entries should have nonempty content state so WebKit doesn't 782 // All committed entries should have nonempty content state so WebKit doesn't
783 // get confused when we go back to them (see the function for details). 783 // get confused when we go back to them (see the function for details).
784 DCHECK(!params.content_state.empty()); 784 DCHECK(!params.content_state.empty());
785 NavigationEntryImpl* active_entry = 785 NavigationEntryImpl* active_entry =
786 NavigationEntryImpl::FromNavigationEntry(GetActiveEntry()); 786 NavigationEntryImpl::FromNavigationEntry(GetActiveEntry());
787 active_entry->SetTimestamp(timestamp); 787 active_entry->SetTimestamp(timestamp);
788 active_entry->SetHttpStatusCode(params.http_status_code);
788 active_entry->SetContentState(params.content_state); 789 active_entry->SetContentState(params.content_state);
789 // No longer needed since content state will hold the post data if any. 790 // No longer needed since content state will hold the post data if any.
790 active_entry->SetBrowserInitiatedPostData(NULL); 791 active_entry->SetBrowserInitiatedPostData(NULL);
791 792
792 // Once committed, we do not need to track if the entry was initiated by 793 // Once committed, we do not need to track if the entry was initiated by
793 // the renderer. 794 // the renderer.
794 active_entry->set_is_renderer_initiated(false); 795 active_entry->set_is_renderer_initiated(false);
795 796
796 // The active entry's SiteInstance should match our SiteInstance. 797 // The active entry's SiteInstance should match our SiteInstance.
797 DCHECK(active_entry->site_instance() == web_contents_->GetSiteInstance()); 798 DCHECK(active_entry->site_instance() == web_contents_->GetSiteInstance());
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 linked_ptr<NavigationEntryImpl>( 1620 linked_ptr<NavigationEntryImpl>(
1620 new NavigationEntryImpl(*source.entries_[i]))); 1621 new NavigationEntryImpl(*source.entries_[i])));
1621 } 1622 }
1622 } 1623 }
1623 } 1624 }
1624 1625
1625 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 1626 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
1626 const base::Callback<base::Time()>& get_timestamp_callback) { 1627 const base::Callback<base::Time()>& get_timestamp_callback) {
1627 get_timestamp_callback_ = get_timestamp_callback; 1628 get_timestamp_callback_ = get_timestamp_callback;
1628 } 1629 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698