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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 #include "content/public/renderer/content_renderer_client.h" | 49 #include "content/public/renderer/content_renderer_client.h" |
50 #include "content/public/renderer/render_process_observer.h" | 50 #include "content/public/renderer/render_process_observer.h" |
51 #include "content/public/renderer/render_view_visitor.h" | 51 #include "content/public/renderer/render_view_visitor.h" |
52 #include "content/renderer/browser_plugin/old/browser_plugin_channel_manager.h" | 52 #include "content/renderer/browser_plugin/old/browser_plugin_channel_manager.h" |
53 #include "content/renderer/browser_plugin/old/browser_plugin_registry.h" | 53 #include "content/renderer/browser_plugin/old/browser_plugin_registry.h" |
54 #include "content/renderer/devtools_agent_filter.h" | 54 #include "content/renderer/devtools_agent_filter.h" |
55 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" | 55 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" |
56 #include "content/renderer/dom_storage/webstoragearea_impl.h" | 56 #include "content/renderer/dom_storage/webstoragearea_impl.h" |
57 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 57 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
58 #include "content/renderer/gpu/compositor_thread.h" | 58 #include "content/renderer/gpu/compositor_thread.h" |
| 59 #include "content/renderer/gpu/compositor_output_surface.h" |
59 #include "content/renderer/gpu/gpu_benchmarking_extension.h" | 60 #include "content/renderer/gpu/gpu_benchmarking_extension.h" |
60 #include "content/renderer/media/audio_hardware.h" | 61 #include "content/renderer/media/audio_hardware.h" |
61 #include "content/renderer/media/audio_input_message_filter.h" | 62 #include "content/renderer/media/audio_input_message_filter.h" |
62 #include "content/renderer/media/audio_message_filter.h" | 63 #include "content/renderer/media/audio_message_filter.h" |
63 #include "content/renderer/media/audio_renderer_mixer_manager.h" | 64 #include "content/renderer/media/audio_renderer_mixer_manager.h" |
64 #include "content/renderer/media/media_stream_center.h" | 65 #include "content/renderer/media/media_stream_center.h" |
65 #include "content/renderer/media/video_capture_impl_manager.h" | 66 #include "content/renderer/media/video_capture_impl_manager.h" |
66 #include "content/renderer/media/video_capture_message_filter.h" | 67 #include "content/renderer/media/video_capture_message_filter.h" |
67 #include "content/renderer/plugin_channel_host.h" | 68 #include "content/renderer/plugin_channel_host.h" |
68 #include "content/renderer/render_process_impl.h" | 69 #include "content/renderer/render_process_impl.h" |
69 #include "content/renderer/render_view_impl.h" | 70 #include "content/renderer/render_view_impl.h" |
70 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 71 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
71 #include "grit/content_resources.h" | 72 #include "grit/content_resources.h" |
72 #include "ipc/ipc_channel_handle.h" | 73 #include "ipc/ipc_channel_handle.h" |
| 74 #include "ipc/ipc_forwarding_message_filter.h" |
73 #include "ipc/ipc_platform_file.h" | 75 #include "ipc/ipc_platform_file.h" |
74 #include "media/base/media.h" | 76 #include "media/base/media.h" |
75 #include "net/base/net_errors.h" | 77 #include "net/base/net_errors.h" |
76 #include "net/base/net_util.h" | 78 #include "net/base/net_util.h" |
77 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositor.h" | 79 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositor.h" |
78 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" | 80 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
79 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h" | 81 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h" |
80 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" | 82 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" |
81 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 83 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
82 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 84 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 294 |
293 RemoveFilter(vc_manager_->video_capture_message_filter()); | 295 RemoveFilter(vc_manager_->video_capture_message_filter()); |
294 | 296 |
295 RemoveFilter(db_message_filter_.get()); | 297 RemoveFilter(db_message_filter_.get()); |
296 db_message_filter_ = NULL; | 298 db_message_filter_ = NULL; |
297 | 299 |
298 // Shutdown the file thread if it's running. | 300 // Shutdown the file thread if it's running. |
299 if (file_thread_.get()) | 301 if (file_thread_.get()) |
300 file_thread_->Stop(); | 302 file_thread_->Stop(); |
301 | 303 |
| 304 RemoveFilter(compositor_output_surface_filter_.get()); |
| 305 compositor_output_surface_filter_ = NULL; |
| 306 |
302 if (compositor_initialized_) { | 307 if (compositor_initialized_) { |
303 WebKit::WebCompositor::shutdown(); | 308 WebKit::WebCompositor::shutdown(); |
304 compositor_initialized_ = false; | 309 compositor_initialized_ = false; |
305 } | 310 } |
306 if (compositor_thread_.get()) { | 311 if (compositor_thread_.get()) { |
307 RemoveFilter(compositor_thread_->GetMessageFilter()); | 312 RemoveFilter(compositor_thread_->GetMessageFilter()); |
308 compositor_thread_.reset(); | 313 compositor_thread_.reset(); |
309 } | 314 } |
310 | 315 |
311 if (webkit_platform_support_.get()) | 316 if (webkit_platform_support_.get()) |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 bool enable = content::IsThreadedCompositingEnabled() && !is_guest; | 504 bool enable = content::IsThreadedCompositingEnabled() && !is_guest; |
500 if (enable) { | 505 if (enable) { |
501 compositor_thread_.reset(new CompositorThread(this)); | 506 compositor_thread_.reset(new CompositorThread(this)); |
502 AddFilter(compositor_thread_->GetMessageFilter()); | 507 AddFilter(compositor_thread_->GetMessageFilter()); |
503 WebKit::WebCompositor::initialize(compositor_thread_->GetWebThread()); | 508 WebKit::WebCompositor::initialize(compositor_thread_->GetWebThread()); |
504 } else { | 509 } else { |
505 WebKit::WebCompositor::initialize(NULL); | 510 WebKit::WebCompositor::initialize(NULL); |
506 } | 511 } |
507 compositor_initialized_ = true; | 512 compositor_initialized_ = true; |
508 | 513 |
| 514 MessageLoop* output_surface_loop = enable ? |
| 515 compositor_thread_->message_loop() : |
| 516 MessageLoop::current(); |
| 517 |
| 518 compositor_output_surface_filter_ = CompositorOutputSurface::CreateFilter( |
| 519 output_surface_loop->message_loop_proxy()); |
| 520 AddFilter(compositor_output_surface_filter_.get()); |
| 521 |
509 WebScriptController::enableV8SingleThreadMode(); | 522 WebScriptController::enableV8SingleThreadMode(); |
510 | 523 |
511 RenderThreadImpl::RegisterSchemes(); | 524 RenderThreadImpl::RegisterSchemes(); |
512 | 525 |
513 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 526 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
514 | 527 |
515 webkit_glue::EnableWebCoreLogChannels( | 528 webkit_glue::EnableWebCoreLogChannels( |
516 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); | 529 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); |
517 | 530 |
518 if (CommandLine::ForCurrentProcess()->HasSwitch( | 531 if (CommandLine::ForCurrentProcess()->HasSwitch( |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 | 1054 |
1042 scoped_refptr<base::MessageLoopProxy> | 1055 scoped_refptr<base::MessageLoopProxy> |
1043 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 1056 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
1044 DCHECK(message_loop() == MessageLoop::current()); | 1057 DCHECK(message_loop() == MessageLoop::current()); |
1045 if (!file_thread_.get()) { | 1058 if (!file_thread_.get()) { |
1046 file_thread_.reset(new base::Thread("Renderer::FILE")); | 1059 file_thread_.reset(new base::Thread("Renderer::FILE")); |
1047 file_thread_->Start(); | 1060 file_thread_->Start(); |
1048 } | 1061 } |
1049 return file_thread_->message_loop_proxy(); | 1062 return file_thread_->message_loop_proxy(); |
1050 } | 1063 } |
OLD | NEW |