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 #include "sync/internal_api/public/attachments/attachment_store_frontend.h" | 5 #include "sync/internal_api/public/attachments/attachment_store_frontend.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/callback.h" | 10 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
12 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
13 #include "base/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
14 #include "sync/api/attachments/attachment.h" | 16 #include "sync/api/attachments/attachment.h" |
15 #include "sync/api/attachments/attachment_id.h" | 17 #include "sync/api/attachments/attachment_id.h" |
16 #include "sync/api/attachments/attachment_store_backend.h" | 18 #include "sync/api/attachments/attachment_store_backend.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 base::Unretained(this)), | 120 base::Unretained(this)), |
119 base::Bind(&AttachmentStoreFrontendTest::DropReferenceCalled, | 121 base::Bind(&AttachmentStoreFrontendTest::DropReferenceCalled, |
120 base::Unretained(this)), | 122 base::Unretained(this)), |
121 base::Bind(&AttachmentStoreFrontendTest::ReadMetadataByIdCalled, | 123 base::Bind(&AttachmentStoreFrontendTest::ReadMetadataByIdCalled, |
122 base::Unretained(this)), | 124 base::Unretained(this)), |
123 base::Bind(&AttachmentStoreFrontendTest::ReadMetadataCalled, | 125 base::Bind(&AttachmentStoreFrontendTest::ReadMetadataCalled, |
124 base::Unretained(this)), | 126 base::Unretained(this)), |
125 base::Bind(&AttachmentStoreFrontendTest::DtorCalled, | 127 base::Bind(&AttachmentStoreFrontendTest::DtorCalled, |
126 base::Unretained(this)))); | 128 base::Unretained(this)))); |
127 attachment_store_frontend_ = new AttachmentStoreFrontend( | 129 attachment_store_frontend_ = new AttachmentStoreFrontend( |
128 backend.Pass(), base::ThreadTaskRunnerHandle::Get()); | 130 std::move(backend), base::ThreadTaskRunnerHandle::Get()); |
129 } | 131 } |
130 | 132 |
131 static void DoneWithResult(const AttachmentStore::Result& result) { | 133 static void DoneWithResult(const AttachmentStore::Result& result) { |
132 NOTREACHED(); | 134 NOTREACHED(); |
133 } | 135 } |
134 | 136 |
135 static void ReadDone(const AttachmentStore::Result& result, | 137 static void ReadDone(const AttachmentStore::Result& result, |
136 scoped_ptr<AttachmentMap> attachments, | 138 scoped_ptr<AttachmentMap> attachments, |
137 scoped_ptr<AttachmentIdList> unavailable_attachments) { | 139 scoped_ptr<AttachmentIdList> unavailable_attachments) { |
138 NOTREACHED(); | 140 NOTREACHED(); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 228 |
227 // Releasing referehce to AttachmentStoreFrontend should result in | 229 // Releasing referehce to AttachmentStoreFrontend should result in |
228 // MockAttachmentStore being deleted on backend loop. | 230 // MockAttachmentStore being deleted on backend loop. |
229 attachment_store_frontend_ = NULL; | 231 attachment_store_frontend_ = NULL; |
230 EXPECT_EQ(dtor_call_count_, 0); | 232 EXPECT_EQ(dtor_call_count_, 0); |
231 RunMessageLoop(); | 233 RunMessageLoop(); |
232 EXPECT_EQ(dtor_call_count_, 1); | 234 EXPECT_EQ(dtor_call_count_, 1); |
233 } | 235 } |
234 | 236 |
235 } // namespace syncer | 237 } // namespace syncer |
OLD | NEW |