| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/plugin_list.h" | 5 #include "content/common/plugin_list.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <dlfcn.h> | 8 #include <dlfcn.h> |
| 9 #if defined(OS_OPENBSD) | 9 #if defined(OS_OPENBSD) |
| 10 #include <sys/exec_elf.h> | 10 #include <sys/exec_elf.h> |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 base::FilePath path = base::FilePath( | 233 base::FilePath path = base::FilePath( |
| 234 std::string(info->path, path_end - info->path)); | 234 std::string(info->path, path_end - info->path)); |
| 235 | 235 |
| 236 if (!ELFMatchesCurrentArchitecture(path)) { | 236 if (!ELFMatchesCurrentArchitecture(path)) { |
| 237 LOG(WARNING) << path.value() << " is nspluginwrapper wrapping a " | 237 LOG(WARNING) << path.value() << " is nspluginwrapper wrapping a " |
| 238 << "plugin for a different architecture; it will " | 238 << "plugin for a different architecture; it will " |
| 239 << "work better if you instead use a native plugin."; | 239 << "work better if you instead use a native plugin."; |
| 240 return; | 240 return; |
| 241 } | 241 } |
| 242 | 242 |
| 243 std::string error; | 243 base::NativeLibraryLoadError error = 0; |
| 244 void* newdl = base::LoadNativeLibrary(path, &error); | 244 void* newdl = base::LoadNativeLibrary(path, &error); |
| 245 if (!newdl) { | 245 if (!newdl) { |
| 246 // We couldn't load the unwrapped plugin for some reason, despite | 246 // We couldn't load the unwrapped plugin for some reason, despite |
| 247 // being able to load the wrapped one. Just use the wrapped one. | 247 // being able to load the wrapped one. Just use the wrapped one. |
| 248 LOG_IF(ERROR, PluginList::DebugPluginLoading()) | 248 LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
| 249 << "Could not use unwrapped nspluginwrapper plugin " | 249 << "Could not use unwrapped nspluginwrapper plugin " |
| 250 << unwrapped_path->value() << " (" << error << "), " | 250 << unwrapped_path->value() << " (" << error << "), " |
| 251 << "using the wrapped one."; | 251 << "using the wrapped one."; |
| 252 return; | 252 return; |
| 253 } | 253 } |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 } | 585 } |
| 586 | 586 |
| 587 // TODO(evanm): prefer the newest version of flash, etc. here? | 587 // TODO(evanm): prefer the newest version of flash, etc. here? |
| 588 | 588 |
| 589 VLOG_IF(1, PluginList::DebugPluginLoading()) << "Using " << info.path.value(); | 589 VLOG_IF(1, PluginList::DebugPluginLoading()) << "Using " << info.path.value(); |
| 590 | 590 |
| 591 return true; | 591 return true; |
| 592 } | 592 } |
| 593 | 593 |
| 594 } // namespace content | 594 } // namespace content |
| OLD | NEW |