| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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_NATIVE_LIBRARY_H_ | 5 #ifndef BASE_NATIVE_LIBRARY_H_ |
| 6 #define BASE_NATIVE_LIBRARY_H_ | 6 #define BASE_NATIVE_LIBRARY_H_ |
| 7 | 7 |
| 8 // This file defines a cross-platform "NativeLibrary" type which represents | 8 // This file defines a cross-platform "NativeLibrary" type which represents |
| 9 // a loadable module. | 9 // a loadable module. |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
| 33 typedef HMODULE NativeLibrary; | 33 typedef HMODULE NativeLibrary; |
| 34 #elif defined(OS_MACOSX) | 34 #elif defined(OS_MACOSX) |
| 35 enum NativeLibraryType { | 35 enum NativeLibraryType { |
| 36 BUNDLE, | 36 BUNDLE, |
| 37 DYNAMIC_LIB | 37 DYNAMIC_LIB |
| 38 }; | 38 }; |
| 39 struct NativeLibraryStruct { | 39 struct NativeLibraryStruct { |
| 40 NativeLibraryType type; | 40 NativeLibraryType type; |
| 41 CFBundleRefNum bundle_resource_ref; |
| 41 union { | 42 union { |
| 42 CFBundleRef bundle; | 43 CFBundleRef bundle; |
| 43 void* dylib; | 44 void* dylib; |
| 44 }; | 45 }; |
| 45 }; | 46 }; |
| 46 typedef NativeLibraryStruct* NativeLibrary; | 47 typedef NativeLibraryStruct* NativeLibrary; |
| 47 #elif defined(OS_POSIX) | 48 #elif defined(OS_POSIX) |
| 48 typedef void* NativeLibrary; | 49 typedef void* NativeLibrary; |
| 49 #endif // OS_* | 50 #endif // OS_* |
| 50 | 51 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 61 | 62 |
| 62 // Returns the full platform specific name for a native library. | 63 // Returns the full platform specific name for a native library. |
| 63 // For example: | 64 // For example: |
| 64 // "mylib" returns "mylib.dll" on Windows, "libmylib.so" on Linux, | 65 // "mylib" returns "mylib.dll" on Windows, "libmylib.so" on Linux, |
| 65 // "mylib.dylib" on Mac. | 66 // "mylib.dylib" on Mac. |
| 66 string16 GetNativeLibraryName(const string16& name); | 67 string16 GetNativeLibraryName(const string16& name); |
| 67 | 68 |
| 68 } // namespace base | 69 } // namespace base |
| 69 | 70 |
| 70 #endif // BASE_NATIVE_LIBRARY_H_ | 71 #endif // BASE_NATIVE_LIBRARY_H_ |
| OLD | NEW |