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

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

Issue 2411423004: Disable MemoryPressureListener when memory coordinator is enabled (Closed)
Patch Set: Created 4 years, 2 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/browser/devtools/protocol/memory_handler.cc ('k') | no next file » | 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 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 media::EnablePlatformDecoderSupport(); 835 media::EnablePlatformDecoderSupport();
836 } 836 }
837 #endif 837 #endif
838 838
839 memory_pressure_listener_.reset(new base::MemoryPressureListener( 839 memory_pressure_listener_.reset(new base::MemoryPressureListener(
840 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)), 840 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)),
841 base::Bind(&RenderThreadImpl::OnSyncMemoryPressure, 841 base::Bind(&RenderThreadImpl::OnSyncMemoryPressure,
842 base::Unretained(this)))); 842 base::Unretained(this))));
843 843
844 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { 844 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) {
845 // Disable MemoryPressureListener when memory coordinator is enabled.
846 base::MemoryPressureListener::SetNotificationsSuppressed(true);
847
845 // TODO(bashi): Revisit how to manage the lifetime of 848 // TODO(bashi): Revisit how to manage the lifetime of
846 // ChildMemoryCoordinatorImpl. 849 // ChildMemoryCoordinatorImpl.
847 // https://codereview.chromium.org/2094583002/#msg52 850 // https://codereview.chromium.org/2094583002/#msg52
848 mojom::MemoryCoordinatorHandlePtr parent_coordinator; 851 mojom::MemoryCoordinatorHandlePtr parent_coordinator;
849 GetRemoteInterfaces()->GetInterface(mojo::GetProxy(&parent_coordinator)); 852 GetRemoteInterfaces()->GetInterface(mojo::GetProxy(&parent_coordinator));
850 memory_coordinator_ = CreateChildMemoryCoordinator( 853 memory_coordinator_ = CreateChildMemoryCoordinator(
851 std::move(parent_coordinator), this); 854 std::move(parent_coordinator), this);
852 } 855 }
853 856
854 int num_raster_threads = 0; 857 int num_raster_threads = 0;
(...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after
2357 } 2360 }
2358 } 2361 }
2359 2362
2360 void RenderThreadImpl::OnRendererInterfaceRequest( 2363 void RenderThreadImpl::OnRendererInterfaceRequest(
2361 mojom::RendererAssociatedRequest request) { 2364 mojom::RendererAssociatedRequest request) {
2362 DCHECK(!renderer_binding_.is_bound()); 2365 DCHECK(!renderer_binding_.is_bound());
2363 renderer_binding_.Bind(std::move(request)); 2366 renderer_binding_.Bind(std::move(request));
2364 } 2367 }
2365 2368
2366 } // namespace content 2369 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/memory_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698