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

Side by Side Diff: sync/api/attachments/fake_attachment_store.h

Issue 187303006: Update sync API to support attachments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@attachmentapi
Patch Set: Pull in upstream changes. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_STORE_H_ 5 #ifndef SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_STORE_H_
6 #define SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_STORE_H_ 6 #define SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_STORE_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 15 matching lines...) Expand all
26 26
27 class Attachment; 27 class Attachment;
28 28
29 // A in-memory only implementation of AttachmentStore used for testing. 29 // A in-memory only implementation of AttachmentStore used for testing.
30 // 30 //
31 // Requires that the current thread has a MessageLoop. 31 // Requires that the current thread has a MessageLoop.
32 class SYNC_EXPORT FakeAttachmentStore : public AttachmentStore { 32 class SYNC_EXPORT FakeAttachmentStore : public AttachmentStore {
33 public: 33 public:
34 // Construct a FakeAttachmentStore whose "IO" will be performed in 34 // Construct a FakeAttachmentStore whose "IO" will be performed in
35 // |backend_task_runner|. 35 // |backend_task_runner|.
36 FakeAttachmentStore( 36 explicit FakeAttachmentStore(
37 const scoped_refptr<base::SequencedTaskRunner>& backend_task_runner); 37 const scoped_refptr<base::SequencedTaskRunner>& backend_task_runner);
38 38
39 virtual ~FakeAttachmentStore(); 39 virtual ~FakeAttachmentStore();
40 40
41 // AttachmentStore implementation. 41 // AttachmentStore implementation.
42 virtual void Read(const sync_pb::AttachmentId& id, 42 virtual void Read(const sync_pb::AttachmentId& id,
43 const ReadCallback& callback) OVERRIDE; 43 const ReadCallback& callback) OVERRIDE;
44 virtual void Write(const scoped_refptr<base::RefCountedMemory>& bytes, 44 virtual void Write(const scoped_refptr<base::RefCountedMemory>& bytes,
45 const WriteCallback& callback) OVERRIDE; 45 const WriteCallback& callback) OVERRIDE;
46 virtual void Drop(const sync_pb::AttachmentId& id, 46 virtual void Drop(const sync_pb::AttachmentId& id,
47 const DropCallback& callback) OVERRIDE; 47 const DropCallback& callback) OVERRIDE;
48 48
49 private: 49 private:
50 class Backend; 50 class Backend;
51 51
52 scoped_refptr<Backend> backend_; 52 scoped_refptr<Backend> backend_;
53 scoped_refptr<base::SequencedTaskRunner> backend_task_runner_; 53 scoped_refptr<base::SequencedTaskRunner> backend_task_runner_;
54 54
55 DISALLOW_COPY_AND_ASSIGN(FakeAttachmentStore); 55 DISALLOW_COPY_AND_ASSIGN(FakeAttachmentStore);
56 }; 56 };
57 57
58 } // namespace syncer 58 } // namespace syncer
59 59
60 #endif // SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_STORE_H_ 60 #endif // SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698