| 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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 RenderThreadImpl::RenderThreadImpl( | 612 RenderThreadImpl::RenderThreadImpl( |
| 613 std::unique_ptr<base::MessageLoop> main_message_loop, | 613 std::unique_ptr<base::MessageLoop> main_message_loop, |
| 614 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler) | 614 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler) |
| 615 : ChildThreadImpl(Options::Builder() | 615 : ChildThreadImpl(Options::Builder() |
| 616 .AutoStartServiceManagerConnection(false) | 616 .AutoStartServiceManagerConnection(false) |
| 617 .ConnectToBrowser(true) | 617 .ConnectToBrowser(true) |
| 618 .Build()), | 618 .Build()), |
| 619 renderer_scheduler_(std::move(scheduler)), | 619 renderer_scheduler_(std::move(scheduler)), |
| 620 main_message_loop_(std::move(main_message_loop)), | 620 main_message_loop_(std::move(main_message_loop)), |
| 621 categorized_worker_pool_(new CategorizedWorkerPool()), | 621 categorized_worker_pool_(new CategorizedWorkerPool()), |
| 622 is_scroll_animator_enabled_(false), |
| 622 renderer_binding_(this) { | 623 renderer_binding_(this) { |
| 623 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter; | 624 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter; |
| 624 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 625 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 625 switches::kRendererClientId)); | 626 switches::kRendererClientId)); |
| 626 base::StringToInt(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 627 base::StringToInt(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 627 switches::kRendererClientId), | 628 switches::kRendererClientId), |
| 628 &client_id_); | 629 &client_id_); |
| 629 Init(test_task_counter); | 630 Init(test_task_counter); |
| 630 } | 631 } |
| 631 | 632 |
| (...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1680 } | 1681 } |
| 1681 | 1682 |
| 1682 bool RenderThreadImpl::AreImageDecodeTasksEnabled() { | 1683 bool RenderThreadImpl::AreImageDecodeTasksEnabled() { |
| 1683 return are_image_decode_tasks_enabled_; | 1684 return are_image_decode_tasks_enabled_; |
| 1684 } | 1685 } |
| 1685 | 1686 |
| 1686 bool RenderThreadImpl::IsThreadedAnimationEnabled() { | 1687 bool RenderThreadImpl::IsThreadedAnimationEnabled() { |
| 1687 return is_threaded_animation_enabled_; | 1688 return is_threaded_animation_enabled_; |
| 1688 } | 1689 } |
| 1689 | 1690 |
| 1691 bool RenderThreadImpl::IsScrollAnimatorEnabled() { |
| 1692 return is_scroll_animator_enabled_; |
| 1693 } |
| 1694 |
| 1690 void RenderThreadImpl::OnRAILModeChanged(v8::RAILMode rail_mode) { | 1695 void RenderThreadImpl::OnRAILModeChanged(v8::RAILMode rail_mode) { |
| 1691 blink::mainThreadIsolate()->SetRAILMode(rail_mode); | 1696 blink::mainThreadIsolate()->SetRAILMode(rail_mode); |
| 1692 blink::setRAILModeOnWorkerThreadIsolates(rail_mode); | 1697 blink::setRAILModeOnWorkerThreadIsolates(rail_mode); |
| 1693 } | 1698 } |
| 1694 | 1699 |
| 1695 bool RenderThreadImpl::IsMainThread() { | 1700 bool RenderThreadImpl::IsMainThread() { |
| 1696 return !!current(); | 1701 return !!current(); |
| 1697 } | 1702 } |
| 1698 | 1703 |
| 1699 scoped_refptr<base::SingleThreadTaskRunner> | 1704 scoped_refptr<base::SingleThreadTaskRunner> |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2113 gpu::GpuChannelHost* RenderThreadImpl::GetGpuChannel() { | 2118 gpu::GpuChannelHost* RenderThreadImpl::GetGpuChannel() { |
| 2114 if (!gpu_channel_) | 2119 if (!gpu_channel_) |
| 2115 return nullptr; | 2120 return nullptr; |
| 2116 if (gpu_channel_->IsLost()) | 2121 if (gpu_channel_->IsLost()) |
| 2117 return nullptr; | 2122 return nullptr; |
| 2118 return gpu_channel_.get(); | 2123 return gpu_channel_.get(); |
| 2119 } | 2124 } |
| 2120 | 2125 |
| 2121 void RenderThreadImpl::CreateView(mojom::CreateViewParamsPtr params) { | 2126 void RenderThreadImpl::CreateView(mojom::CreateViewParamsPtr params) { |
| 2122 CompositorDependencies* compositor_deps = this; | 2127 CompositorDependencies* compositor_deps = this; |
| 2128 is_scroll_animator_enabled_ = params->web_preferences.enable_scroll_animator; |
| 2123 // When bringing in render_view, also bring in webkit's glue and jsbindings. | 2129 // When bringing in render_view, also bring in webkit's glue and jsbindings. |
| 2124 RenderViewImpl::Create(compositor_deps, *params, false); | 2130 RenderViewImpl::Create(compositor_deps, *params, false); |
| 2125 } | 2131 } |
| 2126 | 2132 |
| 2127 void RenderThreadImpl::CreateFrame(mojom::CreateFrameParamsPtr params) { | 2133 void RenderThreadImpl::CreateFrame(mojom::CreateFrameParamsPtr params) { |
| 2128 // Debug cases of https://crbug.com/626802. | 2134 // Debug cases of https://crbug.com/626802. |
| 2129 base::debug::SetCrashKeyValue("newframe_routing_id", | 2135 base::debug::SetCrashKeyValue("newframe_routing_id", |
| 2130 base::IntToString(params->routing_id)); | 2136 base::IntToString(params->routing_id)); |
| 2131 base::debug::SetCrashKeyValue("newframe_proxy_id", | 2137 base::debug::SetCrashKeyValue("newframe_proxy_id", |
| 2132 base::IntToString(params->proxy_routing_id)); | 2138 base::IntToString(params->proxy_routing_id)); |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2477 } | 2483 } |
| 2478 } | 2484 } |
| 2479 | 2485 |
| 2480 void RenderThreadImpl::OnRendererInterfaceRequest( | 2486 void RenderThreadImpl::OnRendererInterfaceRequest( |
| 2481 mojom::RendererAssociatedRequest request) { | 2487 mojom::RendererAssociatedRequest request) { |
| 2482 DCHECK(!renderer_binding_.is_bound()); | 2488 DCHECK(!renderer_binding_.is_bound()); |
| 2483 renderer_binding_.Bind(std::move(request)); | 2489 renderer_binding_.Bind(std::move(request)); |
| 2484 } | 2490 } |
| 2485 | 2491 |
| 2486 } // namespace content | 2492 } // namespace content |
| OLD | NEW |