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

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

Issue 394293003: Do not update AttachmentIds after uploading attachments to sync server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « sync/internal_api/public/write_transaction.h ('k') | sync/syncable/directory_unittest.cc » ('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/mutable_entry.h"
9 #include "sync/syncable/syncable_write_transaction.h" 9 #include "sync/syncable/syncable_write_transaction.h"
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // data type. 74 // data type.
75 GetDirectory()->ResetVersionsForType(transaction_, type); 75 GetDirectory()->ResetVersionsForType(transaction_, type);
76 } 76 }
77 77
78 // Note that it's possible for a GetUpdatesResponse that arrives immediately 78 // Note that it's possible for a GetUpdatesResponse that arrives immediately
79 // after the context update to override the cleared progress markers. 79 // after the context update to override the cleared progress markers.
80 // 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.
81 // See crbug.com/360280 81 // See crbug.com/360280
82 } 82 }
83 83
84 void WriteTransaction::UpdateEntriesWithAttachmentId( 84 void WriteTransaction::UpdateEntriesMarkAttachmentAsOnServer(
85 const AttachmentId& attachment_id) { 85 const AttachmentId& attachment_id) {
86 syncable::Directory::Metahandles handles; 86 syncable::Directory::Metahandles handles;
87 GetDirectory()->GetMetahandlesByAttachmentId( 87 GetDirectory()->GetMetahandlesByAttachmentId(
88 transaction_, attachment_id.GetProto(), &handles); 88 transaction_, attachment_id.GetProto(), &handles);
89 for (syncable::Directory::Metahandles::iterator iter = handles.begin(); 89 for (syncable::Directory::Metahandles::iterator iter = handles.begin();
90 iter != handles.end(); 90 iter != handles.end();
91 ++iter) { 91 ++iter) {
92 syncable::MutableEntry entry(transaction_, syncable::GET_BY_HANDLE, *iter); 92 syncable::MutableEntry entry(transaction_, syncable::GET_BY_HANDLE, *iter);
93 entry.UpdateAttachmentIdWithServerInfo(attachment_id.GetProto()); 93 entry.MarkAttachmentAsOnServer(attachment_id.GetProto());
94 } 94 }
95 } 95 }
96 96
97 } // namespace syncer 97 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/public/write_transaction.h ('k') | sync/syncable/directory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698