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; |
165 | 166 |
166 // Attempt to swap in the wrapped plugin if this is nspluginwrapper. | 167 // Attempt to swap in the wrapped plugin if this is nspluginwrapper. |
167 UnwrapNSPluginWrapper(&dl, &info->path); | 168 UnwrapNSPluginWrapper(&dl, &info->path); |
168 | 169 |
169 // See comments in plugin_lib_mac regarding this symbol. | 170 // See comments in plugin_lib_mac regarding this symbol. |
170 typedef const char* (*NP_GetMimeDescriptionType)(); | 171 typedef const char* (*NP_GetMimeDescriptionType)(); |
171 NP_GetMimeDescriptionType NP_GetMIMEDescription = | 172 NP_GetMimeDescriptionType NP_GetMIMEDescription = |
172 reinterpret_cast<NP_GetMimeDescriptionType>( | 173 reinterpret_cast<NP_GetMimeDescriptionType>( |
173 dlsym(dl, "NP_GetMIMEDescription")); | 174 dlsym(dl, "NP_GetMIMEDescription")); |
174 const char* mime_description = NULL; | 175 const char* mime_description = NULL; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 break; | 290 break; |
290 } | 291 } |
291 } | 292 } |
292 if (!version.empty()) { | 293 if (!version.empty()) { |
293 info->version = UTF8ToUTF16(version); | 294 info->version = UTF8ToUTF16(version); |
294 } | 295 } |
295 } | 296 } |
296 | 297 |
297 } // namespace npapi | 298 } // namespace npapi |
298 } // namespace webkit | 299 } // namespace webkit |
OLD | NEW |