| Index: base/native_library.h
|
| diff --git a/base/native_library.h b/base/native_library.h
|
| index d7513d0b050e181b4df913e276b39051aef5318f..f68bb6f921c39920b8ee8d5aff925335ebb37ddb 100644
|
| --- a/base/native_library.h
|
| +++ b/base/native_library.h
|
| @@ -8,6 +8,8 @@
|
| // This file defines a cross-platform "NativeLibrary" type which represents
|
| // a loadable module.
|
|
|
| +#include <iosfwd>
|
| +
|
| #include "base/base_export.h"
|
| #include "base/compiler_specific.h"
|
| #include "build/build_config.h"
|
| @@ -50,11 +52,20 @@ typedef NativeLibraryStruct* NativeLibrary;
|
| typedef void* NativeLibrary;
|
| #endif // OS_*
|
|
|
| +struct NativeLibraryLoadError {
|
| +#if defined(OS_WIN)
|
| + NativeLibraryLoadError() : error_code(0) {}
|
| + DWORD code;
|
| +#else
|
| + std::string message;
|
| +#endif // OS_WIN
|
| +};
|
| +
|
| // Loads a native library from disk. Release it with UnloadNativeLibrary when
|
| // you're done. Returns NULL on failure.
|
| -// If |error| is not NULL, it may be filled in with an error message on error.
|
| +// If |error| is not NULL, it may be filled in on load error.
|
| BASE_EXPORT NativeLibrary LoadNativeLibrary(const FilePath& library_path,
|
| - std::string* error);
|
| + NativeLibraryLoadError* error);
|
|
|
| #if defined(OS_WIN)
|
| // Loads a native library from disk. Release it with UnloadNativeLibrary when
|
| @@ -79,6 +90,10 @@ BASE_EXPORT void* GetFunctionPointerFromNativeLibrary(NativeLibrary library,
|
| // "mylib.dylib" on Mac.
|
| BASE_EXPORT string16 GetNativeLibraryName(const string16& name);
|
|
|
| +// Stream operator so NativeLibraryLoadError can be used in log statements.
|
| +BASE_EXPORT std::ostream& operator<<(std::ostream& out,
|
| + const NativeLibraryLoadError& error);
|
| +
|
| } // namespace base
|
|
|
| #endif // BASE_NATIVE_LIBRARY_H_
|
|
|