| OLD | NEW |
| 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_ATTACHMENT_STORE_HANDLE_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_STORE_HANDLE_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_STORE_HANDLE_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_STORE_HANDLE_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 24 matching lines...) Expand all Loading... |
| 35 // model thread. | 35 // model thread. |
| 36 class SYNC_EXPORT AttachmentStoreHandle : public AttachmentStore, | 36 class SYNC_EXPORT AttachmentStoreHandle : public AttachmentStore, |
| 37 public base::NonThreadSafe { | 37 public base::NonThreadSafe { |
| 38 public: | 38 public: |
| 39 AttachmentStoreHandle( | 39 AttachmentStoreHandle( |
| 40 scoped_ptr<AttachmentStoreBase> backend, | 40 scoped_ptr<AttachmentStoreBase> backend, |
| 41 const scoped_refptr<base::SequencedTaskRunner>& backend_task_runner); | 41 const scoped_refptr<base::SequencedTaskRunner>& backend_task_runner); |
| 42 | 42 |
| 43 // AttachmentStore implementation. | 43 // AttachmentStore implementation. |
| 44 virtual void Read(const AttachmentIdList& id, | 44 virtual void Read(const AttachmentIdList& id, |
| 45 const ReadCallback& callback) OVERRIDE; | 45 const ReadCallback& callback) override; |
| 46 virtual void Write(const AttachmentList& attachments, | 46 virtual void Write(const AttachmentList& attachments, |
| 47 const WriteCallback& callback) OVERRIDE; | 47 const WriteCallback& callback) override; |
| 48 virtual void Drop(const AttachmentIdList& id, | 48 virtual void Drop(const AttachmentIdList& id, |
| 49 const DropCallback& callback) OVERRIDE; | 49 const DropCallback& callback) override; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 virtual ~AttachmentStoreHandle(); | 52 virtual ~AttachmentStoreHandle(); |
| 53 | 53 |
| 54 // AttachmentStoreHandle controls backend's lifetime. It is safe for | 54 // AttachmentStoreHandle controls backend's lifetime. It is safe for |
| 55 // AttachmentStoreHandle to bind backend through base::Unretained for posts. | 55 // AttachmentStoreHandle to bind backend through base::Unretained for posts. |
| 56 // Backend is deleted on backend_task_runner, after that backend_ pointer is | 56 // Backend is deleted on backend_task_runner, after that backend_ pointer is |
| 57 // invalid. | 57 // invalid. |
| 58 scoped_ptr<AttachmentStoreBase> backend_; | 58 scoped_ptr<AttachmentStoreBase> backend_; |
| 59 scoped_refptr<base::SequencedTaskRunner> backend_task_runner_; | 59 scoped_refptr<base::SequencedTaskRunner> backend_task_runner_; |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(AttachmentStoreHandle); | 61 DISALLOW_COPY_AND_ASSIGN(AttachmentStoreHandle); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace syncer | 64 } // namespace syncer |
| 65 | 65 |
| 66 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_STORE_HANDLE_H_ | 66 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_STORE_HANDLE_H_ |
| OLD | NEW |