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

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

Issue 2382623002: Add a test for MemoryMonitorAndroid::GetFreeMemoryUntilCriticalMB (Closed)
Patch Set: Created 4 years, 3 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 | content/browser/memory/memory_monitor_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/memory/memory_monitor_android.h
diff --git a/content/browser/memory/memory_monitor_android.h b/content/browser/memory/memory_monitor_android.h
index abd7824c1ae42ab86977fdb4af3b57db71c8f702..a1733c5acd7fc49de642b4898f76542d73c53e89 100644
--- a/content/browser/memory/memory_monitor_android.h
+++ b/content/browser/memory/memory_monitor_android.h
@@ -26,6 +26,17 @@ class CONTENT_EXPORT MemoryMonitorAndroid : public MemoryMonitor {
jlong total_mem;
};
+ // Delegate interface used by MemoryMonitorAndroid.
+ class Delegate {
+ public:
+ Delegate() {}
+ virtual ~Delegate() {};
+
+ // Get MemoryInfo. Implementations should fill |out| accordingly.
+ virtual void GetMemoryInfo(MemoryInfo* out) = 0;
+ };
+
+ MemoryMonitorAndroid(std::unique_ptr<Delegate> delegate);
~MemoryMonitorAndroid() override;
// MemoryMonitor implementation:
@@ -34,8 +45,10 @@ class CONTENT_EXPORT MemoryMonitorAndroid : public MemoryMonitor {
// Get memory info from the Android system.
void GetMemoryInfo(MemoryInfo* out);
+ Delegate* delegate() { return delegate_.get(); }
+
private:
- MemoryMonitorAndroid();
+ std::unique_ptr<Delegate> delegate_;
DISALLOW_COPY_AND_ASSIGN(MemoryMonitorAndroid);
};
« no previous file with comments | « no previous file | content/browser/memory/memory_monitor_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698