| 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/animation/animation_events.h" | 7 #include "cc/animation/animation_events.h" |
| 8 #include "cc/test/threaded_channel_for_test.h" | 8 #include "cc/test/threaded_channel_for_test.h" |
| 9 #include "cc/trees/remote_channel_main.h" | 9 #include "cc/trees/remote_channel_main.h" |
| 10 | 10 |
| 11 namespace cc { | 11 namespace cc { |
| 12 | 12 |
| 13 scoped_ptr<ProxyMainForTest> ProxyMainForTest::CreateThreaded( | 13 std::unique_ptr<ProxyMainForTest> ProxyMainForTest::CreateThreaded( |
| 14 TestHooks* test_hooks, | 14 TestHooks* test_hooks, |
| 15 LayerTreeHost* host, | 15 LayerTreeHost* host, |
| 16 TaskRunnerProvider* task_runner_provider) { | 16 TaskRunnerProvider* task_runner_provider) { |
| 17 scoped_ptr<ProxyMainForTest> proxy_main( | 17 std::unique_ptr<ProxyMainForTest> proxy_main( |
| 18 new ProxyMainForTest(test_hooks, host, task_runner_provider)); | 18 new ProxyMainForTest(test_hooks, host, task_runner_provider)); |
| 19 scoped_ptr<ThreadedChannelForTest> channel = ThreadedChannelForTest::Create( | 19 std::unique_ptr<ThreadedChannelForTest> channel = |
| 20 test_hooks, proxy_main.get(), task_runner_provider); | 20 ThreadedChannelForTest::Create(test_hooks, proxy_main.get(), |
| 21 task_runner_provider); |
| 21 proxy_main->threaded_channel_for_test_ = channel.get(); | 22 proxy_main->threaded_channel_for_test_ = channel.get(); |
| 22 proxy_main->SetChannel(std::move(channel)); | 23 proxy_main->SetChannel(std::move(channel)); |
| 23 return proxy_main; | 24 return proxy_main; |
| 24 } | 25 } |
| 25 | 26 |
| 26 scoped_ptr<ProxyMainForTest> ProxyMainForTest::CreateRemote( | 27 std::unique_ptr<ProxyMainForTest> ProxyMainForTest::CreateRemote( |
| 27 TestHooks* test_hooks, | 28 TestHooks* test_hooks, |
| 28 RemoteProtoChannel* remote_proto_channel, | 29 RemoteProtoChannel* remote_proto_channel, |
| 29 LayerTreeHost* host, | 30 LayerTreeHost* host, |
| 30 TaskRunnerProvider* task_runner_provider) { | 31 TaskRunnerProvider* task_runner_provider) { |
| 31 scoped_ptr<ProxyMainForTest> proxy_main( | 32 std::unique_ptr<ProxyMainForTest> proxy_main( |
| 32 new ProxyMainForTest(test_hooks, host, task_runner_provider)); | 33 new ProxyMainForTest(test_hooks, host, task_runner_provider)); |
| 33 proxy_main->SetChannel(RemoteChannelMain::Create( | 34 proxy_main->SetChannel(RemoteChannelMain::Create( |
| 34 remote_proto_channel, proxy_main.get(), task_runner_provider)); | 35 remote_proto_channel, proxy_main.get(), task_runner_provider)); |
| 35 return proxy_main; | 36 return proxy_main; |
| 36 } | 37 } |
| 37 | 38 |
| 38 ProxyMainForTest::~ProxyMainForTest() {} | 39 ProxyMainForTest::~ProxyMainForTest() {} |
| 39 | 40 |
| 40 ProxyMainForTest::ProxyMainForTest(TestHooks* test_hooks, | 41 ProxyMainForTest::ProxyMainForTest(TestHooks* test_hooks, |
| 41 LayerTreeHost* host, | 42 LayerTreeHost* host, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 63 void ProxyMainForTest::BeginMainFrameNotExpectedSoon() { | 64 void ProxyMainForTest::BeginMainFrameNotExpectedSoon() { |
| 64 test_hooks_->ReceivedBeginMainFrameNotExpectedSoon(); | 65 test_hooks_->ReceivedBeginMainFrameNotExpectedSoon(); |
| 65 ProxyMain::BeginMainFrameNotExpectedSoon(); | 66 ProxyMain::BeginMainFrameNotExpectedSoon(); |
| 66 } | 67 } |
| 67 | 68 |
| 68 void ProxyMainForTest::DidCommitAndDrawFrame() { | 69 void ProxyMainForTest::DidCommitAndDrawFrame() { |
| 69 test_hooks_->ReceivedDidCommitAndDrawFrame(); | 70 test_hooks_->ReceivedDidCommitAndDrawFrame(); |
| 70 ProxyMain::DidCommitAndDrawFrame(); | 71 ProxyMain::DidCommitAndDrawFrame(); |
| 71 } | 72 } |
| 72 | 73 |
| 73 void ProxyMainForTest::SetAnimationEvents(scoped_ptr<AnimationEvents> events) { | 74 void ProxyMainForTest::SetAnimationEvents( |
| 75 std::unique_ptr<AnimationEvents> events) { |
| 74 test_hooks_->ReceivedSetAnimationEvents(); | 76 test_hooks_->ReceivedSetAnimationEvents(); |
| 75 ProxyMain::SetAnimationEvents(std::move(events)); | 77 ProxyMain::SetAnimationEvents(std::move(events)); |
| 76 } | 78 } |
| 77 | 79 |
| 78 void ProxyMainForTest::DidLoseOutputSurface() { | 80 void ProxyMainForTest::DidLoseOutputSurface() { |
| 79 test_hooks_->ReceivedDidLoseOutputSurface(); | 81 test_hooks_->ReceivedDidLoseOutputSurface(); |
| 80 ProxyMain::DidLoseOutputSurface(); | 82 ProxyMain::DidLoseOutputSurface(); |
| 81 } | 83 } |
| 82 | 84 |
| 83 void ProxyMainForTest::RequestNewOutputSurface() { | 85 void ProxyMainForTest::RequestNewOutputSurface() { |
| 84 test_hooks_->ReceivedRequestNewOutputSurface(); | 86 test_hooks_->ReceivedRequestNewOutputSurface(); |
| 85 ProxyMain::RequestNewOutputSurface(); | 87 ProxyMain::RequestNewOutputSurface(); |
| 86 } | 88 } |
| 87 | 89 |
| 88 void ProxyMainForTest::DidInitializeOutputSurface( | 90 void ProxyMainForTest::DidInitializeOutputSurface( |
| 89 bool success, | 91 bool success, |
| 90 const RendererCapabilities& capabilities) { | 92 const RendererCapabilities& capabilities) { |
| 91 test_hooks_->ReceivedDidInitializeOutputSurface(success, capabilities); | 93 test_hooks_->ReceivedDidInitializeOutputSurface(success, capabilities); |
| 92 ProxyMain::DidInitializeOutputSurface(success, capabilities); | 94 ProxyMain::DidInitializeOutputSurface(success, capabilities); |
| 93 } | 95 } |
| 94 | 96 |
| 95 void ProxyMainForTest::DidCompletePageScaleAnimation() { | 97 void ProxyMainForTest::DidCompletePageScaleAnimation() { |
| 96 test_hooks_->ReceivedDidCompletePageScaleAnimation(); | 98 test_hooks_->ReceivedDidCompletePageScaleAnimation(); |
| 97 ProxyMain::DidCompletePageScaleAnimation(); | 99 ProxyMain::DidCompletePageScaleAnimation(); |
| 98 } | 100 } |
| 99 | 101 |
| 100 void ProxyMainForTest::PostFrameTimingEventsOnMain( | 102 void ProxyMainForTest::PostFrameTimingEventsOnMain( |
| 101 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, | 103 std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
| 102 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { | 104 std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { |
| 103 test_hooks_->ReceivedPostFrameTimingEventsOnMain(); | 105 test_hooks_->ReceivedPostFrameTimingEventsOnMain(); |
| 104 ProxyMain::PostFrameTimingEventsOnMain(std::move(composite_events), | 106 ProxyMain::PostFrameTimingEventsOnMain(std::move(composite_events), |
| 105 std::move(main_frame_events)); | 107 std::move(main_frame_events)); |
| 106 } | 108 } |
| 107 | 109 |
| 108 void ProxyMainForTest::BeginMainFrame( | 110 void ProxyMainForTest::BeginMainFrame( |
| 109 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) { | 111 std::unique_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) { |
| 110 test_hooks_->ReceivedBeginMainFrame(); | 112 test_hooks_->ReceivedBeginMainFrame(); |
| 111 ProxyMain::BeginMainFrame(std::move(begin_main_frame_state)); | 113 ProxyMain::BeginMainFrame(std::move(begin_main_frame_state)); |
| 112 } | 114 } |
| 113 | 115 |
| 114 } // namespace cc | 116 } // namespace cc |
| OLD | NEW |