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

Unified Diff: chromeos/dbus/cryptohome_client.cc

Issue 176693003: chromeos: Make dbus::MessageReader memory ownership explicit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unnecessary reinterpret_cast Created 6 years, 10 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
Index: chromeos/dbus/cryptohome_client.cc
diff --git a/chromeos/dbus/cryptohome_client.cc b/chromeos/dbus/cryptohome_client.cc
index f0bbd18f5dbfbd65dee39f1fd2a79291d9861f9b..c58ea2098c670e5c256af4d0b1383bc056f192e3 100644
--- a/chromeos/dbus/cryptohome_client.cc
+++ b/chromeos/dbus/cryptohome_client.cc
@@ -357,7 +357,7 @@ class CryptohomeClientImpl : public CryptohomeClient {
if (!response.get())
return false;
dbus::MessageReader reader(response.get());
- uint8* bytes = NULL;
+ const uint8* bytes = NULL;
size_t length = 0;
if (!reader.PopArrayOfBytes(&bytes, &length) ||
!reader.PopBool(successful))
@@ -737,7 +737,7 @@ class CryptohomeClientImpl : public CryptohomeClient {
return;
}
dbus::MessageReader reader(response);
- uint8* bytes = NULL;
+ const uint8* bytes = NULL;
size_t length = 0;
if (!reader.PopArrayOfBytes(&bytes, &length)) {
callback.Run(DBUS_METHOD_CALL_FAILURE, std::vector<uint8>());
@@ -827,7 +827,7 @@ class CryptohomeClientImpl : public CryptohomeClient {
return;
}
dbus::MessageReader reader(response);
- uint8* data_buffer = NULL;
+ const uint8* data_buffer = NULL;
size_t data_length = 0;
bool result = false;
if (!reader.PopArrayOfBytes(&data_buffer, &data_length) ||
@@ -835,7 +835,7 @@ class CryptohomeClientImpl : public CryptohomeClient {
callback.Run(DBUS_METHOD_CALL_FAILURE, false, std::string());
return;
}
- std::string data(reinterpret_cast<char*>(data_buffer), data_length);
+ std::string data(reinterpret_cast<const char*>(data_buffer), data_length);
callback.Run(DBUS_METHOD_CALL_SUCCESS, result, data);
}
@@ -900,7 +900,7 @@ class CryptohomeClientImpl : public CryptohomeClient {
dbus::MessageReader reader(signal);
int async_id = 0;
bool return_status = false;
- uint8* return_data_buffer = NULL;
+ const uint8* return_data_buffer = NULL;
size_t return_data_length = 0;
if (!reader.PopInt32(&async_id) ||
!reader.PopBool(&return_status) ||
@@ -909,7 +909,7 @@ class CryptohomeClientImpl : public CryptohomeClient {
return;
}
if (!async_call_status_data_handler_.is_null()) {
- std::string return_data(reinterpret_cast<char*>(return_data_buffer),
+ std::string return_data(reinterpret_cast<const char*>(return_data_buffer),
return_data_length);
async_call_status_data_handler_.Run(async_id, return_status, return_data);
}
« no previous file with comments | « chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc ('k') | chromeos/dbus/debug_daemon_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698