| Index: components/memory_coordinator/android/memory_state_listener_android.h
|
| diff --git a/components/memory_coordinator/android/memory_state_listener_android.h b/components/memory_coordinator/android/memory_state_listener_android.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..fda12f7afc9175505d6a3e949bb353611f9f7200
|
| --- /dev/null
|
| +++ b/components/memory_coordinator/android/memory_state_listener_android.h
|
| @@ -0,0 +1,31 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef COMPONENTS_MEMORY_COORDINATOR_ANDROID_MEMORY_STATE_LISTENER_ANDROID_H_
|
| +#define COMPONENTS_MEMORY_COORDINATOR_ANDROID_MEMORY_STATE_LISTENER_ANDROID_H_
|
| +
|
| +#include <jni.h>
|
| +
|
| +namespace memory_coordinator {
|
| +
|
| +// C++ counterpart of ComponentCallbacks2. Only supports OnTrimMemory().
|
| +class MemoryStateListenerAndroidDelegate {
|
| + public:
|
| + virtual void OnTrimMemory(int level) = 0;
|
| +};
|
| +
|
| +// JNI bindings to connect ComponentCallback2 with memory coordinator.
|
| +class MemoryStateListenerAndroid {
|
| + public:
|
| + static bool Register(JNIEnv* env);
|
| +
|
| + static void Start(MemoryStateListenerAndroidDelegate* delegate);
|
| + static void Stop();
|
| +
|
| + static void SimulateOnTrimMemory(int level);
|
| +};
|
| +
|
| +} // namespace memory_coordinator
|
| +
|
| +#endif // COMPONENTS_MEMORY_COORDINATOR_ANDROID_MEMORY_STATE_LISTENER_ANDROID_H_
|
|
|