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 "webkit/plugins/npapi/plugin_lib.h" | 5 #include "webkit/plugins/npapi/plugin_lib.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #if defined(OS_OPENBSD) | 8 #if defined(OS_OPENBSD) |
9 #include <sys/exec_elf.h> | 9 #include <sys/exec_elf.h> |
10 #else | 10 #else |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 std::string error; | 155 std::string error; |
156 void* dl = base::LoadNativeLibrary(filename, &error); | 156 void* dl = base::LoadNativeLibrary(filename, &error); |
157 if (!dl) { | 157 if (!dl) { |
158 LOG_IF(ERROR, PluginList::DebugPluginLoading()) | 158 LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
159 << "While reading plugin info, unable to load library " | 159 << "While reading plugin info, unable to load library " |
160 << filename.value() << " (" << error << "), skipping."; | 160 << filename.value() << " (" << error << "), skipping."; |
161 return false; | 161 return false; |
162 } | 162 } |
163 | 163 |
164 info->path = filename; | 164 info->path = filename; |
165 info->enabled = WebPluginInfo::USER_ENABLED; | |
166 | 165 |
167 // Attempt to swap in the wrapped plugin if this is nspluginwrapper. | 166 // Attempt to swap in the wrapped plugin if this is nspluginwrapper. |
168 UnwrapNSPluginWrapper(&dl, &info->path); | 167 UnwrapNSPluginWrapper(&dl, &info->path); |
169 | 168 |
170 // See comments in plugin_lib_mac regarding this symbol. | 169 // See comments in plugin_lib_mac regarding this symbol. |
171 typedef const char* (*NP_GetMimeDescriptionType)(); | 170 typedef const char* (*NP_GetMimeDescriptionType)(); |
172 NP_GetMimeDescriptionType NP_GetMIMEDescription = | 171 NP_GetMimeDescriptionType NP_GetMIMEDescription = |
173 reinterpret_cast<NP_GetMimeDescriptionType>( | 172 reinterpret_cast<NP_GetMimeDescriptionType>( |
174 dlsym(dl, "NP_GetMIMEDescription")); | 173 dlsym(dl, "NP_GetMIMEDescription")); |
175 const char* mime_description = NULL; | 174 const char* mime_description = NULL; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 break; | 289 break; |
291 } | 290 } |
292 } | 291 } |
293 if (!version.empty()) { | 292 if (!version.empty()) { |
294 info->version = UTF8ToUTF16(version); | 293 info->version = UTF8ToUTF16(version); |
295 } | 294 } |
296 } | 295 } |
297 | 296 |
298 } // namespace npapi | 297 } // namespace npapi |
299 } // namespace webkit | 298 } // namespace webkit |
OLD | NEW |