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

Side by Side Diff: components/sync/api/attachments/attachment_id.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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/api/attachments/attachment_id.h" 5 #include "components/sync/api/attachments/attachment_id.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "sync/internal_api/public/base/attachment_id_proto.h" 11 #include "components/sync/base/attachment_id_proto.h"
12 #include "sync/protocol/sync.pb.h" 12 #include "components/sync/protocol/sync.pb.h"
13 13
14 namespace syncer { 14 namespace syncer {
15 15
16 void AttachmentId::ImmutableAttachmentIdProtoTraits::InitializeWrapper( 16 void AttachmentId::ImmutableAttachmentIdProtoTraits::InitializeWrapper(
17 Wrapper* wrapper) { 17 Wrapper* wrapper) {
18 *wrapper = new sync_pb::AttachmentIdProto(); 18 *wrapper = new sync_pb::AttachmentIdProto();
19 } 19 }
20 20
21 void AttachmentId::ImmutableAttachmentIdProtoTraits::DestroyWrapper( 21 void AttachmentId::ImmutableAttachmentIdProtoTraits::DestroyWrapper(
22 Wrapper* wrapper) { 22 Wrapper* wrapper) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 AttachmentId AttachmentId::CreateFromProto( 64 AttachmentId AttachmentId::CreateFromProto(
65 const sync_pb::AttachmentIdProto& proto) { 65 const sync_pb::AttachmentIdProto& proto) {
66 sync_pb::AttachmentIdProto copy_of_proto(proto); 66 sync_pb::AttachmentIdProto copy_of_proto(proto);
67 return AttachmentId(&copy_of_proto); 67 return AttachmentId(&copy_of_proto);
68 } 68 }
69 69
70 const sync_pb::AttachmentIdProto& AttachmentId::GetProto() const { 70 const sync_pb::AttachmentIdProto& AttachmentId::GetProto() const {
71 return proto_.Get(); 71 return proto_.Get();
72 } 72 }
73 73
74 AttachmentId::AttachmentId(sync_pb::AttachmentIdProto* proto) 74 AttachmentId::AttachmentId(sync_pb::AttachmentIdProto* proto) : proto_(proto) {}
75 : proto_(proto) {}
76 75
77 AttachmentId::AttachmentId(const AttachmentId& other) = default; 76 AttachmentId::AttachmentId(const AttachmentId& other) = default;
78 77
79 size_t AttachmentId::GetSize() const { 78 size_t AttachmentId::GetSize() const {
80 return proto_.Get().size_bytes(); 79 return proto_.Get().size_bytes();
81 } 80 }
82 81
83 uint32_t AttachmentId::GetCrc32c() const { 82 uint32_t AttachmentId::GetCrc32c() const {
84 return proto_.Get().crc32c(); 83 return proto_.Get().crc32c();
85 } 84 }
86 85
87 } // namespace syncer 86 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/api/attachments/attachment_id.h ('k') | components/sync/api/attachments/attachment_id_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698