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

Side by Side Diff: content/browser/memory/memory_monitor_android.h

Issue 2340293003: Add MemoryMonitorAndroid (Closed)
Patch Set: rebase 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_MEMORY_MEMORY_MONITOR_ANDROID_H_
6 #define CONTENT_BROWSER_MEMORY_MEMORY_MONITOR_ANDROID_H_
7
8 #include <jni.h>
9
10 #include "content/browser/memory/memory_monitor.h"
11
12 namespace content {
13
14 // A memory monitor for the Android system.
15 class CONTENT_EXPORT MemoryMonitorAndroid : public MemoryMonitor {
16 public:
17 static std::unique_ptr<MemoryMonitorAndroid> Create();
18
19 static bool Register(JNIEnv* env);
20
21 // C++ counter-part of ActivityManager.MemoryInfo
22 struct MemoryInfo {
23 jlong avail_mem;
24 jboolean low_memory;
25 jlong threshold;
26 jlong total_mem;
27 };
28
29 ~MemoryMonitorAndroid() override;
30
31 // MemoryMonitor implementation:
32 int GetFreeMemoryUntilCriticalMB() override;
33
34 // Get memory info from the Android system.
35 void GetMemoryInfo(MemoryInfo* out);
36
37 private:
38 MemoryMonitorAndroid();
39
40 DISALLOW_COPY_AND_ASSIGN(MemoryMonitorAndroid);
41 };
42
43 } // namespace content
44
45 #endif // CONTENT_BROWSER_MEMORY_MEMORY_MONITOR_ANDROID_H_
OLDNEW
« no previous file with comments | « content/browser/android/browser_jni_registrar.cc ('k') | content/browser/memory/memory_monitor_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698