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 1449953002: compositor-worker: Refactor CompositorWorkerManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reviewer comments. Created 5 years 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
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 21 matching lines...) Expand all
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 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 bool using_ipc_sync_compositing = 1081 bool using_ipc_sync_compositing =
1080 base::CommandLine::ForCurrentProcess()->HasSwitch( 1082 base::CommandLine::ForCurrentProcess()->HasSwitch(
1081 switches::kIPCSyncCompositing); 1083 switches::kIPCSyncCompositing);
1082 DCHECK(!sync_compositor_factory || !using_ipc_sync_compositing); 1084 DCHECK(!sync_compositor_factory || !using_ipc_sync_compositing);
1083 1085
1084 if (sync_compositor_factory) { 1086 if (sync_compositor_factory) {
1085 compositor_task_runner_ = 1087 compositor_task_runner_ =
1086 sync_compositor_factory->GetCompositorTaskRunner(); 1088 sync_compositor_factory->GetCompositorTaskRunner();
1087 } 1089 }
1088 #endif 1090 #endif
1089 if (!compositor_task_runner_) { 1091 if (!compositor_task_runner_.get()) {
1090 compositor_thread_.reset(new base::Thread("Compositor")); 1092 compositor_thread_.reset(
1091 base::Thread::Options compositor_thread_options; 1093 blink_platform_impl_->createThreadForCompositor("Compositor"));
1092 #if defined(OS_ANDROID) 1094 compositor_task_runner_ = static_cast<scheduler::WebThreadBase*>(
1093 compositor_thread_options.priority = base::ThreadPriority::DISPLAY; 1095 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( 1096 compositor_task_runner_->PostTask(
1098 FROM_HERE, 1097 FROM_HERE,
1099 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed), 1098 base::Bind(base::IgnoreResult(&ThreadRestrictions::SetIOAllowed),
1100 false)); 1099 false));
1101 } 1100 }
1102 1101
1103 InputHandlerManagerClient* input_handler_manager_client = NULL; 1102 InputHandlerManagerClient* input_handler_manager_client = NULL;
1104 #if defined(OS_ANDROID) 1103 #if defined(OS_ANDROID)
1105 if (using_ipc_sync_compositing) { 1104 if (using_ipc_sync_compositing) {
1106 sync_compositor_message_filter_ = 1105 sync_compositor_message_filter_ =
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
1973 1972
1974 void RenderThreadImpl::ReleaseFreeMemory() { 1973 void RenderThreadImpl::ReleaseFreeMemory() {
1975 base::allocator::ReleaseFreeMemory(); 1974 base::allocator::ReleaseFreeMemory();
1976 discardable_shared_memory_manager()->ReleaseFreeMemory(); 1975 discardable_shared_memory_manager()->ReleaseFreeMemory();
1977 1976
1978 if (blink_platform_impl_) 1977 if (blink_platform_impl_)
1979 blink::decommitFreeableMemory(); 1978 blink::decommitFreeableMemory();
1980 } 1979 }
1981 1980
1982 } // namespace content 1981 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698