| 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 if (webkit_platform_support_.get()) | 424 if (webkit_platform_support_.get()) |
| 425 return; | 425 return; |
| 426 | 426 |
| 427 v8::V8::SetCounterFunction(base::StatsTable::FindLocation); | 427 v8::V8::SetCounterFunction(base::StatsTable::FindLocation); |
| 428 v8::V8::SetCreateHistogramFunction(CreateHistogram); | 428 v8::V8::SetCreateHistogramFunction(CreateHistogram); |
| 429 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); | 429 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); |
| 430 | 430 |
| 431 webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl); | 431 webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl); |
| 432 WebKit::initialize(webkit_platform_support_.get()); | 432 WebKit::initialize(webkit_platform_support_.get()); |
| 433 | 433 |
| 434 compositor_thread_.reset(new CompositorThread(this)); | 434 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 435 AddFilter(compositor_thread_->GetMessageFilter()); | 435 switches::kEnableThreadedCompositing)) { |
| 436 compositor_thread_.reset(new CompositorThread(this)); |
| 437 AddFilter(compositor_thread_->GetMessageFilter()); |
| 438 } |
| 436 | 439 |
| 437 WebScriptController::enableV8SingleThreadMode(); | 440 WebScriptController::enableV8SingleThreadMode(); |
| 438 | 441 |
| 439 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 442 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 440 | 443 |
| 441 webkit_glue::EnableWebCoreLogChannels( | 444 webkit_glue::EnableWebCoreLogChannels( |
| 442 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); | 445 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); |
| 443 | 446 |
| 444 if (command_line.HasSwitch(switches::kPlaybackMode) || | 447 if (command_line.HasSwitch(switches::kPlaybackMode) || |
| 445 command_line.HasSwitch(switches::kRecordMode) || | 448 command_line.HasSwitch(switches::kRecordMode) || |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 | 775 |
| 773 scoped_refptr<base::MessageLoopProxy> | 776 scoped_refptr<base::MessageLoopProxy> |
| 774 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 777 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
| 775 DCHECK(message_loop() == MessageLoop::current()); | 778 DCHECK(message_loop() == MessageLoop::current()); |
| 776 if (!file_thread_.get()) { | 779 if (!file_thread_.get()) { |
| 777 file_thread_.reset(new base::Thread("Renderer::FILE")); | 780 file_thread_.reset(new base::Thread("Renderer::FILE")); |
| 778 file_thread_->Start(); | 781 file_thread_->Start(); |
| 779 } | 782 } |
| 780 return file_thread_->message_loop_proxy(); | 783 return file_thread_->message_loop_proxy(); |
| 781 } | 784 } |
| OLD | NEW |