| Index: cc/test/fake_output_surface.cc
|
| diff --git a/cc/test/fake_output_surface.cc b/cc/test/fake_output_surface.cc
|
| index 7d5a296b32e4d26de065c3d1320f6fd454212b6b..c052994b875a9fd1e83e307e071a7353adbe4058 100644
|
| --- a/cc/test/fake_output_surface.cc
|
| +++ b/cc/test/fake_output_surface.cc
|
| @@ -5,7 +5,7 @@
|
| #include "cc/test/fake_output_surface.h"
|
|
|
| #include "base/bind.h"
|
| -#include "base/message_loop/message_loop.h"
|
| +#include "base/threading/thread_task_runner_handle.h"
|
| #include "cc/output/output_surface_client.h"
|
| #include "cc/resources/returned_resource.h"
|
| #include "cc/test/begin_frame_args_test.h"
|
| @@ -15,11 +15,11 @@ namespace cc {
|
|
|
| FakeOutputSurface::FakeOutputSurface(
|
| scoped_refptr<ContextProvider> context_provider)
|
| - : OutputSurface(std::move(context_provider)) {}
|
| + : OutputSurface(std::move(context_provider)), weak_ptr_factory_(this) {}
|
|
|
| FakeOutputSurface::FakeOutputSurface(
|
| std::unique_ptr<SoftwareOutputDevice> software_device)
|
| - : OutputSurface(std::move(software_device)) {}
|
| + : OutputSurface(std::move(software_device)), weak_ptr_factory_(this) {}
|
|
|
| FakeOutputSurface::~FakeOutputSurface() = default;
|
|
|
| @@ -36,7 +36,13 @@ void FakeOutputSurface::SwapBuffers(OutputSurfaceFrame frame) {
|
| last_swap_rect_valid_ = false;
|
| }
|
|
|
| - PostSwapBuffersComplete();
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| + FROM_HERE, base::Bind(&FakeOutputSurface::SwapBuffersCallback,
|
| + weak_ptr_factory_.GetWeakPtr()));
|
| +}
|
| +
|
| +void FakeOutputSurface::SwapBuffersCallback() {
|
| + client_->DidSwapBuffersComplete();
|
| }
|
|
|
| void FakeOutputSurface::BindFramebuffer() {
|
|
|