Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4001)

Unified Diff: base/native_library.h

Issue 87012: plugins: move NativeLibrary into base. (Closed)
Patch Set: more fixes from trybot Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/native_library.h
diff --git a/base/native_library.h b/base/native_library.h
new file mode 100644
index 0000000000000000000000000000000000000000..77a13fcf65593a36f048a55fc4937db5c9c309d8
--- /dev/null
+++ b/base/native_library.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2009 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 BASE_NATIVE_LIBRARY_H_
+#define BASE_NATIVE_LIBRARY_H_
+
+// This file defines a cross-platform "NativeLibrary" type which represents
+// a loadable module. It's used for holding plugin handles.
jam 2009/04/21 00:26:53 no need to mention plugins here
+
+#include "build/build_config.h"
+
+#if defined(OS_WIN)
+#include <windows.h>
+#elif defined(OS_MACOSX)
+#import <Carbon/Carbon.h>
+#endif // OS_*
+
+class FilePath;
+
+namespace base {
+
+#if defined(OS_WIN)
+typedef HMODULE NativeLibrary;
+typedef char* NativeLibraryFunctionNameType;
+#elif defined(OS_MACOSX)
+typedef CFBundleRef NativeLibrary;
+typedef CFStringRef NativeLibraryFunctionNameType;
+#elif defined(OS_LINUX)
+typedef void* NativeLibrary;
+typedef const char* NativeLibraryFunctionNameType;
+#endif // OS_*
+
+// Loads a native library from disk. Release it with
+// UnloadNativeLibrary when you're done.
+NativeLibrary LoadNativeLibrary(const FilePath& library_path);
+
+// Unloads a native library.
+void UnloadNativeLibrary(NativeLibrary library);
+
+// Gets a function pointer from a native library.
+void* GetFunctionPointerFromNativeLibrary(NativeLibrary library,
+ NativeLibraryFunctionNameType name);
+
+} // namespace base
+
+#endif // BASE_NATIVE_LIBRARY_H_
« no previous file with comments | « base/base.gyp ('k') | base/native_library_linux.cc » ('j') | base/native_library_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698