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

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: 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 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 ResourceDispatcherDelegate* delegate) { 832 ResourceDispatcherDelegate* delegate) {
833 resource_dispatcher()->set_delegate(delegate); 833 resource_dispatcher()->set_delegate(delegate);
834 } 834 }
835 835
836 void RenderThreadImpl::EnsureWebKitInitialized() { 836 void RenderThreadImpl::EnsureWebKitInitialized() {
837 if (blink_platform_impl_) 837 if (blink_platform_impl_)
838 return; 838 return;
839 839
840 blink_platform_impl_.reset(new RendererBlinkPlatformImpl); 840 blink_platform_impl_.reset(new RendererBlinkPlatformImpl);
841 blink::initialize(blink_platform_impl_.get()); 841 blink::initialize(blink_platform_impl_.get());
842 main_thread_compositor_task_runner_ = base::MessageLoopProxy::current();
843 842
844 v8::Isolate* isolate = blink::mainThreadIsolate(); 843 v8::Isolate* isolate = blink::mainThreadIsolate();
845 844
846 isolate->SetCounterFunction(base::StatsTable::FindLocation); 845 isolate->SetCounterFunction(base::StatsTable::FindLocation);
847 isolate->SetCreateHistogramFunction(CreateHistogram); 846 isolate->SetCreateHistogramFunction(CreateHistogram);
848 isolate->SetAddHistogramSampleFunction(AddHistogramSample); 847 isolate->SetAddHistogramSampleFunction(AddHistogramSample);
849 848
850 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 849 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
851 850
851 if (!command_line.HasSwitch(switches::kDisableBlinkScheduler)) {
852 main_thread_compositor_task_runner_ =
853 make_scoped_refptr(new SchedulerProxyTaskRunner<
854 &blink::WebSchedulerProxy::postCompositorTask>());
855 } else {
856 main_thread_compositor_task_runner_ = base::MessageLoopProxy::current();
857 }
858
picksi1 2014/10/08 12:44:37 Stylistic Nit: I'd favor swapping the if/else and
Sami 2014/10/08 12:54:32 Done.
852 bool enable = !command_line.HasSwitch(switches::kDisableThreadedCompositing); 859 bool enable = !command_line.HasSwitch(switches::kDisableThreadedCompositing);
853 if (enable) { 860 if (enable) {
854 #if defined(OS_ANDROID) 861 #if defined(OS_ANDROID)
855 if (SynchronousCompositorFactory* factory = 862 if (SynchronousCompositorFactory* factory =
856 SynchronousCompositorFactory::GetInstance()) 863 SynchronousCompositorFactory::GetInstance())
857 compositor_message_loop_proxy_ = 864 compositor_message_loop_proxy_ =
858 factory->GetCompositorMessageLoop(); 865 factory->GetCompositorMessageLoop();
859 #endif 866 #endif
860 if (!compositor_message_loop_proxy_.get()) { 867 if (!compositor_message_loop_proxy_.get()) {
861 compositor_thread_.reset(new base::Thread("Compositor")); 868 compositor_thread_.reset(new base::Thread("Compositor"));
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 hidden_widget_count_--; 1627 hidden_widget_count_--;
1621 1628
1622 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { 1629 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) {
1623 return; 1630 return;
1624 } 1631 }
1625 1632
1626 ScheduleIdleHandler(kLongIdleHandlerDelayMs); 1633 ScheduleIdleHandler(kLongIdleHandlerDelayMs);
1627 } 1634 }
1628 1635
1629 } // namespace content 1636 } // 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