| 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 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 resource_task_queue2, resource_dispatcher())); | 1152 resource_task_queue2, resource_dispatcher())); |
| 1153 channel()->AddFilter(filter.get()); | 1153 channel()->AddFilter(filter.get()); |
| 1154 resource_dispatcher()->SetResourceSchedulingFilter(filter); | 1154 resource_dispatcher()->SetResourceSchedulingFilter(filter); |
| 1155 | 1155 |
| 1156 // The ChildResourceMessageFilter and the ResourceDispatcher need to use the | 1156 // The ChildResourceMessageFilter and the ResourceDispatcher need to use the |
| 1157 // same queue to ensure tasks are executed in the expected order. | 1157 // same queue to ensure tasks are executed in the expected order. |
| 1158 child_resource_message_filter()->SetMainThreadTaskRunner( | 1158 child_resource_message_filter()->SetMainThreadTaskRunner( |
| 1159 resource_task_queue2); | 1159 resource_task_queue2); |
| 1160 resource_dispatcher()->SetMainThreadTaskRunner(resource_task_queue2); | 1160 resource_dispatcher()->SetMainThreadTaskRunner(resource_task_queue2); |
| 1161 | 1161 |
| 1162 if (!command_line.HasSwitch(switches::kDisableThreadedCompositing) && | 1162 if (!command_line.HasSwitch(switches::kDisableThreadedCompositing)) |
| 1163 !command_line.HasSwitch(switches::kUseRemoteCompositing)) | |
| 1164 InitializeCompositorThread(); | 1163 InitializeCompositorThread(); |
| 1165 | 1164 |
| 1166 if (!input_event_filter_.get()) { | 1165 if (!input_event_filter_.get()) { |
| 1167 // Always provide an input event filter implementation to ensure consistent | 1166 // Always provide an input event filter implementation to ensure consistent |
| 1168 // input event scheduling and prioritization. | 1167 // input event scheduling and prioritization. |
| 1169 // TODO(jdduke): Merge InputEventFilter, InputHandlerManager and | 1168 // TODO(jdduke): Merge InputEventFilter, InputHandlerManager and |
| 1170 // MainThreadInputEventFilter, crbug.com/436057. | 1169 // MainThreadInputEventFilter, crbug.com/436057. |
| 1171 input_event_filter_ = new MainThreadInputEventFilter( | 1170 input_event_filter_ = new MainThreadInputEventFilter( |
| 1172 main_input_callback_.callback(), main_thread_compositor_task_runner_); | 1171 main_input_callback_.callback(), main_thread_compositor_task_runner_); |
| 1173 } | 1172 } |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1567 return base::MakeUnique<cc::BackToBackBeginFrameSource>( | 1566 return base::MakeUnique<cc::BackToBackBeginFrameSource>( |
| 1568 base::MakeUnique<cc::DelayBasedTimeSource>( | 1567 base::MakeUnique<cc::DelayBasedTimeSource>( |
| 1569 compositor_impl_side_task_runner)); | 1568 compositor_impl_side_task_runner)); |
| 1570 } | 1569 } |
| 1571 } | 1570 } |
| 1572 | 1571 |
| 1573 return base::MakeUnique<CompositorExternalBeginFrameSource>( | 1572 return base::MakeUnique<CompositorExternalBeginFrameSource>( |
| 1574 compositor_message_filter_.get(), sync_message_filter(), routing_id); | 1573 compositor_message_filter_.get(), sync_message_filter(), routing_id); |
| 1575 } | 1574 } |
| 1576 | 1575 |
| 1577 cc::ImageSerializationProcessor* | |
| 1578 RenderThreadImpl::GetImageSerializationProcessor() { | |
| 1579 return GetContentClient()->renderer()->GetImageSerializationProcessor(); | |
| 1580 } | |
| 1581 | |
| 1582 cc::TaskGraphRunner* RenderThreadImpl::GetTaskGraphRunner() { | 1576 cc::TaskGraphRunner* RenderThreadImpl::GetTaskGraphRunner() { |
| 1583 return categorized_worker_pool_->GetTaskGraphRunner(); | 1577 return categorized_worker_pool_->GetTaskGraphRunner(); |
| 1584 } | 1578 } |
| 1585 | 1579 |
| 1586 bool RenderThreadImpl::AreImageDecodeTasksEnabled() { | 1580 bool RenderThreadImpl::AreImageDecodeTasksEnabled() { |
| 1587 return are_image_decode_tasks_enabled_; | 1581 return are_image_decode_tasks_enabled_; |
| 1588 } | 1582 } |
| 1589 | 1583 |
| 1590 bool RenderThreadImpl::IsThreadedAnimationEnabled() { | 1584 bool RenderThreadImpl::IsThreadedAnimationEnabled() { |
| 1591 return is_threaded_animation_enabled_; | 1585 return is_threaded_animation_enabled_; |
| (...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2380 } | 2374 } |
| 2381 } | 2375 } |
| 2382 | 2376 |
| 2383 void RenderThreadImpl::OnRendererInterfaceRequest( | 2377 void RenderThreadImpl::OnRendererInterfaceRequest( |
| 2384 mojom::RendererAssociatedRequest request) { | 2378 mojom::RendererAssociatedRequest request) { |
| 2385 DCHECK(!renderer_binding_.is_bound()); | 2379 DCHECK(!renderer_binding_.is_bound()); |
| 2386 renderer_binding_.Bind(std::move(request)); | 2380 renderer_binding_.Bind(std::move(request)); |
| 2387 } | 2381 } |
| 2388 | 2382 |
| 2389 } // namespace content | 2383 } // namespace content |
| OLD | NEW |