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

Unified Diff: dbus/message.h

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
« no previous file with comments | « content/browser/geolocation/wifi_data_provider_linux.cc ('k') | dbus/message.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/message.h
diff --git a/dbus/message.h b/dbus/message.h
index 54ca036cceb90fdd8584f518f3fdbda20c5bc202..db3456acd0cd2aadb81fe76ed239f7de5bdc4b03 100644
--- a/dbus/message.h
+++ b/dbus/message.h
@@ -408,12 +408,14 @@ class CHROME_DBUS_EXPORT MessageReader {
// Arrays of bytes are often used for exchanging binary blobs hence it's
// worth having a specialized function.
//
- // |bytes| must be copied if the contents will be referenced after the
- // MessageReader is destroyed.
- bool PopArrayOfBytes(uint8** bytes, size_t* length);
-
- // Gets the array of strings at the current iterator position.
- // Returns true and advances the iterator on success.
+ // Ownership of the memory pointed to by |bytes| remains with the
+ // MessageReader; |bytes| must be copied if the contents will be referenced
+ // after the MessageReader is destroyed.
+ bool PopArrayOfBytes(const uint8** bytes, size_t* length);
+
+ // Gets the array of strings at the current iterator position. |strings| is
+ // cleared before being modified. Returns true and advances the iterator on
+ // success.
//
// Arrays of strings are often used to communicate with D-Bus
// services like KWallet, hence it's worth having a specialized
@@ -421,7 +423,8 @@ class CHROME_DBUS_EXPORT MessageReader {
bool PopArrayOfStrings(std::vector<std::string>* strings);
// Gets the array of object paths at the current iterator position.
- // Returns true and advances the iterator on success.
+ // |object_paths| is cleared before being modified. Returns true and advances
+ // the iterator on success.
//
// Arrays of object paths are often used to communicate with D-Bus
// services like NetworkManager, hence it's worth having a specialized
« no previous file with comments | « content/browser/geolocation/wifi_data_provider_linux.cc ('k') | dbus/message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698