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

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

Issue 2360433002: Memory-monitor for Mac. (Closed)
Patch Set: rebased Created 4 years, 1 month 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/test_memory_monitor.h
diff --git a/content/browser/memory/test_memory_monitor.h b/content/browser/memory/test_memory_monitor.h
index 946aa566dfa551e42142550255b82d793fff7023..be5fe211b18af4a1e652e85eba508a4bf4e4f8a2 100644
--- a/content/browser/memory/test_memory_monitor.h
+++ b/content/browser/memory/test_memory_monitor.h
@@ -14,14 +14,20 @@ namespace content {
// A delegate that allows mocking the various inputs to MemoryMonitor.
class TestMemoryMonitorDelegate : public MemoryMonitorDelegate {
public:
- TestMemoryMonitorDelegate() : calls_(0) { mem_info_ = {}; }
+ TestMemoryMonitorDelegate() { mem_info_ = {}; }
~TestMemoryMonitorDelegate() override;
void GetSystemMemoryInfo(base::SystemMemoryInfoKB* mem_info) override;
+ bool GetSystemMemoryPressure(int* mem_pressure) override;
size_t calls() const { return calls_; }
void ResetCalls() { calls_ = 0; }
+ void SetMemoryPressure(int mem_pressure) {
+ mem_pressure_ = mem_pressure;
+ mem_pressure_valid_ = true;
+ }
+
void SetTotalMemoryKB(int total_memory_kb) {
mem_info_.total = total_memory_kb;
}
@@ -33,7 +39,9 @@ class TestMemoryMonitorDelegate : public MemoryMonitorDelegate {
base::SystemMemoryInfoKB mem_info_;
private:
- size_t calls_;
+ int mem_pressure_ = -1;
+ int mem_pressure_valid_ = false;
+ size_t calls_ = 0;
DISALLOW_COPY_AND_ASSIGN(TestMemoryMonitorDelegate);
};
« no previous file with comments | « content/browser/memory/memory_monitor_mac_unittest.cc ('k') | content/browser/memory/test_memory_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698