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

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

Issue 187303006: Update sync API to support attachments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@attachmentapi
Patch Set: Rename GetAttachments to GetLocalAttachmentsForUpload. 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
« no previous file with comments | « sync/api/sync_data_unittest.cc ('k') | sync/internal_api/public/DEPS » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/base_node.h" 5 #include "sync/internal_api/public/base_node.h"
6 6
7 #include <stack> 7 #include <stack>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } 283 }
284 284
285 const sync_pb::EntitySpecifics& BaseNode::GetEntitySpecifics() const { 285 const sync_pb::EntitySpecifics& BaseNode::GetEntitySpecifics() const {
286 return GetUnencryptedSpecifics(GetEntry()); 286 return GetUnencryptedSpecifics(GetEntry());
287 } 287 }
288 288
289 ModelType BaseNode::GetModelType() const { 289 ModelType BaseNode::GetModelType() const {
290 return GetEntry()->GetModelType(); 290 return GetEntry()->GetModelType();
291 } 291 }
292 292
293 const syncer::AttachmentIdList BaseNode::GetAttachmentIds() const {
294 // TODO(maniscalco): Once EntryKernel is capable of storing AttachmentIds,
295 // update this method to retrieve the list of AttachmentIds from read_node and
296 // pass it to CreateRemoteData (bug 348625).
297 return AttachmentIdList();
298 }
299
293 void BaseNode::SetUnencryptedSpecifics( 300 void BaseNode::SetUnencryptedSpecifics(
294 const sync_pb::EntitySpecifics& specifics) { 301 const sync_pb::EntitySpecifics& specifics) {
295 ModelType type = GetModelTypeFromSpecifics(specifics); 302 ModelType type = GetModelTypeFromSpecifics(specifics);
296 DCHECK_NE(UNSPECIFIED, type); 303 DCHECK_NE(UNSPECIFIED, type);
297 if (GetModelType() != UNSPECIFIED) { 304 if (GetModelType() != UNSPECIFIED) {
298 DCHECK_EQ(GetModelType(), type); 305 DCHECK_EQ(GetModelType(), type);
299 } 306 }
300 unencrypted_data_.CopyFrom(specifics); 307 unencrypted_data_.CopyFrom(specifics);
301 } 308 }
302 309
303 } // namespace syncer 310 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/api/sync_data_unittest.cc ('k') | sync/internal_api/public/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698