| Index: sync/internal_api/public/base/ack_handle.cc
|
| diff --git a/sync/internal_api/public/base/invalidation.cc b/sync/internal_api/public/base/ack_handle.cc
|
| similarity index 58%
|
| copy from sync/internal_api/public/base/invalidation.cc
|
| copy to sync/internal_api/public/base/ack_handle.cc
|
| index b503d07c4afa99905a688d70eeb85c8d6d80a425..f5ddf121e3b371d75352f974a8d44cf9a73b9512 100644
|
| --- a/sync/internal_api/public/base/invalidation.cc
|
| +++ b/sync/internal_api/public/base/ack_handle.cc
|
| @@ -1,8 +1,8 @@
|
| -// Copyright 2012 The Chromium Authors. All rights reserved.
|
| +// Copyright 2013 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 "sync/internal_api/public/base/invalidation.h"
|
| +#include "sync/internal_api/public/base/ack_handle.h"
|
|
|
| #include <cstddef>
|
| #include "base/rand_util.h"
|
| @@ -64,41 +64,4 @@ AckHandle::AckHandle(const std::string& state, base::Time timestamp)
|
| AckHandle::~AckHandle() {
|
| }
|
|
|
| -const int64 Invalidation::kUnknownVersion = -1;
|
| -
|
| -Invalidation::Invalidation()
|
| - : version(kUnknownVersion), ack_handle(AckHandle::InvalidAckHandle()) {
|
| -}
|
| -
|
| -Invalidation::~Invalidation() {
|
| -}
|
| -
|
| -bool Invalidation::Equals(const Invalidation& other) const {
|
| - return (version == other.version) && (payload == other.payload) &&
|
| - ack_handle.Equals(other.ack_handle);
|
| -}
|
| -
|
| -scoped_ptr<base::DictionaryValue> Invalidation::ToValue() const {
|
| - scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
|
| - value->SetString("version", base::Int64ToString(version));
|
| - value->SetString("payload", payload);
|
| - value->Set("ackHandle", ack_handle.ToValue().release());
|
| - return value.Pass();
|
| -}
|
| -
|
| -bool Invalidation::ResetFromValue(const base::DictionaryValue& value) {
|
| - const base::DictionaryValue* ack_handle_value = NULL;
|
| - std::string version_as_string;
|
| - if (value.GetString("version", &version_as_string)) {
|
| - if (!base::StringToInt64(version_as_string, &version))
|
| - return false;
|
| - } else {
|
| - version = kUnknownVersion;
|
| - }
|
| - return
|
| - value.GetString("payload", &payload) &&
|
| - value.GetDictionary("ackHandle", &ack_handle_value) &&
|
| - ack_handle.ResetFromValue(*ack_handle_value);
|
| -}
|
| -
|
| } // namespace syncer
|
|
|