| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 RemoveFilter(vc_manager_->video_capture_message_filter()); | 239 RemoveFilter(vc_manager_->video_capture_message_filter()); |
| 240 | 240 |
| 241 RemoveFilter(db_message_filter_.get()); | 241 RemoveFilter(db_message_filter_.get()); |
| 242 db_message_filter_ = NULL; | 242 db_message_filter_ = NULL; |
| 243 | 243 |
| 244 // Shutdown the file thread if it's running. | 244 // Shutdown the file thread if it's running. |
| 245 if (file_thread_.get()) | 245 if (file_thread_.get()) |
| 246 file_thread_->Stop(); | 246 file_thread_->Stop(); |
| 247 | 247 |
| 248 #if WEBCOMPOSITOR_HAS_INITIALIZE |
| 249 WebCompositor::shutdown(); |
| 250 #endif |
| 248 if (compositor_thread_.get()) { | 251 if (compositor_thread_.get()) { |
| 249 RemoveFilter(compositor_thread_->GetMessageFilter()); | 252 RemoveFilter(compositor_thread_->GetMessageFilter()); |
| 250 compositor_thread_.reset(); | 253 compositor_thread_.reset(); |
| 251 } | 254 } |
| 252 | 255 |
| 253 if (webkit_platform_support_.get()) | 256 if (webkit_platform_support_.get()) |
| 254 WebKit::shutdown(); | 257 WebKit::shutdown(); |
| 255 | 258 |
| 256 lazy_tls.Pointer()->Set(NULL); | 259 lazy_tls.Pointer()->Set(NULL); |
| 257 | 260 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 v8::V8::SetCreateHistogramFunction(CreateHistogram); | 429 v8::V8::SetCreateHistogramFunction(CreateHistogram); |
| 427 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); | 430 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); |
| 428 | 431 |
| 429 webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl); | 432 webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl); |
| 430 WebKit::initialize(webkit_platform_support_.get()); | 433 WebKit::initialize(webkit_platform_support_.get()); |
| 431 | 434 |
| 432 if (CommandLine::ForCurrentProcess()->HasSwitch( | 435 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 433 switches::kEnableThreadedCompositing)) { | 436 switches::kEnableThreadedCompositing)) { |
| 434 compositor_thread_.reset(new CompositorThread(this)); | 437 compositor_thread_.reset(new CompositorThread(this)); |
| 435 AddFilter(compositor_thread_->GetMessageFilter()); | 438 AddFilter(compositor_thread_->GetMessageFilter()); |
| 439 #if WEBCOMPOSITOR_HAS_INITIALIZE |
| 440 WebCompositor::initialize(compositor_thread_->GetWebThread()); |
| 441 #else |
| 442 WebCompositor::setThread(compositor_thread_->GetWebThread()); |
| 443 #endif |
| 444 } else { |
| 445 #if WEBCOMPOSITOR_HAS_INITIALIZE |
| 446 WebCompositor::initialize(NULL); |
| 447 #endif |
| 436 } | 448 } |
| 437 | 449 |
| 438 WebScriptController::enableV8SingleThreadMode(); | 450 WebScriptController::enableV8SingleThreadMode(); |
| 439 | 451 |
| 440 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 452 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 441 | 453 |
| 442 webkit_glue::EnableWebCoreLogChannels( | 454 webkit_glue::EnableWebCoreLogChannels( |
| 443 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); | 455 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); |
| 444 | 456 |
| 445 if (command_line.HasSwitch(switches::kPlaybackMode) || | 457 if (command_line.HasSwitch(switches::kPlaybackMode) || |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 | 804 |
| 793 scoped_refptr<base::MessageLoopProxy> | 805 scoped_refptr<base::MessageLoopProxy> |
| 794 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 806 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
| 795 DCHECK(message_loop() == MessageLoop::current()); | 807 DCHECK(message_loop() == MessageLoop::current()); |
| 796 if (!file_thread_.get()) { | 808 if (!file_thread_.get()) { |
| 797 file_thread_.reset(new base::Thread("Renderer::FILE")); | 809 file_thread_.reset(new base::Thread("Renderer::FILE")); |
| 798 file_thread_->Start(); | 810 file_thread_->Start(); |
| 799 } | 811 } |
| 800 return file_thread_->message_loop_proxy(); | 812 return file_thread_->message_loop_proxy(); |
| 801 } | 813 } |
| OLD | NEW |