Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: cc/test/proxy_main_for_test.cc

Issue 1506023008: [NOT LANDED] Revert of cc: Split ThreadProxy into ProxyMain and ProxyImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/proxy_main_for_test.h ('k') | cc/test/test_hooks.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cc/test/proxy_main_for_test.h"
6
7 #include "cc/test/threaded_channel_for_test.h"
8
9 namespace cc {
10
11 scoped_ptr<ProxyMain> ProxyMainForTest::CreateThreaded(
12 TestHooks* test_hooks,
13 LayerTreeHost* host,
14 TaskRunnerProvider* task_runner_provider,
15 scoped_ptr<BeginFrameSource> external_begin_frame_source) {
16 scoped_ptr<ProxyMain> proxy_main(
17 new ProxyMainForTest(test_hooks, host, task_runner_provider,
18 std::move(external_begin_frame_source)));
19 proxy_main->SetChannel(ThreadedChannelForTest::Create(
20 test_hooks, proxy_main.get(), task_runner_provider));
21 return proxy_main;
22 }
23
24 ProxyMainForTest::~ProxyMainForTest() {}
25
26 ProxyMainForTest::ProxyMainForTest(
27 TestHooks* test_hooks,
28 LayerTreeHost* host,
29 TaskRunnerProvider* task_runner_provider,
30 scoped_ptr<BeginFrameSource> external_begin_frame_source)
31 : ProxyMain(host,
32 task_runner_provider,
33 std::move(external_begin_frame_source)),
34 test_hooks_(test_hooks) {}
35
36 void ProxyMainForTest::SetNeedsUpdateLayers() {
37 ProxyMain::SetNeedsUpdateLayers();
38 test_hooks_->DidSetNeedsUpdateLayers();
39 }
40
41 void ProxyMainForTest::DidCompleteSwapBuffers() {
42 test_hooks_->ReceivedDidCompleteSwapBuffers();
43 ProxyMain::DidCompleteSwapBuffers();
44 }
45
46 void ProxyMainForTest::SetRendererCapabilities(
47 const RendererCapabilities& capabilities) {
48 test_hooks_->ReceivedSetRendererCapabilitiesMainCopy(capabilities);
49 ProxyMain::SetRendererCapabilities(capabilities);
50 }
51
52 void ProxyMainForTest::BeginMainFrameNotExpectedSoon() {
53 test_hooks_->ReceivedBeginMainFrameNotExpectedSoon();
54 ProxyMain::BeginMainFrameNotExpectedSoon();
55 }
56
57 void ProxyMainForTest::DidCommitAndDrawFrame() {
58 test_hooks_->ReceivedDidCommitAndDrawFrame();
59 ProxyMain::DidCommitAndDrawFrame();
60 }
61
62 void ProxyMainForTest::SetAnimationEvents(
63 scoped_ptr<AnimationEventsVector> events) {
64 test_hooks_->ReceivedSetAnimationEvents();
65 ProxyMain::SetAnimationEvents(std::move(events));
66 }
67
68 void ProxyMainForTest::DidLoseOutputSurface() {
69 test_hooks_->ReceivedDidLoseOutputSurface();
70 ProxyMain::DidLoseOutputSurface();
71 }
72
73 void ProxyMainForTest::RequestNewOutputSurface() {
74 test_hooks_->ReceivedRequestNewOutputSurface();
75 ProxyMain::RequestNewOutputSurface();
76 }
77
78 void ProxyMainForTest::DidInitializeOutputSurface(
79 bool success,
80 const RendererCapabilities& capabilities) {
81 test_hooks_->ReceivedDidInitializeOutputSurface(success, capabilities);
82 ProxyMain::DidInitializeOutputSurface(success, capabilities);
83 }
84
85 void ProxyMainForTest::DidCompletePageScaleAnimation() {
86 test_hooks_->ReceivedDidCompletePageScaleAnimation();
87 ProxyMain::DidCompletePageScaleAnimation();
88 }
89
90 void ProxyMainForTest::PostFrameTimingEventsOnMain(
91 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events,
92 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) {
93 test_hooks_->ReceivedPostFrameTimingEventsOnMain();
94 ProxyMain::PostFrameTimingEventsOnMain(std::move(composite_events),
95 std::move(main_frame_events));
96 }
97
98 void ProxyMainForTest::BeginMainFrame(
99 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) {
100 test_hooks_->ReceivedBeginMainFrame();
101 ProxyMain::BeginMainFrame(std::move(begin_main_frame_state));
102 }
103
104 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/proxy_main_for_test.h ('k') | cc/test/test_hooks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698