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

Unified Diff: dbus/exported_object.h

Issue 12092061: Code cleaning: Uses scoped_ptr<> to express ownership rather than writing ownership in comments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added chrome/browser/password_manager/native_backend_kwallet_x_unitte\ Created 7 years, 11 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_unittest.cc ('k') | dbus/exported_object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/exported_object.h
diff --git a/dbus/exported_object.h b/dbus/exported_object.h
index 4e74ddbca84c3cca736be1e94eea349fa3dcc414..89a413385b8cecc69806729035387283efe4d26f 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.
« no previous file with comments | « content/browser/geolocation/wifi_data_provider_linux_unittest.cc ('k') | dbus/exported_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698