| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "device/wake_lock/wake_lock_service_context.h" | |
| 6 | |
| 7 #include <utility> | |
| 8 | |
| 9 #include "device/wake_lock/wake_lock_service_impl.h" | |
| 10 | |
| 11 namespace device { | |
| 12 | |
| 13 const int WakeLockServiceContext::WakeLockInvalidContextId = -1; | |
| 14 | |
| 15 WakeLockServiceContext::WakeLockServiceContext( | |
| 16 int context_id, | |
| 17 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, | |
| 18 const WakeLockContextCallback& native_view_getter) | |
| 19 : file_task_runner_(std::move(file_task_runner)), | |
| 20 context_id_(context_id), | |
| 21 native_view_getter_(native_view_getter) {} | |
| 22 | |
| 23 WakeLockServiceContext::~WakeLockServiceContext() {} | |
| 24 | |
| 25 void WakeLockServiceContext::GetWakeLock( | |
| 26 mojom::WakeLockType type, | |
| 27 mojom::WakeLockReason reason, | |
| 28 const std::string& description, | |
| 29 mojom::WakeLockServiceRequest request) { | |
| 30 // WakeLockServiceImpl owns itself. | |
| 31 new WakeLockServiceImpl(std::move(request), type, reason, description, | |
| 32 context_id_, native_view_getter_, file_task_runner_); | |
| 33 } | |
| 34 | |
| 35 } // namespace device | |
| OLD | NEW |