OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 RenderThreadImpl::RenderThreadImpl( | 587 RenderThreadImpl::RenderThreadImpl( |
588 std::unique_ptr<base::MessageLoop> main_message_loop, | 588 std::unique_ptr<base::MessageLoop> main_message_loop, |
589 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler) | 589 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler) |
590 : ChildThreadImpl(Options::Builder() | 590 : ChildThreadImpl(Options::Builder() |
591 .AutoStartServiceManagerConnection(false) | 591 .AutoStartServiceManagerConnection(false) |
592 .ConnectToBrowser(true) | 592 .ConnectToBrowser(true) |
593 .Build()), | 593 .Build()), |
594 renderer_scheduler_(std::move(scheduler)), | 594 renderer_scheduler_(std::move(scheduler)), |
595 main_message_loop_(std::move(main_message_loop)), | 595 main_message_loop_(std::move(main_message_loop)), |
596 categorized_worker_pool_(new CategorizedWorkerPool()), | 596 categorized_worker_pool_(new CategorizedWorkerPool()), |
| 597 is_scroll_animator_enabled_(false), |
597 renderer_binding_(this) { | 598 renderer_binding_(this) { |
598 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter; | 599 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter; |
599 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 600 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
600 switches::kRendererClientId)); | 601 switches::kRendererClientId)); |
601 base::StringToInt(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 602 base::StringToInt(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
602 switches::kRendererClientId), | 603 switches::kRendererClientId), |
603 &client_id_); | 604 &client_id_); |
604 Init(test_task_counter); | 605 Init(test_task_counter); |
605 } | 606 } |
606 | 607 |
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 } | 1581 } |
1581 | 1582 |
1582 bool RenderThreadImpl::AreImageDecodeTasksEnabled() { | 1583 bool RenderThreadImpl::AreImageDecodeTasksEnabled() { |
1583 return are_image_decode_tasks_enabled_; | 1584 return are_image_decode_tasks_enabled_; |
1584 } | 1585 } |
1585 | 1586 |
1586 bool RenderThreadImpl::IsThreadedAnimationEnabled() { | 1587 bool RenderThreadImpl::IsThreadedAnimationEnabled() { |
1587 return is_threaded_animation_enabled_; | 1588 return is_threaded_animation_enabled_; |
1588 } | 1589 } |
1589 | 1590 |
| 1591 bool RenderThreadImpl::IsScrollAnimatorEnabled() { |
| 1592 return is_scroll_animator_enabled_; |
| 1593 } |
| 1594 |
1590 void RenderThreadImpl::OnRAILModeChanged(v8::RAILMode rail_mode) { | 1595 void RenderThreadImpl::OnRAILModeChanged(v8::RAILMode rail_mode) { |
1591 blink::mainThreadIsolate()->SetRAILMode(rail_mode); | 1596 blink::mainThreadIsolate()->SetRAILMode(rail_mode); |
1592 blink::setRAILModeOnWorkerThreadIsolates(rail_mode); | 1597 blink::setRAILModeOnWorkerThreadIsolates(rail_mode); |
1593 } | 1598 } |
1594 | 1599 |
1595 bool RenderThreadImpl::IsMainThread() { | 1600 bool RenderThreadImpl::IsMainThread() { |
1596 return !!current(); | 1601 return !!current(); |
1597 } | 1602 } |
1598 | 1603 |
1599 void RenderThreadImpl::OnChannelError() { | 1604 void RenderThreadImpl::OnChannelError() { |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2055 gpu::GpuChannelHost* RenderThreadImpl::GetGpuChannel() { | 2060 gpu::GpuChannelHost* RenderThreadImpl::GetGpuChannel() { |
2056 if (!gpu_channel_) | 2061 if (!gpu_channel_) |
2057 return nullptr; | 2062 return nullptr; |
2058 if (gpu_channel_->IsLost()) | 2063 if (gpu_channel_->IsLost()) |
2059 return nullptr; | 2064 return nullptr; |
2060 return gpu_channel_.get(); | 2065 return gpu_channel_.get(); |
2061 } | 2066 } |
2062 | 2067 |
2063 void RenderThreadImpl::CreateView(mojom::CreateViewParamsPtr params) { | 2068 void RenderThreadImpl::CreateView(mojom::CreateViewParamsPtr params) { |
2064 CompositorDependencies* compositor_deps = this; | 2069 CompositorDependencies* compositor_deps = this; |
| 2070 is_scroll_animator_enabled_ = params->web_preferences.enable_scroll_animator; |
2065 // When bringing in render_view, also bring in webkit's glue and jsbindings. | 2071 // When bringing in render_view, also bring in webkit's glue and jsbindings. |
2066 RenderViewImpl::Create(compositor_deps, *params, | 2072 RenderViewImpl::Create(compositor_deps, *params, |
2067 RenderWidget::ShowCallback()); | 2073 RenderWidget::ShowCallback()); |
2068 } | 2074 } |
2069 | 2075 |
2070 void RenderThreadImpl::CreateFrame(mojom::CreateFrameParamsPtr params) { | 2076 void RenderThreadImpl::CreateFrame(mojom::CreateFrameParamsPtr params) { |
2071 // Debug cases of https://crbug.com/626802. | 2077 // Debug cases of https://crbug.com/626802. |
2072 base::debug::SetCrashKeyValue("newframe_routing_id", | 2078 base::debug::SetCrashKeyValue("newframe_routing_id", |
2073 base::IntToString(params->routing_id)); | 2079 base::IntToString(params->routing_id)); |
2074 base::debug::SetCrashKeyValue("newframe_proxy_id", | 2080 base::debug::SetCrashKeyValue("newframe_proxy_id", |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2430 } | 2436 } |
2431 } | 2437 } |
2432 | 2438 |
2433 void RenderThreadImpl::OnRendererInterfaceRequest( | 2439 void RenderThreadImpl::OnRendererInterfaceRequest( |
2434 mojom::RendererAssociatedRequest request) { | 2440 mojom::RendererAssociatedRequest request) { |
2435 DCHECK(!renderer_binding_.is_bound()); | 2441 DCHECK(!renderer_binding_.is_bound()); |
2436 renderer_binding_.Bind(std::move(request)); | 2442 renderer_binding_.Bind(std::move(request)); |
2437 } | 2443 } |
2438 | 2444 |
2439 } // namespace content | 2445 } // namespace content |
OLD | NEW |