| Index: components/viz/client/client_compositor_frame_sink.cc
|
| diff --git a/components/viz/client/client_compositor_frame_sink.cc b/components/viz/client/client_compositor_frame_sink.cc
|
| index e363f8c58e75735b9ef737af62a2f795a56f7762..59ddd942ae030f9da65e026054a7611bc29a04f9 100644
|
| --- a/components/viz/client/client_compositor_frame_sink.cc
|
| +++ b/components/viz/client/client_compositor_frame_sink.cc
|
| @@ -29,7 +29,8 @@ ClientCompositorFrameSink::ClientCompositorFrameSink(
|
| compositor_frame_sink_info_(std::move(compositor_frame_sink_info)),
|
| client_request_(std::move(client_request)),
|
| client_binding_(this),
|
| - enable_surface_synchronization_(enable_surface_synchronization) {
|
| + enable_surface_synchronization_(enable_surface_synchronization),
|
| + weak_factory_(this) {
|
| DETACH_FROM_THREAD(thread_checker_);
|
| }
|
|
|
| @@ -44,12 +45,19 @@ ClientCompositorFrameSink::ClientCompositorFrameSink(
|
| compositor_frame_sink_info_(std::move(compositor_frame_sink_info)),
|
| client_request_(std::move(client_request)),
|
| client_binding_(this),
|
| - enable_surface_synchronization_(enable_surface_synchronization) {
|
| + enable_surface_synchronization_(enable_surface_synchronization),
|
| + weak_factory_(this) {
|
| DETACH_FROM_THREAD(thread_checker_);
|
| }
|
|
|
| ClientCompositorFrameSink::~ClientCompositorFrameSink() {}
|
|
|
| +base::WeakPtr<ClientCompositorFrameSink>
|
| +ClientCompositorFrameSink::GetWeakPtr() {
|
| + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
| + return weak_factory_.GetWeakPtr();
|
| +}
|
| +
|
| bool ClientCompositorFrameSink::BindToClient(
|
| cc::CompositorFrameSinkClient* client) {
|
| DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
| @@ -82,6 +90,7 @@ void ClientCompositorFrameSink::DetachFromClient() {
|
|
|
| void ClientCompositorFrameSink::SetLocalSurfaceId(
|
| const cc::LocalSurfaceId& local_surface_id) {
|
| + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
| DCHECK(local_surface_id.is_valid());
|
| DCHECK(enable_surface_synchronization_);
|
| local_surface_id_ = local_surface_id;
|
|
|