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

Side by Side Diff: chromeos/cryptohome/cryptohome_parameters.cc

Issue 1540803002: Switch to standard integer types in chromeos/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more includes Created 5 years 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 | « chromeos/cryptohome/cryptohome_parameters.h ('k') | chromeos/cryptohome/cryptohome_util.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 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 "chromeos/cryptohome/cryptohome_parameters.h" 5 #include "chromeos/cryptohome/cryptohome_parameters.h"
6 6
7 #include <stddef.h>
8 #include <stdint.h>
9
7 #include "chromeos/dbus/cryptohome/key.pb.h" 10 #include "chromeos/dbus/cryptohome/key.pb.h"
8 11
9 namespace cryptohome { 12 namespace cryptohome {
10 13
11 Identification::Identification(const std::string& user_id) : user_id(user_id) { 14 Identification::Identification(const std::string& user_id) : user_id(user_id) {
12 } 15 }
13 16
14 bool Identification::operator==(const Identification& other) const { 17 bool Identification::operator==(const Identification& other) const {
15 return user_id == other.user_id; 18 return user_id == other.user_id;
16 } 19 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 KeyDefinition::ProviderData::ProviderData() { 77 KeyDefinition::ProviderData::ProviderData() {
75 } 78 }
76 79
77 KeyDefinition::ProviderData::ProviderData(const std::string& name) 80 KeyDefinition::ProviderData::ProviderData(const std::string& name)
78 : name(name) { 81 : name(name) {
79 } 82 }
80 83
81 KeyDefinition::ProviderData::ProviderData(const ProviderData& other) 84 KeyDefinition::ProviderData::ProviderData(const ProviderData& other)
82 : name(other.name) { 85 : name(other.name) {
83 if (other.number) 86 if (other.number)
84 number.reset(new int64(*other.number)); 87 number.reset(new int64_t(*other.number));
85 if (other.bytes) 88 if (other.bytes)
86 bytes.reset(new std::string(*other.bytes)); 89 bytes.reset(new std::string(*other.bytes));
87 } 90 }
88 91
89 KeyDefinition::ProviderData::ProviderData(const std::string& name, int64 number) 92 KeyDefinition::ProviderData::ProviderData(const std::string& name,
90 : name(name), 93 int64_t number)
91 number(new int64(number)) { 94 : name(name), number(new int64_t(number)) {}
92 }
93 95
94 KeyDefinition::ProviderData::ProviderData(const std::string& name, 96 KeyDefinition::ProviderData::ProviderData(const std::string& name,
95 const std::string& bytes) 97 const std::string& bytes)
96 : name(name), 98 : name(name),
97 bytes(new std::string(bytes)) { 99 bytes(new std::string(bytes)) {
98 } 100 }
99 101
100 void KeyDefinition::ProviderData::operator=(const ProviderData& other) { 102 void KeyDefinition::ProviderData::operator=(const ProviderData& other) {
101 name = other.name; 103 name = other.name;
102 number.reset(other.number ? new int64(*other.number) : NULL); 104 number.reset(other.number ? new int64_t(*other.number) : NULL);
103 bytes.reset(other.bytes ? new std::string(*other.bytes) : NULL); 105 bytes.reset(other.bytes ? new std::string(*other.bytes) : NULL);
104 } 106 }
105 107
106 KeyDefinition::ProviderData::~ProviderData() { 108 KeyDefinition::ProviderData::~ProviderData() {
107 } 109 }
108 110
109 bool KeyDefinition::ProviderData::operator==(const ProviderData& other) const { 111 bool KeyDefinition::ProviderData::operator==(const ProviderData& other) const {
110 const bool has_number = number; 112 const bool has_number = number;
111 const bool other_has_number = other.number; 113 const bool other_has_number = other.number;
112 const bool has_bytes = bytes; 114 const bool has_bytes = bytes;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 177 }
176 178
177 bool MountParameters::operator==(const MountParameters& other) const { 179 bool MountParameters::operator==(const MountParameters& other) const {
178 return ephemeral == other.ephemeral && create_keys == other.create_keys; 180 return ephemeral == other.ephemeral && create_keys == other.create_keys;
179 } 181 }
180 182
181 MountParameters::~MountParameters() { 183 MountParameters::~MountParameters() {
182 } 184 }
183 185
184 } // namespace cryptohome 186 } // namespace cryptohome
OLDNEW
« no previous file with comments | « chromeos/cryptohome/cryptohome_parameters.h ('k') | chromeos/cryptohome/cryptohome_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698