summaryrefslogtreecommitdiffstats
path: root/webkit/plugins
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-18 22:06:22 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-18 22:06:22 +0000
commit84479325c4ccdecd2bddc2f257d436b66595aa10 (patch)
treecd91804f50e952a09f84c6bdf7f68bdb3dab4bc4 /webkit/plugins
parente51eeb7307ea00ec6ef593d938a60f356e3a0882 (diff)
downloadchromium_src-84479325c4ccdecd2bddc2f257d436b66595aa10.zip
chromium_src-84479325c4ccdecd2bddc2f257d436b66595aa10.tar.gz
chromium_src-84479325c4ccdecd2bddc2f257d436b66595aa10.tar.bz2
linux: don't always print dlopen errors from LoadNativeLibrary
Instead, return them to the caller and let the caller decide whether the error is worth notifying the user about. BUG=79068 Review URL: http://codereview.chromium.org/6864020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82008 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins')
-rw-r--r--webkit/plugins/npapi/plugin_lib.cc17
-rw-r--r--webkit/plugins/npapi/plugin_lib_posix.cc13
-rw-r--r--webkit/plugins/ppapi/plugin_module.cc2
3 files changed, 19 insertions, 13 deletions
diff --git a/webkit/plugins/npapi/plugin_lib.cc b/webkit/plugins/npapi/plugin_lib.cc
index f0793c5..2db2a52 100644
--- a/webkit/plugins/npapi/plugin_lib.cc
+++ b/webkit/plugins/npapi/plugin_lib.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -180,6 +180,7 @@ bool PluginLib::Load() {
bool rv = false;
base::NativeLibrary library = 0;
+ std::string error;
if (!internal_) {
#if defined(OS_WIN)
@@ -193,14 +194,16 @@ bool PluginLib::Load() {
std::wstring::npos) {
library = base::LoadNativeLibraryDynamically(web_plugin_info_.path);
} else {
- library = base::LoadNativeLibrary(web_plugin_info_.path);
+ library = base::LoadNativeLibrary(web_plugin_info_.path, &error);
}
-#else // OS_WIN
- library = base::LoadNativeLibrary(web_plugin_info_.path);
-#endif // OS_WIN
- if (library == 0) {
+#else
+ library = base::LoadNativeLibrary(web_plugin_info_.path, &error);
+#endif
+
+ if (!library) {
LOG_IF(ERROR, PluginList::DebugPluginLoading())
- << "Couldn't load plugin " << web_plugin_info_.path.value();
+ << "Couldn't load plugin " << web_plugin_info_.path.value() << " "
+ << error;
return rv;
}
diff --git a/webkit/plugins/npapi/plugin_lib_posix.cc b/webkit/plugins/npapi/plugin_lib_posix.cc
index debd457..641b6cd 100644
--- a/webkit/plugins/npapi/plugin_lib_posix.cc
+++ b/webkit/plugins/npapi/plugin_lib_posix.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -116,13 +116,15 @@ void UnwrapNSPluginWrapper(void **dl, FilePath* unwrapped_path) {
return;
}
- void* newdl = base::LoadNativeLibrary(path);
+ std::string error;
+ void* newdl = base::LoadNativeLibrary(path, &error);
if (!newdl) {
// We couldn't load the unwrapped plugin for some reason, despite
// being able to load the wrapped one. Just use the wrapped one.
LOG_IF(ERROR, PluginList::DebugPluginLoading())
<< "Could not use unwrapped nspluginwrapper plugin "
- << unwrapped_path->value() << ", using the wrapped one.";
+ << unwrapped_path->value() << " (" << error << "), "
+ << "using the wrapped one.";
return;
}
@@ -150,11 +152,12 @@ bool PluginLib::ReadWebPluginInfo(const FilePath& filename,
return false;
}
- void* dl = base::LoadNativeLibrary(filename);
+ std::string error;
+ void* dl = base::LoadNativeLibrary(filename, &error);
if (!dl) {
LOG_IF(ERROR, PluginList::DebugPluginLoading())
<< "While reading plugin info, unable to load library "
- << filename.value() << ", skipping.";
+ << filename.value() << " (" << error << "), skipping.";
return false;
}
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index 5ad10db..7e8dc4a 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -431,7 +431,7 @@ bool PluginModule::InitAsInternalPlugin(const EntryPoints& entry_points) {
}
bool PluginModule::InitAsLibrary(const FilePath& path) {
- base::NativeLibrary library = base::LoadNativeLibrary(path);
+ base::NativeLibrary library = base::LoadNativeLibrary(path, NULL);
if (!library)
return false;