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

Side by Side Diff: sync/internal_api/attachments/attachment_store_handle.cc

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 #include "sync/internal_api/public/attachments/attachment_store_handle.h" 5 #include "sync/internal_api/public/attachments/attachment_store_handle.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/sequenced_task_runner.h" 9 #include "base/sequenced_task_runner.h"
10 #include "sync/api/attachments/attachment.h" 10 #include "sync/api/attachments/attachment.h"
(...skipping 19 matching lines...) Expand all
30 30
31 AttachmentStoreHandle::~AttachmentStoreHandle() { 31 AttachmentStoreHandle::~AttachmentStoreHandle() {
32 DCHECK(backend_); 32 DCHECK(backend_);
33 // To delete backend post task that doesn't do anything, but binds backend 33 // To delete backend post task that doesn't do anything, but binds backend
34 // through base::Passed. This way backend will be deleted regardless whether 34 // through base::Passed. This way backend will be deleted regardless whether
35 // task runs or not. 35 // task runs or not.
36 backend_task_runner_->PostTask( 36 backend_task_runner_->PostTask(
37 FROM_HERE, base::Bind(&NoOp, base::Passed(&backend_))); 37 FROM_HERE, base::Bind(&NoOp, base::Passed(&backend_)));
38 } 38 }
39 39
40 void AttachmentStoreHandle::Load(const LoadCallback& callback) {
41 DCHECK(CalledOnValidThread());
42 backend_task_runner_->PostTask(FROM_HERE,
43 base::Bind(&AttachmentStoreBase::Load,
44 base::Unretained(backend_.get()),
45 callback));
46 }
47
40 void AttachmentStoreHandle::Read(const AttachmentIdList& ids, 48 void AttachmentStoreHandle::Read(const AttachmentIdList& ids,
41 const ReadCallback& callback) { 49 const ReadCallback& callback) {
42 DCHECK(CalledOnValidThread()); 50 DCHECK(CalledOnValidThread());
43 backend_task_runner_->PostTask(FROM_HERE, 51 backend_task_runner_->PostTask(FROM_HERE,
44 base::Bind(&AttachmentStoreBase::Read, 52 base::Bind(&AttachmentStoreBase::Read,
45 base::Unretained(backend_.get()), 53 base::Unretained(backend_.get()),
46 ids, 54 ids,
47 callback)); 55 callback));
48 } 56 }
49 57
(...skipping 11 matching lines...) Expand all
61 const DropCallback& callback) { 69 const DropCallback& callback) {
62 DCHECK(CalledOnValidThread()); 70 DCHECK(CalledOnValidThread());
63 backend_task_runner_->PostTask(FROM_HERE, 71 backend_task_runner_->PostTask(FROM_HERE,
64 base::Bind(&AttachmentStoreBase::Drop, 72 base::Bind(&AttachmentStoreBase::Drop,
65 base::Unretained(backend_.get()), 73 base::Unretained(backend_.get()),
66 ids, 74 ids,
67 callback)); 75 callback));
68 } 76 }
69 77
70 } // namespace syncer 78 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698