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

Side by Side Diff: net/base/mime_util.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 | « net/base/host_mapping_rules.cc ('k') | net/base/net_util.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 <map> 5 #include <map>
6 #include <string> 6 #include <string>
7 7
8 #include "net/base/mime_util.h" 8 #include "net/base/mime_util.h"
9 #include "net/base/platform_mime_util.h" 9 #include "net/base/platform_mime_util.h"
10 10
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 } 423 }
424 } 424 }
425 return true; 425 return true;
426 } 426 }
427 427
428 void MimeUtil::ParseCodecString(const std::string& codecs, 428 void MimeUtil::ParseCodecString(const std::string& codecs,
429 std::vector<std::string>* codecs_out, 429 std::vector<std::string>* codecs_out,
430 bool strip) { 430 bool strip) {
431 std::string no_quote_codecs; 431 std::string no_quote_codecs;
432 TrimString(codecs, "\"", &no_quote_codecs); 432 TrimString(codecs, "\"", &no_quote_codecs);
433 SplitString(no_quote_codecs, ',', codecs_out); 433 base::SplitString(no_quote_codecs, ',', codecs_out);
434 434
435 if (!strip) 435 if (!strip)
436 return; 436 return;
437 437
438 // Strip everything past the first '.' 438 // Strip everything past the first '.'
439 for (std::vector<std::string>::iterator it = codecs_out->begin(); 439 for (std::vector<std::string>::iterator it = codecs_out->begin();
440 it != codecs_out->end(); 440 it != codecs_out->end();
441 ++it) { 441 ++it) {
442 size_t found = it->find_first_of('.'); 442 size_t found = it->find_first_of('.');
443 if (found != std::string::npos) 443 if (found != std::string::npos)
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 706
707 GetExtensionsFromHardCodedMappings(secondary_mappings, 707 GetExtensionsFromHardCodedMappings(secondary_mappings,
708 arraysize(secondary_mappings), 708 arraysize(secondary_mappings),
709 mime_type, 709 mime_type,
710 &unique_extensions); 710 &unique_extensions);
711 711
712 HashSetToVector(&unique_extensions, extensions); 712 HashSetToVector(&unique_extensions, extensions);
713 } 713 }
714 714
715 } // namespace net 715 } // namespace net
OLDNEW
« no previous file with comments | « net/base/host_mapping_rules.cc ('k') | net/base/net_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698