OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CC_TEST_FAKE_REMOTE_COMPOSITOR_BRIDGE_H_ | 5 #ifndef CC_TEST_FAKE_REMOTE_COMPOSITOR_BRIDGE_H_ |
6 #define CC_TEST_FAKE_REMOTE_COMPOSITOR_BRIDGE_H_ | 6 #define CC_TEST_FAKE_REMOTE_COMPOSITOR_BRIDGE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/single_thread_task_runner.h" |
12 #include "cc/blimp/compositor_proto_state.h" | 13 #include "cc/blimp/compositor_proto_state.h" |
13 #include "cc/blimp/remote_compositor_bridge.h" | 14 #include "cc/blimp/remote_compositor_bridge.h" |
14 | 15 |
15 namespace cc { | 16 namespace cc { |
16 | 17 |
17 // An implementation of the RemoteCompositorBridge for tests that pump | 18 // An implementation of the RemoteCompositorBridge for tests that pump |
18 // BeginMainFrames as soon as the client requests them. | 19 // BeginMainFrames as soon as the client requests them. |
19 class FakeRemoteCompositorBridge : public RemoteCompositorBridge { | 20 class FakeRemoteCompositorBridge : public RemoteCompositorBridge { |
20 public: | 21 public: |
21 FakeRemoteCompositorBridge( | 22 FakeRemoteCompositorBridge( |
22 scoped_refptr<base::SingleThreadTaskRunner> compositor_main_task_runner); | 23 scoped_refptr<base::SingleThreadTaskRunner> compositor_main_task_runner); |
23 ~FakeRemoteCompositorBridge() override; | 24 ~FakeRemoteCompositorBridge() override; |
24 | 25 |
25 // RemoteCompositorBridge implementation. | 26 // RemoteCompositorBridge implementation. |
26 void BindToClient(RemoteCompositorBridgeClient* client) override; | 27 void BindToClient(RemoteCompositorBridgeClient* client) override; |
27 void ScheduleMainFrame() override; | 28 void ScheduleMainFrame() override; |
28 void ProcessCompositorStateUpdate( | 29 void ProcessCompositorStateUpdate( |
29 std::unique_ptr<CompositorProtoState> compositor_proto_state) override {} | 30 std::unique_ptr<CompositorProtoState> compositor_proto_state) override {} |
30 | 31 |
31 protected: | 32 protected: |
32 void BeginMainFrame(); | 33 void BeginMainFrame(); |
33 | 34 |
34 RemoteCompositorBridgeClient* client_; | 35 RemoteCompositorBridgeClient* client_; |
35 base::WeakPtrFactory<FakeRemoteCompositorBridge> weak_factory_; | 36 base::WeakPtrFactory<FakeRemoteCompositorBridge> weak_factory_; |
36 }; | 37 }; |
37 | 38 |
38 } // namespace cc | 39 } // namespace cc |
39 | 40 |
40 #endif // CC_TEST_FAKE_REMOTE_COMPOSITOR_BRIDGE_H_ | 41 #endif // CC_TEST_FAKE_REMOTE_COMPOSITOR_BRIDGE_H_ |
OLD | NEW |