Index: cc/test/fake_compositor_proto_state_sink.cc |
diff --git a/cc/test/fake_compositor_proto_state_sink.cc b/cc/test/fake_compositor_proto_state_sink.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8e4c7db241776d255c38cbc4b81d6533b9085347 |
--- /dev/null |
+++ b/cc/test/fake_compositor_proto_state_sink.cc |
@@ -0,0 +1,34 @@ |
+// 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. |
+ |
+#include "cc/test/fake_compositor_proto_state_sink.h" |
+ |
+#include "base/bind.h" |
+#include "base/logging.h" |
+#include "cc/blimp/compositor_proto_state_sink_client.h" |
+ |
+namespace cc { |
+ |
+FakeCompositorProtoStateSink::FakeCompositorProtoStateSink() |
+ : client_(nullptr), weak_factory_(this) {} |
+ |
+FakeCompositorProtoStateSink::~FakeCompositorProtoStateSink() {} |
+ |
+void FakeCompositorProtoStateSink::BindToClient( |
+ CompositorProtoStateSinkClient* client) { |
+ DCHECK(!client_); |
+ client_ = client; |
+} |
+ |
+void FakeCompositorProtoStateSink::ScheduleMainFrame() { |
+ client_->GetMainTaskRunner()->PostTask( |
+ FROM_HERE, base::Bind(&FakeCompositorProtoStateSink::BeginMainFrame, |
+ weak_factory_.GetWeakPtr())); |
+} |
+ |
+void FakeCompositorProtoStateSink::BeginMainFrame() { |
+ client_->BeginMainFrame(); |
+} |
+ |
+} // namespace cc |