OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/test/threaded_channel_for_test.h" | 5 #include "cc/test/threaded_channel_for_test.h" |
6 | 6 |
| 7 #include "base/memory/ptr_util.h" |
7 #include "cc/test/proxy_impl_for_test.h" | 8 #include "cc/test/proxy_impl_for_test.h" |
8 | 9 |
9 namespace cc { | 10 namespace cc { |
10 | 11 |
11 scoped_ptr<ThreadedChannelForTest> ThreadedChannelForTest::Create( | 12 std::unique_ptr<ThreadedChannelForTest> ThreadedChannelForTest::Create( |
12 TestHooks* test_hooks, | 13 TestHooks* test_hooks, |
13 ProxyMain* proxy_main, | 14 ProxyMain* proxy_main, |
14 TaskRunnerProvider* task_runner_provider) { | 15 TaskRunnerProvider* task_runner_provider) { |
15 return make_scoped_ptr( | 16 return base::WrapUnique( |
16 new ThreadedChannelForTest(test_hooks, proxy_main, task_runner_provider)); | 17 new ThreadedChannelForTest(test_hooks, proxy_main, task_runner_provider)); |
17 } | 18 } |
18 | 19 |
19 ThreadedChannelForTest::ThreadedChannelForTest( | 20 ThreadedChannelForTest::ThreadedChannelForTest( |
20 TestHooks* test_hooks, | 21 TestHooks* test_hooks, |
21 ProxyMain* proxy_main, | 22 ProxyMain* proxy_main, |
22 TaskRunnerProvider* task_runner_provider) | 23 TaskRunnerProvider* task_runner_provider) |
23 : ThreadedChannel(proxy_main, task_runner_provider), | 24 : ThreadedChannel(proxy_main, task_runner_provider), |
24 test_hooks_(test_hooks), | 25 test_hooks_(test_hooks), |
25 proxy_impl_for_test_(nullptr) {} | 26 proxy_impl_for_test_(nullptr) {} |
26 | 27 |
27 scoped_ptr<ProxyImpl> ThreadedChannelForTest::CreateProxyImpl( | 28 std::unique_ptr<ProxyImpl> ThreadedChannelForTest::CreateProxyImpl( |
28 ChannelImpl* channel_impl, | 29 ChannelImpl* channel_impl, |
29 LayerTreeHost* layer_tree_host, | 30 LayerTreeHost* layer_tree_host, |
30 TaskRunnerProvider* task_runner_provider, | 31 TaskRunnerProvider* task_runner_provider, |
31 scoped_ptr<BeginFrameSource> external_begin_frame_source) { | 32 std::unique_ptr<BeginFrameSource> external_begin_frame_source) { |
32 scoped_ptr<ProxyImplForTest> proxy_impl = ProxyImplForTest::Create( | 33 std::unique_ptr<ProxyImplForTest> proxy_impl = ProxyImplForTest::Create( |
33 test_hooks_, channel_impl, layer_tree_host, task_runner_provider, | 34 test_hooks_, channel_impl, layer_tree_host, task_runner_provider, |
34 std::move(external_begin_frame_source)); | 35 std::move(external_begin_frame_source)); |
35 proxy_impl_for_test_ = proxy_impl.get(); | 36 proxy_impl_for_test_ = proxy_impl.get(); |
36 return std::move(proxy_impl); | 37 return std::move(proxy_impl); |
37 } | 38 } |
38 | 39 |
39 } // namespace cc | 40 } // namespace cc |
OLD | NEW |