| 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 "net/base/net_util.h" | 5 #include "net/base/net_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <unicode/regex.h> | 9 #include <unicode/regex.h> |
| 10 #include <unicode/ucnv.h> | 10 #include <unicode/ucnv.h> |
| (...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 base::JsonDoubleQuote( | 1355 base::JsonDoubleQuote( |
| 1356 FormatBytes(size, GetByteDisplayUnits(size), true), | 1356 FormatBytes(size, GetByteDisplayUnits(size), true), |
| 1357 true, | 1357 true, |
| 1358 &result); | 1358 &result); |
| 1359 | 1359 |
| 1360 result.append(","); | 1360 result.append(","); |
| 1361 | 1361 |
| 1362 string16 modified_str; | 1362 string16 modified_str; |
| 1363 // |modified| can be NULL in FTP listings. | 1363 // |modified| can be NULL in FTP listings. |
| 1364 if (!modified.is_null()) { | 1364 if (!modified.is_null()) { |
| 1365 modified_str = WideToUTF16Hack(base::TimeFormatShortDateAndTime(modified)); | 1365 modified_str = base::TimeFormatShortDateAndTime(modified); |
| 1366 } | 1366 } |
| 1367 base::JsonDoubleQuote(modified_str, true, &result); | 1367 base::JsonDoubleQuote(modified_str, true, &result); |
| 1368 | 1368 |
| 1369 result.append(");</script>\n"); | 1369 result.append(");</script>\n"); |
| 1370 | 1370 |
| 1371 return result; | 1371 return result; |
| 1372 } | 1372 } |
| 1373 | 1373 |
| 1374 string16 StripWWW(const string16& text) { | 1374 string16 StripWWW(const string16& text) { |
| 1375 const string16 www(ASCIIToUTF16("www.")); | 1375 const string16 www(ASCIIToUTF16("www.")); |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2060 } | 2060 } |
| 2061 | 2061 |
| 2062 int GetPortFromAddrinfo(const struct addrinfo* info) { | 2062 int GetPortFromAddrinfo(const struct addrinfo* info) { |
| 2063 uint16* port_field = GetPortFieldFromAddrinfo(info); | 2063 uint16* port_field = GetPortFieldFromAddrinfo(info); |
| 2064 if (!port_field) | 2064 if (!port_field) |
| 2065 return -1; | 2065 return -1; |
| 2066 return ntohs(*port_field); | 2066 return ntohs(*port_field); |
| 2067 } | 2067 } |
| 2068 | 2068 |
| 2069 } // namespace net | 2069 } // namespace net |
| OLD | NEW |