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

Unified Diff: chrome/browser/sync/notifier/invalidation_util.cc

Issue 5254009: roll cacheinvalidation to @60 (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 10 years, 1 month 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
Index: chrome/browser/sync/notifier/invalidation_util.cc
===================================================================
--- chrome/browser/sync/notifier/invalidation_util.cc (revision 67496)
+++ chrome/browser/sync/notifier/invalidation_util.cc (working copy)
@@ -20,8 +20,7 @@
model_type, &notification_type)) {
return false;
}
- object_id->mutable_name()->set_string_value(notification_type);
- object_id->set_source(invalidation::ObjectId::CHROME_SYNC);
+ object_id->Init(invalidation::ObjectSource::CHROME_SYNC, notification_type);
return true;
}
@@ -29,19 +28,27 @@
syncable::ModelType* model_type) {
return
syncable::NotificationTypeToRealModelType(
- object_id.name().string_value(), model_type);
+ object_id.name(), model_type);
}
std::string ObjectIdToString(
const invalidation::ObjectId& object_id) {
std::stringstream ss;
ss << "{ ";
- ss << "name: " << object_id.name().string_value() << ", ";
+ ss << "name: " << object_id.name() << ", ";
ss << "source: " << object_id.source();
ss << " }";
return ss.str();
}
+std::string ObjectIdPToString(
+ const invalidation::ObjectIdP& object_id) {
+ return ObjectIdToString(
+ invalidation::ObjectId(
+ (invalidation::ObjectSource_Type) object_id.source(),
+ object_id.name().string_value()));
+}
+
std::string StatusToString(
const invalidation::Status& status) {
std::stringstream ss;
@@ -57,18 +64,8 @@
std::stringstream ss;
ss << "{ ";
ss << "object_id: " << ObjectIdToString(invalidation.object_id()) << ", ";
- ss << "version: " << invalidation.version() << ", ";
- ss << "components: { ";
- const invalidation::ComponentStampLog& component_stamp_log =
- invalidation.component_stamp_log();
- for (int i = 0; i < component_stamp_log.stamp_size(); ++i) {
- const invalidation::ComponentStamp& component_stamp =
- component_stamp_log.stamp(i);
- ss << "component: " << component_stamp.component() << ", ";
- ss << "time: " << component_stamp.time() << ", ";
- }
+ ss << "version: " << invalidation.version();
ss << " }";
- ss << " }";
return ss.str();
}
@@ -77,7 +74,7 @@
std::stringstream ss;
ss << "{ ";
ss << "type: " << update.type() << ", ";
- ss << "object_id: " << ObjectIdToString(update.object_id()) << ", ";
+ ss << "object_id: " << ObjectIdPToString(update.object_id()) << ", ";
ss << "version: " << update.version() << ", ";
ss << "sequence_number: " << update.sequence_number();
ss << " }";
« no previous file with comments | « chrome/browser/sync/notifier/invalidation_util.h ('k') | third_party/cacheinvalidation/cacheinvalidation.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698