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 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 const std::string& leading_mime_type, | 869 const std::string& leading_mime_type, |
870 base::hash_set<base::FilePath::StringType>* extensions) { | 870 base::hash_set<base::FilePath::StringType>* extensions) { |
871 base::FilePath::StringType extension; | 871 base::FilePath::StringType extension; |
872 for (size_t i = 0; i < mappings_len; ++i) { | 872 for (size_t i = 0; i < mappings_len; ++i) { |
873 if (StartsWithASCII(mappings[i].mime_type, leading_mime_type, false)) { | 873 if (StartsWithASCII(mappings[i].mime_type, leading_mime_type, false)) { |
874 std::vector<string> this_extensions; | 874 std::vector<string> this_extensions; |
875 base::SplitStringUsingSubstr(mappings[i].extensions, ",", | 875 base::SplitStringUsingSubstr(mappings[i].extensions, ",", |
876 &this_extensions); | 876 &this_extensions); |
877 for (size_t j = 0; j < this_extensions.size(); ++j) { | 877 for (size_t j = 0; j < this_extensions.size(); ++j) { |
878 #if defined(OS_WIN) | 878 #if defined(OS_WIN) |
879 base::FilePath::StringType extension(UTF8ToWide(this_extensions[j])); | 879 base::FilePath::StringType extension( |
| 880 base::UTF8ToWide(this_extensions[j])); |
880 #else | 881 #else |
881 base::FilePath::StringType extension(this_extensions[j]); | 882 base::FilePath::StringType extension(this_extensions[j]); |
882 #endif | 883 #endif |
883 extensions->insert(extension); | 884 extensions->insert(extension); |
884 } | 885 } |
885 } | 886 } |
886 } | 887 } |
887 } | 888 } |
888 | 889 |
889 void GetExtensionsHelper( | 890 void GetExtensionsHelper( |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 post_data->append("\r\n" + value + "\r\n"); | 1018 post_data->append("\r\n" + value + "\r\n"); |
1018 } | 1019 } |
1019 | 1020 |
1020 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, | 1021 void AddMultipartFinalDelimiterForUpload(const std::string& mime_boundary, |
1021 std::string* post_data) { | 1022 std::string* post_data) { |
1022 DCHECK(post_data); | 1023 DCHECK(post_data); |
1023 post_data->append("--" + mime_boundary + "--\r\n"); | 1024 post_data->append("--" + mime_boundary + "--\r\n"); |
1024 } | 1025 } |
1025 | 1026 |
1026 } // namespace net | 1027 } // namespace net |
OLD | NEW |