| 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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 WebKit::initialize(webkit_platform_support_.get()); | 585 WebKit::initialize(webkit_platform_support_.get()); |
| 586 WebKit::setSharedWorkerRepository( | 586 WebKit::setSharedWorkerRepository( |
| 587 webkit_platform_support_.get()->sharedWorkerRepository()); | 587 webkit_platform_support_.get()->sharedWorkerRepository()); |
| 588 WebKit::setIDBFactory( | 588 WebKit::setIDBFactory( |
| 589 webkit_platform_support_.get()->idbFactory()); | 589 webkit_platform_support_.get()->idbFactory()); |
| 590 | 590 |
| 591 WebKit::WebCompositorSupport* compositor_support = | 591 WebKit::WebCompositorSupport* compositor_support = |
| 592 WebKit::Platform::current()->compositorSupport(); | 592 WebKit::Platform::current()->compositorSupport(); |
| 593 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 593 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 594 | 594 |
| 595 // TODO(fsamuel): Guests don't currently support threaded compositing. | 595 bool enable = command_line.HasSwitch(switches::kEnableThreadedCompositing); |
| 596 // This should go away with the new design of the browser plugin. | |
| 597 // The new design can be tracked at: http://crbug.com/134492. | |
| 598 bool is_guest = command_line.HasSwitch(switches::kGuestRenderer); | |
| 599 bool threaded = command_line.HasSwitch(switches::kEnableThreadedCompositing); | |
| 600 | |
| 601 bool enable = threaded && !is_guest; | |
| 602 if (enable) { | 596 if (enable) { |
| 603 compositor_thread_.reset(new CompositorThread(this)); | 597 compositor_thread_.reset(new CompositorThread(this)); |
| 604 AddFilter(compositor_thread_->GetMessageFilter()); | 598 AddFilter(compositor_thread_->GetMessageFilter()); |
| 605 compositor_support->initialize(compositor_thread_->GetWebThread()); | 599 compositor_support->initialize(compositor_thread_->GetWebThread()); |
| 606 } else { | 600 } else { |
| 607 compositor_support->initialize(NULL); | 601 compositor_support->initialize(NULL); |
| 608 } | 602 } |
| 609 compositor_initialized_ = true; | 603 compositor_initialized_ = true; |
| 610 | 604 |
| 611 MessageLoop* output_surface_loop = enable ? | 605 MessageLoop* output_surface_loop = enable ? |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 1143 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
| 1150 DCHECK(message_loop() == MessageLoop::current()); | 1144 DCHECK(message_loop() == MessageLoop::current()); |
| 1151 if (!file_thread_.get()) { | 1145 if (!file_thread_.get()) { |
| 1152 file_thread_.reset(new base::Thread("Renderer::FILE")); | 1146 file_thread_.reset(new base::Thread("Renderer::FILE")); |
| 1153 file_thread_->Start(); | 1147 file_thread_->Start(); |
| 1154 } | 1148 } |
| 1155 return file_thread_->message_loop_proxy(); | 1149 return file_thread_->message_loop_proxy(); |
| 1156 } | 1150 } |
| 1157 | 1151 |
| 1158 } // namespace content | 1152 } // namespace content |
| OLD | NEW |