Chromium Code Reviews| 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 <vector> | 10 #include <vector> |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 widget_count_ = 0; | 205 widget_count_ = 0; |
| 206 hidden_widget_count_ = 0; | 206 hidden_widget_count_ = 0; |
| 207 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; | 207 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; |
| 208 idle_notifications_to_skip_ = 0; | 208 idle_notifications_to_skip_ = 0; |
| 209 compositor_initialized_ = false; | 209 compositor_initialized_ = false; |
| 210 | 210 |
| 211 appcache_dispatcher_.reset(new AppCacheDispatcher(Get())); | 211 appcache_dispatcher_.reset(new AppCacheDispatcher(Get())); |
| 212 dom_storage_dispatcher_.reset(new DomStorageDispatcher()); | 212 dom_storage_dispatcher_.reset(new DomStorageDispatcher()); |
| 213 main_thread_indexed_db_dispatcher_.reset(new IndexedDBDispatcher()); | 213 main_thread_indexed_db_dispatcher_.reset(new IndexedDBDispatcher()); |
| 214 | 214 |
| 215 browser_plugin_registry_.reset(new content::BrowserPluginRegistry()); | |
| 216 channel_manager_ = new content::BrowserPluginChannelManager(); | |
| 217 AddObserver(channel_manager_.get()); | |
| 218 | |
| 215 media_stream_center_ = NULL; | 219 media_stream_center_ = NULL; |
| 216 | 220 |
| 217 db_message_filter_ = new DBMessageFilter(); | 221 db_message_filter_ = new DBMessageFilter(); |
| 218 AddFilter(db_message_filter_.get()); | 222 AddFilter(db_message_filter_.get()); |
| 219 | 223 |
| 220 vc_manager_ = new VideoCaptureImplManager(); | 224 vc_manager_ = new VideoCaptureImplManager(); |
| 221 AddFilter(vc_manager_->video_capture_message_filter()); | 225 AddFilter(vc_manager_->video_capture_message_filter()); |
| 222 | 226 |
| 223 audio_input_message_filter_ = new AudioInputMessageFilter(); | 227 audio_input_message_filter_ = new AudioInputMessageFilter(); |
| 224 AddFilter(audio_input_message_filter_.get()); | 228 AddFilter(audio_input_message_filter_.get()); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 audio_input_message_filter_ = NULL; | 263 audio_input_message_filter_ = NULL; |
| 260 | 264 |
| 261 RemoveFilter(audio_message_filter_.get()); | 265 RemoveFilter(audio_message_filter_.get()); |
| 262 audio_message_filter_ = NULL; | 266 audio_message_filter_ = NULL; |
| 263 | 267 |
| 264 RemoveFilter(vc_manager_->video_capture_message_filter()); | 268 RemoveFilter(vc_manager_->video_capture_message_filter()); |
| 265 | 269 |
| 266 RemoveFilter(db_message_filter_.get()); | 270 RemoveFilter(db_message_filter_.get()); |
| 267 db_message_filter_ = NULL; | 271 db_message_filter_ = NULL; |
| 268 | 272 |
| 273 channel_manager_ = NULL; | |
| 274 | |
| 269 // Shutdown the file thread if it's running. | 275 // Shutdown the file thread if it's running. |
| 270 if (file_thread_.get()) | 276 if (file_thread_.get()) |
| 271 file_thread_->Stop(); | 277 file_thread_->Stop(); |
| 272 | 278 |
| 273 if (compositor_initialized_) { | 279 if (compositor_initialized_) { |
| 274 WebKit::WebCompositor::shutdown(); | 280 WebKit::WebCompositor::shutdown(); |
| 275 compositor_initialized_ = false; | 281 compositor_initialized_ = false; |
| 276 } | 282 } |
| 277 if (compositor_thread_.get()) { | 283 if (compositor_thread_.get()) { |
| 278 RemoveFilter(compositor_thread_->GetMessageFilter()); | 284 RemoveFilter(compositor_thread_->GetMessageFilter()); |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 854 ++it, ++i) { | 860 ++it, ++i) { |
| 855 color_names[i] = it->first; | 861 color_names[i] = it->first; |
| 856 web_colors[i] = it->second; | 862 web_colors[i] = it->second; |
| 857 } | 863 } |
| 858 WebKit::setNamedColors(color_names.get(), web_colors.get(), num_colors); | 864 WebKit::setNamedColors(color_names.get(), web_colors.get(), num_colors); |
| 859 } | 865 } |
| 860 | 866 |
| 861 void RenderThreadImpl::OnCreateNewView(const ViewMsg_New_Params& params) { | 867 void RenderThreadImpl::OnCreateNewView(const ViewMsg_New_Params& params) { |
| 862 EnsureWebKitInitialized(); | 868 EnsureWebKitInitialized(); |
| 863 // When bringing in render_view, also bring in webkit's glue and jsbindings. | 869 // When bringing in render_view, also bring in webkit's glue and jsbindings. |
| 864 RenderViewImpl::Create( | 870 if (!params.embedder_channel_name.empty()) |
|
jam
2012/05/16 02:22:40
nit: per style guide, use brace brackets
Fady Samuel
2012/05/16 04:43:54
Done.
| |
| 865 params.parent_window, | 871 channel_manager_->CreateRenderView(params); |
| 866 params.opener_route_id, | 872 else |
| 867 params.renderer_preferences, | 873 RenderViewImpl::Create( |
| 868 params.web_preferences, | 874 params.parent_window, |
| 869 new SharedRenderViewCounter(0), | 875 params.opener_route_id, |
| 870 params.view_id, | 876 params.renderer_preferences, |
| 871 params.surface_id, | 877 params.web_preferences, |
| 872 params.session_storage_namespace_id, | 878 new SharedRenderViewCounter(0), |
| 873 params.frame_name, | 879 params.view_id, |
| 874 false, | 880 params.surface_id, |
| 875 params.swapped_out, | 881 params.session_storage_namespace_id, |
| 876 params.next_page_id, | 882 params.frame_name, |
| 877 params.screen_info, | 883 false, |
| 878 false, | 884 params.swapped_out, |
| 879 params.accessibility_mode); | 885 params.next_page_id, |
| 886 params.screen_info, | |
| 887 NULL, | |
| 888 params.accessibility_mode); | |
| 880 } | 889 } |
| 881 | 890 |
| 882 GpuChannelHost* RenderThreadImpl::EstablishGpuChannelSync( | 891 GpuChannelHost* RenderThreadImpl::EstablishGpuChannelSync( |
| 883 content::CauseForGpuLaunch cause_for_gpu_launch) { | 892 content::CauseForGpuLaunch cause_for_gpu_launch) { |
| 884 if (gpu_channel_.get()) { | 893 if (gpu_channel_.get()) { |
| 885 // Do nothing if we already have a GPU channel or are already | 894 // Do nothing if we already have a GPU channel or are already |
| 886 // establishing one. | 895 // establishing one. |
| 887 if (gpu_channel_->state() == GpuChannelHost::kUnconnected || | 896 if (gpu_channel_->state() == GpuChannelHost::kUnconnected || |
| 888 gpu_channel_->state() == GpuChannelHost::kConnected) | 897 gpu_channel_->state() == GpuChannelHost::kConnected) |
| 889 return GetGpuChannel(); | 898 return GetGpuChannel(); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 967 | 976 |
| 968 scoped_refptr<base::MessageLoopProxy> | 977 scoped_refptr<base::MessageLoopProxy> |
| 969 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 978 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
| 970 DCHECK(message_loop() == MessageLoop::current()); | 979 DCHECK(message_loop() == MessageLoop::current()); |
| 971 if (!file_thread_.get()) { | 980 if (!file_thread_.get()) { |
| 972 file_thread_.reset(new base::Thread("Renderer::FILE")); | 981 file_thread_.reset(new base::Thread("Renderer::FILE")); |
| 973 file_thread_->Start(); | 982 file_thread_->Start(); |
| 974 } | 983 } |
| 975 return file_thread_->message_loop_proxy(); | 984 return file_thread_->message_loop_proxy(); |
| 976 } | 985 } |
| OLD | NEW |