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

Unified Diff: dbus/object_proxy.cc

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 | « dbus/object_proxy.h ('k') | dbus/test_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/object_proxy.cc
diff --git a/dbus/object_proxy.cc b/dbus/object_proxy.cc
index b20f544c4b23cd5c2b294f97978fdd1a37692451..9a84f250c5ec512c72537273fd21cbd9354a4c17 100644
--- a/dbus/object_proxy.cc
+++ b/dbus/object_proxy.cc
@@ -63,14 +63,14 @@ ObjectProxy::~ObjectProxy() {
// Originally we tried to make |method_call| a const reference, but we
// gave up as dbus_connection_send_with_reply_and_block() takes a
// non-const pointer of DBusMessage as the second parameter.
-Response* ObjectProxy::CallMethodAndBlock(MethodCall* method_call,
- int timeout_ms) {
+scoped_ptr<Response> ObjectProxy::CallMethodAndBlock(MethodCall* method_call,
+ int timeout_ms) {
bus_->AssertOnDBusThread();
if (!bus_->Connect() ||
!method_call->SetDestination(service_name_) ||
!method_call->SetPath(object_path_))
- return NULL;
+ return scoped_ptr<Response>();
DBusMessage* request_message = method_call->raw_message();
@@ -93,7 +93,7 @@ Response* ObjectProxy::CallMethodAndBlock(MethodCall* method_call,
method_call->GetMember(),
error.is_set() ? error.name() : "unknown error type",
error.is_set() ? error.message() : "");
- return NULL;
+ return scoped_ptr<Response>();
}
// Record time spent for the method call. Don't include failures.
UMA_HISTOGRAM_TIMES("DBus.SyncMethodCallTime",
« no previous file with comments | « dbus/object_proxy.h ('k') | dbus/test_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698