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

Side by Side Diff: services/device/device_service.cc

Issue 2729293002: Fix renderers not getting power broadcast messages (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/device/device_service.h" 5 #include "services/device/device_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 return true; 48 return true;
49 } 49 }
50 50
51 void DeviceService::Create(const service_manager::Identity& remote_identity, 51 void DeviceService::Create(const service_manager::Identity& remote_identity,
52 mojom::FingerprintRequest request) { 52 mojom::FingerprintRequest request) {
53 Fingerprint::Create(std::move(request)); 53 Fingerprint::Create(std::move(request));
54 } 54 }
55 55
56 void DeviceService::Create(const service_manager::Identity& remote_identity, 56 void DeviceService::Create(const service_manager::Identity& remote_identity,
57 mojom::PowerMonitorRequest request) { 57 mojom::PowerMonitorRequest request) {
58 PowerMonitorMessageBroadcaster::Create(std::move(request)); 58 if (!power_monitor_message_broadcaster_) {
59 power_monitor_message_broadcaster_ =
60 base::MakeUnique<PowerMonitorMessageBroadcaster>();
61 }
62 power_monitor_message_broadcaster_->Bind(std::move(request));
59 } 63 }
60 64
61 void DeviceService::Create(const service_manager::Identity& remote_identity, 65 void DeviceService::Create(const service_manager::Identity& remote_identity,
62 mojom::TimeZoneMonitorRequest request) { 66 mojom::TimeZoneMonitorRequest request) {
63 if (!time_zone_monitor_) 67 if (!time_zone_monitor_)
64 time_zone_monitor_ = device::TimeZoneMonitor::Create(file_task_runner_); 68 time_zone_monitor_ = device::TimeZoneMonitor::Create(file_task_runner_);
65 time_zone_monitor_->Bind(std::move(request)); 69 time_zone_monitor_->Bind(std::move(request));
66 } 70 }
67 71
68 } // namespace device 72 } // namespace device
OLDNEW
« no previous file with comments | « services/device/device_service.h ('k') | services/device/power_monitor/power_monitor_message_broadcaster.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698