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

Unified Diff: cc/test/fake_compositor_proto_state_sink.cc

Issue 2362073002: cc/blimp: Add a LayerTreeHostRemote implementation. (Closed)
Patch Set: source frame number Created 4 years, 3 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_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

Powered by Google App Engine
This is Rietveld 408576698