| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 #endif | 186 #endif |
| 187 | 187 |
| 188 // In single process the single process is all there is. | 188 // In single process the single process is all there is. |
| 189 suspend_webkit_shared_timer_ = true; | 189 suspend_webkit_shared_timer_ = true; |
| 190 notify_webkit_of_modal_loop_ = true; | 190 notify_webkit_of_modal_loop_ = true; |
| 191 plugin_refresh_allowed_ = true; | 191 plugin_refresh_allowed_ = true; |
| 192 widget_count_ = 0; | 192 widget_count_ = 0; |
| 193 hidden_widget_count_ = 0; | 193 hidden_widget_count_ = 0; |
| 194 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; | 194 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; |
| 195 idle_notifications_to_skip_ = 0; | 195 idle_notifications_to_skip_ = 0; |
| 196 compositor_initialized_ = false; |
| 196 task_factory_.reset(new ScopedRunnableMethodFactory<RenderThreadImpl>(this)); | 197 task_factory_.reset(new ScopedRunnableMethodFactory<RenderThreadImpl>(this)); |
| 197 | 198 |
| 198 appcache_dispatcher_.reset(new AppCacheDispatcher(Get())); | 199 appcache_dispatcher_.reset(new AppCacheDispatcher(Get())); |
| 199 indexed_db_dispatcher_.reset(new IndexedDBDispatcher()); | 200 indexed_db_dispatcher_.reset(new IndexedDBDispatcher()); |
| 200 | 201 |
| 201 db_message_filter_ = new DBMessageFilter(); | 202 db_message_filter_ = new DBMessageFilter(); |
| 202 AddFilter(db_message_filter_.get()); | 203 AddFilter(db_message_filter_.get()); |
| 203 | 204 |
| 204 vc_manager_ = new VideoCaptureImplManager(); | 205 vc_manager_ = new VideoCaptureImplManager(); |
| 205 AddFilter(vc_manager_->video_capture_message_filter()); | 206 AddFilter(vc_manager_->video_capture_message_filter()); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 RemoveFilter(vc_manager_->video_capture_message_filter()); | 240 RemoveFilter(vc_manager_->video_capture_message_filter()); |
| 240 | 241 |
| 241 RemoveFilter(db_message_filter_.get()); | 242 RemoveFilter(db_message_filter_.get()); |
| 242 db_message_filter_ = NULL; | 243 db_message_filter_ = NULL; |
| 243 | 244 |
| 244 // Shutdown the file thread if it's running. | 245 // Shutdown the file thread if it's running. |
| 245 if (file_thread_.get()) | 246 if (file_thread_.get()) |
| 246 file_thread_->Stop(); | 247 file_thread_->Stop(); |
| 247 | 248 |
| 248 #ifdef WEBCOMPOSITOR_HAS_INITIALIZE | 249 #ifdef WEBCOMPOSITOR_HAS_INITIALIZE |
| 249 WebKit::WebCompositor::shutdown(); | 250 if (compositor_initialized_) { |
| 251 WebKit::WebCompositor::shutdown(); |
| 252 compositor_initialized_ = false; |
| 253 } |
| 250 #endif | 254 #endif |
| 251 if (compositor_thread_.get()) { | 255 if (compositor_thread_.get()) { |
| 252 RemoveFilter(compositor_thread_->GetMessageFilter()); | 256 RemoveFilter(compositor_thread_->GetMessageFilter()); |
| 253 compositor_thread_.reset(); | 257 compositor_thread_.reset(); |
| 254 } | 258 } |
| 255 | 259 |
| 256 if (webkit_platform_support_.get()) | 260 if (webkit_platform_support_.get()) |
| 257 WebKit::shutdown(); | 261 WebKit::shutdown(); |
| 258 | 262 |
| 259 lazy_tls.Pointer()->Set(NULL); | 263 lazy_tls.Pointer()->Set(NULL); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 #ifdef WEBCOMPOSITOR_HAS_INITIALIZE | 443 #ifdef WEBCOMPOSITOR_HAS_INITIALIZE |
| 440 WebKit::WebCompositor::initialize(compositor_thread_->GetWebThread()); | 444 WebKit::WebCompositor::initialize(compositor_thread_->GetWebThread()); |
| 441 #else | 445 #else |
| 442 WebKit::WebCompositor::setThread(compositor_thread_->GetWebThread()); | 446 WebKit::WebCompositor::setThread(compositor_thread_->GetWebThread()); |
| 443 #endif | 447 #endif |
| 444 } else { | 448 } else { |
| 445 #ifdef WEBCOMPOSITOR_HAS_INITIALIZE | 449 #ifdef WEBCOMPOSITOR_HAS_INITIALIZE |
| 446 WebKit::WebCompositor::initialize(NULL); | 450 WebKit::WebCompositor::initialize(NULL); |
| 447 #endif | 451 #endif |
| 448 } | 452 } |
| 453 compositor_initialized_ = true; |
| 449 | 454 |
| 450 WebScriptController::enableV8SingleThreadMode(); | 455 WebScriptController::enableV8SingleThreadMode(); |
| 451 | 456 |
| 452 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 457 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 453 | 458 |
| 454 webkit_glue::EnableWebCoreLogChannels( | 459 webkit_glue::EnableWebCoreLogChannels( |
| 455 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); | 460 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); |
| 456 | 461 |
| 457 if (command_line.HasSwitch(switches::kPlaybackMode) || | 462 if (command_line.HasSwitch(switches::kPlaybackMode) || |
| 458 command_line.HasSwitch(switches::kRecordMode) || | 463 command_line.HasSwitch(switches::kRecordMode) || |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 | 845 |
| 841 scoped_refptr<base::MessageLoopProxy> | 846 scoped_refptr<base::MessageLoopProxy> |
| 842 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 847 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
| 843 DCHECK(message_loop() == MessageLoop::current()); | 848 DCHECK(message_loop() == MessageLoop::current()); |
| 844 if (!file_thread_.get()) { | 849 if (!file_thread_.get()) { |
| 845 file_thread_.reset(new base::Thread("Renderer::FILE")); | 850 file_thread_.reset(new base::Thread("Renderer::FILE")); |
| 846 file_thread_->Start(); | 851 file_thread_->Start(); |
| 847 } | 852 } |
| 848 return file_thread_->message_loop_proxy(); | 853 return file_thread_->message_loop_proxy(); |
| 849 } | 854 } |
| OLD | NEW |