Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: net/base/net_util.cc

Issue 6064003: Update the time formatting APIs to use string16.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698