Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2009 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 BASE_NATIVE_LIBRARY_H_ | |
| 6 #define BASE_NATIVE_LIBRARY_H_ | |
| 7 | |
| 8 // This file defines a cross-platform "NativeLibrary" type which represents | |
| 9 // a loadable module. It's used for holding plugin handles. | |
|
jam
2009/04/21 00:26:53
no need to mention plugins here
| |
| 10 | |
| 11 #include "build/build_config.h" | |
| 12 | |
| 13 #if defined(OS_WIN) | |
| 14 #include <windows.h> | |
| 15 #elif defined(OS_MACOSX) | |
| 16 #import <Carbon/Carbon.h> | |
| 17 #endif // OS_* | |
| 18 | |
| 19 class FilePath; | |
| 20 | |
| 21 namespace base { | |
| 22 | |
| 23 #if defined(OS_WIN) | |
| 24 typedef HMODULE NativeLibrary; | |
| 25 typedef char* NativeLibraryFunctionNameType; | |
| 26 #elif defined(OS_MACOSX) | |
| 27 typedef CFBundleRef NativeLibrary; | |
| 28 typedef CFStringRef NativeLibraryFunctionNameType; | |
| 29 #elif defined(OS_LINUX) | |
| 30 typedef void* NativeLibrary; | |
| 31 typedef const char* NativeLibraryFunctionNameType; | |
| 32 #endif // OS_* | |
| 33 | |
| 34 // Loads a native library from disk. Release it with | |
| 35 // UnloadNativeLibrary when you're done. | |
| 36 NativeLibrary LoadNativeLibrary(const FilePath& library_path); | |
| 37 | |
| 38 // Unloads a native library. | |
| 39 void UnloadNativeLibrary(NativeLibrary library); | |
| 40 | |
| 41 // Gets a function pointer from a native library. | |
| 42 void* GetFunctionPointerFromNativeLibrary(NativeLibrary library, | |
| 43 NativeLibraryFunctionNameType name); | |
| 44 | |
| 45 } // namespace base | |
| 46 | |
| 47 #endif // BASE_NATIVE_LIBRARY_H_ | |
| OLD | NEW |