| 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 <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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |