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 "cc/test/proxy_main_for_test.h" | 5 #include "cc/test/proxy_main_for_test.h" |
6 | 6 |
7 #include "cc/test/threaded_channel_for_test.h" | 7 #include "cc/test/threaded_channel_for_test.h" |
| 8 #include "cc/trees/remote_channel_main.h" |
8 | 9 |
9 namespace cc { | 10 namespace cc { |
10 | 11 |
11 scoped_ptr<ProxyMain> ProxyMainForTest::CreateThreaded( | 12 scoped_ptr<ProxyMain> ProxyMainForTest::CreateThreaded( |
12 TestHooks* test_hooks, | 13 TestHooks* test_hooks, |
13 LayerTreeHost* host, | 14 LayerTreeHost* host, |
14 TaskRunnerProvider* task_runner_provider, | 15 TaskRunnerProvider* task_runner_provider, |
15 scoped_ptr<BeginFrameSource> external_begin_frame_source) { | 16 scoped_ptr<BeginFrameSource> external_begin_frame_source) { |
16 scoped_ptr<ProxyMain> proxy_main( | 17 scoped_ptr<ProxyMain> proxy_main( |
17 new ProxyMainForTest(test_hooks, host, task_runner_provider, | 18 new ProxyMainForTest(test_hooks, host, task_runner_provider, |
18 std::move(external_begin_frame_source))); | 19 std::move(external_begin_frame_source))); |
19 proxy_main->SetChannel(ThreadedChannelForTest::Create( | 20 proxy_main->SetChannel(ThreadedChannelForTest::Create( |
20 test_hooks, proxy_main.get(), task_runner_provider)); | 21 test_hooks, proxy_main.get(), task_runner_provider)); |
21 return proxy_main; | 22 return proxy_main; |
22 } | 23 } |
23 | 24 |
| 25 scoped_ptr<ProxyMain> ProxyMainForTest::CreateRemote( |
| 26 TestHooks* test_hooks, |
| 27 RemoteProtoChannel* remote_proto_channel, |
| 28 LayerTreeHost* host, |
| 29 TaskRunnerProvider* task_runner_provider) { |
| 30 scoped_ptr<ProxyMain> proxy_main( |
| 31 new ProxyMainForTest(test_hooks, host, task_runner_provider, nullptr)); |
| 32 proxy_main->SetChannel(RemoteChannelMain::Create( |
| 33 remote_proto_channel, proxy_main.get(), task_runner_provider)); |
| 34 return proxy_main; |
| 35 } |
| 36 |
24 ProxyMainForTest::~ProxyMainForTest() {} | 37 ProxyMainForTest::~ProxyMainForTest() {} |
25 | 38 |
26 ProxyMainForTest::ProxyMainForTest( | 39 ProxyMainForTest::ProxyMainForTest( |
27 TestHooks* test_hooks, | 40 TestHooks* test_hooks, |
28 LayerTreeHost* host, | 41 LayerTreeHost* host, |
29 TaskRunnerProvider* task_runner_provider, | 42 TaskRunnerProvider* task_runner_provider, |
30 scoped_ptr<BeginFrameSource> external_begin_frame_source) | 43 scoped_ptr<BeginFrameSource> external_begin_frame_source) |
31 : ProxyMain(host, | 44 : ProxyMain(host, |
32 task_runner_provider, | 45 task_runner_provider, |
33 std::move(external_begin_frame_source)), | 46 std::move(external_begin_frame_source)), |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 std::move(main_frame_events)); | 108 std::move(main_frame_events)); |
96 } | 109 } |
97 | 110 |
98 void ProxyMainForTest::BeginMainFrame( | 111 void ProxyMainForTest::BeginMainFrame( |
99 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) { | 112 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) { |
100 test_hooks_->ReceivedBeginMainFrame(); | 113 test_hooks_->ReceivedBeginMainFrame(); |
101 ProxyMain::BeginMainFrame(std::move(begin_main_frame_state)); | 114 ProxyMain::BeginMainFrame(std::move(begin_main_frame_state)); |
102 } | 115 } |
103 | 116 |
104 } // namespace cc | 117 } // namespace cc |
OLD | NEW |