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

Unified Diff: content/browser/geolocation/wifi_data_provider_linux.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: content/browser/geolocation/wifi_data_provider_linux.cc
diff --git a/content/browser/geolocation/wifi_data_provider_linux.cc b/content/browser/geolocation/wifi_data_provider_linux.cc
index 6e5d54eac2d36fe8a1c97dcf62141318a19de705..fc4a30f8da53db158a526037e14a4a5e4da79b8a 100644
--- a/content/browser/geolocation/wifi_data_provider_linux.cc
+++ b/content/browser/geolocation/wifi_data_provider_linux.cc
@@ -67,10 +67,11 @@ class NetworkManagerWlanApi : public WifiDataProviderCommon::WlanApiInterface {
WifiData::AccessPointDataSet* data);
// Internal method used by |GetAccessPointsForAdapter|, given a wifi access
- // point proxy retrieves the named property and returns it. Returns NULL if
- // the property could not be read.
- dbus::Response* GetAccessPointProperty(dbus::ObjectProxy* proxy,
- const std::string& property_name);
+ // point proxy retrieves the named property and returns it. Returns NULL in
+ // a scoped_ptr if the property could not be read.
+ scoped_ptr<dbus::Response> GetAccessPointProperty(
+ dbus::ObjectProxy* proxy,
+ const std::string& property_name);
scoped_refptr<dbus::Bus> system_bus_;
dbus::ObjectProxy* network_manager_proxy_;
@@ -324,20 +325,20 @@ bool NetworkManagerWlanApi::GetAccessPointsForAdapter(
return true;
}
-dbus::Response* NetworkManagerWlanApi::GetAccessPointProperty(
+scoped_ptr<dbus::Response> NetworkManagerWlanApi::GetAccessPointProperty(
dbus::ObjectProxy* access_point_proxy,
const std::string& property_name) {
dbus::MethodCall method_call(DBUS_INTERFACE_PROPERTIES, "Get");
dbus::MessageWriter builder(&method_call);
builder.AppendString("org.freedesktop.NetworkManager.AccessPoint");
builder.AppendString(property_name);
- dbus::Response* response = access_point_proxy->CallMethodAndBlock(
+ scoped_ptr<dbus::Response> response = access_point_proxy->CallMethodAndBlock(
&method_call,
dbus::ObjectProxy::TIMEOUT_USE_DEFAULT);
- if (!response) {
+ if (!response.get()) {
LOG(WARNING) << "Failed to get property for " << property_name;
}
- return response;
+ return response.Pass();
}
} // namespace
« no previous file with comments | « chromeos/dbus/shill_client_unittest_base.cc ('k') | content/browser/geolocation/wifi_data_provider_linux_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698