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

Unified Diff: content/test/fake_renderer_compositor_frame_sink.cc

Issue 2774373002: Use MojoCompositorFrameSink in RendererCompositorFrameSink (Closed)
Patch Set: Rebased, dedup IPC Created 3 years, 8 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
« no previous file with comments | « content/test/fake_renderer_compositor_frame_sink.h ('k') | content/test/test_render_view_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/fake_renderer_compositor_frame_sink.cc
diff --git a/content/test/fake_renderer_compositor_frame_sink.cc b/content/test/fake_renderer_compositor_frame_sink.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1fa897aaafe561f8232c6b50530c9b35b5bc71af
--- /dev/null
+++ b/content/test/fake_renderer_compositor_frame_sink.cc
@@ -0,0 +1,36 @@
+// Copyright 2017 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 "content/test/fake_renderer_compositor_frame_sink.h"
+
+namespace content {
+
+FakeRendererCompositorFrameSink::FakeRendererCompositorFrameSink(
+ cc::mojom::MojoCompositorFrameSinkPtr sink,
+ cc::mojom::MojoCompositorFrameSinkClientRequest request)
+ : binding_(this, std::move(request)), sink_(std::move(sink)) {}
+
+FakeRendererCompositorFrameSink::~FakeRendererCompositorFrameSink() = default;
+
+void FakeRendererCompositorFrameSink::DidReceiveCompositorFrameAck(
+ const cc::ReturnedResourceArray& resources) {
+ ReclaimResources(resources);
+ did_receive_ack_ = true;
+}
+
+void FakeRendererCompositorFrameSink::ReclaimResources(
+ const cc::ReturnedResourceArray& resources) {
+ last_reclaimed_resources_ = resources;
+}
+
+void FakeRendererCompositorFrameSink::Reset() {
+ did_receive_ack_ = false;
+ last_reclaimed_resources_.clear();
+}
+
+void FakeRendererCompositorFrameSink::Flush() {
+ binding_.FlushForTesting();
+}
+
+} // namespace content
« no previous file with comments | « content/test/fake_renderer_compositor_frame_sink.h ('k') | content/test/test_render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698