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

Side by Side Diff: device/battery/battery_status_manager_linux.cc

Issue 1544323002: Convert Pass()→std::move() in //device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « device/battery/battery_monitor_impl.cc ('k') | device/battery/battery_status_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/battery/battery_status_manager_linux.h" 5 #include "device/battery/battery_status_manager_linux.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 ignore_result(value.release()); 78 ignore_result(value.release());
79 return scoped_ptr<base::DictionaryValue>(dictionary_value); 79 return scoped_ptr<base::DictionaryValue>(dictionary_value);
80 } 80 }
81 } 81 }
82 return scoped_ptr<base::DictionaryValue>(); 82 return scoped_ptr<base::DictionaryValue>();
83 } 83 }
84 84
85 scoped_ptr<PathsVector> GetPowerSourcesPaths(dbus::ObjectProxy* proxy) { 85 scoped_ptr<PathsVector> GetPowerSourcesPaths(dbus::ObjectProxy* proxy) {
86 scoped_ptr<PathsVector> paths(new PathsVector()); 86 scoped_ptr<PathsVector> paths(new PathsVector());
87 if (!proxy) 87 if (!proxy)
88 return paths.Pass(); 88 return paths;
89 89
90 dbus::MethodCall method_call(kUPowerServiceName, kUPowerEnumerateDevices); 90 dbus::MethodCall method_call(kUPowerServiceName, kUPowerEnumerateDevices);
91 scoped_ptr<dbus::Response> response( 91 scoped_ptr<dbus::Response> response(
92 proxy->CallMethodAndBlock(&method_call, 92 proxy->CallMethodAndBlock(&method_call,
93 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT)); 93 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT));
94 94
95 if (response) { 95 if (response) {
96 dbus::MessageReader reader(response.get()); 96 dbus::MessageReader reader(response.get());
97 reader.PopArrayOfObjectPaths(paths.get()); 97 reader.PopArrayOfObjectPaths(paths.get());
98 } 98 }
99 return paths.Pass();; 99 return paths;
100 } 100 }
101 101
102 void UpdateNumberBatteriesHistogram(int count) { 102 void UpdateNumberBatteriesHistogram(int count) {
103 UMA_HISTOGRAM_CUSTOM_COUNTS( 103 UMA_HISTOGRAM_CUSTOM_COUNTS(
104 "BatteryStatus.NumberBatteriesLinux", count, 1, 5, 6); 104 "BatteryStatus.NumberBatteriesLinux", count, 1, 5, 6);
105 } 105 }
106 106
107 // Class that represents a dedicated thread which communicates with DBus to 107 // Class that represents a dedicated thread which communicates with DBus to
108 // obtain battery information and receives battery change notifications. 108 // obtain battery information and receives battery change notifications.
109 class BatteryStatusNotificationThread : public base::Thread { 109 class BatteryStatusNotificationThread : public base::Thread {
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 } 368 }
369 369
370 // static 370 // static
371 scoped_ptr<BatteryStatusManager> BatteryStatusManager::Create( 371 scoped_ptr<BatteryStatusManager> BatteryStatusManager::Create(
372 const BatteryStatusService::BatteryUpdateCallback& callback) { 372 const BatteryStatusService::BatteryUpdateCallback& callback) {
373 return scoped_ptr<BatteryStatusManager>( 373 return scoped_ptr<BatteryStatusManager>(
374 new BatteryStatusManagerLinux(callback)); 374 new BatteryStatusManagerLinux(callback));
375 } 375 }
376 376
377 } // namespace device 377 } // namespace device
OLDNEW
« no previous file with comments | « device/battery/battery_monitor_impl.cc ('k') | device/battery/battery_status_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698