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

Unified Diff: chromeos/dbus/blocking_method_caller.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 | « chromeos/dbus/blocking_method_caller.h ('k') | chromeos/dbus/blocking_method_caller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/blocking_method_caller.cc
diff --git a/chromeos/dbus/blocking_method_caller.cc b/chromeos/dbus/blocking_method_caller.cc
index 91c796c3a3bd1afc79e334b9629705951b7e26ed..5fc0c9a7cd81e2fe7d111737ff18d1575ec738b8 100644
--- a/chromeos/dbus/blocking_method_caller.cc
+++ b/chromeos/dbus/blocking_method_caller.cc
@@ -15,7 +15,7 @@ namespace {
// This function is a part of CallMethodAndBlock implementation.
void CallMethodAndBlockInternal(
- dbus::Response** response,
+ scoped_ptr<dbus::Response>* response,
base::ScopedClosureRunner* signaler,
dbus::ObjectProxy* proxy,
dbus::MethodCall* method_call) {
@@ -36,7 +36,7 @@ BlockingMethodCaller::BlockingMethodCaller(dbus::Bus* bus,
BlockingMethodCaller::~BlockingMethodCaller() {
}
-dbus::Response* BlockingMethodCaller::CallMethodAndBlock(
+scoped_ptr<dbus::Response> BlockingMethodCaller::CallMethodAndBlock(
dbus::MethodCall* method_call) {
// on_blocking_method_call_->Signal() will be called when |signaler| is
// destroyed.
@@ -46,7 +46,7 @@ dbus::Response* BlockingMethodCaller::CallMethodAndBlock(
base::ScopedClosureRunner* signaler =
new base::ScopedClosureRunner(signal_task);
- dbus::Response* response = NULL;
+ scoped_ptr<dbus::Response> response;
bus_->PostTaskToDBusThread(
FROM_HERE,
base::Bind(&CallMethodAndBlockInternal,
@@ -57,7 +57,7 @@ dbus::Response* BlockingMethodCaller::CallMethodAndBlock(
// http://crbug.com/125360
base::ThreadRestrictions::ScopedAllowWait allow_wait;
on_blocking_method_call_.Wait();
- return response;
+ return response.Pass();
}
} // namespace chromeos
« no previous file with comments | « chromeos/dbus/blocking_method_caller.h ('k') | chromeos/dbus/blocking_method_caller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698