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

Unified Diff: chromeos/cryptohome/cryptohome_parameters.cc

Issue 488633003: Switch CryptohomeAuthenticator from MountAsync() to MountEx() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/cryptohome/cryptohome_parameters.h ('k') | chromeos/login/auth/cryptohome_authenticator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/cryptohome/cryptohome_parameters.cc
diff --git a/chromeos/cryptohome/cryptohome_parameters.cc b/chromeos/cryptohome/cryptohome_parameters.cc
index 9444ee4e3079887a40cdbff72934ec8cdf6aec74..eb6d906b68089ef73daa988acc0ad453a53b6dbf 100644
--- a/chromeos/cryptohome/cryptohome_parameters.cc
+++ b/chromeos/cryptohome/cryptohome_parameters.cc
@@ -6,21 +6,57 @@
namespace cryptohome {
-Authorization::Authorization(const std::string& key, const std::string& label)
- : key(key), label(label) {}
-
-Authorization::Authorization(const KeyDefinition& key_def)
- : key(key_def.key), label(key_def.label) {}
-MountParameters::MountParameters(bool ephemeral) : ephemeral(ephemeral) {}
+Identification::Identification(const std::string& user_id) : user_id(user_id) {
+}
-MountParameters::~MountParameters() {}
+bool Identification::operator==(const Identification& other) const {
+ return user_id == other.user_id;
+}
KeyDefinition::KeyDefinition(const std::string& key,
const std::string& label,
int /*AuthKeyPrivileges*/ privileges)
- : label(label), revision(1), key(key), privileges(privileges) {}
+ : label(label),
+ revision(1),
+ key(key),
+ privileges(privileges) {
+}
+
+KeyDefinition::~KeyDefinition() {
+}
+
+bool KeyDefinition::operator==(const KeyDefinition& other) const {
+ return label == other.label &&
+ revision == other.revision &&
+ key == other.key &&
+ encryption_key == other.encryption_key &&
+ signature_key == other.signature_key &&
+ privileges == other.privileges;
+}
+
+Authorization::Authorization(const std::string& key, const std::string& label)
+ : key(key),
+ label(label) {
+}
+
+Authorization::Authorization(const KeyDefinition& key_def)
+ : key(key_def.key),
+ label(key_def.label) {
+}
+
+bool Authorization::operator==(const Authorization& other) const {
+ return key == other.key && label == other.label;
+}
+
+MountParameters::MountParameters(bool ephemeral) : ephemeral(ephemeral) {
+}
+
+MountParameters::~MountParameters() {
+}
-KeyDefinition::~KeyDefinition() {}
+bool MountParameters::operator==(const MountParameters& other) const {
+ return ephemeral == other.ephemeral && create_keys == other.create_keys;
+}
} // namespace cryptohome
« no previous file with comments | « chromeos/cryptohome/cryptohome_parameters.h ('k') | chromeos/login/auth/cryptohome_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698