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 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 | 917 |
918 void GetExtensionsFromHardCodedMappings( | 918 void GetExtensionsFromHardCodedMappings( |
919 const MimeInfo* mappings, | 919 const MimeInfo* mappings, |
920 size_t mappings_len, | 920 size_t mappings_len, |
921 const std::string& leading_mime_type, | 921 const std::string& leading_mime_type, |
922 base::hash_set<base::FilePath::StringType>* extensions) { | 922 base::hash_set<base::FilePath::StringType>* extensions) { |
923 base::FilePath::StringType extension; | 923 base::FilePath::StringType extension; |
924 for (size_t i = 0; i < mappings_len; ++i) { | 924 for (size_t i = 0; i < mappings_len; ++i) { |
925 if (StartsWithASCII(mappings[i].mime_type, leading_mime_type, false)) { | 925 if (StartsWithASCII(mappings[i].mime_type, leading_mime_type, false)) { |
926 std::vector<string> this_extensions; | 926 std::vector<string> this_extensions; |
927 base::SplitStringUsingSubstr(mappings[i].extensions, ",", | 927 base::SplitString(mappings[i].extensions, ',', &this_extensions); |
928 &this_extensions); | |
929 for (size_t j = 0; j < this_extensions.size(); ++j) { | 928 for (size_t j = 0; j < this_extensions.size(); ++j) { |
930 #if defined(OS_WIN) | 929 #if defined(OS_WIN) |
931 base::FilePath::StringType extension( | 930 base::FilePath::StringType extension( |
932 base::UTF8ToWide(this_extensions[j])); | 931 base::UTF8ToWide(this_extensions[j])); |
933 #else | 932 #else |
934 base::FilePath::StringType extension(this_extensions[j]); | 933 base::FilePath::StringType extension(this_extensions[j]); |
935 #endif | 934 #endif |
936 extensions->insert(extension); | 935 extensions->insert(extension); |
937 } | 936 } |
938 } | 937 } |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 post_data->append("\r\n" + value + "\r\n"); | 1069 post_data->append("\r\n" + value + "\r\n"); |
1071 } | 1070 } |
1072 | 1071 |
1073 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, | 1072 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, |
1074 std::string* post_data) { | 1073 std::string* post_data) { |
1075 DCHECK(post_data); | 1074 DCHECK(post_data); |
1076 post_data->append("--" + mime_boundary + "--\r\n"); | 1075 post_data->append("--" + mime_boundary + "--\r\n"); |
1077 } | 1076 } |
1078 | 1077 |
1079 } // namespace net | 1078 } // namespace net |
OLD | NEW |