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

Side by Side Diff: sync/api/attachments/fake_attachment_service.cc

Issue 247983002: Keep track of which attachments are referenced by which sync entries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix "copy yourself bug". Created 6 years, 8 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 | Annotate | Revision Log
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/api/attachments/fake_attachment_service.h" 5 #include "sync/api/attachments/fake_attachment_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/test/test_simple_task_runner.h" 9 #include "base/test/test_simple_task_runner.h"
10 #include "sync/api/attachments/attachment.h" 10 #include "sync/api/attachments/attachment.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 void FakeAttachmentService::DropAttachments( 46 void FakeAttachmentService::DropAttachments(
47 const AttachmentIdList& attachment_ids, 47 const AttachmentIdList& attachment_ids,
48 const DropCallback& callback) { 48 const DropCallback& callback) {
49 DCHECK(CalledOnValidThread()); 49 DCHECK(CalledOnValidThread());
50 attachment_store_->Drop(attachment_ids, 50 attachment_store_->Drop(attachment_ids,
51 base::Bind(&FakeAttachmentService::DropDone, 51 base::Bind(&FakeAttachmentService::DropDone,
52 weak_ptr_factory_.GetWeakPtr(), 52 weak_ptr_factory_.GetWeakPtr(),
53 callback)); 53 callback));
54 } 54 }
55 55
56 void FakeAttachmentService::OnSyncDataAdd(const SyncData& sync_data) { 56 void FakeAttachmentService::StoreAttachments(const AttachmentList& attachment,
57 const StoreCallback& callback) {
57 DCHECK(CalledOnValidThread()); 58 DCHECK(CalledOnValidThread());
58 // TODO(maniscalco): Ensure the linked attachments get persisted in local 59 // TODO(maniscalco): Ensure the linked attachments get persisted in local
59 // storage and schedule them for upload to the server (bug 356351). 60 // storage and schedule them for upload to the server (bug 356351).
60 } 61 }
61 62
62 void FakeAttachmentService::OnSyncDataDelete(const SyncData& sync_data) { 63 void FakeAttachmentService::OnSyncDataDelete(const SyncData& sync_data) {
63 DCHECK(CalledOnValidThread()); 64 DCHECK(CalledOnValidThread());
64 // TODO(maniscalco): One or more of sync_data's attachments may no longer be 65 // TODO(maniscalco): One or more of sync_data's attachments may no longer be
65 // referenced anywhere. We should probably delete them at this point (bug 66 // referenced anywhere. We should probably delete them at this point (bug
66 // 356351). 67 // 356351).
(...skipping 28 matching lines...) Expand all
95 AttachmentService::DROP_UNSPECIFIED_ERROR; 96 AttachmentService::DROP_UNSPECIFIED_ERROR;
96 if (result == AttachmentStore::SUCCESS) { 97 if (result == AttachmentStore::SUCCESS) {
97 drop_result = AttachmentService::DROP_SUCCESS; 98 drop_result = AttachmentService::DROP_SUCCESS;
98 } 99 }
99 // TODO(maniscalco): Deal with case where an error occurred (bug 361251). 100 // TODO(maniscalco): Deal with case where an error occurred (bug 361251).
100 base::MessageLoop::current()->PostTask(FROM_HERE, 101 base::MessageLoop::current()->PostTask(FROM_HERE,
101 base::Bind(callback, drop_result)); 102 base::Bind(callback, drop_result));
102 } 103 }
103 104
104 } // namespace syncer 105 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698