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 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 } | 835 } |
836 | 836 |
837 int num_raster_threads = 0; | 837 int num_raster_threads = 0; |
838 std::string string_value = | 838 std::string string_value = |
839 command_line.GetSwitchValueASCII(switches::kNumRasterThreads); | 839 command_line.GetSwitchValueASCII(switches::kNumRasterThreads); |
840 bool parsed_num_raster_threads = | 840 bool parsed_num_raster_threads = |
841 base::StringToInt(string_value, &num_raster_threads); | 841 base::StringToInt(string_value, &num_raster_threads); |
842 DCHECK(parsed_num_raster_threads) << string_value; | 842 DCHECK(parsed_num_raster_threads) << string_value; |
843 DCHECK_GT(num_raster_threads, 0); | 843 DCHECK_GT(num_raster_threads, 0); |
844 | 844 |
845 // TODO(vmpstr): If the flag sticks, we should clean it up and always have | |
846 // image decode tasks. | |
847 are_image_decode_tasks_enabled_ = true; | |
848 | |
849 categorized_worker_pool_->Start(num_raster_threads); | 845 categorized_worker_pool_->Start(num_raster_threads); |
850 | 846 |
851 discardable_memory::mojom::DiscardableSharedMemoryManagerPtr manager_ptr; | 847 discardable_memory::mojom::DiscardableSharedMemoryManagerPtr manager_ptr; |
852 if (IsRunningInMash()) { | 848 if (IsRunningInMash()) { |
853 #if defined(USE_AURA) | 849 #if defined(USE_AURA) |
854 GetServiceManagerConnection()->GetConnector()->BindInterface( | 850 GetServiceManagerConnection()->GetConnector()->BindInterface( |
855 ui::mojom::kServiceName, &manager_ptr); | 851 ui::mojom::kServiceName, &manager_ptr); |
856 #else | 852 #else |
857 NOTREACHED(); | 853 NOTREACHED(); |
858 #endif | 854 #endif |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 : base::ThreadTaskRunnerHandle::Get().get(); | 1563 : base::ThreadTaskRunnerHandle::Get().get(); |
1568 return base::MakeUnique<cc::BackToBackBeginFrameSource>( | 1564 return base::MakeUnique<cc::BackToBackBeginFrameSource>( |
1569 base::MakeUnique<cc::DelayBasedTimeSource>( | 1565 base::MakeUnique<cc::DelayBasedTimeSource>( |
1570 compositor_impl_side_task_runner)); | 1566 compositor_impl_side_task_runner)); |
1571 } | 1567 } |
1572 | 1568 |
1573 cc::TaskGraphRunner* RenderThreadImpl::GetTaskGraphRunner() { | 1569 cc::TaskGraphRunner* RenderThreadImpl::GetTaskGraphRunner() { |
1574 return categorized_worker_pool_->GetTaskGraphRunner(); | 1570 return categorized_worker_pool_->GetTaskGraphRunner(); |
1575 } | 1571 } |
1576 | 1572 |
1577 bool RenderThreadImpl::AreImageDecodeTasksEnabled() { | |
1578 return are_image_decode_tasks_enabled_; | |
1579 } | |
1580 | |
1581 bool RenderThreadImpl::IsThreadedAnimationEnabled() { | 1573 bool RenderThreadImpl::IsThreadedAnimationEnabled() { |
1582 return is_threaded_animation_enabled_; | 1574 return is_threaded_animation_enabled_; |
1583 } | 1575 } |
1584 | 1576 |
1585 bool RenderThreadImpl::IsScrollAnimatorEnabled() { | 1577 bool RenderThreadImpl::IsScrollAnimatorEnabled() { |
1586 return is_scroll_animator_enabled_; | 1578 return is_scroll_animator_enabled_; |
1587 } | 1579 } |
1588 | 1580 |
1589 bool RenderThreadImpl::IsSurfaceSynchronizationEnabled() { | 1581 bool RenderThreadImpl::IsSurfaceSynchronizationEnabled() { |
1590 return is_surface_synchronization_enabled_; | 1582 return is_surface_synchronization_enabled_; |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2452 } | 2444 } |
2453 } | 2445 } |
2454 | 2446 |
2455 void RenderThreadImpl::OnRendererInterfaceRequest( | 2447 void RenderThreadImpl::OnRendererInterfaceRequest( |
2456 mojom::RendererAssociatedRequest request) { | 2448 mojom::RendererAssociatedRequest request) { |
2457 DCHECK(!renderer_binding_.is_bound()); | 2449 DCHECK(!renderer_binding_.is_bound()); |
2458 renderer_binding_.Bind(std::move(request)); | 2450 renderer_binding_.Bind(std::move(request)); |
2459 } | 2451 } |
2460 | 2452 |
2461 } // namespace content | 2453 } // namespace content |
OLD | NEW |