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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 2777393002: Revert of Initialize ChildMemoryCoordinator before blink (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 3fca390590adb1c4c1f0f2b68484410c5912d5eb..fc83bd7fb946a937142e210324832a6e540a82d2 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -639,22 +639,6 @@
shared_bitmap_manager_.reset(
new ChildSharedBitmapManager(thread_safe_render_message_filter_));
- memory_pressure_listener_.reset(new base::MemoryPressureListener(
- base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)),
- base::Bind(&RenderThreadImpl::OnSyncMemoryPressure,
- base::Unretained(this))));
-
- if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) {
- // Disable MemoryPressureListener when memory coordinator is enabled.
- base::MemoryPressureListener::SetNotificationsSuppressed(true);
-
- mojom::MemoryCoordinatorHandlePtr parent_coordinator;
- GetConnector()->BindInterface(mojom::kBrowserServiceName,
- mojo::MakeRequest(&parent_coordinator));
- memory_coordinator_ =
- CreateChildMemoryCoordinator(std::move(parent_coordinator), this);
- }
-
InitializeWebKit(resource_task_queue);
// In single process the single process is all there is.
@@ -838,6 +822,25 @@
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableNewVp9CodecString)) {
media::EnableNewVp9CodecStringSupport();
+ }
+
+ memory_pressure_listener_.reset(new base::MemoryPressureListener(
+ base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)),
+ base::Bind(&RenderThreadImpl::OnSyncMemoryPressure,
+ base::Unretained(this))));
+
+ if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) {
+ // Disable MemoryPressureListener when memory coordinator is enabled.
+ base::MemoryPressureListener::SetNotificationsSuppressed(true);
+
+ // TODO(bashi): Revisit how to manage the lifetime of
+ // ChildMemoryCoordinatorImpl.
+ // https://codereview.chromium.org/2094583002/#msg52
+ mojom::MemoryCoordinatorHandlePtr parent_coordinator;
+ GetConnector()->BindInterface(mojom::kBrowserServiceName,
+ mojo::MakeRequest(&parent_coordinator));
+ memory_coordinator_ = CreateChildMemoryCoordinator(
+ std::move(parent_coordinator), this);
}
int num_raster_threads = 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698