OLD | NEW |
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 Loading... |
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(©_of_proto); | 67 return AttachmentId(©_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 |
OLD | NEW |