Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(827)

Unified Diff: sync/api/attachments/fake_attachment_service.h

Issue 187303006: Update sync API to support attachments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@attachmentapi
Patch Set: Remove AttachmentServiceBase for reals. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..3bbd5d6d553fcb6cee1364d7bee0b6eab9856b2f
--- /dev/null
+++ b/sync/api/attachments/fake_attachment_service.h
@@ -0,0 +1,45 @@
+// 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_proxy.h"
+#include "sync/api/attachments/attachment_store.h"
+
+namespace syncer {
+
+// A fake implementation of AttachmentService.
+class SYNC_EXPORT FakeAttachmentService : public AttachmentService,
+ 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::AttachmentService> 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;
+
+ private:
+ const scoped_ptr<AttachmentStore> attachment_store_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeAttachmentService);
+};
+
+} // namespace syncer
+
+#endif // SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698