Changeset 85909 in webkit


Ignore:
Timestamp:
May 5, 2011 6:37:54 PM (13 years ago)
Author:
jcivelli@chromium.org
Message:

2011-05-05 Jay Civelli <jcivelli@chromium.org>

Reviewed by Adam Barth.

Added convenience methods to convert from a byte to hex ASCII digit
characters and vice-versa.
https://bugs.webkit.org/show_bug.cgi?id=59834

  • wtf/ASCIICType.h: (WTF::toASCIIHexValue): (WTF::lowerNibbleToASCIIHexDigit): (WTF::upperNibbleToASCIIHexDigit):

2011-05-05 Jay Civelli <jcivelli@chromium.org>

Reviewed by Adam Barth.

Adding quoted-printable encoding/decoding capabilities.
This is needed for MHTML support.
https://bugs.webkit.org/show_bug.cgi?id=59834

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • platform/text/QuotedPrintable.cpp: Added.
  • platform/text/QuotedPrintable.h: Added.
Location:
trunk/Source
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r85855 r85909  
     12011-05-05  Jay Civelli  <jcivelli@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Added convenience methods to convert from a byte to hex ASCII digit
     6        characters and vice-versa.
     7        https://bugs.webkit.org/show_bug.cgi?id=59834
     8
     9        * wtf/ASCIICType.h:
     10        (WTF::toASCIIHexValue):
     11        (WTF::lowerNibbleToASCIIHexDigit):
     12        (WTF::upperNibbleToASCIIHexDigit):
     13
    1142011-05-05  Alexis Menard  <alexis.menard@openbossa.org>
    215
  • trunk/Source/JavaScriptCore/wtf/ASCIICType.h

    r73206 r85909  
    147147
    148148    inline int toASCIIHexValue(char c) { ASSERT(isASCIIHexDigit(c)); return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF; }
     149    inline int toASCIIHexValue(char upperValue, char lowerValue) { ASSERT(isASCIIHexDigit(upperValue) && isASCIIHexDigit(lowerValue)); return ((toASCIIHexValue(upperValue) << 4) & 0xF0) | toASCIIHexValue(lowerValue); }
    149150    inline int toASCIIHexValue(unsigned short c) { ASSERT(isASCIIHexDigit(c)); return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF; }
    150151#if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED)
     
    153154    inline int toASCIIHexValue(int c) { ASSERT(isASCIIHexDigit(c)); return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF; }
    154155    inline int toASCIIHexValue(unsigned c) { ASSERT(isASCIIHexDigit(c)); return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF; }
     156
     157    inline char lowerNibbleToASCIIHexDigit(char c) { char nibble = c & 0xF; return nibble < 10 ? '0' + nibble : 'A' + nibble - 10; }
     158    inline char upperNibbleToASCIIHexDigit(char c) { char nibble = (c >> 4) & 0xF; return nibble < 10 ? '0' + nibble : 'A' + nibble - 10; }
    155159
    156160    inline bool isASCIIPrintable(char c) { return c >= ' ' && c <= '~'; }
     
    176180using WTF::toASCIILower;
    177181using WTF::toASCIIUpper;
     182using WTF::lowerNibbleToASCIIHexDigit;
     183using WTF::upperNibbleToASCIIHexDigit;
    178184
    179185#endif
  • trunk/Source/WebCore/CMakeLists.txt

    r85864 r85909  
    11701170    platform/text/Base64.cpp
    11711171    platform/text/BidiContext.cpp
     1172    platform/text/Hyphenation.cpp
    11721173    platform/text/LineEnding.cpp
    11731174    platform/text/LocalizedDateNone.cpp
    11741175    platform/text/LocalizedNumberNone.cpp
    1175     platform/text/Hyphenation.cpp
     1176    platform/text/QuotedPrintable.cpp
    11761177    platform/text/RegularExpression.cpp
    11771178    platform/text/SegmentedString.cpp
  • trunk/Source/WebCore/ChangeLog

    r85903 r85909  
     12011-05-05  Jay Civelli  <jcivelli@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Adding quoted-printable encoding/decoding capabilities.
     6        This is needed for MHTML support.
     7        https://bugs.webkit.org/show_bug.cgi?id=59834
     8
     9        * CMakeLists.txt:
     10        * GNUmakefile.list.am:
     11        * WebCore.gypi:
     12        * WebCore.pro:
     13        * WebCore.vcproj/WebCore.vcproj:
     14        * WebCore.xcodeproj/project.pbxproj:
     15        * platform/text/QuotedPrintable.cpp: Added.
     16        * platform/text/QuotedPrintable.h: Added.
     17
    1182011-05-05  Andy Estes  <aestes@apple.com>
    219
  • trunk/Source/WebCore/GNUmakefile.list.am

    r85864 r85909  
    26382638        Source/WebCore/platform/text/ParserUtilities.h \
    26392639        Source/WebCore/platform/text/PlatformString.h \
     2640        Source/WebCore/platform/text/QuotedPrintable.cpp \
     2641        Source/WebCore/platform/text/QuotedPrintable.h \
    26402642        Source/WebCore/platform/text/RegularExpression.cpp \
    26412643        Source/WebCore/platform/text/RegularExpression.h \
  • trunk/Source/WebCore/WebCore.gypi

    r85864 r85909  
    49084908            'platform/text/LocalizedNumberNone.cpp',
    49094909            'platform/text/ParserUtilities.h',
     4910            'platform/text/QuotedPrintable.h',
     4911            'platform/text/QuotedPrintable.cpp',
    49104912            'platform/text/RegularExpression.cpp',
    49114913            'platform/text/SegmentedString.cpp',
  • trunk/Source/WebCore/WebCore.pro

    r85864 r85909  
    948948    platform/text/LocalizedDateNone.cpp \
    949949    platform/text/LocalizedNumberNone.cpp \
     950    platform/text/QuotedPrintable.cpp \
    950951    platform/ContentType.cpp \
    951952    platform/CrossThreadCopier.cpp \
     
    20392040    platform/text/BidiContext.h \
    20402041    platform/text/Hyphenation.h \
     2042    platform/text/QuotedPrintable.h \
    20412043    platform/text/qt/TextCodecQt.h \
    20422044    platform/text/RegularExpression.h \
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r85864 r85909  
    3052130521                                        >
    3052230522                                </File>
     30523                                <File
     30524                                        RelativePath="..\platform\text\QuotedPrintable.cpp"
     30525                                        >
     30526                                </File>
     30527                                <File
     30528                                        RelativePath="..\platform\text\QuotedPrintable.h"
     30529                                        >
     30530                                </File>
    3052330531                                <File
    3052430532                                        RelativePath="..\platform\text\RegularExpression.cpp"
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r85864 r85909  
    801801                379919971200DDF400EA041C /* WOFFFileFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 379919951200DDF400EA041C /* WOFFFileFormat.h */; };
    802802                379919B21200DE5000EA041C /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 379919B11200DE5000EA041C /* libz.dylib */; };
     803                379E371613736A6600B9E919 /* QuotedPrintable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379E371413736A6600B9E919 /* QuotedPrintable.cpp */; };
     804                379E371713736A6600B9E919 /* QuotedPrintable.h in Headers */ = {isa = PBXBuildFile; fileRef = 379E371513736A6600B9E919 /* QuotedPrintable.h */; };
    803805                379E61C9126CA5C300B63E8D /* BaseButtonInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379E61C5126CA5C300B63E8D /* BaseButtonInputType.cpp */; };
    804806                379E61CA126CA5C400B63E8D /* BaseButtonInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = 379E61C6126CA5C300B63E8D /* BaseButtonInputType.h */; };
     
    72427244                379919951200DDF400EA041C /* WOFFFileFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WOFFFileFormat.h; sourceTree = "<group>"; };
    72437245                379919B11200DE5000EA041C /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; };
     7246                379E371413736A6600B9E919 /* QuotedPrintable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QuotedPrintable.cpp; sourceTree = "<group>"; };
     7247                379E371513736A6600B9E919 /* QuotedPrintable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuotedPrintable.h; sourceTree = "<group>"; };
    72447248                379E61C5126CA5C300B63E8D /* BaseButtonInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseButtonInputType.cpp; sourceTree = "<group>"; };
    72457249                379E61C6126CA5C300B63E8D /* BaseButtonInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseButtonInputType.h; sourceTree = "<group>"; };
     
    1773817742                                BC76AC110DD7AD5C00415F34 /* ParserUtilities.h */,
    1773917743                                B2C3D9FB0D006C1D00EF6F26 /* PlatformString.h */,
     17744                                379E371413736A6600B9E919 /* QuotedPrintable.cpp */,
     17745                                379E371513736A6600B9E919 /* QuotedPrintable.h */,
    1774017746                                B2C3D9FC0D006C1D00EF6F26 /* RegularExpression.cpp */,
    1774117747                                B2C3D9FD0D006C1D00EF6F26 /* RegularExpression.h */,
     
    2273522741                                977E2E0F12F0FC9C00C13379 /* XSSFilter.h in Headers */,
    2273622742                                37AFFDF71370A0B800E895C0 /* SharedBufferCRLFLineReader.h in Headers */,
     22743                                379E371713736A6600B9E919 /* QuotedPrintable.h in Headers */,
    2273722744                        );
    2273822745                        runOnlyForDeploymentPostprocessing = 0;
     
    2539925406                                977E2E0E12F0FC9C00C13379 /* XSSFilter.cpp in Sources */,
    2540025407                                37AFFDF61370A0B800E895C0 /* SharedBufferCRLFLineReader.cpp in Sources */,
     25408                                379E371613736A6600B9E919 /* QuotedPrintable.cpp in Sources */,
    2540125409                        );
    2540225410                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.