| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 std::string::size_type end = description.find(':', ofs); | 228 std::string::size_type end = description.find(':', ofs); |
| 229 if (end == std::string::npos) | 229 if (end == std::string::npos) |
| 230 break; | 230 break; |
| 231 mime_type.mime_type = description.substr(ofs, end - ofs); | 231 mime_type.mime_type = description.substr(ofs, end - ofs); |
| 232 ofs = end + 1; | 232 ofs = end + 1; |
| 233 | 233 |
| 234 end = description.find(':', ofs); | 234 end = description.find(':', ofs); |
| 235 if (end == std::string::npos) | 235 if (end == std::string::npos) |
| 236 break; | 236 break; |
| 237 const std::string extensions = description.substr(ofs, end - ofs); | 237 const std::string extensions = description.substr(ofs, end - ofs); |
| 238 SplitString(extensions, ',', &mime_type.file_extensions); | 238 base::SplitString(extensions, ',', &mime_type.file_extensions); |
| 239 ofs = end + 1; | 239 ofs = end + 1; |
| 240 | 240 |
| 241 end = description.find(';', ofs); | 241 end = description.find(';', ofs); |
| 242 // It's ok for end to run off the string here. If there's no | 242 // It's ok for end to run off the string here. If there's no |
| 243 // trailing semicolon we consume the remainder of the string. | 243 // trailing semicolon we consume the remainder of the string. |
| 244 if (end != std::string::npos) { | 244 if (end != std::string::npos) { |
| 245 mime_type.description = UTF8ToUTF16(description.substr(ofs, end - ofs)); | 245 mime_type.description = UTF8ToUTF16(description.substr(ofs, end - ofs)); |
| 246 } else { | 246 } else { |
| 247 mime_type.description = UTF8ToUTF16(description.substr(ofs)); | 247 mime_type.description = UTF8ToUTF16(description.substr(ofs)); |
| 248 } | 248 } |
| 249 mime_types->push_back(mime_type); | 249 mime_types->push_back(mime_type); |
| 250 if (end == std::string::npos) | 250 if (end == std::string::npos) |
| 251 break; | 251 break; |
| 252 ofs = end + 1; | 252 ofs = end + 1; |
| 253 } | 253 } |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace NPAPI | 256 } // namespace NPAPI |
| OLD | NEW |