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

Unified Diff: base/native_library_linux.cc

Issue 6864020: linux: don't always print dlopen errors from LoadNativeLibrary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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_linux.cc
diff --git a/base/native_library_linux.cc b/base/native_library_linux.cc
index e282bce2213f5d4131d4db1b1275b0eab984b12a..4a1ba1b25c6c9594a92bf0d80c4d4cbfea685b93 100644
--- a/base/native_library_linux.cc
+++ b/base/native_library_linux.cc
@@ -14,7 +14,8 @@
namespace base {
// static
-NativeLibrary LoadNativeLibrary(const FilePath& library_path) {
+NativeLibrary LoadNativeLibrary(const FilePath& library_path,
+ std::string* error) {
// dlopen() opens the file off disk.
base::ThreadRestrictions::AssertIOAllowed();
@@ -23,16 +24,8 @@ NativeLibrary LoadNativeLibrary(const FilePath& library_path) {
// http://crbug.com/17943, http://crbug.com/17557, http://crbug.com/36892,
// and http://crbug.com/40794.
void* dl = dlopen(library_path.value().c_str(), RTLD_LAZY);
- if (!dl) {
- std::string error_message = dlerror();
- // Some obsolete plugins depend on libxul or libxpcom.
- // Ignore the error messages when failing to load these.
- if (error_message.find("libxul.so") == std::string::npos &&
- error_message.find("libxpcom.so") == std::string::npos) {
- LOG(ERROR) << "dlopen failed when trying to open " << library_path.value()
- << ": " << error_message;
- }
- }
+ if (!dl && error)
+ *error = dlerror();
return dl;
}
« no previous file with comments | « base/native_library.h ('k') | base/native_library_mac.mm » ('j') | base/native_library_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698