Web Speech API: Fix a race condition causing renderer crash.
[chromium-blink-merge.git] / cc / test / fake_layer_tree_host_impl.cc
blobc1a7326f633b7126985d96ac07bb92f7c3a6eef9
1 // Copyright 2012 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.
5 #include "cc/test/fake_layer_tree_host_impl.h"
6 #include "cc/trees/layer_tree_impl.h"
8 namespace cc {
10 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(Proxy* proxy)
11 : LayerTreeHostImpl(LayerTreeSettings(),
12 &client_,
13 proxy,
14 &stats_instrumentation_) {
15 // Explicitly clear all debug settings.
16 SetDebugState(LayerTreeDebugState());
19 FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(
20 const LayerTreeSettings& settings,
21 Proxy* proxy)
22 : LayerTreeHostImpl(settings,
23 &client_,
24 proxy,
25 &stats_instrumentation_) {
26 // Explicitly clear all debug settings.
27 SetDebugState(LayerTreeDebugState());
30 FakeLayerTreeHostImpl::~FakeLayerTreeHostImpl() {}
32 void FakeLayerTreeHostImpl::CreatePendingTree() {
33 LayerTreeHostImpl::CreatePendingTree();
34 float arbitrary_large_page_scale = 100000.f;
35 pending_tree()->SetPageScaleFactorAndLimits(
36 1.f, 1.f / arbitrary_large_page_scale, arbitrary_large_page_scale);
39 base::TimeTicks FakeLayerTreeHostImpl::CurrentFrameTimeTicks() {
40 if (current_frame_time_ticks_.is_null())
41 return LayerTreeHostImpl::CurrentFrameTimeTicks();
42 return current_frame_time_ticks_;
45 void FakeLayerTreeHostImpl::SetCurrentFrameTimeTicks(
46 base::TimeTicks current_frame_time_ticks) {
47 current_frame_time_ticks_ = current_frame_time_ticks;
50 } // namespace cc