summaryrefslogtreecommitdiffstats
path: root/dbus/message.h
diff options
context:
space:
mode:
authoryuki@chromium.org <yuki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-07 09:46:24 +0000
committeryuki@chromium.org <yuki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-07 09:46:24 +0000
commit9b25d4557040da82c582d7dca22bc7a334a97f48 (patch)
tree4abc6ffa62f5cb58262d182843aade883eaed1e5 /dbus/message.h
parentd43177fa5c889a451b6a033c970a7e25bcb6ad37 (diff)
downloadchromium_src-9b25d4557040da82c582d7dca22bc7a334a97f48.zip
chromium_src-9b25d4557040da82c582d7dca22bc7a334a97f48.tar.gz
chromium_src-9b25d4557040da82c582d7dca22bc7a334a97f48.tar.bz2
Code cleaning: Uses scoped_ptr<> to express ownership rather than writing ownership in comments.
Replaces Response* with scoped_ptr<Response> in dbus code and its related code. BUG=163231 TEST=no regression / no behavior changes Review URL: https://chromiumcodereview.appspot.com/12092061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181266 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus/message.h')
-rw-r--r--dbus/message.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/dbus/message.h b/dbus/message.h
index 42d6860..54ca036 100644
--- a/dbus/message.h
+++ b/dbus/message.h
@@ -10,6 +10,7 @@
#include <dbus/dbus.h>
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
#include "dbus/dbus_export.h"
#include "dbus/file_descriptor.h"
#include "dbus/object_path.h"
@@ -200,18 +201,17 @@ class CHROME_DBUS_EXPORT Signal : public Message {
class CHROME_DBUS_EXPORT Response : public Message {
public:
// Returns a newly created Response from the given raw message of the
- // type DBUS_MESSAGE_TYPE_METHOD_RETURN. The caller must delete the
- // returned object. Takes the ownership of |raw_message|.
- static Response* FromRawMessage(DBusMessage* raw_message);
+ // type DBUS_MESSAGE_TYPE_METHOD_RETURN. Takes the ownership of |raw_message|.
+ static scoped_ptr<Response> FromRawMessage(DBusMessage* raw_message);
- // Returns a newly created Response from the given method call. The
- // caller must delete the returned object. Used for implementing
- // exported methods.
- static Response* FromMethodCall(MethodCall* method_call);
+ // Returns a newly created Response from the given method call.
+ // Used for implementing exported methods. Does NOT take the ownership of
+ // |method_call|.
+ static scoped_ptr<Response> FromMethodCall(MethodCall* method_call);
- // Returns a newly created Response with an empty payload. The caller
- // must delete the returned object. Useful for testing.
- static Response* CreateEmpty();
+ // Returns a newly created Response with an empty payload.
+ // Useful for testing.
+ static scoped_ptr<Response> CreateEmpty();
protected:
// Creates a Response message. The internal raw message is NULL.
@@ -226,17 +226,17 @@ class CHROME_DBUS_EXPORT Response : public Message {
class CHROME_DBUS_EXPORT ErrorResponse: public Response {
public:
// Returns a newly created Response from the given raw message of the
- // type DBUS_MESSAGE_TYPE_METHOD_RETURN. The caller must delete the
- // returned object. Takes the ownership of |raw_message|.
- static ErrorResponse* FromRawMessage(DBusMessage* raw_message);
+ // type DBUS_MESSAGE_TYPE_METHOD_RETURN. Takes the ownership of |raw_message|.
+ static scoped_ptr<ErrorResponse> FromRawMessage(DBusMessage* raw_message);
// Returns a newly created ErrorResponse from the given method call, the
// error name, and the error message. The error name looks like
// "org.freedesktop.DBus.Error.Failed". Used for returning an error to a
- // failed method call.
- static ErrorResponse* FromMethodCall(MethodCall* method_call,
- const std::string& error_name,
- const std::string& error_message);
+ // failed method call. Does NOT take the ownership of |method_call|.
+ static scoped_ptr<ErrorResponse> FromMethodCall(
+ MethodCall* method_call,
+ const std::string& error_name,
+ const std::string& error_message);
private:
// Creates an ErrorResponse message. The internal raw message is NULL.