Chromium Code Reviews| 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 21 matching lines...) Expand all Loading... | |
| 32 #include "base/threading/thread_restrictions.h" | 32 #include "base/threading/thread_restrictions.h" |
| 33 #include "base/trace_event/memory_dump_manager.h" | 33 #include "base/trace_event/memory_dump_manager.h" |
| 34 #include "base/trace_event/trace_event.h" | 34 #include "base/trace_event/trace_event.h" |
| 35 #include "base/values.h" | 35 #include "base/values.h" |
| 36 #include "cc/base/histograms.h" | 36 #include "cc/base/histograms.h" |
| 37 #include "cc/base/switches.h" | 37 #include "cc/base/switches.h" |
| 38 #include "cc/blink/web_external_bitmap_impl.h" | 38 #include "cc/blink/web_external_bitmap_impl.h" |
| 39 #include "cc/blink/web_layer_impl.h" | 39 #include "cc/blink/web_layer_impl.h" |
| 40 #include "cc/layers/layer_settings.h" | 40 #include "cc/layers/layer_settings.h" |
| 41 #include "cc/raster/task_graph_runner.h" | 41 #include "cc/raster/task_graph_runner.h" |
| 42 #include "cc/trees/layer_tree_host_common.h" | |
| 42 #include "cc/trees/layer_tree_settings.h" | 43 #include "cc/trees/layer_tree_settings.h" |
| 44 #include "components/scheduler/child/webthread_base.h" | |
| 43 #include "components/scheduler/renderer/renderer_scheduler.h" | 45 #include "components/scheduler/renderer/renderer_scheduler.h" |
| 44 #include "content/child/appcache/appcache_dispatcher.h" | 46 #include "content/child/appcache/appcache_dispatcher.h" |
| 45 #include "content/child/appcache/appcache_frontend_impl.h" | 47 #include "content/child/appcache/appcache_frontend_impl.h" |
| 46 #include "content/child/child_discardable_shared_memory_manager.h" | 48 #include "content/child/child_discardable_shared_memory_manager.h" |
| 47 #include "content/child/child_gpu_memory_buffer_manager.h" | 49 #include "content/child/child_gpu_memory_buffer_manager.h" |
| 48 #include "content/child/child_histogram_message_filter.h" | 50 #include "content/child/child_histogram_message_filter.h" |
| 49 #include "content/child/child_resource_message_filter.h" | 51 #include "content/child/child_resource_message_filter.h" |
| 50 #include "content/child/child_shared_bitmap_manager.h" | 52 #include "content/child/child_shared_bitmap_manager.h" |
| 51 #include "content/child/content_child_helpers.h" | 53 #include "content/child/content_child_helpers.h" |
| 52 #include "content/child/db_message_filter.h" | 54 #include "content/child/db_message_filter.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 #include "media/base/media.h" | 132 #include "media/base/media.h" |
| 131 #include "media/renderers/gpu_video_accelerator_factories.h" | 133 #include "media/renderers/gpu_video_accelerator_factories.h" |
| 132 #include "mojo/common/common_type_converters.h" | 134 #include "mojo/common/common_type_converters.h" |
| 133 #include "mojo/public/cpp/bindings/strong_binding.h" | 135 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 134 #include "net/base/net_errors.h" | 136 #include "net/base/net_errors.h" |
| 135 #include "net/base/net_util.h" | 137 #include "net/base/net_util.h" |
| 136 #include "net/base/port_util.h" | 138 #include "net/base/port_util.h" |
| 137 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 139 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 138 #include "skia/ext/event_tracer_impl.h" | 140 #include "skia/ext/event_tracer_impl.h" |
| 139 #include "skia/ext/skia_memory_dump_provider.h" | 141 #include "skia/ext/skia_memory_dump_provider.h" |
| 142 #include "third_party/WebKit/public/platform/Platform.h" | |
| 140 #include "third_party/WebKit/public/platform/WebImageGenerator.h" | 143 #include "third_party/WebKit/public/platform/WebImageGenerator.h" |
| 141 #include "third_party/WebKit/public/platform/WebString.h" | 144 #include "third_party/WebKit/public/platform/WebString.h" |
| 142 #include "third_party/WebKit/public/platform/WebThread.h" | 145 #include "third_party/WebKit/public/platform/WebThread.h" |
| 143 #include "third_party/WebKit/public/web/WebCache.h" | 146 #include "third_party/WebKit/public/web/WebCache.h" |
| 144 #include "third_party/WebKit/public/web/WebDatabase.h" | 147 #include "third_party/WebKit/public/web/WebDatabase.h" |
| 145 #include "third_party/WebKit/public/web/WebDocument.h" | 148 #include "third_party/WebKit/public/web/WebDocument.h" |
| 146 #include "third_party/WebKit/public/web/WebFrame.h" | 149 #include "third_party/WebKit/public/web/WebFrame.h" |
| 147 #include "third_party/WebKit/public/web/WebImageCache.h" | 150 #include "third_party/WebKit/public/web/WebImageCache.h" |
| 148 #include "third_party/WebKit/public/web/WebKit.h" | 151 #include "third_party/WebKit/public/web/WebKit.h" |
| 149 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" | 152 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" |
| (...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1079 bool using_ipc_sync_compositing = | 1082 bool using_ipc_sync_compositing = |
| 1080 base::CommandLine::ForCurrentProcess()->HasSwitch( | 1083 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1081 switches::kIPCSyncCompositing); | 1084 switches::kIPCSyncCompositing); |
| 1082 DCHECK(!sync_compositor_factory || !using_ipc_sync_compositing); | 1085 DCHECK(!sync_compositor_factory || !using_ipc_sync_compositing); |
| 1083 | 1086 |
| 1084 if (sync_compositor_factory) { | 1087 if (sync_compositor_factory) { |
| 1085 compositor_task_runner_ = | 1088 compositor_task_runner_ = |
| 1086 sync_compositor_factory->GetCompositorTaskRunner(); | 1089 sync_compositor_factory->GetCompositorTaskRunner(); |
| 1087 } | 1090 } |
| 1088 #endif | 1091 #endif |
| 1089 if (!compositor_task_runner_) { | 1092 if (!compositor_task_runner_.get()) { |
| 1090 compositor_thread_.reset(new base::Thread("Compositor")); | 1093 compositor_thread_.reset( |
| 1091 base::Thread::Options compositor_thread_options; | 1094 blink::Platform::current()->createThreadForCompositor("Compositor")); |
|
sadrul
2015/11/27 19:03:08
This can directly call into BlinkPlatformImpl thro
Ian Vollick
2015/11/27 19:56:11
Done.
| |
| 1092 #if defined(OS_ANDROID) | 1095 compositor_task_runner_ = static_cast<scheduler::WebThreadBase*>( |
| 1093 compositor_thread_options.priority = base::ThreadPriority::DISPLAY; | 1096 compositor_thread_.get())->TaskRunner(); |
| 1094 #endif | |
| 1095 compositor_thread_->StartWithOptions(compositor_thread_options); | |
| 1096 compositor_task_runner_ = compositor_thread_->task_runner(); | |
| 1097 compositor_task_runner_->PostTask( | 1097 compositor_task_runner_->PostTask( |
| 1098 FROM_HERE, | 1098 FROM_HERE, |
| 1099 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), | 1099 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), |
| 1100 false)); | 1100 false)); |
| 1101 } | 1101 } |
| 1102 | 1102 |
| 1103 InputHandlerManagerClient* input_handler_manager_client = NULL; | 1103 InputHandlerManagerClient* input_handler_manager_client = NULL; |
| 1104 #if defined(OS_ANDROID) | 1104 #if defined(OS_ANDROID) |
| 1105 if (using_ipc_sync_compositing) { | 1105 if (using_ipc_sync_compositing) { |
| 1106 sync_compositor_message_filter_ = | 1106 sync_compositor_message_filter_ = |
| (...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1973 | 1973 |
| 1974 void RenderThreadImpl::ReleaseFreeMemory() { | 1974 void RenderThreadImpl::ReleaseFreeMemory() { |
| 1975 base::allocator::ReleaseFreeMemory(); | 1975 base::allocator::ReleaseFreeMemory(); |
| 1976 discardable_shared_memory_manager()->ReleaseFreeMemory(); | 1976 discardable_shared_memory_manager()->ReleaseFreeMemory(); |
| 1977 | 1977 |
| 1978 if (blink_platform_impl_) | 1978 if (blink_platform_impl_) |
| 1979 blink::decommitFreeableMemory(); | 1979 blink::decommitFreeableMemory(); |
| 1980 } | 1980 } |
| 1981 | 1981 |
| 1982 } // namespace content | 1982 } // namespace content |
| OLD | NEW |