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

Side by Side 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, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/geolocation/wifi_data_provider_linux.cc ('k') | dbus/message.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef DBUS_MESSAGE_H_ 5 #ifndef DBUS_MESSAGE_H_
6 #define DBUS_MESSAGE_H_ 6 #define DBUS_MESSAGE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 #include <dbus/dbus.h> 10 #include <dbus/dbus.h>
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 bool PopStruct(MessageReader* sub_reader); 401 bool PopStruct(MessageReader* sub_reader);
402 bool PopDictEntry(MessageReader* sub_reader); 402 bool PopDictEntry(MessageReader* sub_reader);
403 bool PopVariant(MessageReader* sub_reader); 403 bool PopVariant(MessageReader* sub_reader);
404 404
405 // Gets the array of bytes at the current iterator position. 405 // Gets the array of bytes at the current iterator position.
406 // Returns true and advances the iterator on success. 406 // Returns true and advances the iterator on success.
407 // 407 //
408 // Arrays of bytes are often used for exchanging binary blobs hence it's 408 // Arrays of bytes are often used for exchanging binary blobs hence it's
409 // worth having a specialized function. 409 // worth having a specialized function.
410 // 410 //
411 // |bytes| must be copied if the contents will be referenced after the 411 // Ownership of the memory pointed to by |bytes| remains with the
412 // MessageReader is destroyed. 412 // MessageReader; |bytes| must be copied if the contents will be referenced
413 bool PopArrayOfBytes(uint8** bytes, size_t* length); 413 // after the MessageReader is destroyed.
414 bool PopArrayOfBytes(const uint8** bytes, size_t* length);
414 415
415 // Gets the array of strings at the current iterator position. 416 // Gets the array of strings at the current iterator position. |strings| is
416 // Returns true and advances the iterator on success. 417 // cleared before being modified. Returns true and advances the iterator on
418 // success.
417 // 419 //
418 // Arrays of strings are often used to communicate with D-Bus 420 // Arrays of strings are often used to communicate with D-Bus
419 // services like KWallet, hence it's worth having a specialized 421 // services like KWallet, hence it's worth having a specialized
420 // function. 422 // function.
421 bool PopArrayOfStrings(std::vector<std::string>* strings); 423 bool PopArrayOfStrings(std::vector<std::string>* strings);
422 424
423 // Gets the array of object paths at the current iterator position. 425 // Gets the array of object paths at the current iterator position.
424 // Returns true and advances the iterator on success. 426 // |object_paths| is cleared before being modified. Returns true and advances
427 // the iterator on success.
425 // 428 //
426 // Arrays of object paths are often used to communicate with D-Bus 429 // Arrays of object paths are often used to communicate with D-Bus
427 // services like NetworkManager, hence it's worth having a specialized 430 // services like NetworkManager, hence it's worth having a specialized
428 // function. 431 // function.
429 bool PopArrayOfObjectPaths(std::vector<ObjectPath>* object_paths); 432 bool PopArrayOfObjectPaths(std::vector<ObjectPath>* object_paths);
430 433
431 // Gets the array of bytes at the current iterator position. It then parses 434 // Gets the array of bytes at the current iterator position. It then parses
432 // this binary blob into the protocol buffer supplied. 435 // this binary blob into the protocol buffer supplied.
433 // Returns true and advances the iterator on success. On failure returns false 436 // Returns true and advances the iterator on success. On failure returns false
434 // and emits an error message on the source of the failure. The two most 437 // and emits an error message on the source of the failure. The two most
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 479
477 Message* message_; 480 Message* message_;
478 DBusMessageIter raw_message_iter_; 481 DBusMessageIter raw_message_iter_;
479 482
480 DISALLOW_COPY_AND_ASSIGN(MessageReader); 483 DISALLOW_COPY_AND_ASSIGN(MessageReader);
481 }; 484 };
482 485
483 } // namespace dbus 486 } // namespace dbus
484 487
485 #endif // DBUS_MESSAGE_H_ 488 #endif // DBUS_MESSAGE_H_
OLDNEW
« 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