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

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

Issue 2143353004: Revert of Add MemoryCoordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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"
50 #include "components/scheduler/child/compositor_worker_scheduler.h" 49 #include "components/scheduler/child/compositor_worker_scheduler.h"
51 #include "components/scheduler/child/webthread_base.h" 50 #include "components/scheduler/child/webthread_base.h"
52 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" 51 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h"
53 #include "components/scheduler/renderer/renderer_scheduler.h" 52 #include "components/scheduler/renderer/renderer_scheduler.h"
54 #include "content/child/appcache/appcache_dispatcher.h" 53 #include "content/child/appcache/appcache_dispatcher.h"
55 #include "content/child/appcache/appcache_frontend_impl.h" 54 #include "content/child/appcache/appcache_frontend_impl.h"
56 #include "content/child/blob_storage/blob_message_filter.h" 55 #include "content/child/blob_storage/blob_message_filter.h"
57 #include "content/child/child_discardable_shared_memory_manager.h" 56 #include "content/child/child_discardable_shared_memory_manager.h"
58 #include "content/child/child_gpu_memory_buffer_manager.h" 57 #include "content/child/child_gpu_memory_buffer_manager.h"
59 #include "content/child/child_histogram_message_filter.h" 58 #include "content/child/child_histogram_message_filter.h"
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 media::MediaCodecUtil::IsMediaCodecAvailable()) { 816 media::MediaCodecUtil::IsMediaCodecAvailable()) {
818 media::EnablePlatformDecoderSupport(); 817 media::EnablePlatformDecoderSupport();
819 } 818 }
820 #endif 819 #endif
821 820
822 memory_pressure_listener_.reset(new base::MemoryPressureListener( 821 memory_pressure_listener_.reset(new base::MemoryPressureListener(
823 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)), 822 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)),
824 base::Bind(&RenderThreadImpl::OnSyncMemoryPressure, 823 base::Bind(&RenderThreadImpl::OnSyncMemoryPressure,
825 base::Unretained(this)))); 824 base::Unretained(this))));
826 825
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
836 int num_raster_threads = 0; 826 int num_raster_threads = 0;
837 std::string string_value = 827 std::string string_value =
838 command_line.GetSwitchValueASCII(switches::kNumRasterThreads); 828 command_line.GetSwitchValueASCII(switches::kNumRasterThreads);
839 bool parsed_num_raster_threads = 829 bool parsed_num_raster_threads =
840 base::StringToInt(string_value, &num_raster_threads); 830 base::StringToInt(string_value, &num_raster_threads);
841 DCHECK(parsed_num_raster_threads) << string_value; 831 DCHECK(parsed_num_raster_threads) << string_value;
842 DCHECK_GT(num_raster_threads, 0); 832 DCHECK_GT(num_raster_threads, 0);
843 833
844 // TODO(vmpstr): If the flag sticks, we should clean it up and always have 834 // TODO(vmpstr): If the flag sticks, we should clean it up and always have
845 // image decode tasks. 835 // image decode tasks.
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
2249 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) 2239 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical)
2250 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; 2240 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate;
2251 2241
2252 blink::mainThreadIsolate()->MemoryPressureNotification( 2242 blink::mainThreadIsolate()->MemoryPressureNotification(
2253 v8_memory_pressure_level); 2243 v8_memory_pressure_level);
2254 blink::MemoryPressureNotificationToWorkerThreadIsolates( 2244 blink::MemoryPressureNotificationToWorkerThreadIsolates(
2255 v8_memory_pressure_level); 2245 v8_memory_pressure_level);
2256 } 2246 }
2257 2247
2258 } // namespace content 2248 } // 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