| 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 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 resource_task_queue2, resource_dispatcher())); | 1184 resource_task_queue2, resource_dispatcher())); |
| 1185 channel()->AddFilter(filter.get()); | 1185 channel()->AddFilter(filter.get()); |
| 1186 resource_dispatcher()->SetResourceSchedulingFilter(filter); | 1186 resource_dispatcher()->SetResourceSchedulingFilter(filter); |
| 1187 | 1187 |
| 1188 // The ChildResourceMessageFilter and the ResourceDispatcher need to use the | 1188 // The ChildResourceMessageFilter and the ResourceDispatcher need to use the |
| 1189 // same queue to ensure tasks are executed in the expected order. | 1189 // same queue to ensure tasks are executed in the expected order. |
| 1190 child_resource_message_filter()->SetMainThreadTaskRunner( | 1190 child_resource_message_filter()->SetMainThreadTaskRunner( |
| 1191 resource_task_queue2); | 1191 resource_task_queue2); |
| 1192 resource_dispatcher()->SetMainThreadTaskRunner(resource_task_queue2); | 1192 resource_dispatcher()->SetMainThreadTaskRunner(resource_task_queue2); |
| 1193 | 1193 |
| 1194 if (!command_line.HasSwitch(switches::kDisableThreadedCompositing) && | 1194 if (!command_line.HasSwitch(switches::kDisableThreadedCompositing)) |
| 1195 !command_line.HasSwitch(switches::kUseRemoteCompositing)) | |
| 1196 InitializeCompositorThread(); | 1195 InitializeCompositorThread(); |
| 1197 | 1196 |
| 1198 if (!input_event_filter_.get()) { | 1197 if (!input_event_filter_.get()) { |
| 1199 // Always provide an input event filter implementation to ensure consistent | 1198 // Always provide an input event filter implementation to ensure consistent |
| 1200 // input event scheduling and prioritization. | 1199 // input event scheduling and prioritization. |
| 1201 // TODO(jdduke): Merge InputEventFilter, InputHandlerManager and | 1200 // TODO(jdduke): Merge InputEventFilter, InputHandlerManager and |
| 1202 // MainThreadInputEventFilter, crbug.com/436057. | 1201 // MainThreadInputEventFilter, crbug.com/436057. |
| 1203 input_event_filter_ = new MainThreadInputEventFilter( | 1202 input_event_filter_ = new MainThreadInputEventFilter( |
| 1204 main_input_callback_.callback(), main_thread_compositor_task_runner_); | 1203 main_input_callback_.callback(), main_thread_compositor_task_runner_); |
| 1205 } | 1204 } |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1589 return base::MakeUnique<cc::BackToBackBeginFrameSource>( | 1588 return base::MakeUnique<cc::BackToBackBeginFrameSource>( |
| 1590 base::MakeUnique<cc::DelayBasedTimeSource>( | 1589 base::MakeUnique<cc::DelayBasedTimeSource>( |
| 1591 compositor_impl_side_task_runner)); | 1590 compositor_impl_side_task_runner)); |
| 1592 } | 1591 } |
| 1593 } | 1592 } |
| 1594 | 1593 |
| 1595 return base::MakeUnique<CompositorExternalBeginFrameSource>( | 1594 return base::MakeUnique<CompositorExternalBeginFrameSource>( |
| 1596 compositor_message_filter_.get(), sync_message_filter(), routing_id); | 1595 compositor_message_filter_.get(), sync_message_filter(), routing_id); |
| 1597 } | 1596 } |
| 1598 | 1597 |
| 1599 cc::ImageSerializationProcessor* | |
| 1600 RenderThreadImpl::GetImageSerializationProcessor() { | |
| 1601 return GetContentClient()->renderer()->GetImageSerializationProcessor(); | |
| 1602 } | |
| 1603 | |
| 1604 cc::TaskGraphRunner* RenderThreadImpl::GetTaskGraphRunner() { | 1598 cc::TaskGraphRunner* RenderThreadImpl::GetTaskGraphRunner() { |
| 1605 return categorized_worker_pool_->GetTaskGraphRunner(); | 1599 return categorized_worker_pool_->GetTaskGraphRunner(); |
| 1606 } | 1600 } |
| 1607 | 1601 |
| 1608 bool RenderThreadImpl::AreImageDecodeTasksEnabled() { | 1602 bool RenderThreadImpl::AreImageDecodeTasksEnabled() { |
| 1609 return are_image_decode_tasks_enabled_; | 1603 return are_image_decode_tasks_enabled_; |
| 1610 } | 1604 } |
| 1611 | 1605 |
| 1612 bool RenderThreadImpl::IsThreadedAnimationEnabled() { | 1606 bool RenderThreadImpl::IsThreadedAnimationEnabled() { |
| 1613 return is_threaded_animation_enabled_; | 1607 return is_threaded_animation_enabled_; |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2421 } | 2415 } |
| 2422 } | 2416 } |
| 2423 | 2417 |
| 2424 void RenderThreadImpl::OnRendererInterfaceRequest( | 2418 void RenderThreadImpl::OnRendererInterfaceRequest( |
| 2425 mojom::RendererAssociatedRequest request) { | 2419 mojom::RendererAssociatedRequest request) { |
| 2426 DCHECK(!renderer_binding_.is_bound()); | 2420 DCHECK(!renderer_binding_.is_bound()); |
| 2427 renderer_binding_.Bind(std::move(request)); | 2421 renderer_binding_.Bind(std::move(request)); |
| 2428 } | 2422 } |
| 2429 | 2423 |
| 2430 } // namespace content | 2424 } // namespace content |
| OLD | NEW |