Chromium Code Reviews| Index: dbus/exported_object.h |
| diff --git a/dbus/exported_object.h b/dbus/exported_object.h |
| index bc67bcdb6e5e3913f5865c579e632c0dfc7f44b6..c1e1e0c00a8c706eb957367767b0914bf1332c4b 100644 |
| --- a/dbus/exported_object.h |
| +++ b/dbus/exported_object.h |
| @@ -38,9 +38,15 @@ class ExportedObject : public base::RefCountedThreadSafe<ExportedObject> { |
| const std::string& service_name, |
| const std::string& object_path); |
| + // Called to send a response from an exported method. Response* is the |
| + // response message. |
|
satorux1
2011/11/22 06:20:05
Please describe that the export method should call
Vince Laviano
2011/11/22 22:10:17
Done.
|
| + typedef base::Callback<void (Response*)> SendResponseCallback; |
|
satorux1
2011/11/22 06:20:05
I suggested SendResponseCallback, but I'm now thin
Vince Laviano
2011/11/22 22:10:17
Done.
|
| + |
| // Called when an exported method is called. MethodCall* is the request |
| - // message. |
| - typedef base::Callback<Response* (MethodCall*)> MethodCallCallback; |
| + // message. SendResponseCallback is the callback that should be used to |
| + // send a response. |
| + typedef base::Callback<void (MethodCall*, SendResponseCallback)> |
| + MethodCallCallback; |
| // Called when method exporting is done. |
| // Parameters: |
| @@ -124,7 +130,14 @@ class ExportedObject : public base::RefCountedThreadSafe<ExportedObject> { |
| MethodCall* method_call, |
| base::TimeTicks start_time); |
| - // Called on completion of the method run from RunMethod(). |
| + // 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); |
| + |
| + // Called on completion of the method run from SendResponse(). |
| // Takes ownership of |method_call| and |response|. |
| void OnMethodCompleted(MethodCall* method_call, |
| Response* response, |