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

Unified Diff: services/device/device_service.h

Issue 2734943003: Device Service: Decouple Wake Lock from //content (Closed)
Patch Set: Response to review + rebase Created 3 years, 9 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: services/device/device_service.h
diff --git a/services/device/device_service.h b/services/device/device_service.h
index a86caa5544a01657687904ccaed3e29225042675..fd6e0d9a9bb92a6e7e0e9037288604c9fb388eb9 100644
--- a/services/device/device_service.h
+++ b/services/device/device_service.h
@@ -7,6 +7,8 @@
#include "base/memory/ref_counted.h"
#include "device/screen_orientation/public/interfaces/screen_orientation.mojom.h"
+#include "device/wake_lock/public/interfaces/wake_lock_context_provider.mojom.h"
+#include "device/wake_lock/wake_lock_service_context.h"
#include "services/device/public/interfaces/fingerprint.mojom.h"
#include "services/device/public/interfaces/power_monitor.mojom.h"
#include "services/device/public/interfaces/time_zone_monitor.mojom.h"
@@ -22,9 +24,16 @@ namespace device {
class PowerMonitorMessageBroadcaster;
class TimeZoneMonitor;
+#if defined(OS_ANDROID)
+std::unique_ptr<service_manager::Service> CreateDeviceService(
+ scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
+ WakeLockContextCallback wake_lock_context_callback);
+#else
std::unique_ptr<service_manager::Service> CreateDeviceService(
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner);
+#endif
class DeviceService
: public service_manager::Service,
@@ -32,10 +41,17 @@ class DeviceService
public service_manager::InterfaceFactory<mojom::PowerMonitor>,
public service_manager::InterfaceFactory<
mojom::ScreenOrientationListener>,
- public service_manager::InterfaceFactory<mojom::TimeZoneMonitor> {
+ public service_manager::InterfaceFactory<mojom::TimeZoneMonitor>,
+ public service_manager::InterfaceFactory<mojom::WakeLockContextProvider> {
public:
+#if defined(OS_ANDROID)
+ DeviceService(scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
+ WakeLockContextCallback wake_lock_context_callback);
+#else
DeviceService(scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner);
+#endif
~DeviceService() override;
private:
@@ -60,6 +76,10 @@ class DeviceService
void Create(const service_manager::Identity& remote_identity,
mojom::TimeZoneMonitorRequest request) override;
+ // InterfaceFactory<mojom::WakeLockContextProvider>:
+ void Create(const service_manager::Identity& remote_identity,
+ mojom::WakeLockContextProviderRequest request) override;
+
std::unique_ptr<PowerMonitorMessageBroadcaster>
power_monitor_message_broadcaster_;
std::unique_ptr<TimeZoneMonitor> time_zone_monitor_;
@@ -67,6 +87,8 @@ class DeviceService
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
+ WakeLockContextCallback wake_lock_context_callback_;
+
DISALLOW_COPY_AND_ASSIGN(DeviceService);
};

Powered by Google App Engine
This is Rietveld 408576698