| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef BASE_ANDROID_JAVA_RUNTIME_H_ | 5 #ifndef BASE_ANDROID_JAVA_RUNTIME_H_ |
| 6 #define BASE_ANDROID_JAVA_RUNTIME_H_ | 6 #define BASE_ANDROID_JAVA_RUNTIME_H_ |
| 7 | 7 |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "base/base_export.h" | 9 #include "base/base_export.h" |
| 10 | 10 |
| 11 namespace base { | 11 namespace base { |
| 12 namespace android { | 12 namespace android { |
| 13 | 13 |
| 14 // Wrapper class for using the java.lang.Runtime object from jni. | 14 // Wrapper class for using the java.lang.Runtime object from jni. |
| 15 class BASE_EXPORT JavaRuntime { | 15 class BASE_EXPORT JavaRuntime { |
| 16 public: | 16 public: |
| 17 // Registers the jni class (once per process). | |
| 18 static bool Register(JNIEnv* env); | |
| 19 | |
| 20 // Fills the total memory used and memory allocated for objects by the java | 17 // Fills the total memory used and memory allocated for objects by the java |
| 21 // heap in the current process. Returns true on success. | 18 // heap in the current process. Returns true on success. |
| 22 static void GetMemoryUsage(long* total_memory, long* free_memory); | 19 static void GetMemoryUsage(long* total_memory, long* free_memory); |
| 23 }; | 20 }; |
| 24 | 21 |
| 25 } // namespace android | 22 } // namespace android |
| 26 } // namespace base | 23 } // namespace base |
| 27 | 24 |
| 28 #endif // BASE_ANDROID_JAVA_RUNTIME_H_ | 25 #endif // BASE_ANDROID_JAVA_RUNTIME_H_ |
| OLD | NEW |