| Index: components/invalidation/invalidation_util.cc
|
| diff --git a/components/invalidation/invalidation_util.cc b/components/invalidation/invalidation_util.cc
|
| deleted file mode 100644
|
| index d3706f48b73890b0878db9bce579e0e48886d78f..0000000000000000000000000000000000000000
|
| --- a/components/invalidation/invalidation_util.cc
|
| +++ /dev/null
|
| @@ -1,69 +0,0 @@
|
| -// Copyright 2014 The Chromium Authors. All rights reserved.
|
| -// Use of this source code is governed by a BSD-style license that can be
|
| -// found in the LICENSE file.
|
| -
|
| -#include "components/invalidation/invalidation_util.h"
|
| -
|
| -#include <ostream>
|
| -#include <sstream>
|
| -
|
| -#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"
|
| -
|
| -namespace syncer {
|
| -
|
| -bool ObjectIdLessThan::operator()(const invalidation::ObjectId& lhs,
|
| - const invalidation::ObjectId& rhs) const {
|
| - return (lhs.source() < rhs.source()) ||
|
| - (lhs.source() == rhs.source() && lhs.name() < rhs.name());
|
| -}
|
| -
|
| -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());
|
| -
|
| - if (a.is_unknown_version() && !b.is_unknown_version())
|
| - return true;
|
| -
|
| - if (!a.is_unknown_version() && b.is_unknown_version())
|
| - return false;
|
| -
|
| - if (a.is_unknown_version() && b.is_unknown_version())
|
| - return false;
|
| -
|
| - return a.version() < b.version();
|
| -}
|
| -
|
| -scoped_ptr<base::DictionaryValue> ObjectIdToValue(
|
| - const invalidation::ObjectId& object_id) {
|
| - scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
|
| - value->SetInteger("source", object_id.source());
|
| - value->SetString("name", object_id.name());
|
| - return value.Pass();
|
| -}
|
| -
|
| -bool ObjectIdFromValue(const base::DictionaryValue& value,
|
| - invalidation::ObjectId* out) {
|
| - *out = invalidation::ObjectId();
|
| - std::string name;
|
| - int source = 0;
|
| - 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 str;
|
| - base::JSONWriter::Write(*ObjectIdToValue(object_id), &str);
|
| - return str;
|
| -}
|
| -
|
| -} // namespace syncer
|
|
|