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