summaryrefslogtreecommitdiff
path: root/runtime/native_bridge.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/native_bridge.h')
-rw-r--r--runtime/native_bridge.h38
1 files changed, 9 insertions, 29 deletions
diff --git a/runtime/native_bridge.h b/runtime/native_bridge.h
index 3d20fe43f8..be647fc1eb 100644
--- a/runtime/native_bridge.h
+++ b/runtime/native_bridge.h
@@ -17,42 +17,22 @@
#ifndef ART_RUNTIME_NATIVE_BRIDGE_H_
#define ART_RUNTIME_NATIVE_BRIDGE_H_
-#include "base/mutex.h"
-
#include <string>
namespace art {
-struct NativeBridgeCallbacks;
-
-class NativeBridge {
- public:
- // Initialize the native bridge, if any. Should be called by Runtime::Init(). An empty string
- // signals that we do not want to load a native bridge.
- static void SetNativeBridgeLibraryString(std::string& native_bridge_library_string);
-
- // Load a shared library that is supported by the native-bridge.
- static void* LoadLibrary(const char* libpath, int flag);
- // Get a native-bridge trampoline for specified native method.
- static void* GetTrampoline(void* handle, const char* name, const char* shorty, uint32_t len);
- // True if native library is valid and is for an ABI that is supported by native-bridge.
- static bool IsSupported(const char* libpath);
-
- private:
- static bool Initialize();
-
- // The library name we are supposed to load.
- static std::string native_bridge_library_string_;
+// Initialize the native bridge, if any. Should be called by Runtime::Init(). An empty string
+// signals that we do not want to load a native bridge.
+void SetNativeBridgeLibraryString(const std::string& native_bridge_library_string);
- // Whether we have already initialized (or tried to).
- static bool initialized_ GUARDED_BY(lock_);
- static Mutex lock_;
+// Load a shared library that is supported by the native-bridge.
+void* NativeBridgeLoadLibrary(const char* libpath, int flag);
- // Whether a native bridge is available (loaded and ready).
- static bool available_;
+// Get a native-bridge trampoline for specified native method.
+void* NativeBridgeGetTrampoline(void* handle, const char* name, const char* shorty, uint32_t len);
- static NativeBridgeCallbacks* callbacks_;
-};
+// True if native library is valid and is for an ABI that is supported by native-bridge.
+bool NativeBridgeIsSupported(const char* libpath);
}; // namespace art