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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 RenderThreadImpl::RenderThreadImpl( | 616 RenderThreadImpl::RenderThreadImpl( |
617 std::unique_ptr<base::MessageLoop> main_message_loop, | 617 std::unique_ptr<base::MessageLoop> main_message_loop, |
618 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler) | 618 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler) |
619 : ChildThreadImpl(Options::Builder() | 619 : ChildThreadImpl(Options::Builder() |
620 .AutoStartServiceManagerConnection(false) | 620 .AutoStartServiceManagerConnection(false) |
621 .ConnectToBrowser(true) | 621 .ConnectToBrowser(true) |
622 .Build()), | 622 .Build()), |
623 renderer_scheduler_(std::move(scheduler)), | 623 renderer_scheduler_(std::move(scheduler)), |
624 main_message_loop_(std::move(main_message_loop)), | 624 main_message_loop_(std::move(main_message_loop)), |
625 categorized_worker_pool_(new CategorizedWorkerPool()), | 625 categorized_worker_pool_(new CategorizedWorkerPool()), |
| 626 is_scroll_animator_enabled_(false), |
626 renderer_binding_(this) { | 627 renderer_binding_(this) { |
627 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter; | 628 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter; |
628 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 629 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
629 switches::kRendererClientId)); | 630 switches::kRendererClientId)); |
630 base::StringToInt(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 631 base::StringToInt(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
631 switches::kRendererClientId), | 632 switches::kRendererClientId), |
632 &client_id_); | 633 &client_id_); |
633 Init(test_task_counter); | 634 Init(test_task_counter); |
634 } | 635 } |
635 | 636 |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1706 } | 1707 } |
1707 | 1708 |
1708 bool RenderThreadImpl::AreImageDecodeTasksEnabled() { | 1709 bool RenderThreadImpl::AreImageDecodeTasksEnabled() { |
1709 return are_image_decode_tasks_enabled_; | 1710 return are_image_decode_tasks_enabled_; |
1710 } | 1711 } |
1711 | 1712 |
1712 bool RenderThreadImpl::IsThreadedAnimationEnabled() { | 1713 bool RenderThreadImpl::IsThreadedAnimationEnabled() { |
1713 return is_threaded_animation_enabled_; | 1714 return is_threaded_animation_enabled_; |
1714 } | 1715 } |
1715 | 1716 |
| 1717 bool RenderThreadImpl::IsScrollAnimatorEnabled() { |
| 1718 return is_scroll_animator_enabled_; |
| 1719 } |
| 1720 |
1716 void RenderThreadImpl::OnRAILModeChanged(v8::RAILMode rail_mode) { | 1721 void RenderThreadImpl::OnRAILModeChanged(v8::RAILMode rail_mode) { |
1717 blink::mainThreadIsolate()->SetRAILMode(rail_mode); | 1722 blink::mainThreadIsolate()->SetRAILMode(rail_mode); |
1718 blink::setRAILModeOnWorkerThreadIsolates(rail_mode); | 1723 blink::setRAILModeOnWorkerThreadIsolates(rail_mode); |
1719 } | 1724 } |
1720 | 1725 |
1721 bool RenderThreadImpl::IsMainThread() { | 1726 bool RenderThreadImpl::IsMainThread() { |
1722 return !!current(); | 1727 return !!current(); |
1723 } | 1728 } |
1724 | 1729 |
1725 void RenderThreadImpl::OnChannelError() { | 1730 void RenderThreadImpl::OnChannelError() { |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2107 gpu::GpuChannelHost* RenderThreadImpl::GetGpuChannel() { | 2112 gpu::GpuChannelHost* RenderThreadImpl::GetGpuChannel() { |
2108 if (!gpu_channel_) | 2113 if (!gpu_channel_) |
2109 return nullptr; | 2114 return nullptr; |
2110 if (gpu_channel_->IsLost()) | 2115 if (gpu_channel_->IsLost()) |
2111 return nullptr; | 2116 return nullptr; |
2112 return gpu_channel_.get(); | 2117 return gpu_channel_.get(); |
2113 } | 2118 } |
2114 | 2119 |
2115 void RenderThreadImpl::CreateView(mojom::CreateViewParamsPtr params) { | 2120 void RenderThreadImpl::CreateView(mojom::CreateViewParamsPtr params) { |
2116 CompositorDependencies* compositor_deps = this; | 2121 CompositorDependencies* compositor_deps = this; |
| 2122 is_scroll_animator_enabled_ = params->web_preferences.enable_scroll_animator; |
2117 // When bringing in render_view, also bring in webkit's glue and jsbindings. | 2123 // When bringing in render_view, also bring in webkit's glue and jsbindings. |
2118 RenderViewImpl::Create(compositor_deps, *params, | 2124 RenderViewImpl::Create(compositor_deps, *params, |
2119 RenderWidget::ShowCallback()); | 2125 RenderWidget::ShowCallback()); |
2120 } | 2126 } |
2121 | 2127 |
2122 void RenderThreadImpl::CreateFrame(mojom::CreateFrameParamsPtr params) { | 2128 void RenderThreadImpl::CreateFrame(mojom::CreateFrameParamsPtr params) { |
2123 // Debug cases of https://crbug.com/626802. | 2129 // Debug cases of https://crbug.com/626802. |
2124 base::debug::SetCrashKeyValue("newframe_routing_id", | 2130 base::debug::SetCrashKeyValue("newframe_routing_id", |
2125 base::IntToString(params->routing_id)); | 2131 base::IntToString(params->routing_id)); |
2126 base::debug::SetCrashKeyValue("newframe_proxy_id", | 2132 base::debug::SetCrashKeyValue("newframe_proxy_id", |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2501 } | 2507 } |
2502 } | 2508 } |
2503 | 2509 |
2504 void RenderThreadImpl::OnRendererInterfaceRequest( | 2510 void RenderThreadImpl::OnRendererInterfaceRequest( |
2505 mojom::RendererAssociatedRequest request) { | 2511 mojom::RendererAssociatedRequest request) { |
2506 DCHECK(!renderer_binding_.is_bound()); | 2512 DCHECK(!renderer_binding_.is_bound()); |
2507 renderer_binding_.Bind(std::move(request)); | 2513 renderer_binding_.Bind(std::move(request)); |
2508 } | 2514 } |
2509 | 2515 |
2510 } // namespace content | 2516 } // namespace content |
OLD | NEW |