diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-24 03:32:06 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-24 03:32:06 +0000 |
commit | 06ead8788ef8d9ea7e5db736d563a7fb25df059d (patch) | |
tree | 4ddbcc90d432a750f0458b63f2e7f1074d405e48 /dbus/object_proxy.h | |
parent | 313bbf5ef2c0a1c428e3d92847c1b4b665b71706 (diff) | |
download | chromium_src-06ead8788ef8d9ea7e5db736d563a7fb25df059d.zip chromium_src-06ead8788ef8d9ea7e5db736d563a7fb25df059d.tar.gz chromium_src-06ead8788ef8d9ea7e5db736d563a7fb25df059d.tar.bz2 |
Fix design shortcomings in Message classes.
- Prohibit to instantiate Message class.
Rationale: this is not corresponding to any D-Bus message types.
- Get rid of Message::reset_raw_message()
Rationale: this was breaking encapsulation. For instance, It was possible
to inject a DBUS_MESSAGE_TYPE_ERROR raw message to a MethodCall message,
which should not be allowed.
- Prohibit to instantiate Response/ErrorResponse with NULL raw message.
Rationale: Message objects should be backed up by valid raw messages.
- Change Object::CallMethodAndBlock() to return Response*.
Rationale: the original API requred a Response object with raw_message_ set
to NULL, which we no longer allow.
- Add message_type header to ToString().
BUG=90036
TEST=dbus_unittests
Review URL: http://codereview.chromium.org/7709009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97983 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus/object_proxy.h')
-rw-r--r-- | dbus/object_proxy.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/dbus/object_proxy.h b/dbus/object_proxy.h index 70e412df..ae9bd9a3 100644 --- a/dbus/object_proxy.h +++ b/dbus/object_proxy.h @@ -60,12 +60,11 @@ class ObjectProxy : public base::RefCountedThreadSafe<ObjectProxy> { OnConnectedCallback; // Calls the method of the remote object and blocks until the response - // is returned. + // is returned. Returns NULL on error. // // BLOCKING CALL. - virtual bool CallMethodAndBlock(MethodCall* method_call, - int timeout_ms, - Response* response); + virtual Response* CallMethodAndBlock(MethodCall* method_call, + int timeout_ms); // Requests to call the method of the remote object. // @@ -132,7 +131,7 @@ class ObjectProxy : public base::RefCountedThreadSafe<ObjectProxy> { // Runs the response callback with the given response object. void RunResponseCallback(ResponseCallback response_callback, - Response* response); + void* response_message); // Redirects the function call to OnPendingCallIsComplete(). static void OnPendingCallIsCompleteThunk(DBusPendingCall* pending_call, |