diff options
author | yuki@chromium.org <yuki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-07 09:46:24 +0000 |
---|---|---|
committer | yuki@chromium.org <yuki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-07 09:46:24 +0000 |
commit | 9b25d4557040da82c582d7dca22bc7a334a97f48 (patch) | |
tree | 4abc6ffa62f5cb58262d182843aade883eaed1e5 /dbus/exported_object.h | |
parent | d43177fa5c889a451b6a033c970a7e25bcb6ad37 (diff) | |
download | chromium_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/exported_object.h')
-rw-r--r-- | dbus/exported_object.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/dbus/exported_object.h b/dbus/exported_object.h index 4e74ddb..89a4133 100644 --- a/dbus/exported_object.h +++ b/dbus/exported_object.h @@ -41,12 +41,7 @@ class CHROME_DBUS_EXPORT ExportedObject // Called to send a response from an exported method. |response| is the // response message. Callers should pass NULL in the event of an error that // prevents the sending of a response. - // - // ResponseSender takes ownership of |response| hence client code should - // not delete |response|. - // TODO(satorux): Change this to take scoped_ptr<Response> to make - // ownership clearer. crbug.com/163231 - typedef base::Callback<void (Response* response)> ResponseSender; + typedef base::Callback<void (scoped_ptr<Response> response)> ResponseSender; // Called when an exported method is called. |method_call| is the request // message. |sender| is the callback that's used to send a response. @@ -134,20 +129,20 @@ class CHROME_DBUS_EXPORT ExportedObject // Runs the method. Helper function for HandleMessage(). void RunMethod(MethodCallCallback method_call_callback, - MethodCall* method_call, + scoped_ptr<MethodCall> method_call, base::TimeTicks start_time); // Callback invoked by service provider to send a response to a method call. // Can be called immediately from a MethodCallCallback to implement a // synchronous service or called later to implement an asynchronous service. void SendResponse(base::TimeTicks start_time, - MethodCall* method_call, - Response* response); + scoped_ptr<MethodCall> method_call, + scoped_ptr<Response> response); // Called on completion of the method run from SendResponse(). // Takes ownership of |method_call| and |response|. - void OnMethodCompleted(MethodCall* method_call, - Response* response, + void OnMethodCompleted(scoped_ptr<MethodCall> method_call, + scoped_ptr<Response> response, base::TimeTicks start_time); // Called when the object is unregistered. |