| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <iterator> | 6 #include <iterator> |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 | 661 |
| 662 bool MimeUtil::AreSupportedMediaCodecs( | 662 bool MimeUtil::AreSupportedMediaCodecs( |
| 663 const std::vector<std::string>& codecs) const { | 663 const std::vector<std::string>& codecs) const { |
| 664 return AreSupportedCodecs(codecs_map_, codecs); | 664 return AreSupportedCodecs(codecs_map_, codecs); |
| 665 } | 665 } |
| 666 | 666 |
| 667 void MimeUtil::ParseCodecString(const std::string& codecs, | 667 void MimeUtil::ParseCodecString(const std::string& codecs, |
| 668 std::vector<std::string>* codecs_out, | 668 std::vector<std::string>* codecs_out, |
| 669 bool strip) { | 669 bool strip) { |
| 670 std::string no_quote_codecs; | 670 std::string no_quote_codecs; |
| 671 TrimString(codecs, "\"", &no_quote_codecs); | 671 base::TrimString(codecs, "\"", &no_quote_codecs); |
| 672 base::SplitString(no_quote_codecs, ',', codecs_out); | 672 base::SplitString(no_quote_codecs, ',', codecs_out); |
| 673 | 673 |
| 674 if (!strip) | 674 if (!strip) |
| 675 return; | 675 return; |
| 676 | 676 |
| 677 // Strip everything past the first '.' | 677 // Strip everything past the first '.' |
| 678 for (std::vector<std::string>::iterator it = codecs_out->begin(); | 678 for (std::vector<std::string>::iterator it = codecs_out->begin(); |
| 679 it != codecs_out->end(); | 679 it != codecs_out->end(); |
| 680 ++it) { | 680 ++it) { |
| 681 size_t found = it->find_first_of('.'); | 681 size_t found = it->find_first_of('.'); |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 post_data->append("\r\n" + value + "\r\n"); | 1015 post_data->append("\r\n" + value + "\r\n"); |
| 1016 } | 1016 } |
| 1017 | 1017 |
| 1018 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, | 1018 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, |
| 1019 std::string* post_data) { | 1019 std::string* post_data) { |
| 1020 DCHECK(post_data); | 1020 DCHECK(post_data); |
| 1021 post_data->append("--" + mime_boundary + "--\r\n"); | 1021 post_data->append("--" + mime_boundary + "--\r\n"); |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 } // namespace net | 1024 } // namespace net |
| OLD | NEW |