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_API_ATTACHMENTS_ATTACHMENT_STORE_H_ | 5 #ifndef SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_ |
6 #define SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_ | 6 #define SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // attachment store is asynchronous, once it finishes |callback| will be | 108 // attachment store is asynchronous, once it finishes |callback| will be |
109 // called on the thread that called CreateOnDiskStore. |store| parameter of | 109 // called on the thread that called CreateOnDiskStore. |store| parameter of |
110 // callback is only valid when |result| is SUCCESS. | 110 // callback is only valid when |result| is SUCCESS. |
111 static void CreateOnDiskStore( | 111 static void CreateOnDiskStore( |
112 const base::FilePath& path, | 112 const base::FilePath& path, |
113 const scoped_refptr<base::SequencedTaskRunner>& backend_task_runner, | 113 const scoped_refptr<base::SequencedTaskRunner>& backend_task_runner, |
114 const CreateCallback& callback); | 114 const CreateCallback& callback); |
115 | 115 |
116 protected: | 116 protected: |
117 friend class base::RefCountedThreadSafe<AttachmentStore>; | 117 friend class base::RefCountedThreadSafe<AttachmentStore>; |
118 virtual ~AttachmentStore(); | 118 ~AttachmentStore() override; |
119 | 119 |
120 private: | 120 private: |
121 static void CreateOnDiskStoreOnBackendThread( | 121 static void CreateOnDiskStoreOnBackendThread( |
122 const base::FilePath& path, | 122 const base::FilePath& path, |
123 const scoped_refptr<base::SequencedTaskRunner>& frontend_task_runner, | 123 const scoped_refptr<base::SequencedTaskRunner>& frontend_task_runner, |
124 const CreateCallback& callback); | 124 const CreateCallback& callback); |
125 | 125 |
126 static void CreateBackendDone( | 126 static void CreateBackendDone( |
127 const Result& result, | 127 const Result& result, |
128 scoped_ptr<AttachmentStoreBase> backend, | 128 scoped_ptr<AttachmentStoreBase> backend, |
129 const scoped_refptr<base::SequencedTaskRunner>& backend_task_runner, | 129 const scoped_refptr<base::SequencedTaskRunner>& backend_task_runner, |
130 const CreateCallback& callback); | 130 const CreateCallback& callback); |
131 }; | 131 }; |
132 | 132 |
133 } // namespace syncer | 133 } // namespace syncer |
134 | 134 |
135 #endif // SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_ | 135 #endif // SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_ |
OLD | NEW |