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

Unified Diff: cc/test/fake_compositor_frame_sink.cc

Issue 2402173002: cc: Get rid of PostSwapBuffersComplete. (Closed)
Patch Set: postswap: fix-blimp-unittest-post-swap-acks 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
« no previous file with comments | « cc/test/fake_compositor_frame_sink.h ('k') | cc/test/fake_output_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_compositor_frame_sink.cc
diff --git a/cc/test/fake_compositor_frame_sink.cc b/cc/test/fake_compositor_frame_sink.cc
index 91775d3869112cb07d07dcd0288c3af2123ff052..73336bc59517f94a480258e65e41686a9e4e8a07 100644
--- a/cc/test/fake_compositor_frame_sink.cc
+++ b/cc/test/fake_compositor_frame_sink.cc
@@ -5,7 +5,7 @@
#include "cc/test/fake_compositor_frame_sink.h"
#include "base/bind.h"
-#include "base/message_loop/message_loop.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "cc/output/compositor_frame_sink_client.h"
#include "cc/resources/returned_resource.h"
#include "cc/test/begin_frame_args_test.h"
@@ -17,7 +17,8 @@ FakeCompositorFrameSink::FakeCompositorFrameSink(
scoped_refptr<ContextProvider> context_provider,
scoped_refptr<ContextProvider> worker_context_provider)
: CompositorFrameSink(std::move(context_provider),
- std::move(worker_context_provider)) {}
+ std::move(worker_context_provider)),
+ weak_ptr_factory_(this) {}
FakeCompositorFrameSink::~FakeCompositorFrameSink() = default;
@@ -45,7 +46,13 @@ void FakeCompositorFrameSink::SwapBuffers(CompositorFrame frame) {
}
}
- PostSwapBuffersComplete();
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&FakeCompositorFrameSink::SwapBuffersAck,
+ weak_ptr_factory_.GetWeakPtr()));
+}
+
+void FakeCompositorFrameSink::SwapBuffersAck() {
+ client_->DidSwapBuffersComplete();
}
bool FakeCompositorFrameSink::BindToClient(CompositorFrameSinkClient* client) {
« no previous file with comments | « cc/test/fake_compositor_frame_sink.h ('k') | cc/test/fake_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698