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

Unified Diff: chromeos/dbus/ibus/ibus_engine_service.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
Index: chromeos/dbus/ibus/ibus_engine_service.cc
diff --git a/chromeos/dbus/ibus/ibus_engine_service.cc b/chromeos/dbus/ibus/ibus_engine_service.cc
index c7ec1ae8309ea3e0ba3bc4330e3e5876291865fb..81d37c81d0a9c419c119e61b382f4d10c57a61d4 100644
--- a/chromeos/dbus/ibus/ibus_engine_service.cc
+++ b/chromeos/dbus/ibus/ibus_engine_service.cc
@@ -232,8 +232,7 @@ class IBusEngineServiceImpl : public IBusEngineService {
if (engine_handler_ == NULL)
return;
engine_handler_->FocusIn();
- dbus::Response* response = dbus::Response::FromMethodCall(method_call);
- response_sender.Run(response);
+ response_sender.Run(dbus::Response::FromMethodCall(method_call));
}
// Handles FocusOut method call from ibus-daemon.
@@ -242,8 +241,7 @@ class IBusEngineServiceImpl : public IBusEngineService {
if (engine_handler_ == NULL)
return;
engine_handler_->FocusOut();
- dbus::Response* response = dbus::Response::FromMethodCall(method_call);
- response_sender.Run(response);
+ response_sender.Run(dbus::Response::FromMethodCall(method_call));
}
// Handles Enable method call from ibus-daemon.
@@ -252,8 +250,7 @@ class IBusEngineServiceImpl : public IBusEngineService {
if (engine_handler_ == NULL)
return;
engine_handler_->Enable();
- dbus::Response* response = dbus::Response::FromMethodCall(method_call);
- response_sender.Run(response);
+ response_sender.Run(dbus::Response::FromMethodCall(method_call));
}
// Handles Disable method call from ibus-daemon.
@@ -262,8 +259,7 @@ class IBusEngineServiceImpl : public IBusEngineService {
if (engine_handler_ == NULL)
return;
engine_handler_->Disable();
- dbus::Response* response = dbus::Response::FromMethodCall(method_call);
- response_sender.Run(response);
+ response_sender.Run(dbus::Response::FromMethodCall(method_call));
}
// Handles PropertyActivate method call from ibus-daemon.
@@ -287,8 +283,7 @@ class IBusEngineServiceImpl : public IBusEngineService {
engine_handler_->PropertyActivate(
property_name,
static_cast<ibus::IBusPropertyState>(property_state));
- dbus::Response* response = dbus::Response::FromMethodCall(method_call);
- response_sender.Run(response);
+ response_sender.Run(dbus::Response::FromMethodCall(method_call));
}
// Handles PropertyShow method call from ibus-daemon.
@@ -304,8 +299,7 @@ class IBusEngineServiceImpl : public IBusEngineService {
return;
}
engine_handler_->PropertyShow(property_name);
- dbus::Response* response = dbus::Response::FromMethodCall(method_call);
- response_sender.Run(response);
+ response_sender.Run(dbus::Response::FromMethodCall(method_call));
}
// Handles PropertyHide method call from ibus-daemon.
@@ -321,8 +315,7 @@ class IBusEngineServiceImpl : public IBusEngineService {
return;
}
engine_handler_->PropertyHide(property_name);
- dbus::Response* response = dbus::Response::FromMethodCall(method_call);
- response_sender.Run(response);
+ response_sender.Run(dbus::Response::FromMethodCall(method_call));
}
// Handles SetCapability method call from ibus-daemon.
@@ -339,8 +332,7 @@ class IBusEngineServiceImpl : public IBusEngineService {
}
engine_handler_->SetCapability(
static_cast<IBusEngineHandlerInterface::IBusCapability>(capability));
- dbus::Response* response = dbus::Response::FromMethodCall(method_call);
- response_sender.Run(response);
+ response_sender.Run(dbus::Response::FromMethodCall(method_call));
}
void Reset(dbus::MethodCall* method_call,
@@ -348,8 +340,7 @@ class IBusEngineServiceImpl : public IBusEngineService {
if (engine_handler_ == NULL)
return;
engine_handler_->Reset();
- dbus::Response* response = dbus::Response::FromMethodCall(method_call);
- response_sender.Run(response);
+ response_sender.Run(dbus::Response::FromMethodCall(method_call));
}
// Handles ProcessKeyEvent method call from ibus-daemon.
@@ -380,19 +371,18 @@ class IBusEngineServiceImpl : public IBusEngineService {
keysym, keycode, state,
base::Bind(&IBusEngineServiceImpl::KeyEventDone,
weak_ptr_factory_.GetWeakPtr(),
- base::Unretained(
- dbus::Response::FromMethodCall(method_call)),
+ base::Passed(dbus::Response::FromMethodCall(method_call)),
response_sender));
}
- void KeyEventDone(dbus::Response* response,
+ void KeyEventDone(scoped_ptr<dbus::Response> response,
const dbus::ExportedObject::ResponseSender& response_sender,
bool consume) {
if (engine_handler_ == NULL)
return;
- dbus::MessageWriter writer(response);
+ dbus::MessageWriter writer(response.get());
writer.AppendBool(consume);
- response_sender.Run(response);
+ response_sender.Run(response.Pass());
}
// Handles CandidateClicked method call from ibus-daemon.
@@ -423,8 +413,7 @@ class IBusEngineServiceImpl : public IBusEngineService {
index,
static_cast<ibus::IBusMouseButton>(button),
state);
- dbus::Response* response = dbus::Response::FromMethodCall(method_call);
- response_sender.Run(response);
+ response_sender.Run(dbus::Response::FromMethodCall(method_call));
}
// Handles SetSurroundingText method call from ibus-daemon.
@@ -454,8 +443,7 @@ class IBusEngineServiceImpl : public IBusEngineService {
}
engine_handler_->SetSurroundingText(text, cursor_pos, anchor_pos);
- dbus::Response* response = dbus::Response::FromMethodCall(method_call);
- response_sender.Run(response);
+ response_sender.Run(dbus::Response::FromMethodCall(method_call));
}
// Called when the method call is exported.
« no previous file with comments | « chromeos/dbus/ibus/ibus_engine_factory_service_unittest.cc ('k') | chromeos/dbus/ibus/ibus_engine_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698