OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/glue/plugins/plugin_lib.h" | 5 #include "webkit/glue/plugins/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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 // Skip files that aren't appropriate for our architecture. | 125 // Skip files that aren't appropriate for our architecture. |
126 if (!ELFMatchesCurrentArchitecture(filename)) | 126 if (!ELFMatchesCurrentArchitecture(filename)) |
127 return false; | 127 return false; |
128 | 128 |
129 void* dl = base::LoadNativeLibrary(filename); | 129 void* dl = base::LoadNativeLibrary(filename); |
130 if (!dl) | 130 if (!dl) |
131 return false; | 131 return false; |
132 | 132 |
133 info->path = filename; | 133 info->path = filename; |
| 134 info->enabled = true; |
134 | 135 |
135 // Attempt to swap in the wrapped plugin if this is nspluginwrapper. | 136 // Attempt to swap in the wrapped plugin if this is nspluginwrapper. |
136 UnwrapNSPluginWrapper(&dl, &info->path); | 137 UnwrapNSPluginWrapper(&dl, &info->path); |
137 | 138 |
138 // See comments in plugin_lib_mac regarding this symbol. | 139 // See comments in plugin_lib_mac regarding this symbol. |
139 typedef const char* (*NP_GetMimeDescriptionType)(); | 140 typedef const char* (*NP_GetMimeDescriptionType)(); |
140 NP_GetMimeDescriptionType NP_GetMIMEDescription = | 141 NP_GetMimeDescriptionType NP_GetMIMEDescription = |
141 reinterpret_cast<NP_GetMimeDescriptionType>( | 142 reinterpret_cast<NP_GetMimeDescriptionType>( |
142 dlsym(dl, "NP_GetMIMEDescription")); | 143 dlsym(dl, "NP_GetMIMEDescription")); |
143 const char* mime_description = NULL; | 144 const char* mime_description = NULL; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 mime_type.description = UTF8ToWide(description.substr(ofs)); | 209 mime_type.description = UTF8ToWide(description.substr(ofs)); |
209 } | 210 } |
210 mime_types->push_back(mime_type); | 211 mime_types->push_back(mime_type); |
211 if (end == std::string::npos) | 212 if (end == std::string::npos) |
212 break; | 213 break; |
213 ofs = end + 1; | 214 ofs = end + 1; |
214 } | 215 } |
215 } | 216 } |
216 | 217 |
217 } // namespace NPAPI | 218 } // namespace NPAPI |
OLD | NEW |