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

Unified Diff: chromeos/dbus/easy_unlock_client.cc

Issue 569813002: Minor cleanup in EasyUnlockClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 3 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/dbus/easy_unlock_client.h ('k') | chromeos/dbus/fake_easy_unlock_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/easy_unlock_client.cc
diff --git a/chromeos/dbus/easy_unlock_client.cc b/chromeos/dbus/easy_unlock_client.cc
index ea07f1c0937192eaa666cac0bf28415ed6112558..8d171a810173fb293c30e2a1b8a3c477c948633c 100644
--- a/chromeos/dbus/easy_unlock_client.cc
+++ b/chromeos/dbus/easy_unlock_client.cc
@@ -74,13 +74,7 @@ class EasyUnlockClientImpl : public EasyUnlockClient {
// EasyUnlockClient override.
virtual void CreateSecureMessage(const std::string& payload,
- const std::string& secret_key,
- const std::string& associated_data,
- const std::string& public_metadata,
- const std::string& verification_key_id,
- const std::string& decryption_key_id,
- const std::string& encryption_type,
- const std::string& signature_type,
+ const CreateSecureMessageOptions& options,
const DataCallback& callback) OVERRIDE {
dbus::MethodCall method_call(
easy_unlock::kEasyUnlockServiceInterface,
@@ -89,13 +83,13 @@ class EasyUnlockClientImpl : public EasyUnlockClient {
// NOTE: DBus expects that data sent as string is UTF-8 encoded. This is
// not guaranteed here, so the method uses byte arrays.
AppendStringAsByteArray(payload, &writer);
- AppendStringAsByteArray(secret_key, &writer);
- AppendStringAsByteArray(associated_data, &writer);
- AppendStringAsByteArray(public_metadata, &writer);
- AppendStringAsByteArray(verification_key_id, &writer);
- AppendStringAsByteArray(decryption_key_id, &writer);
- writer.AppendString(encryption_type);
- writer.AppendString(signature_type);
+ AppendStringAsByteArray(options.key, &writer);
+ AppendStringAsByteArray(options.associated_data, &writer);
+ AppendStringAsByteArray(options.public_metadata, &writer);
+ AppendStringAsByteArray(options.verification_key_id, &writer);
+ AppendStringAsByteArray(options.decryption_key_id, &writer);
+ writer.AppendString(options.encryption_type);
+ writer.AppendString(options.signature_type);
proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&EasyUnlockClientImpl::OnData,
weak_ptr_factory_.GetWeakPtr(),
@@ -104,10 +98,7 @@ class EasyUnlockClientImpl : public EasyUnlockClient {
// EasyUnlockClient override.
virtual void UnwrapSecureMessage(const std::string& message,
- const std::string& secret_key,
- const std::string& associated_data,
- const std::string& encryption_type,
- const std::string& signature_type,
+ const UnwrapSecureMessageOptions& options,
const DataCallback& callback) OVERRIDE {
dbus::MethodCall method_call(
easy_unlock::kEasyUnlockServiceInterface,
@@ -116,10 +107,10 @@ class EasyUnlockClientImpl : public EasyUnlockClient {
// NOTE: DBus expects that data sent as string is UTF-8 encoded. This is
// not guaranteed here, so the method uses byte arrays.
AppendStringAsByteArray(message, &writer);
- AppendStringAsByteArray(secret_key, &writer);
- AppendStringAsByteArray(associated_data, &writer);
- writer.AppendString(encryption_type);
- writer.AppendString(signature_type);
+ AppendStringAsByteArray(options.key, &writer);
+ AppendStringAsByteArray(options.associated_data, &writer);
+ writer.AppendString(options.encryption_type);
+ writer.AppendString(options.signature_type);
proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&EasyUnlockClientImpl::OnData,
weak_ptr_factory_.GetWeakPtr(),
@@ -174,6 +165,14 @@ class EasyUnlockClientImpl : public EasyUnlockClient {
} // namespace
+EasyUnlockClient::CreateSecureMessageOptions::CreateSecureMessageOptions() {}
+
+EasyUnlockClient::CreateSecureMessageOptions::~CreateSecureMessageOptions() {}
+
+EasyUnlockClient::UnwrapSecureMessageOptions::UnwrapSecureMessageOptions() {}
+
+EasyUnlockClient::UnwrapSecureMessageOptions::~UnwrapSecureMessageOptions() {}
+
EasyUnlockClient::EasyUnlockClient() {
}
« no previous file with comments | « chromeos/dbus/easy_unlock_client.h ('k') | chromeos/dbus/fake_easy_unlock_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698