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

Unified Diff: device/battery/battery_status_service.h

Issue 1874313002: Convert device to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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 | « device/battery/battery_status_manager_win.cc ('k') | device/battery/battery_status_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/battery/battery_status_service.h
diff --git a/device/battery/battery_status_service.h b/device/battery/battery_status_service.h
index 9462344dc1f4cb00f0759a0693ba93e717ed832c..6767320963a7eee3dd4dc0cc3c448414c81e4fd0 100644
--- a/device/battery/battery_status_service.h
+++ b/device/battery/battery_status_service.h
@@ -5,9 +5,10 @@
#ifndef DEVICE_BATTERY_BATTERY_STATUS_SERVICE_H_
#define DEVICE_BATTERY_BATTERY_STATUS_SERVICE_H_
+#include <memory>
+
#include "base/callback_list.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "device/battery/battery_export.h"
#include "device/battery/battery_status.mojom.h"
@@ -32,7 +33,7 @@ class DEVICE_BATTERY_EXPORT BatteryStatusService {
// Adds a callback to receive battery status updates. Must be called on the
// main thread. The callback itself will be called on the main thread as well.
// NOTE: The callback may be run before AddCallback returns!
- scoped_ptr<BatteryUpdateSubscription> AddCallback(
+ std::unique_ptr<BatteryUpdateSubscription> AddCallback(
const BatteryUpdateCallback& callback);
// Gracefully clean-up.
@@ -40,7 +41,7 @@ class DEVICE_BATTERY_EXPORT BatteryStatusService {
// Injects a custom battery status manager for testing purposes.
void SetBatteryManagerForTesting(
- scoped_ptr<BatteryStatusManager> test_battery_manager);
+ std::unique_ptr<BatteryStatusManager> test_battery_manager);
// Returns callback to invoke when battery is changed. Used for testing.
const BatteryUpdateCallback& GetUpdateCallbackForTesting() const;
@@ -59,7 +60,7 @@ class DEVICE_BATTERY_EXPORT BatteryStatusService {
void ConsumersChanged();
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
- scoped_ptr<BatteryStatusManager> battery_fetcher_;
+ std::unique_ptr<BatteryStatusManager> battery_fetcher_;
BatteryUpdateCallbackList callback_list_;
BatteryUpdateCallback update_callback_;
BatteryStatus status_;
« no previous file with comments | « device/battery/battery_status_manager_win.cc ('k') | device/battery/battery_status_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698