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

Unified Diff: chrome/browser/sessions/session_types.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sessions/session_types.h ('k') | chrome/browser/sessions/session_types_test_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_types.cc
diff --git a/chrome/browser/sessions/session_types.cc b/chrome/browser/sessions/session_types.cc
index 183b3a90d54ad386be8772babc83af166e5080c3..afe2acbb47eeb93cac6b07fa4bd4bcd3d823854c 100644
--- a/chrome/browser/sessions/session_types.cc
+++ b/chrome/browser/sessions/session_types.cc
@@ -27,7 +27,8 @@ TabNavigation::TabNavigation()
transition_type_(content::PAGE_TRANSITION_TYPED),
has_post_data_(false),
post_id_(-1),
- is_overriding_user_agent_(false) {}
+ is_overriding_user_agent_(false),
+ http_status_code_(0) {}
TabNavigation::~TabNavigation() {}
@@ -48,6 +49,7 @@ TabNavigation TabNavigation::FromNavigationEntry(
navigation.original_request_url_ = entry.GetOriginalRequestURL();
navigation.is_overriding_user_agent_ = entry.GetIsOverridingUserAgent();
navigation.timestamp_ = entry.GetTimestamp();
+ navigation.http_status_code_ = entry.GetHttpStatusCode();
return navigation;
}
@@ -132,6 +134,7 @@ TabNavigation TabNavigation::FromSyncData(
static_cast<content::PageTransition>(transition);
navigation.timestamp_ = base::Time();
+ navigation.http_status_code_ = sync_data.http_status_code();
return navigation;
}
@@ -201,6 +204,7 @@ enum TypeMask {
// original_request_url_
// is_overriding_user_agent_
// timestamp_
+// http_status_code_
void TabNavigation::WriteToPickle(Pickle* pickle) const {
pickle->WriteInt(index_);
@@ -245,6 +249,7 @@ void TabNavigation::WriteToPickle(Pickle* pickle) const {
original_request_url_.spec() : std::string());
pickle->WriteBool(is_overriding_user_agent_);
pickle->WriteInt64(timestamp_.ToInternalValue());
+ pickle->WriteInt(http_status_code_);
}
bool TabNavigation::ReadFromPickle(PickleIterator* iterator) {
@@ -298,6 +303,9 @@ bool TabNavigation::ReadFromPickle(PickleIterator* iterator) {
} else {
timestamp_ = base::Time();
}
+
+ if (!iterator->ReadInt(&http_status_code_))
+ http_status_code_ = 0;
}
return true;
@@ -326,6 +334,7 @@ scoped_ptr<NavigationEntry> TabNavigation::ToNavigationEntry(
entry->SetOriginalRequestURL(original_request_url_);
entry->SetIsOverridingUserAgent(is_overriding_user_agent_);
entry->SetTimestamp(timestamp_);
+ entry->SetHttpStatusCode(http_status_code_);
return entry.Pass();
}
@@ -417,6 +426,7 @@ sync_pb::TabNavigation TabNavigation::ToSyncData() const {
// TODO(akalin): Don't lose resolution, i.e. define a new timestamp
// field with microsecond resolution and use that.
sync_data.set_timestamp(syncer::TimeToProtoTime(timestamp_));
+ sync_data.set_http_status_code(http_status_code_);
return sync_data;
}
« no previous file with comments | « chrome/browser/sessions/session_types.h ('k') | chrome/browser/sessions/session_types_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698