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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 GetInterfaceRegistry()->AddInterface(base::Bind(CreateEmbeddedWorkerSetup)); | 851 GetInterfaceRegistry()->AddInterface(base::Bind(CreateEmbeddedWorkerSetup)); |
852 | 852 |
853 GetRemoteInterfaces()->GetInterface( | 853 GetRemoteInterfaces()->GetInterface( |
854 mojo::GetProxy(&storage_partition_service_)); | 854 mojo::GetProxy(&storage_partition_service_)); |
855 | 855 |
856 device::mojom::TimeZoneMonitorPtr time_zone_monitor; | 856 device::mojom::TimeZoneMonitorPtr time_zone_monitor; |
857 GetRemoteInterfaces()->GetInterface(mojo::GetProxy(&time_zone_monitor)); | 857 GetRemoteInterfaces()->GetInterface(mojo::GetProxy(&time_zone_monitor)); |
858 time_zone_monitor->AddClient( | 858 time_zone_monitor->AddClient( |
859 time_zone_monitor_binding_.CreateInterfacePtrAndBind()); | 859 time_zone_monitor_binding_.CreateInterfacePtrAndBind()); |
860 | 860 |
| 861 #if defined(OS_LINUX) |
| 862 ChildProcess::current()->SetIOThreadPriority(base::ThreadPriority::DISPLAY); |
| 863 ChildThreadImpl::current()->SetThreadPriority( |
| 864 categorized_worker_pool_->background_worker_thread_id(), |
| 865 base::ThreadPriority::BACKGROUND); |
| 866 #endif |
| 867 |
861 is_renderer_suspended_ = false; | 868 is_renderer_suspended_ = false; |
862 } | 869 } |
863 | 870 |
864 RenderThreadImpl::~RenderThreadImpl() { | 871 RenderThreadImpl::~RenderThreadImpl() { |
865 } | 872 } |
866 | 873 |
867 void RenderThreadImpl::Shutdown() { | 874 void RenderThreadImpl::Shutdown() { |
868 FOR_EACH_OBSERVER( | 875 FOR_EACH_OBSERVER( |
869 RenderThreadObserver, observers_, OnRenderProcessShutdown()); | 876 RenderThreadObserver, observers_, OnRenderProcessShutdown()); |
870 | 877 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 base::Thread::Options options; | 1134 base::Thread::Options options; |
1128 #if defined(OS_ANDROID) | 1135 #if defined(OS_ANDROID) |
1129 options.priority = base::ThreadPriority::DISPLAY; | 1136 options.priority = base::ThreadPriority::DISPLAY; |
1130 #endif | 1137 #endif |
1131 compositor_thread_.reset(new WebThreadForCompositor(options)); | 1138 compositor_thread_.reset(new WebThreadForCompositor(options)); |
1132 blink_platform_impl_->SetCompositorThread(compositor_thread_.get()); | 1139 blink_platform_impl_->SetCompositorThread(compositor_thread_.get()); |
1133 compositor_task_runner_ = compositor_thread_->GetTaskRunner(); | 1140 compositor_task_runner_ = compositor_thread_->GetTaskRunner(); |
1134 compositor_task_runner_->PostTask( | 1141 compositor_task_runner_->PostTask( |
1135 FROM_HERE, | 1142 FROM_HERE, |
1136 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), false)); | 1143 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), false)); |
| 1144 #if defined(OS_LINUX) |
| 1145 ChildThreadImpl::current()->SetThreadPriority(compositor_thread_->threadId(), |
| 1146 base::ThreadPriority::DISPLAY); |
| 1147 #endif |
1137 | 1148 |
1138 SynchronousInputHandlerProxyClient* synchronous_input_handler_proxy_client = | 1149 SynchronousInputHandlerProxyClient* synchronous_input_handler_proxy_client = |
1139 nullptr; | 1150 nullptr; |
1140 #if defined(OS_ANDROID) | 1151 #if defined(OS_ANDROID) |
1141 if (GetContentClient()->UsingSynchronousCompositing()) { | 1152 if (GetContentClient()->UsingSynchronousCompositing()) { |
1142 sync_compositor_message_filter_ = | 1153 sync_compositor_message_filter_ = |
1143 new SynchronousCompositorFilter(compositor_task_runner_); | 1154 new SynchronousCompositorFilter(compositor_task_runner_); |
1144 AddFilter(sync_compositor_message_filter_.get()); | 1155 AddFilter(sync_compositor_message_filter_.get()); |
1145 synchronous_input_handler_proxy_client = | 1156 synchronous_input_handler_proxy_client = |
1146 sync_compositor_message_filter_.get(); | 1157 sync_compositor_message_filter_.get(); |
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2274 if (blink::mainThreadIsolate()) { | 2285 if (blink::mainThreadIsolate()) { |
2275 blink::mainThreadIsolate()->MemoryPressureNotification( | 2286 blink::mainThreadIsolate()->MemoryPressureNotification( |
2276 v8::MemoryPressureLevel::kCritical); | 2287 v8::MemoryPressureLevel::kCritical); |
2277 blink::MemoryPressureNotificationToWorkerThreadIsolates( | 2288 blink::MemoryPressureNotificationToWorkerThreadIsolates( |
2278 v8::MemoryPressureLevel::kCritical); | 2289 v8::MemoryPressureLevel::kCritical); |
2279 } | 2290 } |
2280 } | 2291 } |
2281 | 2292 |
2282 | 2293 |
2283 } // namespace content | 2294 } // namespace content |
OLD | NEW |