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

Unified Diff: base/native_library.h

Issue 2277863002: Enable loading native libraries with RTLD_DEEPBIND (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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
index b4f3a3cd1ba267000848b09c0ee9d8af7983387f..074b6a70adf343d06e3a0f8bac17f3ded2136903 100644
--- a/base/native_library.h
+++ b/base/native_library.h
@@ -65,12 +65,29 @@ struct BASE_EXPORT NativeLibraryLoadError {
#endif // OS_WIN
};
+struct BASE_EXPORT NativeLibraryOptions {
Primiano Tucci (use gerrit) 2016/08/24 22:14:09 If there are no other use cases this IMHO should b
Ken Rockot(use gerrit already) 2016/08/24 23:23:57 I'd prefer to use a struct here only because it's
Primiano Tucci (use gerrit) 2016/08/25 10:20:44 I leave this to base owners, as I'm not an owner h
+ NativeLibraryOptions() {}
+
+ // If |true| the library will prefer its own symbols in lieu of symbols in the
+ // global scope. This is ignored on non-POSIX platforms. On POSIX the behavior
+ // when |true| corresponds to setting RTLD_DEEPBIND on dlopen().
Primiano Tucci (use gerrit) 2016/08/24 22:14:09 Interestingly it seems that on Mac OSX DEEPBIND is
Ken Rockot(use gerrit already) 2016/08/24 23:23:57 Added a note about this
+ bool prefer_own_symbols = false;
+};
+
// 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 on load error.
BASE_EXPORT NativeLibrary LoadNativeLibrary(const FilePath& library_path,
NativeLibraryLoadError* error);
+// 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 on load error.
+BASE_EXPORT NativeLibrary LoadNativeLibraryWithOptions(
+ const FilePath& library_path,
+ const NativeLibraryOptions& options,
+ NativeLibraryLoadError* error);
+
#if defined(OS_WIN)
// Loads a native library from disk. Release it with UnloadNativeLibrary when
// you're done.

Powered by Google App Engine
This is Rietveld 408576698