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

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

Issue 553483005: Revert of Forward input and compositing tasks to the Blink scheduler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/renderer/scheduler_proxy_task_runner.h » ('j') | 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>
11 11
12 #include "base/allocator/allocator_extension.h" 12 #include "base/allocator/allocator_extension.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/debug/trace_event.h" 14 #include "base/debug/trace_event.h"
15 #include "base/lazy_instance.h" 15 #include "base/lazy_instance.h"
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "base/memory/discardable_memory.h" 17 #include "base/memory/discardable_memory.h"
18 #include "base/memory/discardable_memory_emulated.h" 18 #include "base/memory/discardable_memory_emulated.h"
19 #include "base/memory/shared_memory.h" 19 #include "base/memory/shared_memory.h"
20 #include "base/metrics/field_trial.h" 20 #include "base/metrics/field_trial.h"
21 #include "base/metrics/histogram.h" 21 #include "base/metrics/histogram.h"
22 #include "base/metrics/stats_table.h" 22 #include "base/metrics/stats_table.h"
23 #include "base/path_service.h" 23 #include "base/path_service.h"
24 #include "base/single_thread_task_runner.h"
25 #include "base/strings/string16.h" 24 #include "base/strings/string16.h"
26 #include "base/strings/string_number_conversions.h" 25 #include "base/strings/string_number_conversions.h"
27 #include "base/strings/string_tokenizer.h" 26 #include "base/strings/string_tokenizer.h"
28 #include "base/strings/utf_string_conversions.h" 27 #include "base/strings/utf_string_conversions.h"
29 #include "base/threading/thread_local.h" 28 #include "base/threading/thread_local.h"
30 #include "base/threading/thread_restrictions.h" 29 #include "base/threading/thread_restrictions.h"
31 #include "base/values.h" 30 #include "base/values.h"
32 #include "cc/base/switches.h" 31 #include "cc/base/switches.h"
33 #include "cc/blink/web_external_bitmap_impl.h" 32 #include "cc/blink/web_external_bitmap_impl.h"
34 #include "cc/blink/web_layer_impl.h" 33 #include "cc/blink/web_layer_impl.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 #include "content/renderer/media/midi_message_filter.h" 84 #include "content/renderer/media/midi_message_filter.h"
86 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h" 85 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h"
87 #include "content/renderer/media/video_capture_impl_manager.h" 86 #include "content/renderer/media/video_capture_impl_manager.h"
88 #include "content/renderer/media/video_capture_message_filter.h" 87 #include "content/renderer/media/video_capture_message_filter.h"
89 #include "content/renderer/net_info_helper.h" 88 #include "content/renderer/net_info_helper.h"
90 #include "content/renderer/p2p/socket_dispatcher.h" 89 #include "content/renderer/p2p/socket_dispatcher.h"
91 #include "content/renderer/render_frame_proxy.h" 90 #include "content/renderer/render_frame_proxy.h"
92 #include "content/renderer/render_process_impl.h" 91 #include "content/renderer/render_process_impl.h"
93 #include "content/renderer/render_view_impl.h" 92 #include "content/renderer/render_view_impl.h"
94 #include "content/renderer/renderer_webkitplatformsupport_impl.h" 93 #include "content/renderer/renderer_webkitplatformsupport_impl.h"
95 #include "content/renderer/scheduler_proxy_task_runner.h"
96 #include "content/renderer/service_worker/embedded_worker_context_message_filter .h" 94 #include "content/renderer/service_worker/embedded_worker_context_message_filter .h"
97 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" 95 #include "content/renderer/service_worker/embedded_worker_dispatcher.h"
98 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h" 96 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h"
99 #include "ipc/ipc_channel_handle.h" 97 #include "ipc/ipc_channel_handle.h"
100 #include "ipc/ipc_forwarding_message_filter.h" 98 #include "ipc/ipc_forwarding_message_filter.h"
101 #include "ipc/ipc_platform_file.h" 99 #include "ipc/ipc_platform_file.h"
102 #include "media/base/audio_hardware_config.h" 100 #include "media/base/audio_hardware_config.h"
103 #include "media/base/media.h" 101 #include "media/base/media.h"
104 #include "media/filters/gpu_video_accelerator_factories.h" 102 #include "media/filters/gpu_video_accelerator_factories.h"
105 #include "mojo/common/common_type_converters.h" 103 #include "mojo/common/common_type_converters.h"
106 #include "net/base/net_errors.h" 104 #include "net/base/net_errors.h"
107 #include "net/base/net_util.h" 105 #include "net/base/net_util.h"
108 #include "skia/ext/event_tracer_impl.h" 106 #include "skia/ext/event_tracer_impl.h"
109 #include "third_party/WebKit/public/platform/WebString.h" 107 #include "third_party/WebKit/public/platform/WebString.h"
110 #include "third_party/WebKit/public/platform/WebThread.h"
111 #include "third_party/WebKit/public/web/WebColorName.h" 108 #include "third_party/WebKit/public/web/WebColorName.h"
112 #include "third_party/WebKit/public/web/WebDatabase.h" 109 #include "third_party/WebKit/public/web/WebDatabase.h"
113 #include "third_party/WebKit/public/web/WebDocument.h" 110 #include "third_party/WebKit/public/web/WebDocument.h"
114 #include "third_party/WebKit/public/web/WebFrame.h" 111 #include "third_party/WebKit/public/web/WebFrame.h"
115 #include "third_party/WebKit/public/web/WebImageCache.h" 112 #include "third_party/WebKit/public/web/WebImageCache.h"
116 #include "third_party/WebKit/public/web/WebKit.h" 113 #include "third_party/WebKit/public/web/WebKit.h"
117 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" 114 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h"
118 #include "third_party/WebKit/public/web/WebPopupMenu.h" 115 #include "third_party/WebKit/public/web/WebPopupMenu.h"
119 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" 116 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
120 #include "third_party/WebKit/public/web/WebScriptController.h" 117 #include "third_party/WebKit/public/web/WebScriptController.h"
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 644
648 // RemoveEmbeddedWorkerRoute may be called while deleting 645 // RemoveEmbeddedWorkerRoute may be called while deleting
649 // EmbeddedWorkerDispatcher. So it must be deleted before deleting 646 // EmbeddedWorkerDispatcher. So it must be deleted before deleting
650 // RenderThreadImpl. 647 // RenderThreadImpl.
651 embedded_worker_dispatcher_.reset(); 648 embedded_worker_dispatcher_.reset();
652 649
653 // Ramp down IDB before we ramp down WebKit (and V8), since IDB classes might 650 // Ramp down IDB before we ramp down WebKit (and V8), since IDB classes might
654 // hold pointers to V8 objects (e.g., via pending requests). 651 // hold pointers to V8 objects (e.g., via pending requests).
655 main_thread_indexed_db_dispatcher_.reset(); 652 main_thread_indexed_db_dispatcher_.reset();
656 653
657 main_thread_compositor_task_runner_ = NULL;
658 main_thread_input_task_runner_ = NULL;
659
660 if (webkit_platform_support_) 654 if (webkit_platform_support_)
661 blink::shutdown(); 655 blink::shutdown();
662 656
663 lazy_tls.Pointer()->Set(NULL); 657 lazy_tls.Pointer()->Set(NULL);
664 658
665 // TODO(port) 659 // TODO(port)
666 #if defined(OS_WIN) 660 #if defined(OS_WIN)
667 // Clean up plugin channels before this thread goes away. 661 // Clean up plugin channels before this thread goes away.
668 NPChannelBase::CleanupChannels(); 662 NPChannelBase::CleanupChannels();
669 #endif 663 #endif
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 ResourceDispatcherDelegate* delegate) { 826 ResourceDispatcherDelegate* delegate) {
833 resource_dispatcher()->set_delegate(delegate); 827 resource_dispatcher()->set_delegate(delegate);
834 } 828 }
835 829
836 void RenderThreadImpl::EnsureWebKitInitialized() { 830 void RenderThreadImpl::EnsureWebKitInitialized() {
837 if (webkit_platform_support_) 831 if (webkit_platform_support_)
838 return; 832 return;
839 833
840 webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl); 834 webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl);
841 blink::initialize(webkit_platform_support_.get()); 835 blink::initialize(webkit_platform_support_.get());
842 main_thread_compositor_task_runner_ =
843 make_scoped_refptr(new SchedulerProxyTaskRunner<
844 &blink::WebSchedulerProxy::postCompositorTask>());
845 main_thread_input_task_runner_ = make_scoped_refptr(
846 new SchedulerProxyTaskRunner<&blink::WebSchedulerProxy::postInputTask>());
847 836
848 v8::Isolate* isolate = blink::mainThreadIsolate(); 837 v8::Isolate* isolate = blink::mainThreadIsolate();
849 838
850 isolate->SetCounterFunction(base::StatsTable::FindLocation); 839 isolate->SetCounterFunction(base::StatsTable::FindLocation);
851 isolate->SetCreateHistogramFunction(CreateHistogram); 840 isolate->SetCreateHistogramFunction(CreateHistogram);
852 isolate->SetAddHistogramSampleFunction(AddHistogramSample); 841 isolate->SetAddHistogramSampleFunction(AddHistogramSample);
853 842
854 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 843 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
855 844
856 bool enable = !command_line.HasSwitch(switches::kDisableThreadedCompositing); 845 bool enable = !command_line.HasSwitch(switches::kDisableThreadedCompositing);
(...skipping 19 matching lines...) Expand all
876 } 865 }
877 866
878 InputHandlerManagerClient* input_handler_manager_client = NULL; 867 InputHandlerManagerClient* input_handler_manager_client = NULL;
879 #if defined(OS_ANDROID) 868 #if defined(OS_ANDROID)
880 if (SynchronousCompositorFactory* factory = 869 if (SynchronousCompositorFactory* factory =
881 SynchronousCompositorFactory::GetInstance()) { 870 SynchronousCompositorFactory::GetInstance()) {
882 input_handler_manager_client = factory->GetInputHandlerManagerClient(); 871 input_handler_manager_client = factory->GetInputHandlerManagerClient();
883 } 872 }
884 #endif 873 #endif
885 if (!input_handler_manager_client) { 874 if (!input_handler_manager_client) {
886 input_event_filter_ = new InputEventFilter( 875 input_event_filter_ =
887 this, main_thread_input_task_runner_, compositor_message_loop_proxy_); 876 new InputEventFilter(this, compositor_message_loop_proxy_);
888 AddFilter(input_event_filter_.get()); 877 AddFilter(input_event_filter_.get());
889 input_handler_manager_client = input_event_filter_.get(); 878 input_handler_manager_client = input_event_filter_.get();
890 } 879 }
891 input_handler_manager_.reset( 880 input_handler_manager_.reset(
892 new InputHandlerManager(compositor_message_loop_proxy_, 881 new InputHandlerManager(compositor_message_loop_proxy_,
893 input_handler_manager_client)); 882 input_handler_manager_client));
894 } 883 }
895 884
896 scoped_refptr<base::MessageLoopProxy> output_surface_loop; 885 scoped_refptr<base::MessageLoopProxy> output_surface_loop;
897 if (enable) 886 if (enable)
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1650 hidden_widget_count_--; 1639 hidden_widget_count_--;
1651 1640
1652 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { 1641 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) {
1653 return; 1642 return;
1654 } 1643 }
1655 1644
1656 ScheduleIdleHandler(kLongIdleHandlerDelayMs); 1645 ScheduleIdleHandler(kLongIdleHandlerDelayMs);
1657 } 1646 }
1658 1647
1659 } // namespace content 1648 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/renderer/scheduler_proxy_task_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698