| Index: sync/api/attachments/fake_attachment_service.h
|
| diff --git a/sync/api/attachments/fake_attachment_service.h b/sync/api/attachments/fake_attachment_service.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..141f27517fe025319eb8a1381a94d76c25c815d6
|
| --- /dev/null
|
| +++ b/sync/api/attachments/fake_attachment_service.h
|
| @@ -0,0 +1,52 @@
|
| +// 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.
|
| +
|
| +#ifndef SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_SERVICE_H_
|
| +#define SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_SERVICE_H_
|
| +
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "base/threading/non_thread_safe.h"
|
| +#include "sync/api/attachments/attachment_service.h"
|
| +#include "sync/api/attachments/attachment_service_base.h"
|
| +#include "sync/api/attachments/attachment_service_proxy.h"
|
| +#include "sync/api/attachments/attachment_store.h"
|
| +
|
| +namespace syncer {
|
| +
|
| +// A fake implementation of AttachmentService.
|
| +class SYNC_EXPORT FakeAttachmentService : public AttachmentServiceBase,
|
| + public base::NonThreadSafe {
|
| + public:
|
| + explicit FakeAttachmentService(scoped_ptr<AttachmentStore> attachment_store);
|
| + virtual ~FakeAttachmentService();
|
| +
|
| + // Create a FakeAttachmentService suitable for use in tests.
|
| + static scoped_ptr<syncer::AttachmentServiceBase> CreateForTest();
|
| +
|
| + // AttachmentService implementation.
|
| + virtual void GetOrDownloadAttachments(const AttachmentIdList& attachment_ids,
|
| + const GetOrDownloadCallback& callback)
|
| + OVERRIDE;
|
| + virtual void DropAttachments(const AttachmentIdList& attachment_ids,
|
| + const DropCallback& callback) OVERRIDE;
|
| + virtual void OnSyncDataAdd(const SyncData& sync_data) OVERRIDE;
|
| + virtual void OnSyncDataDelete(const SyncData& sync_data) OVERRIDE;
|
| + virtual void OnSyncDataUpdate(const AttachmentIdList& old_attachment_ids,
|
| + const SyncData& updated_sync_data) OVERRIDE;
|
| +
|
| + // AttachmentServiceBase implementation.
|
| + virtual base::WeakPtr<AttachmentServiceBase> AsWeakPtr() OVERRIDE;
|
| +
|
| + private:
|
| + const scoped_ptr<AttachmentStore> attachment_store_;
|
| +
|
| + // Must be last data member.
|
| + base::WeakPtrFactory<AttachmentServiceBase> weak_ptr_factory_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(FakeAttachmentService);
|
| +};
|
| +
|
| +} // namespace syncer
|
| +
|
| +#endif // SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_SERVICE_H_
|
|
|