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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 std::unique_ptr<base::MessageLoop> main_message_loop, | 622 std::unique_ptr<base::MessageLoop> main_message_loop, |
623 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler) | 623 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler) |
624 : ChildThreadImpl(Options::Builder() | 624 : ChildThreadImpl(Options::Builder() |
625 .AutoStartServiceManagerConnection(false) | 625 .AutoStartServiceManagerConnection(false) |
626 .ConnectToBrowser(true) | 626 .ConnectToBrowser(true) |
627 .Build()), | 627 .Build()), |
628 renderer_scheduler_(std::move(scheduler)), | 628 renderer_scheduler_(std::move(scheduler)), |
629 time_zone_monitor_binding_(this), | 629 time_zone_monitor_binding_(this), |
630 main_message_loop_(std::move(main_message_loop)), | 630 main_message_loop_(std::move(main_message_loop)), |
631 categorized_worker_pool_(new CategorizedWorkerPool()), | 631 categorized_worker_pool_(new CategorizedWorkerPool()), |
| 632 is_scroll_animator_enabled_(false), |
632 renderer_binding_(this) { | 633 renderer_binding_(this) { |
633 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter; | 634 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter; |
634 Init(test_task_counter); | 635 Init(test_task_counter); |
635 } | 636 } |
636 | 637 |
637 void RenderThreadImpl::Init( | 638 void RenderThreadImpl::Init( |
638 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) { | 639 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) { |
639 TRACE_EVENT0("startup", "RenderThreadImpl::Init"); | 640 TRACE_EVENT0("startup", "RenderThreadImpl::Init"); |
640 | 641 |
641 base::trace_event::TraceLog::GetInstance()->SetThreadSortIndex( | 642 base::trace_event::TraceLog::GetInstance()->SetThreadSortIndex( |
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1688 } | 1689 } |
1689 | 1690 |
1690 bool RenderThreadImpl::AreImageDecodeTasksEnabled() { | 1691 bool RenderThreadImpl::AreImageDecodeTasksEnabled() { |
1691 return are_image_decode_tasks_enabled_; | 1692 return are_image_decode_tasks_enabled_; |
1692 } | 1693 } |
1693 | 1694 |
1694 bool RenderThreadImpl::IsThreadedAnimationEnabled() { | 1695 bool RenderThreadImpl::IsThreadedAnimationEnabled() { |
1695 return is_threaded_animation_enabled_; | 1696 return is_threaded_animation_enabled_; |
1696 } | 1697 } |
1697 | 1698 |
| 1699 bool RenderThreadImpl::IsScrollAnimatorEnabled() { |
| 1700 return is_scroll_animator_enabled_; |
| 1701 } |
| 1702 |
1698 void RenderThreadImpl::OnRAILModeChanged(v8::RAILMode rail_mode) { | 1703 void RenderThreadImpl::OnRAILModeChanged(v8::RAILMode rail_mode) { |
1699 blink::mainThreadIsolate()->SetRAILMode(rail_mode); | 1704 blink::mainThreadIsolate()->SetRAILMode(rail_mode); |
1700 blink::setRAILModeOnWorkerThreadIsolates(rail_mode); | 1705 blink::setRAILModeOnWorkerThreadIsolates(rail_mode); |
1701 } | 1706 } |
1702 | 1707 |
1703 bool RenderThreadImpl::IsMainThread() { | 1708 bool RenderThreadImpl::IsMainThread() { |
1704 return !!current(); | 1709 return !!current(); |
1705 } | 1710 } |
1706 | 1711 |
1707 scoped_refptr<base::SingleThreadTaskRunner> | 1712 scoped_refptr<base::SingleThreadTaskRunner> |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2103 gpu::GpuChannelHost* RenderThreadImpl::GetGpuChannel() { | 2108 gpu::GpuChannelHost* RenderThreadImpl::GetGpuChannel() { |
2104 if (!gpu_channel_) | 2109 if (!gpu_channel_) |
2105 return nullptr; | 2110 return nullptr; |
2106 if (gpu_channel_->IsLost()) | 2111 if (gpu_channel_->IsLost()) |
2107 return nullptr; | 2112 return nullptr; |
2108 return gpu_channel_.get(); | 2113 return gpu_channel_.get(); |
2109 } | 2114 } |
2110 | 2115 |
2111 void RenderThreadImpl::CreateView(mojom::CreateViewParamsPtr params) { | 2116 void RenderThreadImpl::CreateView(mojom::CreateViewParamsPtr params) { |
2112 CompositorDependencies* compositor_deps = this; | 2117 CompositorDependencies* compositor_deps = this; |
| 2118 is_scroll_animator_enabled_ = params->web_preferences.enable_scroll_animator; |
2113 // When bringing in render_view, also bring in webkit's glue and jsbindings. | 2119 // When bringing in render_view, also bring in webkit's glue and jsbindings. |
2114 RenderViewImpl::Create(compositor_deps, *params, false); | 2120 RenderViewImpl::Create(compositor_deps, *params, false); |
2115 } | 2121 } |
2116 | 2122 |
2117 void RenderThreadImpl::CreateFrame(mojom::CreateFrameParamsPtr params) { | 2123 void RenderThreadImpl::CreateFrame(mojom::CreateFrameParamsPtr params) { |
2118 // Debug cases of https://crbug.com/626802. | 2124 // Debug cases of https://crbug.com/626802. |
2119 base::debug::SetCrashKeyValue("newframe_routing_id", | 2125 base::debug::SetCrashKeyValue("newframe_routing_id", |
2120 base::IntToString(params->routing_id)); | 2126 base::IntToString(params->routing_id)); |
2121 base::debug::SetCrashKeyValue("newframe_proxy_id", | 2127 base::debug::SetCrashKeyValue("newframe_proxy_id", |
2122 base::IntToString(params->proxy_routing_id)); | 2128 base::IntToString(params->proxy_routing_id)); |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2479 } | 2485 } |
2480 } | 2486 } |
2481 | 2487 |
2482 void RenderThreadImpl::OnRendererInterfaceRequest( | 2488 void RenderThreadImpl::OnRendererInterfaceRequest( |
2483 mojom::RendererAssociatedRequest request) { | 2489 mojom::RendererAssociatedRequest request) { |
2484 DCHECK(!renderer_binding_.is_bound()); | 2490 DCHECK(!renderer_binding_.is_bound()); |
2485 renderer_binding_.Bind(std::move(request)); | 2491 renderer_binding_.Bind(std::move(request)); |
2486 } | 2492 } |
2487 | 2493 |
2488 } // namespace content | 2494 } // namespace content |
OLD | NEW |