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

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

Issue 2094583002: Add MemoryCoordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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 | « content/renderer/render_thread_impl.h ('k') | content/test/BUILD.gn » ('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 <utility> 10 #include <utility>
(...skipping 28 matching lines...) Expand all
39 #include "build/build_config.h" 39 #include "build/build_config.h"
40 #include "cc/base/histograms.h" 40 #include "cc/base/histograms.h"
41 #include "cc/base/switches.h" 41 #include "cc/base/switches.h"
42 #include "cc/blink/web_external_bitmap_impl.h" 42 #include "cc/blink/web_external_bitmap_impl.h"
43 #include "cc/blink/web_layer_impl.h" 43 #include "cc/blink/web_layer_impl.h"
44 #include "cc/output/output_surface.h" 44 #include "cc/output/output_surface.h"
45 #include "cc/output/vulkan_in_process_context_provider.h" 45 #include "cc/output/vulkan_in_process_context_provider.h"
46 #include "cc/raster/task_graph_runner.h" 46 #include "cc/raster/task_graph_runner.h"
47 #include "cc/trees/layer_tree_host_common.h" 47 #include "cc/trees/layer_tree_host_common.h"
48 #include "cc/trees/layer_tree_settings.h" 48 #include "cc/trees/layer_tree_settings.h"
49 #include "components/memory_coordinator/child/child_memory_coordinator_impl.h"
49 #include "components/scheduler/child/compositor_worker_scheduler.h" 50 #include "components/scheduler/child/compositor_worker_scheduler.h"
50 #include "components/scheduler/child/webthread_base.h" 51 #include "components/scheduler/child/webthread_base.h"
51 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" 52 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h"
52 #include "components/scheduler/renderer/renderer_scheduler.h" 53 #include "components/scheduler/renderer/renderer_scheduler.h"
53 #include "content/child/appcache/appcache_dispatcher.h" 54 #include "content/child/appcache/appcache_dispatcher.h"
54 #include "content/child/appcache/appcache_frontend_impl.h" 55 #include "content/child/appcache/appcache_frontend_impl.h"
55 #include "content/child/blob_storage/blob_message_filter.h" 56 #include "content/child/blob_storage/blob_message_filter.h"
56 #include "content/child/child_discardable_shared_memory_manager.h" 57 #include "content/child/child_discardable_shared_memory_manager.h"
57 #include "content/child/child_gpu_memory_buffer_manager.h" 58 #include "content/child/child_gpu_memory_buffer_manager.h"
58 #include "content/child/child_histogram_message_filter.h" 59 #include "content/child/child_histogram_message_filter.h"
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 media::MediaCodecUtil::IsMediaCodecAvailable()) { 817 media::MediaCodecUtil::IsMediaCodecAvailable()) {
817 media::EnablePlatformDecoderSupport(); 818 media::EnablePlatformDecoderSupport();
818 } 819 }
819 #endif 820 #endif
820 821
821 memory_pressure_listener_.reset(new base::MemoryPressureListener( 822 memory_pressure_listener_.reset(new base::MemoryPressureListener(
822 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)), 823 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)),
823 base::Bind(&RenderThreadImpl::OnSyncMemoryPressure, 824 base::Bind(&RenderThreadImpl::OnSyncMemoryPressure,
824 base::Unretained(this)))); 825 base::Unretained(this))));
825 826
827 if (memory_coordinator::IsEnabled()) {
828 // TODO(bashi): Revisit how to manage the lifetime of
829 // ChildMemoryCoordinatorImpl.
830 // https://codereview.chromium.org/2094583002/#msg52
831 memory_coordinator_.reset(
832 new memory_coordinator::ChildMemoryCoordinatorImpl(
833 GetRemoteInterfaces()));
834 }
835
826 int num_raster_threads = 0; 836 int num_raster_threads = 0;
827 std::string string_value = 837 std::string string_value =
828 command_line.GetSwitchValueASCII(switches::kNumRasterThreads); 838 command_line.GetSwitchValueASCII(switches::kNumRasterThreads);
829 bool parsed_num_raster_threads = 839 bool parsed_num_raster_threads =
830 base::StringToInt(string_value, &num_raster_threads); 840 base::StringToInt(string_value, &num_raster_threads);
831 DCHECK(parsed_num_raster_threads) << string_value; 841 DCHECK(parsed_num_raster_threads) << string_value;
832 DCHECK_GT(num_raster_threads, 0); 842 DCHECK_GT(num_raster_threads, 0);
833 843
834 // TODO(vmpstr): If the flag sticks, we should clean it up and always have 844 // TODO(vmpstr): If the flag sticks, we should clean it up and always have
835 // image decode tasks. 845 // image decode tasks.
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
2239 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) 2249 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical)
2240 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; 2250 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate;
2241 2251
2242 blink::mainThreadIsolate()->MemoryPressureNotification( 2252 blink::mainThreadIsolate()->MemoryPressureNotification(
2243 v8_memory_pressure_level); 2253 v8_memory_pressure_level);
2244 blink::MemoryPressureNotificationToWorkerThreadIsolates( 2254 blink::MemoryPressureNotificationToWorkerThreadIsolates(
2245 v8_memory_pressure_level); 2255 v8_memory_pressure_level);
2246 } 2256 }
2247 2257
2248 } // namespace content 2258 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698