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 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 | 847 |
848 GetContentClient()->renderer()->ExposeInterfacesToBrowser( | 848 GetContentClient()->renderer()->ExposeInterfacesToBrowser( |
849 GetInterfaceRegistry()); | 849 GetInterfaceRegistry()); |
850 | 850 |
851 GetInterfaceRegistry()->AddInterface(base::Bind(CreateFrameFactory)); | 851 GetInterfaceRegistry()->AddInterface(base::Bind(CreateFrameFactory)); |
852 GetInterfaceRegistry()->AddInterface(base::Bind(CreateEmbeddedWorkerSetup)); | 852 GetInterfaceRegistry()->AddInterface(base::Bind(CreateEmbeddedWorkerSetup)); |
853 | 853 |
854 GetRemoteInterfaces()->GetInterface( | 854 GetRemoteInterfaces()->GetInterface( |
855 mojo::GetProxy(&storage_partition_service_)); | 855 mojo::GetProxy(&storage_partition_service_)); |
856 | 856 |
| 857 #if defined(OS_LINUX) |
| 858 ChildProcess::current()->SetIOThreadPriority(base::ThreadPriority::DISPLAY); |
| 859 ChildThreadImpl::current()->SetThreadPriority( |
| 860 categorized_worker_pool_->background_worker_thread_id(), |
| 861 base::ThreadPriority::BACKGROUND); |
| 862 #endif |
| 863 |
857 is_renderer_suspended_ = false; | 864 is_renderer_suspended_ = false; |
858 } | 865 } |
859 | 866 |
860 RenderThreadImpl::~RenderThreadImpl() { | 867 RenderThreadImpl::~RenderThreadImpl() { |
861 } | 868 } |
862 | 869 |
863 void RenderThreadImpl::Shutdown() { | 870 void RenderThreadImpl::Shutdown() { |
864 FOR_EACH_OBSERVER( | 871 FOR_EACH_OBSERVER( |
865 RenderThreadObserver, observers_, OnRenderProcessShutdown()); | 872 RenderThreadObserver, observers_, OnRenderProcessShutdown()); |
866 | 873 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 base::Thread::Options options; | 1130 base::Thread::Options options; |
1124 #if defined(OS_ANDROID) | 1131 #if defined(OS_ANDROID) |
1125 options.priority = base::ThreadPriority::DISPLAY; | 1132 options.priority = base::ThreadPriority::DISPLAY; |
1126 #endif | 1133 #endif |
1127 compositor_thread_.reset(new WebThreadForCompositor(options)); | 1134 compositor_thread_.reset(new WebThreadForCompositor(options)); |
1128 blink_platform_impl_->SetCompositorThread(compositor_thread_.get()); | 1135 blink_platform_impl_->SetCompositorThread(compositor_thread_.get()); |
1129 compositor_task_runner_ = compositor_thread_->GetTaskRunner(); | 1136 compositor_task_runner_ = compositor_thread_->GetTaskRunner(); |
1130 compositor_task_runner_->PostTask( | 1137 compositor_task_runner_->PostTask( |
1131 FROM_HERE, | 1138 FROM_HERE, |
1132 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), false)); | 1139 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), false)); |
| 1140 #if defined(OS_LINUX) |
| 1141 ChildThreadImpl::current()->SetThreadPriority(compositor_thread_->threadId(), |
| 1142 base::ThreadPriority::DISPLAY); |
| 1143 #endif |
1133 | 1144 |
1134 SynchronousInputHandlerProxyClient* synchronous_input_handler_proxy_client = | 1145 SynchronousInputHandlerProxyClient* synchronous_input_handler_proxy_client = |
1135 nullptr; | 1146 nullptr; |
1136 #if defined(OS_ANDROID) | 1147 #if defined(OS_ANDROID) |
1137 if (GetContentClient()->UsingSynchronousCompositing()) { | 1148 if (GetContentClient()->UsingSynchronousCompositing()) { |
1138 sync_compositor_message_filter_ = | 1149 sync_compositor_message_filter_ = |
1139 new SynchronousCompositorFilter(compositor_task_runner_); | 1150 new SynchronousCompositorFilter(compositor_task_runner_); |
1140 AddFilter(sync_compositor_message_filter_.get()); | 1151 AddFilter(sync_compositor_message_filter_.get()); |
1141 synchronous_input_handler_proxy_client = | 1152 synchronous_input_handler_proxy_client = |
1142 sync_compositor_message_filter_.get(); | 1153 sync_compositor_message_filter_.get(); |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2226 if (blink::mainThreadIsolate()) { | 2237 if (blink::mainThreadIsolate()) { |
2227 blink::mainThreadIsolate()->MemoryPressureNotification( | 2238 blink::mainThreadIsolate()->MemoryPressureNotification( |
2228 v8::MemoryPressureLevel::kCritical); | 2239 v8::MemoryPressureLevel::kCritical); |
2229 blink::MemoryPressureNotificationToWorkerThreadIsolates( | 2240 blink::MemoryPressureNotificationToWorkerThreadIsolates( |
2230 v8::MemoryPressureLevel::kCritical); | 2241 v8::MemoryPressureLevel::kCritical); |
2231 } | 2242 } |
2232 } | 2243 } |
2233 | 2244 |
2234 | 2245 |
2235 } // namespace content | 2246 } // namespace content |
OLD | NEW |