| Index: sync/internal_api/public/base/invalidation_state.cc
|
| diff --git a/sync/internal_api/public/base/invalidation_state.cc b/sync/internal_api/public/base/invalidation_state.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d64cbf03f720b119ac81ad6d9d4f64993339cb9e
|
| --- /dev/null
|
| +++ b/sync/internal_api/public/base/invalidation_state.cc
|
| @@ -0,0 +1,42 @@
|
| +// Copyright (c) 2012 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_state.h"
|
| +
|
| +#include "base/values.h"
|
| +
|
| +namespace syncer {
|
| +
|
| +bool AckHandle::Equals(const AckHandle& other) const {
|
| + return true;
|
| +}
|
| +
|
| +base::Value* AckHandle::ToValue() const {
|
| + return new DictionaryValue();
|
| +}
|
| +
|
| +bool AckHandle::ResetFromValue(const base::Value& value) {
|
| + return true;
|
| +}
|
| +
|
| +bool InvalidationState::Equals(const InvalidationState& other) const {
|
| + return (payload == other.payload) && ack_handle.Equals(other.ack_handle);
|
| +}
|
| +
|
| +base::DictionaryValue* InvalidationState::ToValue() const {
|
| + DictionaryValue* value = new DictionaryValue();
|
| + value->SetString("payload", payload);
|
| + value->Set("ackHandle", ack_handle.ToValue());
|
| + return value;
|
| +}
|
| +
|
| +bool InvalidationState::ResetFromValue(const base::DictionaryValue& value) {
|
| + const base::Value* ack_handle_value = NULL;
|
| + return
|
| + value.GetString("payload", &payload) &&
|
| + value.Get("ackHandle", &ack_handle_value) &&
|
| + ack_handle.ResetFromValue(*ack_handle_value);
|
| +}
|
| +
|
| +} // namespace syncer
|
|
|