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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 RemoveFilter(vc_manager_->video_capture_message_filter()); | 259 RemoveFilter(vc_manager_->video_capture_message_filter()); |
260 | 260 |
261 RemoveFilter(db_message_filter_.get()); | 261 RemoveFilter(db_message_filter_.get()); |
262 db_message_filter_ = NULL; | 262 db_message_filter_ = NULL; |
263 | 263 |
264 // Shutdown the file thread if it's running. | 264 // Shutdown the file thread if it's running. |
265 if (file_thread_.get()) | 265 if (file_thread_.get()) |
266 file_thread_->Stop(); | 266 file_thread_->Stop(); |
267 | 267 |
268 #ifdef WEBCOMPOSITOR_HAS_INITIALIZE | |
269 if (compositor_initialized_) { | 268 if (compositor_initialized_) { |
270 WebKit::WebCompositor::shutdown(); | 269 WebKit::WebCompositor::shutdown(); |
271 compositor_initialized_ = false; | 270 compositor_initialized_ = false; |
272 } | 271 } |
273 #endif | |
274 if (compositor_thread_.get()) { | 272 if (compositor_thread_.get()) { |
275 RemoveFilter(compositor_thread_->GetMessageFilter()); | 273 RemoveFilter(compositor_thread_->GetMessageFilter()); |
276 compositor_thread_.reset(); | 274 compositor_thread_.reset(); |
277 } | 275 } |
278 | 276 |
279 if (webkit_platform_support_.get()) | 277 if (webkit_platform_support_.get()) |
280 WebKit::shutdown(); | 278 WebKit::shutdown(); |
281 | 279 |
282 GpuChannelHostFactory::set_instance(NULL); | 280 GpuChannelHostFactory::set_instance(NULL); |
283 lazy_tls.Pointer()->Set(NULL); | 281 lazy_tls.Pointer()->Set(NULL); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 v8::V8::SetCreateHistogramFunction(CreateHistogram); | 455 v8::V8::SetCreateHistogramFunction(CreateHistogram); |
458 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); | 456 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); |
459 | 457 |
460 webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl); | 458 webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl); |
461 WebKit::initialize(webkit_platform_support_.get()); | 459 WebKit::initialize(webkit_platform_support_.get()); |
462 | 460 |
463 if (CommandLine::ForCurrentProcess()->HasSwitch( | 461 if (CommandLine::ForCurrentProcess()->HasSwitch( |
464 switches::kEnableThreadedCompositing)) { | 462 switches::kEnableThreadedCompositing)) { |
465 compositor_thread_.reset(new CompositorThread(this)); | 463 compositor_thread_.reset(new CompositorThread(this)); |
466 AddFilter(compositor_thread_->GetMessageFilter()); | 464 AddFilter(compositor_thread_->GetMessageFilter()); |
467 #ifdef WEBCOMPOSITOR_HAS_INITIALIZE | |
468 WebKit::WebCompositor::initialize(compositor_thread_->GetWebThread()); | 465 WebKit::WebCompositor::initialize(compositor_thread_->GetWebThread()); |
469 #else | 466 } else |
470 WebKit::WebCompositor::setThread(compositor_thread_->GetWebThread()); | |
471 #endif | |
472 } else { | |
473 #ifdef WEBCOMPOSITOR_HAS_INITIALIZE | |
474 WebKit::WebCompositor::initialize(NULL); | 467 WebKit::WebCompositor::initialize(NULL); |
475 #endif | |
476 } | |
477 compositor_initialized_ = true; | 468 compositor_initialized_ = true; |
478 | 469 |
479 WebScriptController::enableV8SingleThreadMode(); | 470 WebScriptController::enableV8SingleThreadMode(); |
480 | 471 |
481 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 472 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
482 | 473 |
483 webkit_glue::EnableWebCoreLogChannels( | 474 webkit_glue::EnableWebCoreLogChannels( |
484 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); | 475 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); |
485 | 476 |
486 if (command_line.HasSwitch(switches::kPlaybackMode) || | 477 if (command_line.HasSwitch(switches::kPlaybackMode) || |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 | 950 |
960 scoped_refptr<base::MessageLoopProxy> | 951 scoped_refptr<base::MessageLoopProxy> |
961 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 952 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
962 DCHECK(message_loop() == MessageLoop::current()); | 953 DCHECK(message_loop() == MessageLoop::current()); |
963 if (!file_thread_.get()) { | 954 if (!file_thread_.get()) { |
964 file_thread_.reset(new base::Thread("Renderer::FILE")); | 955 file_thread_.reset(new base::Thread("Renderer::FILE")); |
965 file_thread_->Start(); | 956 file_thread_->Start(); |
966 } | 957 } |
967 return file_thread_->message_loop_proxy(); | 958 return file_thread_->message_loop_proxy(); |
968 } | 959 } |
OLD | NEW |