Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(652)

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 10811002: Add threaded compositing mode to field trial (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 22 matching lines...) Expand all
33 #include "content/common/gpu/client/gpu_channel_host.h" 33 #include "content/common/gpu/client/gpu_channel_host.h"
34 #include "content/common/gpu/gpu_messages.h" 34 #include "content/common/gpu/gpu_messages.h"
35 #include "content/common/indexed_db/indexed_db_dispatcher.h" 35 #include "content/common/indexed_db/indexed_db_dispatcher.h"
36 #include "content/common/indexed_db/indexed_db_message_filter.h" 36 #include "content/common/indexed_db/indexed_db_message_filter.h"
37 #include "content/common/npobject_util.h" 37 #include "content/common/npobject_util.h"
38 #include "content/common/plugin_messages.h" 38 #include "content/common/plugin_messages.h"
39 #include "content/common/resource_dispatcher.h" 39 #include "content/common/resource_dispatcher.h"
40 #include "content/common/resource_messages.h" 40 #include "content/common/resource_messages.h"
41 #include "content/common/view_messages.h" 41 #include "content/common/view_messages.h"
42 #include "content/common/web_database_observer_impl.h" 42 #include "content/common/web_database_observer_impl.h"
43 #include "content/public/common/content_constants.h"
43 #include "content/public/common/content_paths.h" 44 #include "content/public/common/content_paths.h"
44 #include "content/public/common/content_switches.h" 45 #include "content/public/common/content_switches.h"
45 #include "content/public/common/renderer_preferences.h" 46 #include "content/public/common/renderer_preferences.h"
46 #include "content/public/common/url_constants.h" 47 #include "content/public/common/url_constants.h"
47 #include "content/public/renderer/content_renderer_client.h" 48 #include "content/public/renderer/content_renderer_client.h"
48 #include "content/public/renderer/render_process_observer.h" 49 #include "content/public/renderer/render_process_observer.h"
49 #include "content/public/renderer/render_view_visitor.h" 50 #include "content/public/renderer/render_view_visitor.h"
50 #include "content/renderer/browser_plugin/old/browser_plugin_channel_manager.h" 51 #include "content/renderer/browser_plugin/old/browser_plugin_channel_manager.h"
51 #include "content/renderer/browser_plugin/old/browser_plugin_registry.h" 52 #include "content/renderer/browser_plugin/old/browser_plugin_registry.h"
52 #include "content/renderer/devtools_agent_filter.h" 53 #include "content/renderer/devtools_agent_filter.h"
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 ScheduleIdleHandler(kLongIdleHandlerDelayMs); 486 ScheduleIdleHandler(kLongIdleHandlerDelayMs);
486 } 487 }
487 488
488 void RenderThreadImpl::EnsureWebKitInitialized() { 489 void RenderThreadImpl::EnsureWebKitInitialized() {
489 if (webkit_platform_support_.get()) 490 if (webkit_platform_support_.get())
490 return; 491 return;
491 492
492 webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl); 493 webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl);
493 WebKit::initialize(webkit_platform_support_.get()); 494 WebKit::initialize(webkit_platform_support_.get());
494 495
496 base::FieldTrial* thread_trial =
497 base::FieldTrialList::Find(content::kGpuCompositingFieldTrialName);
498 bool is_thread_trial = thread_trial && thread_trial->group_name() ==
499 content::kGpuCompositingFieldTrialThreadEnabledName;
495 bool has_enable = CommandLine::ForCurrentProcess()->HasSwitch( 500 bool has_enable = CommandLine::ForCurrentProcess()->HasSwitch(
496 switches::kEnableThreadedCompositing); 501 switches::kEnableThreadedCompositing);
497 bool has_disable = CommandLine::ForCurrentProcess()->HasSwitch( 502 bool has_disable = CommandLine::ForCurrentProcess()->HasSwitch(
498 switches::kDisableThreadedCompositing); 503 switches::kDisableThreadedCompositing);
499 // TODO(fsamuel): Guests don't currently support threaded compositing. 504 // TODO(fsamuel): Guests don't currently support threaded compositing.
500 // This should go away with the new design of the browser plugin. 505 // This should go away with the new design of the browser plugin.
501 // The new design can be tracked at: http://crbug.com/134492. 506 // The new design can be tracked at: http://crbug.com/134492.
502 bool is_guest = CommandLine::ForCurrentProcess()->HasSwitch( 507 bool is_guest = CommandLine::ForCurrentProcess()->HasSwitch(
503 switches::kGuestRenderer); 508 switches::kGuestRenderer);
504 bool enable = has_enable && (!has_disable) && (!is_guest); 509 bool enable = (is_thread_trial || (has_enable && !has_disable)) && !is_guest;
Ilya Sherman 2012/07/20 05:36:05 Is it correct that the field trial should override
jbates 2012/07/23 17:47:00 Done.
505 if (enable) { 510 if (enable) {
506 compositor_thread_.reset(new CompositorThread(this)); 511 compositor_thread_.reset(new CompositorThread(this));
507 AddFilter(compositor_thread_->GetMessageFilter()); 512 AddFilter(compositor_thread_->GetMessageFilter());
508 WebKit::WebCompositor::initialize(compositor_thread_->GetWebThread()); 513 WebKit::WebCompositor::initialize(compositor_thread_->GetWebThread());
509 } else 514 } else
510 WebKit::WebCompositor::initialize(NULL); 515 WebKit::WebCompositor::initialize(NULL);
Ilya Sherman 2012/07/20 05:36:05 nit: As long as you're editing nearby code, please
jbates 2012/07/23 17:47:00 Done.
511 compositor_initialized_ = true; 516 compositor_initialized_ = true;
512 517
513 WebScriptController::enableV8SingleThreadMode(); 518 WebScriptController::enableV8SingleThreadMode();
514 519
515 RenderThreadImpl::RegisterSchemes(); 520 RenderThreadImpl::RegisterSchemes();
516 521
517 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 522 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
518 523
519 webkit_glue::EnableWebCoreLogChannels( 524 webkit_glue::EnableWebCoreLogChannels(
520 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); 525 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels));
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 1049
1045 scoped_refptr<base::MessageLoopProxy> 1050 scoped_refptr<base::MessageLoopProxy>
1046 RenderThreadImpl::GetFileThreadMessageLoopProxy() { 1051 RenderThreadImpl::GetFileThreadMessageLoopProxy() {
1047 DCHECK(message_loop() == MessageLoop::current()); 1052 DCHECK(message_loop() == MessageLoop::current());
1048 if (!file_thread_.get()) { 1053 if (!file_thread_.get()) {
1049 file_thread_.reset(new base::Thread("Renderer::FILE")); 1054 file_thread_.reset(new base::Thread("Renderer::FILE"));
1050 file_thread_->Start(); 1055 file_thread_->Start();
1051 } 1056 }
1052 return file_thread_->message_loop_proxy(); 1057 return file_thread_->message_loop_proxy();
1053 } 1058 }
OLDNEW
« chrome/browser/gpu_util.cc ('K') | « content/public/common/content_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698