| 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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 | 848 |
| 849 GetContentClient()->renderer()->ExposeInterfacesToBrowser( | 849 GetContentClient()->renderer()->ExposeInterfacesToBrowser( |
| 850 GetInterfaceRegistry()); | 850 GetInterfaceRegistry()); |
| 851 | 851 |
| 852 GetInterfaceRegistry()->AddInterface(base::Bind(CreateFrameFactory)); | 852 GetInterfaceRegistry()->AddInterface(base::Bind(CreateFrameFactory)); |
| 853 GetInterfaceRegistry()->AddInterface(base::Bind(CreateEmbeddedWorkerSetup)); | 853 GetInterfaceRegistry()->AddInterface(base::Bind(CreateEmbeddedWorkerSetup)); |
| 854 | 854 |
| 855 GetRemoteInterfaces()->GetInterface( | 855 GetRemoteInterfaces()->GetInterface( |
| 856 mojo::GetProxy(&storage_partition_service_)); | 856 mojo::GetProxy(&storage_partition_service_)); |
| 857 | 857 |
| 858 ChildProcess::current()->SetIOThreadAffinity(base::ThreadPriority::DISPLAY); |
| 859 ChildThreadImpl::current()->SetThreadAffinity( |
| 860 categorized_worker_pool_->background_worker_thread_id(), |
| 861 base::ThreadPriority::BACKGROUND); |
| 862 |
| 858 is_renderer_suspended_ = false; | 863 is_renderer_suspended_ = false; |
| 859 } | 864 } |
| 860 | 865 |
| 861 RenderThreadImpl::~RenderThreadImpl() { | 866 RenderThreadImpl::~RenderThreadImpl() { |
| 862 } | 867 } |
| 863 | 868 |
| 864 void RenderThreadImpl::Shutdown() { | 869 void RenderThreadImpl::Shutdown() { |
| 865 FOR_EACH_OBSERVER( | 870 FOR_EACH_OBSERVER( |
| 866 RenderThreadObserver, observers_, OnRenderProcessShutdown()); | 871 RenderThreadObserver, observers_, OnRenderProcessShutdown()); |
| 867 | 872 |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 base::Thread::Options options; | 1129 base::Thread::Options options; |
| 1125 #if defined(OS_ANDROID) | 1130 #if defined(OS_ANDROID) |
| 1126 options.priority = base::ThreadPriority::DISPLAY; | 1131 options.priority = base::ThreadPriority::DISPLAY; |
| 1127 #endif | 1132 #endif |
| 1128 compositor_thread_.reset(new WebThreadForCompositor(options)); | 1133 compositor_thread_.reset(new WebThreadForCompositor(options)); |
| 1129 blink_platform_impl_->SetCompositorThread(compositor_thread_.get()); | 1134 blink_platform_impl_->SetCompositorThread(compositor_thread_.get()); |
| 1130 compositor_task_runner_ = compositor_thread_->GetTaskRunner(); | 1135 compositor_task_runner_ = compositor_thread_->GetTaskRunner(); |
| 1131 compositor_task_runner_->PostTask( | 1136 compositor_task_runner_->PostTask( |
| 1132 FROM_HERE, | 1137 FROM_HERE, |
| 1133 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), false)); | 1138 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), false)); |
| 1139 ChildThreadImpl::current()->SetThreadAffinity(compositor_thread_->threadId(), |
| 1140 base::ThreadPriority::DISPLAY); |
| 1134 | 1141 |
| 1135 SynchronousInputHandlerProxyClient* synchronous_input_handler_proxy_client = | 1142 SynchronousInputHandlerProxyClient* synchronous_input_handler_proxy_client = |
| 1136 nullptr; | 1143 nullptr; |
| 1137 #if defined(OS_ANDROID) | 1144 #if defined(OS_ANDROID) |
| 1138 if (GetContentClient()->UsingSynchronousCompositing()) { | 1145 if (GetContentClient()->UsingSynchronousCompositing()) { |
| 1139 sync_compositor_message_filter_ = | 1146 sync_compositor_message_filter_ = |
| 1140 new SynchronousCompositorFilter(compositor_task_runner_); | 1147 new SynchronousCompositorFilter(compositor_task_runner_); |
| 1141 AddFilter(sync_compositor_message_filter_.get()); | 1148 AddFilter(sync_compositor_message_filter_.get()); |
| 1142 synchronous_input_handler_proxy_client = | 1149 synchronous_input_handler_proxy_client = |
| 1143 sync_compositor_message_filter_.get(); | 1150 sync_compositor_message_filter_.get(); |
| (...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2245 if (blink::mainThreadIsolate()) { | 2252 if (blink::mainThreadIsolate()) { |
| 2246 blink::mainThreadIsolate()->MemoryPressureNotification( | 2253 blink::mainThreadIsolate()->MemoryPressureNotification( |
| 2247 v8::MemoryPressureLevel::kCritical); | 2254 v8::MemoryPressureLevel::kCritical); |
| 2248 blink::MemoryPressureNotificationToWorkerThreadIsolates( | 2255 blink::MemoryPressureNotificationToWorkerThreadIsolates( |
| 2249 v8::MemoryPressureLevel::kCritical); | 2256 v8::MemoryPressureLevel::kCritical); |
| 2250 } | 2257 } |
| 2251 } | 2258 } |
| 2252 | 2259 |
| 2253 | 2260 |
| 2254 } // namespace content | 2261 } // namespace content |
| OLD | NEW |