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

Unified Diff: dbus/exported_object.h

Issue 11416252: dbus: Add comments about object ownership (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « no previous file | no next file » | 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 9d3164fcca0e1974057dd47d687d04d017fc5f39..4e74ddbca84c3cca736be1e94eea349fa3dcc414 100644
--- a/dbus/exported_object.h
+++ b/dbus/exported_object.h
@@ -38,22 +38,29 @@ class CHROME_DBUS_EXPORT ExportedObject
// constructor.
ExportedObject(Bus* bus, const ObjectPath& object_path);
- // Called to send a response from an exported method. Response* is the
- // response message. Callers should pass a NULL Response* in the event
- // of an error that prevents the sending of a response.
- typedef base::Callback<void (Response*)> ResponseSender;
-
- // Called when an exported method is called. MethodCall* is the request
- // message. ResponseSender is the callback that should be used to send a
- // response.
- typedef base::Callback<void (MethodCall*, ResponseSender)> MethodCallCallback;
+ // 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;
+
+ // Called when an exported method is called. |method_call| is the request
+ // message. |sender| is the callback that's used to send a response.
+ //
+ // |method_call| is owned by ExportedObject, hence client code should not
+ // delete |method_call|.
+ typedef base::Callback<void (MethodCall* method_call, ResponseSender sender)>
+ MethodCallCallback;
// Called when method exporting is done.
- // Parameters:
- // - the interface name.
- // - the method name.
- // - whether exporting was successful or not.
- typedef base::Callback<void (const std::string&, const std::string&, bool)>
+ // |success| indicates whether exporting was successful or not.
+ typedef base::Callback<void (const std::string& interface_name,
+ const std::string& method_name,
+ bool success)>
OnExportedCallback;
// Exports the method specified by |interface_name| and |method_name|,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698