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

Unified Diff: cc/test/fake_remote_compositor_bridge.h

Issue 2362073002: cc/blimp: Add a LayerTreeHostRemote implementation. (Closed)
Patch Set: Rebase Created 4 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: cc/test/fake_remote_compositor_bridge.h
diff --git a/cc/test/fake_remote_compositor_bridge.h b/cc/test/fake_remote_compositor_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..5958f36d7873e978b5b39e212f2d21e4e55da92e
--- /dev/null
+++ b/cc/test/fake_remote_compositor_bridge.h
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_TEST_FAKE_REMOTE_COMPOSITOR_BRIDGE_H_
+#define CC_TEST_FAKE_REMOTE_COMPOSITOR_BRIDGE_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "cc/blimp/compositor_proto_state.h"
+#include "cc/blimp/remote_compositor_bridge.h"
+
+namespace cc {
+
+// An implementation of the RemoteCompositorBridge for tests that pump
+// BeginMainFrames as soon as the client requests them.
+class FakeRemoteCompositorBridge : public RemoteCompositorBridge {
+ public:
+ FakeRemoteCompositorBridge(
+ scoped_refptr<base::SingleThreadTaskRunner> compositor_main_task_runner);
+ ~FakeRemoteCompositorBridge() override;
+
+ // RemoteCompositorBridge implementation.
+ void BindToClient(RemoteCompositorBridgeClient* client) override;
+ void ScheduleMainFrame() override;
+ void ProcessCompositorStateUpdate(
+ std::unique_ptr<CompositorProtoState> compositor_proto_state) override {}
+
+ private:
+ void BeginMainFrame();
+
+ RemoteCompositorBridgeClient* client_;
+ base::WeakPtrFactory<FakeRemoteCompositorBridge> weak_factory_;
+};
+
+} // namespace cc
+
+#endif // CC_TEST_FAKE_REMOTE_COMPOSITOR_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698