Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 1589463002: compositor worker: Use a WebThread for the compositor thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self-nits Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 #if defined(OS_ANDROID) 888 #if defined(OS_ANDROID)
889 if (sync_compositor_message_filter_) { 889 if (sync_compositor_message_filter_) {
890 RemoveFilter(sync_compositor_message_filter_.get()); 890 RemoveFilter(sync_compositor_message_filter_.get());
891 sync_compositor_message_filter_ = nullptr; 891 sync_compositor_message_filter_ = nullptr;
892 } 892 }
893 stream_texture_factory_ = nullptr; 893 stream_texture_factory_ = nullptr;
894 #endif 894 #endif
895 895
896 media_thread_.reset(); 896 media_thread_.reset();
897 897
898 blink_platform_impl_->set_compositor_thread(nullptr); 898 blink_platform_impl_->reset_compositor_thread();
899 899
900 compositor_thread_.reset(); 900 compositor_thread_.reset();
901 901
902 // AudioMessageFilter may be accessed on |media_thread_|, so shutdown after. 902 // AudioMessageFilter may be accessed on |media_thread_|, so shutdown after.
903 RemoveFilter(audio_message_filter_.get()); 903 RemoveFilter(audio_message_filter_.get());
904 audio_message_filter_ = NULL; 904 audio_message_filter_ = NULL;
905 905
906 raster_worker_pool_->Shutdown(); 906 raster_worker_pool_->Shutdown();
907 907
908 main_input_callback_.Cancel(); 908 main_input_callback_.Cancel();
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 base::CommandLine::ForCurrentProcess()->HasSwitch( 1141 base::CommandLine::ForCurrentProcess()->HasSwitch(
1142 switches::kIPCSyncCompositing); 1142 switches::kIPCSyncCompositing);
1143 DCHECK(!sync_compositor_factory || !using_ipc_sync_compositing); 1143 DCHECK(!sync_compositor_factory || !using_ipc_sync_compositing);
1144 1144
1145 if (sync_compositor_factory) { 1145 if (sync_compositor_factory) {
1146 compositor_task_runner_ = 1146 compositor_task_runner_ =
1147 sync_compositor_factory->GetCompositorTaskRunner(); 1147 sync_compositor_factory->GetCompositorTaskRunner();
1148 } 1148 }
1149 #endif 1149 #endif
1150 if (!compositor_task_runner_.get()) { 1150 if (!compositor_task_runner_.get()) {
1151 1151 compositor_thread_ = blink_platform_impl_->createCompositorThread();
1152 compositor_thread_.reset(new base::Thread("Compositor")); 1152 compositor_task_runner_ = compositor_thread_->TaskRunner();
1153 base::Thread::Options compositor_thread_options;
1154 #if defined(OS_ANDROID)
1155 compositor_thread_options.priority = base::ThreadPriority::DISPLAY;
1156 #endif
1157 compositor_thread_->StartWithOptions(compositor_thread_options);
1158 compositor_task_runner_ = compositor_thread_->task_runner();
1159 compositor_task_runner_->PostTask( 1153 compositor_task_runner_->PostTask(
1160 FROM_HERE, 1154 FROM_HERE,
1161 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), 1155 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed),
1162 false)); 1156 false));
1163 } 1157 }
1164 1158
1165 InputHandlerManagerClient* input_handler_manager_client = NULL; 1159 InputHandlerManagerClient* input_handler_manager_client = NULL;
1166 #if defined(OS_ANDROID) 1160 #if defined(OS_ANDROID)
1167 if (using_ipc_sync_compositing) { 1161 if (using_ipc_sync_compositing) {
1168 sync_compositor_message_filter_ = 1162 sync_compositor_message_filter_ =
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
2092 } 2086 }
2093 2087
2094 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { 2088 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() {
2095 size_t erased = 2089 size_t erased =
2096 RenderThreadImpl::current()->pending_render_frame_connects_.erase( 2090 RenderThreadImpl::current()->pending_render_frame_connects_.erase(
2097 routing_id_); 2091 routing_id_);
2098 DCHECK_EQ(1u, erased); 2092 DCHECK_EQ(1u, erased);
2099 } 2093 }
2100 2094
2101 } // namespace content 2095 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698