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

Side by Side Diff: sync/internal_api/write_transaction.cc

Issue 272043002: Invoke AttachmentUploader and update AttachmentIds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android build Created 6 years, 7 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
« no previous file with comments | « sync/internal_api/public/write_transaction.h ('k') | sync/syncable/directory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/write_transaction.h" 5 #include "sync/internal_api/public/write_transaction.h"
6 6
7 #include "sync/syncable/directory.h" 7 #include "sync/syncable/directory.h"
8 #include "sync/syncable/mutable_entry.h"
8 #include "sync/syncable/syncable_write_transaction.h" 9 #include "sync/syncable/syncable_write_transaction.h"
9 10
10 namespace syncer { 11 namespace syncer {
11 12
12 ////////////////////////////////////////////////////////////////////////// 13 //////////////////////////////////////////////////////////////////////////
13 // WriteTransaction member definitions 14 // WriteTransaction member definitions
14 WriteTransaction::WriteTransaction(const tracked_objects::Location& from_here, 15 WriteTransaction::WriteTransaction(const tracked_objects::Location& from_here,
15 UserShare* share) 16 UserShare* share)
16 : BaseTransaction(share), 17 : BaseTransaction(share),
17 transaction_(NULL) { 18 transaction_(NULL) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // data type. 74 // data type.
74 GetDirectory()->ResetVersionsForType(transaction_, type); 75 GetDirectory()->ResetVersionsForType(transaction_, type);
75 } 76 }
76 77
77 // Note that it's possible for a GetUpdatesResponse that arrives immediately 78 // Note that it's possible for a GetUpdatesResponse that arrives immediately
78 // after the context update to override the cleared progress markers. 79 // after the context update to override the cleared progress markers.
79 // TODO(zea): add a flag in the directory to prevent this from happening. 80 // TODO(zea): add a flag in the directory to prevent this from happening.
80 // See crbug.com/360280 81 // See crbug.com/360280
81 } 82 }
82 83
84 void WriteTransaction::UpdateEntriesWithAttachmentId(
85 const AttachmentId& attachment_id) {
86 syncable::Directory::Metahandles handles;
87 GetDirectory()->GetMetahandlesByAttachmentId(
88 transaction_, attachment_id.GetProto(), &handles);
89 for (syncable::Directory::Metahandles::iterator iter = handles.begin();
90 iter != handles.end();
91 ++iter) {
92 syncable::MutableEntry entry(transaction_, syncable::GET_BY_HANDLE, *iter);
93 entry.UpdateAttachmentIdWithServerInfo(attachment_id.GetProto());
94 }
95 }
96
83 } // namespace syncer 97 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/public/write_transaction.h ('k') | sync/syncable/directory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698