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

Side by Side Diff: sync/internal_api/public/attachments/in_memory_attachment_store.h

Issue 652723003: Implementation of OnDiskAttachmentStore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: OVERRIDE => override Created 6 years, 2 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_INTERNAL_API_PUBLIC_ATTACHMENTS_IN_MEMORY_ATTACHMENT_STORE_H_ 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_IN_MEMORY_ATTACHMENT_STORE_H_
6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_IN_MEMORY_ATTACHMENT_STORE_H_ 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_IN_MEMORY_ATTACHMENT_STORE_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/non_thread_safe.h" 10 #include "base/threading/non_thread_safe.h"
11 #include "sync/api/attachments/attachment.h" 11 #include "sync/api/attachments/attachment.h"
12 #include "sync/api/attachments/attachment_id.h" 12 #include "sync/api/attachments/attachment_id.h"
13 #include "sync/api/attachments/attachment_store.h" 13 #include "sync/api/attachments/attachment_store.h"
14 #include "sync/base/sync_export.h" 14 #include "sync/base/sync_export.h"
15 15
16 namespace syncer { 16 namespace syncer {
17 17
18 // An in-memory implementation of AttachmentStore used for testing. 18 // An in-memory implementation of AttachmentStore used for testing.
19 // InMemoryAttachmentStore is not threadsafe, it lives on backend thread and 19 // InMemoryAttachmentStore is not threadsafe, it lives on backend thread and
20 // posts callbacks with results on |callback_task_runner|. 20 // posts callbacks with results on |callback_task_runner|.
21 class SYNC_EXPORT InMemoryAttachmentStore : public AttachmentStoreBase, 21 class SYNC_EXPORT InMemoryAttachmentStore : public AttachmentStoreBase,
22 public base::NonThreadSafe { 22 public base::NonThreadSafe {
23 public: 23 public:
24 InMemoryAttachmentStore( 24 InMemoryAttachmentStore(
25 const scoped_refptr<base::SingleThreadTaskRunner>& callback_task_runner); 25 const scoped_refptr<base::SingleThreadTaskRunner>& callback_task_runner);
26 virtual ~InMemoryAttachmentStore(); 26 virtual ~InMemoryAttachmentStore();
27 27
28 // AttachmentStoreBase implementation. 28 // AttachmentStoreBase implementation.
29 virtual void Load(const LoadCallback& callback) override;
29 virtual void Read(const AttachmentIdList& ids, 30 virtual void Read(const AttachmentIdList& ids,
30 const ReadCallback& callback) override; 31 const ReadCallback& callback) override;
31 virtual void Write(const AttachmentList& attachments, 32 virtual void Write(const AttachmentList& attachments,
32 const WriteCallback& callback) override; 33 const WriteCallback& callback) override;
33 virtual void Drop(const AttachmentIdList& ids, 34 virtual void Drop(const AttachmentIdList& ids,
34 const DropCallback& callback) override; 35 const DropCallback& callback) override;
35 36
36 private: 37 private:
37 scoped_refptr<base::SingleThreadTaskRunner> callback_task_runner_; 38 scoped_refptr<base::SingleThreadTaskRunner> callback_task_runner_;
38 AttachmentMap attachments_; 39 AttachmentMap attachments_;
39 }; 40 };
40 41
41 } // namespace syncer 42 } // namespace syncer
42 43
43 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_IN_MEMORY_ATTACHMENT_STORE_H_ 44 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_IN_MEMORY_ATTACHMENT_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698