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

Side by Side Diff: device/wake_lock/wake_lock_service_context.cc

Issue 2867303003: Generalize the API of WakeLockContext mojo interface. (Closed)
Patch Set: Generalize the API of WakeLockContext mojo interface. Created 3 years, 7 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/wake_lock/wake_lock_service_context.h ('k') | device/wake_lock/wake_lock_service_impl.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/wake_lock/wake_lock_service_context.h" 5 #include "device/wake_lock/wake_lock_service_context.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "device/power_save_blocker/power_save_blocker.h"
10 #include "device/wake_lock/wake_lock_service_impl.h" 9 #include "device/wake_lock/wake_lock_service_impl.h"
11 10
12 namespace device { 11 namespace device {
13 12
14 WakeLockServiceContext::WakeLockServiceContext( 13 WakeLockServiceContext::WakeLockServiceContext(
15 int context_id, 14 int context_id,
16 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, 15 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
17 const WakeLockContextCallback& native_view_getter) 16 const WakeLockContextCallback& native_view_getter)
18 : file_task_runner_(std::move(file_task_runner)), 17 : file_task_runner_(std::move(file_task_runner)),
19 context_id_(context_id), 18 context_id_(context_id),
20 native_view_getter_(native_view_getter) {} 19 native_view_getter_(native_view_getter) {}
21 20
22 WakeLockServiceContext::~WakeLockServiceContext() {} 21 WakeLockServiceContext::~WakeLockServiceContext() {}
23 22
24 void WakeLockServiceContext::GetWakeLock( 23 void WakeLockServiceContext::GetWakeLock(
24 mojom::WakeLockType type,
25 mojom::WakeLockReason reason,
26 const std::string& description,
25 mojom::WakeLockServiceRequest request) { 27 mojom::WakeLockServiceRequest request) {
26 // WakeLockServiceImpl owns itself. 28 // WakeLockServiceImpl owns itself.
27 new WakeLockServiceImpl(std::move(request), 29 new WakeLockServiceImpl(std::move(request), type, reason, description,
28 device::PowerSaveBlocker::PowerSaveBlockerType:: 30 context_id_, native_view_getter_, file_task_runner_);
29 kPowerSaveBlockPreventDisplaySleep,
30 device::PowerSaveBlocker::Reason::kReasonOther,
31 "Wake Lock API", context_id_, native_view_getter_,
32 file_task_runner_);
33 } 31 }
34 32
35 } // namespace device 33 } // namespace device
OLDNEW
« no previous file with comments | « device/wake_lock/wake_lock_service_context.h ('k') | device/wake_lock/wake_lock_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698