Changeset 146908 in webkit
- Timestamp:
- Mar 26, 2013 10:59:49 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r146833 r146908 2075 2075 platform/network/HTTPParsers.cpp 2076 2076 platform/network/HTTPRequest.cpp 2077 platform/network/HTTPValidation.cpp2078 2077 platform/network/MIMEHeader.cpp 2079 2078 platform/network/NetworkStateNotifier.cpp -
trunk/Source/WebCore/ChangeLog
r146907 r146908 1 2013-03-26 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 3 Code duplication between HTTPParsers and HTTPValidation 4 https://bugs.webkit.org/show_bug.cgi?id=113283 5 6 Reviewed by Alexey Proskuryakov. 7 8 Merged isValidHTTPToken() from HTTPValidation.h and isRFC2616Token() from 9 HTTPParsers.h. They were doing exactly the same thing and their 10 implementation was almost the same. 11 12 Removed HTTPValidation.* and moved remaining code to HTTPParsers.* as this 13 seems like the proper place and it seems odd to keep HTTPValidation for 14 just one function. 15 16 No new tests, no behavior change for layout tests. 17 18 * CMakeLists.txt: 19 * GNUmakefile.list.am: 20 * Target.pri: 21 * WebCore.gypi: 22 * WebCore.vcproj/WebCore.vcproj: 23 * WebCore.vcxproj/WebCore.vcxproj: 24 * WebCore.vcxproj/WebCore.vcxproj.filters: 25 * WebCore.xcodeproj/project.pbxproj: 26 * platform/network/HTTPParsers.cpp: 27 (WebCore::isValidHTTPHeaderValue): 28 (WebCore): 29 (WebCore::isValidHTTPToken): Implementation is slightly simplified based on 30 isValidHTTPToken() from HTTPValidation.cpp. (c >= 0x80 || c == 0x7F) is 31 replaced by (c >= 0x7F). (c <= 0x1F || c == ' ' || c == '\t') is replaced 32 by (c <= 0x20). Those expressions are shorter but equivalent. 33 (WebCore::contentDispositionType): 34 * platform/network/HTTPParsers.h: 35 * platform/network/HTTPValidation.cpp: Removed. 36 * platform/network/HTTPValidation.h: Removed. 37 * xml/XMLHttpRequest.cpp: Stop including HTTPValidation.h. 38 1 39 2013-03-26 Sergio Villar Senin <svillar@igalia.com> 2 40 -
trunk/Source/WebCore/GNUmakefile.list.am
r146855 r146908 5914 5914 Source/WebCore/platform/network/HTTPRequest.cpp \ 5915 5915 Source/WebCore/platform/network/HTTPRequest.h \ 5916 Source/WebCore/platform/network/HTTPValidation.cpp \5917 Source/WebCore/platform/network/HTTPValidation.h \5918 5916 Source/WebCore/platform/network/MIMEHeader.cpp \ 5919 5917 Source/WebCore/platform/network/MIMEHeader.h \ -
trunk/Source/WebCore/Target.pri
r146833 r146908 1102 1102 platform/network/HTTPParsers.cpp \ 1103 1103 platform/network/HTTPRequest.cpp \ 1104 platform/network/HTTPValidation.cpp \1105 1104 platform/network/MIMEHeader.cpp \ 1106 1105 platform/network/NetworkStateNotifier.cpp \ … … 2364 2363 platform/network/HTTPParsers.h \ 2365 2364 platform/network/HTTPRequest.h \ 2366 platform/network/HTTPValidation.h \2367 2365 platform/network/HTTPStatusCodes.h \ 2368 2366 platform/network/MIMESniffing.h \ -
trunk/Source/WebCore/WebCore.gypi
r146874 r146908 4371 4371 'platform/network/HTTPRequest.cpp', 4372 4372 'platform/network/HTTPRequest.h', 4373 'platform/network/HTTPValidation.cpp',4374 'platform/network/HTTPValidation.h',4375 4373 'platform/network/MIMEHeader.cpp', 4376 4374 'platform/network/NetworkStateNotifier.cpp', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r146833 r146908 33103 33103 </File> 33104 33104 <File 33105 RelativePath="..\platform\network\HTTPValidation.cpp"33106 >33107 </File>33108 <File33109 RelativePath="..\platform\network\HTTPValidation.h"33110 >33111 </File>33112 <File33113 33105 RelativePath="..\platform\network\MIMEHeader.cpp" 33114 33106 > -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r146833 r146908 4631 4631 <ClCompile Include="..\platform\network\HTTPParsers.cpp" /> 4632 4632 <ClCompile Include="..\platform\network\HTTPRequest.cpp" /> 4633 <ClCompile Include="..\platform\network\HTTPValidation.cpp" />4634 4633 <ClCompile Include="..\platform\network\MIMEHeader.cpp" /> 4635 4634 <ClCompile Include="..\platform\network\NetworkStateNotifier.cpp" /> … … 11911 11910 <ClInclude Include="..\platform\network\HTTPParsers.h" /> 11912 11911 <ClInclude Include="..\platform\network\HTTPRequest.h" /> 11913 <ClInclude Include="..\platform\network\HTTPValidation.h" />11914 11912 <ClInclude Include="..\platform\network\MIMEHeader.h" /> 11915 11913 <ClInclude Include="..\platform\network\NetworkingContext.h" /> -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
r146833 r146908 3277 3277 <Filter>platform\network</Filter> 3278 3278 </ClCompile> 3279 <ClCompile Include="..\platform\network\HTTPValidation.cpp">3280 <Filter>platform\network</Filter>3281 </ClCompile>3282 3279 <ClCompile Include="..\platform\network\MIMEHeader.cpp"> 3283 3280 <Filter>platform\network</Filter> … … 10082 10079 </ClInclude> 10083 10080 <ClInclude Include="..\platform\network\HTTPRequest.h"> 10084 <Filter>platform\network</Filter>10085 </ClInclude>10086 <ClInclude Include="..\platform\network\HTTPValidation.h">10087 10081 <Filter>platform\network</Filter> 10088 10082 </ClInclude> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r146833 r146908 3809 3809 9A9CEF8D163B3EA100DE7EFE /* ExclusionShapeOutsideInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9CEF8B163B3EA100DE7EFE /* ExclusionShapeOutsideInfo.cpp */; }; 3810 3810 9A9CEF8E163B3EA100DE7EFE /* ExclusionShapeOutsideInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9CEF8C163B3EA100DE7EFE /* ExclusionShapeOutsideInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3811 9B0FB191140DB5790022588F /* HTTPValidation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B0FB18F140DB5790022588F /* HTTPValidation.cpp */; };3812 9B0FB192140DB5790022588F /* HTTPValidation.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B0FB190140DB5790022588F /* HTTPValidation.h */; };3813 3811 9B1AB07C1648C7C40051F3F2 /* JSHTMLFormControlsCollectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B1AB07B1648C7C40051F3F2 /* JSHTMLFormControlsCollectionCustom.cpp */; }; 3814 3812 9B24DE8E15194B9500C59C27 /* HTMLBDIElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B24DE8C15194B9500C59C27 /* HTMLBDIElement.h */; }; … … 11365 11363 9A9CEF8B163B3EA100DE7EFE /* ExclusionShapeOutsideInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExclusionShapeOutsideInfo.cpp; sourceTree = "<group>"; }; 11366 11364 9A9CEF8C163B3EA100DE7EFE /* ExclusionShapeOutsideInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExclusionShapeOutsideInfo.h; sourceTree = "<group>"; }; 11367 9B0FB18F140DB5790022588F /* HTTPValidation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPValidation.cpp; sourceTree = "<group>"; };11368 9B0FB190140DB5790022588F /* HTTPValidation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPValidation.h; sourceTree = "<group>"; };11369 11365 9B1AB0791648C69D0051F3F2 /* HTMLFormControlsCollection.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = HTMLFormControlsCollection.idl; sourceTree = "<group>"; }; 11370 11366 9B1AB07B1648C7C40051F3F2 /* JSHTMLFormControlsCollectionCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFormControlsCollectionCustom.cpp; sourceTree = "<group>"; }; … … 16297 16293 A5D214AE12E905510090F370 /* HTTPRequest.cpp */, 16298 16294 A5D214AF12E905510090F370 /* HTTPRequest.h */, 16299 9B0FB18F140DB5790022588F /* HTTPValidation.cpp */,16300 9B0FB190140DB5790022588F /* HTTPValidation.h */,16301 16295 37DDCD9213844FD50008B793 /* MIMEHeader.cpp */, 16302 16296 37DDCD9313844FD50008B793 /* MIMEHeader.h */, … … 24826 24820 514C76730CE923A1007EF3CD /* HTTPParsers.h in Headers */, 24827 24821 A5D214B212E905510090F370 /* HTTPRequest.h in Headers */, 24828 9B0FB192140DB5790022588F /* HTTPValidation.h in Headers */,24829 24822 375CD232119D43C800A2A859 /* Hyphenation.h in Headers */, 24830 24823 B275356E0B053814002CE64F /* Icon.h in Headers */, … … 28160 28153 514C76720CE923A1007EF3CD /* HTTPParsers.cpp in Sources */, 28161 28154 A5D214B112E905510090F370 /* HTTPRequest.cpp in Sources */, 28162 9B0FB191140DB5790022588F /* HTTPValidation.cpp in Sources */,28163 28155 371A67CB11C6C7DB00047B8B /* HyphenationCF.cpp in Sources */, 28164 28156 375CD23B119D44EA00A2A859 /* HyphenationMac.mm in Sources */, -
trunk/Source/WebCore/platform/network/HTTPParsers.cpp
r143880 r146908 103 103 } 104 104 105 bool isValidHTTPHeaderValue(const String& name) 106 { 107 // FIXME: This should really match name against 108 // field-value in section 4.2 of RFC 2616. 109 110 return !name.contains('\r') && !name.contains('\n'); 111 } 112 105 113 // See RFC 2616, Section 2.2. 106 bool is RFC2616Token(const String& characters)114 bool isValidHTTPToken(const String& characters) 107 115 { 108 116 if (characters.isEmpty()) … … 110 118 for (unsigned i = 0; i < characters.length(); ++i) { 111 119 UChar c = characters[i]; 112 if (c >= 0x80 || c <= 0x1F || c == 0x7F120 if (c <= 0x20 || c >= 0x7F 113 121 || c == '(' || c == ')' || c == '<' || c == '>' || c == '@' 114 122 || c == ',' || c == ';' || c == ':' || c == '\\' || c == '"' 115 123 || c == '/' || c == '[' || c == ']' || c == '?' || c == '=' 116 || c == '{' || c == '}' || c == ' ' || c == '\t')124 || c == '{' || c == '}') 117 125 return false; 118 126 } … … 150 158 // 151 159 // without a disposition token... screen those out. 152 if (!is RFC2616Token(dispositionType))160 if (!isValidHTTPToken(dispositionType)) 153 161 return ContentDispositionNone; 154 162 -
trunk/Source/WebCore/platform/network/HTTPParsers.h
r143880 r146908 56 56 57 57 ContentDispositionType contentDispositionType(const String&); 58 bool isRFC2616Token(const String&); 58 bool isValidHTTPHeaderValue(const String&); 59 bool isValidHTTPToken(const String&); 59 60 bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& delay, String& url); 60 61 double parseDate(const String&); -
trunk/Source/WebCore/xml/XMLHttpRequest.cpp
r146537 r146908 39 39 #include "HTMLDocument.h" 40 40 #include "HTTPParsers.h" 41 #include "HTTPValidation.h"42 41 #include "HistogramSupport.h" 43 42 #include "InspectorInstrumentation.h" -
trunk/Source/WebKit/chromium/ChangeLog
r146894 r146908 1 2013-03-26 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 3 Code duplication between HTTPParsers and HTTPValidation 4 https://bugs.webkit.org/show_bug.cgi?id=113283 5 6 Reviewed by Alexey Proskuryakov. 7 8 * src/AssociatedURLLoader.cpp: Include HTTPParsers.h instead 9 of HTTPValidation.h to use isValidHTTPToken(). 10 1 11 2013-03-26 Yufeng Shen <miletus@chromium.org> 2 12 -
trunk/Source/WebKit/chromium/src/AssociatedURLLoader.cpp
r144568 r146908 35 35 #include "DocumentThreadableLoader.h" 36 36 #include "DocumentThreadableLoaderClient.h" 37 #include "HTTP Validation.h"37 #include "HTTPParsers.h" 38 38 #include "ResourceError.h" 39 39 #include "SubresourceLoader.h"
Note: See TracChangeset
for help on using the changeset viewer.