OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <map> | 6 #include <map> |
7 #include <unicode/ucnv.h> | 7 #include <unicode/ucnv.h> |
8 #include <unicode/uidna.h> | 8 #include <unicode/uidna.h> |
9 #include <unicode/ulocdata.h> | 9 #include <unicode/ulocdata.h> |
10 #include <unicode/uniset.h> | 10 #include <unicode/uniset.h> |
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 } | 911 } |
912 | 912 |
913 std::string CanonicalizeHost(const std::wstring& host, | 913 std::string CanonicalizeHost(const std::wstring& host, |
914 url_canon::CanonHostInfo* host_info) { | 914 url_canon::CanonHostInfo* host_info) { |
915 std::string converted_host; | 915 std::string converted_host; |
916 WideToUTF8(host.c_str(), host.length(), &converted_host); | 916 WideToUTF8(host.c_str(), host.length(), &converted_host); |
917 return CanonicalizeHost(converted_host, host_info); | 917 return CanonicalizeHost(converted_host, host_info); |
918 } | 918 } |
919 | 919 |
920 std::string GetDirectoryListingHeader(const string16& title) { | 920 std::string GetDirectoryListingHeader(const string16& title) { |
921 static const StringPiece header(NetModule::GetResource(IDR_DIR_HEADER_HTML)); | 921 static const base::StringPiece header( |
| 922 NetModule::GetResource(IDR_DIR_HEADER_HTML)); |
922 // This can be null in unit tests. | 923 // This can be null in unit tests. |
923 DLOG_IF(WARNING, header.empty()) << | 924 DLOG_IF(WARNING, header.empty()) << |
924 "Missing resource: directory listing header"; | 925 "Missing resource: directory listing header"; |
925 | 926 |
926 std::string result; | 927 std::string result; |
927 if (!header.empty()) | 928 if (!header.empty()) |
928 result.assign(header.data(), header.size()); | 929 result.assign(header.data(), header.size()); |
929 | 930 |
930 result.append("<script>start("); | 931 result.append("<script>start("); |
931 string_escape::JsonDoubleQuote(title, true, &result); | 932 string_escape::JsonDoubleQuote(title, true, &result); |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 if (length > 0) | 1354 if (length > 0) |
1354 ports.insert(StringToInt(WideToASCII( | 1355 ports.insert(StringToInt(WideToASCII( |
1355 allowed_ports.substr(last, length)))); | 1356 allowed_ports.substr(last, length)))); |
1356 last = i + 1; | 1357 last = i + 1; |
1357 } | 1358 } |
1358 } | 1359 } |
1359 explicitly_allowed_ports = ports; | 1360 explicitly_allowed_ports = ports; |
1360 } | 1361 } |
1361 | 1362 |
1362 } // namespace net | 1363 } // namespace net |
OLD | NEW |