| Index: sync/notifier/unacked_invalidation_storage.h
|
| diff --git a/sync/notifier/unacked_invalidation_storage.h b/sync/notifier/unacked_invalidation_storage.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..915cb79035b35fc98b2d02367fc93c70dec9f57d
|
| --- /dev/null
|
| +++ b/sync/notifier/unacked_invalidation_storage.h
|
| @@ -0,0 +1,64 @@
|
| +// 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.
|
| +
|
| +#ifndef SYNC_NOTIFIER_UNACKED_INVALIDATION_STORAGE_H_
|
| +#define SYNC_NOTIFIER_UNACKED_INVALIDATION_STORAGE_H_
|
| +
|
| +#include <vector>
|
| +
|
| +#include "sync/internal_api/public/base/invalidation.h"
|
| +#include "sync/internal_api/public/util/weak_handle.h"
|
| +#include "sync/notifier/invalidation_util.h"
|
| +
|
| +namespace base {
|
| +class DictionaryValue;
|
| +} // namespace base
|
| +
|
| +namespace syncer {
|
| +
|
| +class OrderedInvalidationList;
|
| +class ObjectIdInvalidationMap;
|
| +class AckHandle;
|
| +
|
| +class SYNC_EXPORT UnackedInvalidationStorage {
|
| + public:
|
| + UnackedInvalidationStorage(invalidation::ObjectId id);
|
| + ~UnackedInvalidationStorage();
|
| +
|
| + bool ResetFromValue(const base::DictionaryValue& value);
|
| +
|
| + const invalidation::ObjectId& GetObjectId() const;
|
| +
|
| + void RecordInvalidation(const Invalidation& invalidation);
|
| + void RecordInvalidations(const OrderedInvalidationList& invalidations);
|
| + void UnpackRecordedInvalidations(ObjectIdInvalidationMap* out,
|
| + WeakHandle<AckHandler> ack_handler) const;
|
| + void Clear();
|
| +
|
| + void SetIsRegistered();
|
| + void UnsetIsRegistered();
|
| +
|
| + void Acknowledge(const AckHandle& handle);
|
| + void Drop(const AckHandle& handle);
|
| +
|
| + scoped_ptr<base::DictionaryValue> ToValue() const;
|
| +
|
| + private:
|
| + typedef std::set<Invalidation, InvalidationVersionLessThan> InvalidationsSet;
|
| +
|
| + void Truncate(size_t max_size);
|
| + bool ResetListFromValue(const base::ListValue& value);
|
| +
|
| + bool registered_;
|
| + invalidation::ObjectId object_id_;
|
| + InvalidationsSet invalidations_;
|
| +};
|
| +
|
| +typedef std::map<invalidation::ObjectId,
|
| + UnackedInvalidationStorage,
|
| + ObjectIdLessThan> UnackedInvalidationStorageMap;
|
| +
|
| +} // namespace syncer
|
| +
|
| +#endif // SYNC_NOTIFIER_UNACKED_INVALIDATION_STORAGE_H_
|
|
|