OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "cc/test/fake_compositor_proto_state_sink.h" |
| 6 |
| 7 #include "base/bind.h" |
| 8 #include "base/logging.h" |
| 9 #include "cc/blimp/compositor_proto_state_sink_client.h" |
| 10 |
| 11 namespace cc { |
| 12 |
| 13 FakeCompositorProtoStateSink::FakeCompositorProtoStateSink() |
| 14 : client_(nullptr), weak_factory_(this) {} |
| 15 |
| 16 FakeCompositorProtoStateSink::~FakeCompositorProtoStateSink() {} |
| 17 |
| 18 void FakeCompositorProtoStateSink::BindToClient( |
| 19 CompositorProtoStateSinkClient* client) { |
| 20 DCHECK(!client_); |
| 21 client_ = client; |
| 22 } |
| 23 |
| 24 void FakeCompositorProtoStateSink::ScheduleMainFrame() { |
| 25 client_->GetMainTaskRunner()->PostTask( |
| 26 FROM_HERE, base::Bind(&FakeCompositorProtoStateSink::BeginMainFrame, |
| 27 weak_factory_.GetWeakPtr())); |
| 28 } |
| 29 |
| 30 void FakeCompositorProtoStateSink::BeginMainFrame() { |
| 31 client_->BeginMainFrame(); |
| 32 } |
| 33 |
| 34 } // namespace cc |
OLD | NEW |