OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_context_provider.h" | 5 #include "device/wake_lock/wake_lock_context_provider.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "mojo/public/cpp/bindings/strong_binding.h" | 9 #include "mojo/public/cpp/bindings/strong_binding.h" |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, | 24 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, |
25 const WakeLockContextCallback& native_view_getter) | 25 const WakeLockContextCallback& native_view_getter) |
26 : file_task_runner_(std::move(file_task_runner)), | 26 : file_task_runner_(std::move(file_task_runner)), |
27 native_view_getter_(native_view_getter) {} | 27 native_view_getter_(native_view_getter) {} |
28 | 28 |
29 WakeLockContextProvider::~WakeLockContextProvider() {} | 29 WakeLockContextProvider::~WakeLockContextProvider() {} |
30 | 30 |
31 void WakeLockContextProvider::GetContext( | 31 void WakeLockContextProvider::GetContext( |
32 int context_id, | 32 int context_id, |
33 mojo::InterfaceRequest<mojom::WakeLockContext> request) { | 33 mojo::InterfaceRequest<mojom::WakeLockContext> request) { |
34 // WakeLockServiceContext owns itself (see the comment on | 34 mojo::MakeStrongBinding( |
35 // wake_lock_service_context.h). | 35 base::MakeUnique<WakeLockServiceContext>(context_id, file_task_runner_, |
36 new WakeLockServiceContext(std::move(request), context_id, file_task_runner_, | 36 native_view_getter_), |
37 native_view_getter_); | 37 std::move(request)); |
38 } | 38 } |
39 | 39 |
40 } // namespace device | 40 } // namespace device |
OLD | NEW |