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

Unified Diff: content/browser/memory/memory_coordinator_impl.h

Issue 2731913002: NotForReview: Expose the global memory budget (chromium side)
Patch Set: Add --simulate-memory-pressure 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
Index: content/browser/memory/memory_coordinator_impl.h
diff --git a/content/browser/memory/memory_coordinator_impl.h b/content/browser/memory/memory_coordinator_impl.h
index ba9bcf3a392919036d355de9a74bd179e03c2998..818ca0654cf22f1ba986c2a4d0d19104b307398a 100644
--- a/content/browser/memory/memory_coordinator_impl.h
+++ b/content/browser/memory/memory_coordinator_impl.h
@@ -19,6 +19,7 @@
#include "content/public/browser/memory_coordinator_delegate.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "mojo/public/cpp/system/buffer.h"
namespace content {
@@ -80,6 +81,8 @@ class CONTENT_EXPORT MemoryCoordinatorImpl : public base::MemoryCoordinator,
// base::MemoryCoordinator implementations:
MemoryState GetCurrentMemoryState() const override;
+ int64_t GetGlobalBudget() override;
+ void SetGlobalBudgetUpdateInterval(uint32_t interval_ms) override;
// content::MemoryCoordinator implementation:
MemoryState GetStateForProcess(base::ProcessHandle handle) override;
@@ -103,6 +106,9 @@ class CONTENT_EXPORT MemoryCoordinatorImpl : public base::MemoryCoordinator,
// like purging memory and memory state changes.
void UpdateConditionIfNeeded(MemoryCondition condition);
+ // Updates the global memory budget.
+ void UpdateGlobalBudget(int budget);
+
// Asks the delegate to discard a tab.
void DiscardTab();
@@ -212,6 +218,9 @@ class CONTENT_EXPORT MemoryCoordinatorImpl : public base::MemoryCoordinator,
// disconnected.
ChildInfoMap children_;
+ mojo::ScopedSharedBufferHandle global_budget_handle_;
+ mojo::ScopedSharedBufferMapping global_budget_mapping_;
+
DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorImpl);
};
« no previous file with comments | « content/browser/memory/memory_condition_observer.cc ('k') | content/browser/memory/memory_coordinator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698