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

Unified Diff: components/invalidation/invalidation_util.cc

Issue 400073003: Finish decoupling sync and invalidations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix GN Created 6 years, 5 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 | « components/invalidation/invalidation_util.h ('k') | components/invalidation/invalidator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/invalidation/invalidation_util.cc
diff --git a/sync/internal_api/public/base/invalidation_util.cc b/components/invalidation/invalidation_util.cc
similarity index 82%
rename from sync/internal_api/public/base/invalidation_util.cc
rename to components/invalidation/invalidation_util.cc
index 64336776269b7ab3d8beda76cda2e49c00c3fe27..50e3a5c4908f39f63401b9379f8363f3e3b7b46e 100644
--- a/sync/internal_api/public/base/invalidation_util.cc
+++ b/components/invalidation/invalidation_util.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sync/internal_api/public/base/invalidation_util.h"
+#include "components/invalidation/invalidation_util.h"
#include <ostream>
#include <sstream>
@@ -10,9 +10,9 @@
#include "base/json/json_writer.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
+#include "components/invalidation/invalidation.h"
#include "google/cacheinvalidation/include/types.h"
#include "google/cacheinvalidation/types.pb.h"
-#include "sync/internal_api/public/base/invalidation.h"
namespace syncer {
@@ -22,9 +22,8 @@ bool ObjectIdLessThan::operator()(const invalidation::ObjectId& lhs,
(lhs.source() == rhs.source() && lhs.name() < rhs.name());
}
-bool InvalidationVersionLessThan::operator()(
- const Invalidation& a,
- const Invalidation& b) const {
+bool InvalidationVersionLessThan::operator()(const Invalidation& a,
+ const Invalidation& b) const {
DCHECK(a.object_id() == b.object_id())
<< "a: " << ObjectIdToString(a.object_id()) << ", "
<< "b: " << ObjectIdToString(a.object_id());
@@ -54,16 +53,14 @@ bool ObjectIdFromValue(const base::DictionaryValue& value,
*out = invalidation::ObjectId();
std::string name;
int source = 0;
- if (!value.GetInteger("source", &source) ||
- !value.GetString("name", &name)) {
+ if (!value.GetInteger("source", &source) || !value.GetString("name", &name)) {
return false;
}
*out = invalidation::ObjectId(source, name);
return true;
}
-std::string ObjectIdToString(
- const invalidation::ObjectId& object_id) {
+std::string ObjectIdToString(const invalidation::ObjectId& object_id) {
scoped_ptr<base::DictionaryValue> value(ObjectIdToValue(object_id));
std::string str;
base::JSONWriter::Write(value.get(), &str);
« no previous file with comments | « components/invalidation/invalidation_util.h ('k') | components/invalidation/invalidator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698