| 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 "chromeos/cryptohome/cryptohome_parameters.h" | 5 #include "chromeos/cryptohome/cryptohome_parameters.h" |
| 6 | 6 |
| 7 #include "chromeos/dbus/cryptohome/key.pb.h" | 7 #include "chromeos/dbus/cryptohome/key.pb.h" |
| 8 | 8 |
| 9 namespace cryptohome { | 9 namespace cryptohome { |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 | 80 |
| 81 KeyDefinition::ProviderData::ProviderData(const ProviderData& other) | 81 KeyDefinition::ProviderData::ProviderData(const ProviderData& other) |
| 82 : name(other.name) { | 82 : name(other.name) { |
| 83 if (other.number) | 83 if (other.number) |
| 84 number.reset(new int64(*other.number)); | 84 number.reset(new int64(*other.number)); |
| 85 if (other.bytes) | 85 if (other.bytes) |
| 86 bytes.reset(new std::string(*other.bytes)); | 86 bytes.reset(new std::string(*other.bytes)); |
| 87 } | 87 } |
| 88 | 88 |
| 89 KeyDefinition::ProviderData::ProviderData(const std::string& name, int64 number) |
| 90 : name(name), |
| 91 number(new int64(number)) { |
| 92 } |
| 93 |
| 94 KeyDefinition::ProviderData::ProviderData(const std::string& name, |
| 95 const std::string& bytes) |
| 96 : name(name), |
| 97 bytes(new std::string(bytes)) { |
| 98 } |
| 99 |
| 89 void KeyDefinition::ProviderData::operator=(const ProviderData& other) { | 100 void KeyDefinition::ProviderData::operator=(const ProviderData& other) { |
| 90 name = other.name; | 101 name = other.name; |
| 91 number.reset(other.number ? new int64(*other.number) : NULL); | 102 number.reset(other.number ? new int64(*other.number) : NULL); |
| 92 bytes.reset(other.bytes ? new std::string(*other.bytes) : NULL); | 103 bytes.reset(other.bytes ? new std::string(*other.bytes) : NULL); |
| 93 } | 104 } |
| 94 | 105 |
| 95 KeyDefinition::ProviderData::~ProviderData() { | 106 KeyDefinition::ProviderData::~ProviderData() { |
| 96 } | 107 } |
| 97 | 108 |
| 98 bool KeyDefinition::ProviderData::operator==(const ProviderData& other) const { | 109 bool KeyDefinition::ProviderData::operator==(const ProviderData& other) const { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 175 } |
| 165 | 176 |
| 166 bool MountParameters::operator==(const MountParameters& other) const { | 177 bool MountParameters::operator==(const MountParameters& other) const { |
| 167 return ephemeral == other.ephemeral && create_keys == other.create_keys; | 178 return ephemeral == other.ephemeral && create_keys == other.create_keys; |
| 168 } | 179 } |
| 169 | 180 |
| 170 MountParameters::~MountParameters() { | 181 MountParameters::~MountParameters() { |
| 171 } | 182 } |
| 172 | 183 |
| 173 } // namespace cryptohome | 184 } // namespace cryptohome |
| OLD | NEW |