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

Side by Side Diff: third_party/WebKit/Source/wtf/DateMath.cpp

Issue 2017303002: Revert of Remove StringBuilder::appendLiteral. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Google Inc. All rights reserved. 4 * Copyright (C) 2009 Google Inc. All rights reserved.
5 * Copyright (C) 2007-2009 Torch Mobile, Inc. 5 * Copyright (C) 2007-2009 Torch Mobile, Inc.
6 * Copyright (C) 2010 &yet, LLC. (nate@andyet.net) 6 * Copyright (C) 2010 &yet, LLC. (nate@andyet.net)
7 * 7 *
8 * The Original Code is Mozilla Communicator client code, released 8 * The Original Code is Mozilla Communicator client code, released
9 * March 31, 1998. 9 * March 31, 1998.
10 * 10 *
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 offset = static_cast<int>((utcOffset + dstOffset) / msPerMinute); 793 offset = static_cast<int>((utcOffset + dstOffset) / msPerMinute);
794 } 794 }
795 return ms - (offset * msPerMinute); 795 return ms - (offset * msPerMinute);
796 } 796 }
797 797
798 // See http://tools.ietf.org/html/rfc2822#section-3.3 for more information. 798 // See http://tools.ietf.org/html/rfc2822#section-3.3 for more information.
799 String makeRFC2822DateString(unsigned dayOfWeek, unsigned day, unsigned month, u nsigned year, unsigned hours, unsigned minutes, unsigned seconds, int utcOffset) 799 String makeRFC2822DateString(unsigned dayOfWeek, unsigned day, unsigned month, u nsigned year, unsigned hours, unsigned minutes, unsigned seconds, int utcOffset)
800 { 800 {
801 StringBuilder stringBuilder; 801 StringBuilder stringBuilder;
802 stringBuilder.append(weekdayName[dayOfWeek]); 802 stringBuilder.append(weekdayName[dayOfWeek]);
803 stringBuilder.append(", "); 803 stringBuilder.appendLiteral(", ");
804 stringBuilder.appendNumber(day); 804 stringBuilder.appendNumber(day);
805 stringBuilder.append(' '); 805 stringBuilder.append(' ');
806 stringBuilder.append(monthName[month]); 806 stringBuilder.append(monthName[month]);
807 stringBuilder.append(' '); 807 stringBuilder.append(' ');
808 stringBuilder.appendNumber(year); 808 stringBuilder.appendNumber(year);
809 stringBuilder.append(' '); 809 stringBuilder.append(' ');
810 810
811 appendTwoDigitNumber(stringBuilder, hours); 811 appendTwoDigitNumber(stringBuilder, hours);
812 stringBuilder.append(':'); 812 stringBuilder.append(':');
813 appendTwoDigitNumber(stringBuilder, minutes); 813 appendTwoDigitNumber(stringBuilder, minutes);
(...skipping 10 matching lines...) Expand all
824 } 824 }
825 825
826 double convertToLocalTime(double ms) 826 double convertToLocalTime(double ms)
827 { 827 {
828 double utcOffset = calculateUTCOffset(); 828 double utcOffset = calculateUTCOffset();
829 double dstOffset = calculateDSTOffset(ms, utcOffset); 829 double dstOffset = calculateDSTOffset(ms, utcOffset);
830 return (ms + utcOffset + dstOffset); 830 return (ms + utcOffset + dstOffset);
831 } 831 }
832 832
833 } // namespace WTF 833 } // namespace WTF
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/FrameSerializerTest.cpp ('k') | third_party/WebKit/Source/wtf/InstanceCounter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698