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

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

Issue 629243003: Forward compositor and input tasks to the Blink scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 ResourceDispatcherDelegate* delegate) { 844 ResourceDispatcherDelegate* delegate) {
845 resource_dispatcher()->set_delegate(delegate); 845 resource_dispatcher()->set_delegate(delegate);
846 } 846 }
847 847
848 void RenderThreadImpl::EnsureWebKitInitialized() { 848 void RenderThreadImpl::EnsureWebKitInitialized() {
849 if (blink_platform_impl_) 849 if (blink_platform_impl_)
850 return; 850 return;
851 851
852 blink_platform_impl_.reset(new RendererBlinkPlatformImpl); 852 blink_platform_impl_.reset(new RendererBlinkPlatformImpl);
853 blink::initialize(blink_platform_impl_.get()); 853 blink::initialize(blink_platform_impl_.get());
854 main_thread_compositor_task_runner_ = base::MessageLoopProxy::current();
855 854
856 v8::Isolate* isolate = blink::mainThreadIsolate(); 855 v8::Isolate* isolate = blink::mainThreadIsolate();
857 856
858 isolate->SetCounterFunction(base::StatsTable::FindLocation); 857 isolate->SetCounterFunction(base::StatsTable::FindLocation);
859 isolate->SetCreateHistogramFunction(CreateHistogram); 858 isolate->SetCreateHistogramFunction(CreateHistogram);
860 isolate->SetAddHistogramSampleFunction(AddHistogramSample); 859 isolate->SetAddHistogramSampleFunction(AddHistogramSample);
861 860
862 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 861 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
863 862
863 if (command_line.HasSwitch(switches::kDisableBlinkScheduler)) {
864 main_thread_compositor_task_runner_ = base::MessageLoopProxy::current();
865 } else {
866 main_thread_compositor_task_runner_ =
867 make_scoped_refptr(new SchedulerProxyTaskRunner<
868 &blink::WebSchedulerProxy::postCompositorTask>());
869 }
870
864 bool enable = !command_line.HasSwitch(switches::kDisableThreadedCompositing); 871 bool enable = !command_line.HasSwitch(switches::kDisableThreadedCompositing);
865 if (enable) { 872 if (enable) {
866 #if defined(OS_ANDROID) 873 #if defined(OS_ANDROID)
867 if (SynchronousCompositorFactory* factory = 874 if (SynchronousCompositorFactory* factory =
868 SynchronousCompositorFactory::GetInstance()) 875 SynchronousCompositorFactory::GetInstance())
869 compositor_message_loop_proxy_ = 876 compositor_message_loop_proxy_ =
870 factory->GetCompositorMessageLoop(); 877 factory->GetCompositorMessageLoop();
871 #endif 878 #endif
872 if (!compositor_message_loop_proxy_.get()) { 879 if (!compositor_message_loop_proxy_.get()) {
873 compositor_thread_.reset(new base::Thread("Compositor")); 880 compositor_thread_.reset(new base::Thread("Compositor"));
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
1632 hidden_widget_count_--; 1639 hidden_widget_count_--;
1633 1640
1634 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { 1641 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) {
1635 return; 1642 return;
1636 } 1643 }
1637 1644
1638 ScheduleIdleHandler(kLongIdleHandlerDelayMs); 1645 ScheduleIdleHandler(kLongIdleHandlerDelayMs);
1639 } 1646 }
1640 1647
1641 } // namespace content 1648 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698