Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: webkit/glue/plugins/plugin_lib_posix.cc

Issue 3750001: base: Move SplitString functions into the base namespace and update the callers. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: brett review, reverted changes in o3d due to it's using an old base revision Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webkit/glue/plugins/plugin_lib_mac.mm ('k') | webkit/glue/plugins/plugin_list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « webkit/glue/plugins/plugin_lib_mac.mm ('k') | webkit/glue/plugins/plugin_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698