<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[169826] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/169826">169826</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-06-11 13:42:34 -0700 (Wed, 11 Jun 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add a script that generates a gperf hash for HTTP header names
https://bugs.webkit.org/show_bug.cgi?id=133760
Reviewed by Andreas Kling.
This is the first step towards getting rid of AtomicString from HTTPHeaderMap.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* platform/network/HTTPHeaderNames.in: Added.
* platform/network/create-http-header-name-table: Added.
(HTTPHeaderName):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformnetworkHTTPHeaderNamesin">trunk/Source/WebCore/platform/network/HTTPHeaderNames.in</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcreatehttpheadernametable">trunk/Source/WebCore/platform/network/create-http-header-name-table</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (169825 => 169826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-06-11 20:37:59 UTC (rev 169825)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-06-11 20:42:34 UTC (rev 169826)
</span><span class="lines">@@ -3318,6 +3318,15 @@
</span><span class="cx"> VERBATIM)
</span><span class="cx"> list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/HTMLEntityTable.cpp)
</span><span class="cx">
</span><ins>+# Generate HTTP header names
+add_custom_command(
+ OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/HTTPHeaderNames.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/HTTPHeaderNames.gperf ${DERIVED_SOURCES_WEBCORE_DIR}/HTTPHeaderNames.h
+ MAIN_DEPENDENCY ${WEBCORE_DIR}/platform/network/HTTPHeaderNames.in
+ DEPENDS ${WEBCORE_DIR}/platform/network/create-http-header-name-table
+ COMMAND ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/html/parser/create-http-header-name-table ${WEBCORE_DIR}/platform/network/HTTPHeaderNames.in
+ VERBATIM)
+list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/HTTPHeaderNames.cpp)
+
</ins><span class="cx"> # Generate CSS property names
</span><span class="cx"> add_custom_command(
</span><span class="cx"> OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/CSSPropertyNames.in ${DERIVED_SOURCES_WEBCORE_DIR}/CSSPropertyNames.h ${DERIVED_SOURCES_WEBCORE_DIR}/CSSPropertyNames.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/CSSPropertyNames.gperf
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (169825 => 169826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-11 20:37:59 UTC (rev 169825)
+++ trunk/Source/WebCore/ChangeLog        2014-06-11 20:42:34 UTC (rev 169826)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2014-06-11 Anders Carlsson <andersca@apple.com>
+
+ Add a script that generates a gperf hash for HTTP header names
+ https://bugs.webkit.org/show_bug.cgi?id=133760
+
+ Reviewed by Andreas Kling.
+
+ This is the first step towards getting rid of AtomicString from HTTPHeaderMap.
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * WebCore.vcxproj/WebCore.vcxproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/network/HTTPHeaderNames.in: Added.
+ * platform/network/create-http-header-name-table: Added.
+ (HTTPHeaderName):
+
</ins><span class="cx"> 2014-06-11 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> ROLLOUT: r153510: Broke Table borders on Wikipedia
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (169825 => 169826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2014-06-11 20:37:59 UTC (rev 169825)
+++ trunk/Source/WebCore/DerivedSources.make        2014-06-11 20:42:34 UTC (rev 169826)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx"> $(WebCore)/inspector \
</span><span class="cx"> $(WebCore)/loader/appcache \
</span><span class="cx"> $(WebCore)/page \
</span><ins>+ $(WebCore)/platform/network \
</ins><span class="cx"> $(WebCore)/plugins \
</span><span class="cx"> $(WebCore)/storage \
</span><span class="cx"> $(WebCore)/xml \
</span><span class="lines">@@ -760,6 +761,7 @@
</span><span class="cx"> HTMLElementFactory.cpp \
</span><span class="cx"> HTMLEntityTable.cpp \
</span><span class="cx"> HTMLNames.cpp \
</span><ins>+ HTTPHeaderNames.h \
</ins><span class="cx"> JSHTMLElementWrapperFactory.cpp \
</span><span class="cx"> JSSVGElementWrapperFactory.cpp \
</span><span class="cx"> PlugInsResources.h \
</span><span class="lines">@@ -843,11 +845,18 @@
</span><span class="cx">
</span><span class="cx"> # --------
</span><span class="cx">
</span><ins>+# --------
+
</ins><span class="cx"> # HTML entity names
</span><span class="cx">
</span><span class="cx"> HTMLEntityTable.cpp : html/parser/HTMLEntityNames.in $(WebCore)/html/parser/create-html-entity-table
</span><span class="cx">         $(PYTHON) $(WebCore)/html/parser/create-html-entity-table -o HTMLEntityTable.cpp $(WebCore)/html/parser/HTMLEntityNames.in
</span><span class="cx">
</span><ins>+# HTTP header names
+
+HTTPHeaderNames.h : platform/network/HTTPHeaderNames.in $(WebCore)/platform/network/create-http-header-name-table
+        $(PYTHON) $(WebCore)/platform/network/create-http-header-name-table $(WebCore)/platform/network/HTTPHeaderNames.in
+
</ins><span class="cx"> # --------
</span><span class="cx">
</span><span class="cx"> # color names
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (169825 => 169826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-06-11 20:37:59 UTC (rev 169825)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-06-11 20:42:34 UTC (rev 169826)
</span><span class="lines">@@ -282,6 +282,7 @@
</span><span class="cx"> </ClCompile>
</span><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\CSSPropertyNames.cpp" />
</span><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\CSSValueKeywords.cpp" />
</span><ins>+ <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\HTTPHeaderNames.cpp" />
</ins><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SelectorPseudoClassAndCompatibilityElementMap.cpp" />
</span><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SelectorPseudoElementTypeMap.cpp" />
</span><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSANGLEInstancedArrays.cpp">
</span><span class="lines">@@ -8383,6 +8384,7 @@
</span><span class="cx"> <ClCompile Include="..\platform\network\FormData.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\network\FormDataBuilder.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\network\HTTPHeaderMap.cpp" />
</span><ins>+ <None Include="..\platform\network\HTTPHeaderNames.in" />
</ins><span class="cx"> <ClCompile Include="..\platform\network\HTTPParsers.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\network\MIMEHeader.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\network\NetworkStateNotifier.cpp" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (169825 => 169826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-06-11 20:37:59 UTC (rev 169825)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-06-11 20:42:34 UTC (rev 169826)
</span><span class="lines">@@ -826,6 +826,7 @@
</span><span class="cx">                 1AC2260D0DB69F190089B669 /* JSDOMApplicationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC2260B0DB69F190089B669 /* JSDOMApplicationCache.h */; };
</span><span class="cx">                 1AC2D845171734A100652FC0 /* Storage.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E3F9C40DA059DC00250911 /* Storage.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1AC69593161A1E53003732CB /* GraphicsLayerFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC69592161A1E53003732CB /* GraphicsLayerFactory.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                1AC900C31943C0FC008625B5 /* HTTPHeaderNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC900C01943C0A0008625B5 /* HTTPHeaderNames.cpp */; };
</ins><span class="cx">                 1ACADD791880D91C00D8B71D /* ProgressTrackerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACADD781880D91C00D8B71D /* ProgressTrackerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1ACD1B630B029739007E5016 /* DOMCSSStyleDeclarationInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85E711440AC5D5340053270F /* DOMCSSStyleDeclarationInternal.h */; };
</span><span class="cx">                 1ACE53DF0A8D18810022947D /* JSDOMParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ACE53DD0A8D18810022947D /* JSDOMParser.cpp */; };
</span><span class="lines">@@ -7752,6 +7753,10 @@
</span><span class="cx">                 1AC2260A0DB69F190089B669 /* JSDOMApplicationCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMApplicationCache.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1AC2260B0DB69F190089B669 /* JSDOMApplicationCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMApplicationCache.h; sourceTree = "<group>"; };
</span><span class="cx">                 1AC69592161A1E53003732CB /* GraphicsLayerFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsLayerFactory.h; sourceTree = "<group>"; };
</span><ins>+                1AC900BF1943AF3D008625B5 /* HTTPHeaderNames.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = HTTPHeaderNames.in; sourceTree = "<group>"; };
+                1AC900C01943C0A0008625B5 /* HTTPHeaderNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPHeaderNames.cpp; sourceTree = "<group>"; };
+                1AC900C11943C0A0008625B5 /* HTTPHeaderNames.gperf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; path = HTTPHeaderNames.gperf; sourceTree = "<group>"; };
+                1AC900C21943C0A0008625B5 /* HTTPHeaderNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPHeaderNames.h; sourceTree = "<group>"; };
</ins><span class="cx">                 1ACADD781880D91C00D8B71D /* ProgressTrackerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProgressTrackerClient.h; sourceTree = "<group>"; };
</span><span class="cx">                 1ACE53DD0A8D18810022947D /* JSDOMParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMParser.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1ACE53DE0A8D18810022947D /* JSDOMParser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSDOMParser.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -16112,6 +16117,9 @@
</span><span class="cx">                                 A8BC04911214F69600B5F122 /* HTMLEntityTable.cpp */,
</span><span class="cx">                                 A8D06B380A265DCD005E7203 /* HTMLNames.cpp */,
</span><span class="cx">                                 A8D06B370A265DCD005E7203 /* HTMLNames.h */,
</span><ins>+                                1AC900C01943C0A0008625B5 /* HTTPHeaderNames.cpp */,
+                                1AC900C11943C0A0008625B5 /* HTTPHeaderNames.gperf */,
+                                1AC900C21943C0A0008625B5 /* HTTPHeaderNames.h */,
</ins><span class="cx">                                 53E29E5C167A8A1900586D3D /* InternalSettingsGenerated.cpp */,
</span><span class="cx">                                 53E29E5D167A8A1900586D3D /* InternalSettingsGenerated.h */,
</span><span class="cx">                                 409EBDC416B7F3CA00CBA3FC /* JSCSSFontFaceLoadEvent.cpp */,
</span><span class="lines">@@ -16194,6 +16202,7 @@
</span><span class="cx">                                 514C765B0CE923A1007EF3CD /* FormData.h */,
</span><span class="cx">                                 085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */,
</span><span class="cx">                                 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */,
</span><ins>+                                1AC900BF1943AF3D008625B5 /* HTTPHeaderNames.in */,
</ins><span class="cx">                                 0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */,
</span><span class="cx">                                 514C765C0CE923A1007EF3CD /* HTTPHeaderMap.h */,
</span><span class="cx">                                 514C765D0CE923A1007EF3CD /* HTTPParsers.cpp */,
</span><span class="lines">@@ -28844,6 +28853,7 @@
</span><span class="cx">                                 2934940B16C02C0A00901318 /* PlatformSpeechSynthesisUtterance.cpp in Sources */,
</span><span class="cx">                                 2934940A16C02C0700901318 /* PlatformSpeechSynthesisVoice.cpp in Sources */,
</span><span class="cx">                                 297BE3DA16C043D8003316BD /* PlatformSpeechSynthesizer.cpp in Sources */,
</span><ins>+                                1AC900C31943C0FC008625B5 /* HTTPHeaderNames.cpp in Sources */,
</ins><span class="cx">                                 AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizerIOS.mm in Sources */,
</span><span class="cx">                                 297BE3D816C03CCE003316BD /* PlatformSpeechSynthesizerMac.mm in Sources */,
</span><span class="cx">                                 1AD8F81C11CAB9E900E93E54 /* PlatformStrategies.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkHTTPHeaderNamesin"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/network/HTTPHeaderNames.in (0 => 169826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/HTTPHeaderNames.in         (rev 0)
+++ trunk/Source/WebCore/platform/network/HTTPHeaderNames.in        2014-06-11 20:42:34 UTC (rev 169826)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+//
+// Copyright (C) 2014 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+//
+
+Accept
+Location
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcreatehttpheadernametable"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/network/create-http-header-name-table (0 => 169826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/create-http-header-name-table         (rev 0)
+++ trunk/Source/WebCore/platform/network/create-http-header-name-table        2014-06-11 20:42:34 UTC (rev 169826)
</span><span class="lines">@@ -0,0 +1,245 @@
</span><ins>+#!/usr/bin/env python
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import sys
+
+program_name = os.path.basename(__file__)
+if len(sys.argv) < 2:
+ sys.stderr.write("Usage: %s INPUT_FILE\n" % program_name)
+ exit(1)
+
+input_path = sys.argv[1]
+input_file = open(input_path)
+
+http_header_name_to_id = { }
+http_header_names = []
+
+for line in input_file.xreadlines():
+ http_header_name = line.strip()
+ if not http_header_name or http_header_name[:2] == '//':
+ continue
+
+ http_header_name_to_id[http_header_name] = http_header_name.replace('-', '')
+
+ http_header_names.append(http_header_name)
+
+input_file.close()
+
+http_header_names.sort()
+
+gperf_file = open('HTTPHeaderNames.gperf', 'w')
+gperf_file.write('''
+%{
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/// This file is generated by create-http-header-name-table, do not edit.
+
+#include "config.h"
+#include "HTTPHeaderNames.h"
+
+#include <wtf/text/StringView.h>
+
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunknown-pragmas"
+#pragma clang diagnostic ignored "-Wdeprecated-register"
+#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
+#endif
+
+namespace WebCore {
+
+static const struct HeaderNameString {
+ const char* const name;
+ unsigned length;
+} headerNameStrings[] = {
+''')
+
+for http_header_name in http_header_names:
+ gperf_file.write(' { "%s", %u },\n' % (http_header_name, len(http_header_name)))
+
+gperf_file.write('};\n\n')
+
+gperf_file.write('''
+%}
+
+%language=C++
+%readonly-tables
+%global-table
+%compare-strncmp
+%ignore-case
+%struct-type
+struct HeaderNameHashEntry {
+ const char* name;
+ HTTPHeaderName headerName;
+};
+%define class-name HTTPHeaderNamesHash
+%define lookup-function-name findHeaderNameImpl
+%define hash-function-name header_name_hash_function
+%define word-array-name header_name_wordlist
+%enum
+%%
+''')
+
+for http_header_name in http_header_names:
+ gperf_file.write('%s, HTTPHeaderName::%s\n' % (http_header_name, http_header_name_to_id[http_header_name]))
+
+gperf_file.write('''%%
+bool findHTTPHeaderName(StringView stringView, HTTPHeaderName& headerName)
+{
+ unsigned length = stringView.length();
+ if (length > maxHTTPHeaderNameLength || length < minHTTPHeaderNameLength)
+ return false;
+
+ if (stringView.is8Bit()) {
+ if (auto nameAndString = HTTPHeaderNamesHash::findHeaderNameImpl(reinterpret_cast<const char*>(stringView.characters8()), length)) {
+ headerName = nameAndString->headerName;
+ return true;
+ }
+ } else {
+ LChar characters[maxHTTPHeaderNameLength];
+ for (unsigned i = 0; i < length; ++i) {
+ UChar character = stringView.characters16()[i];
+ if (!isASCII(character))
+ return false;
+
+ characters[i] = static_cast<LChar>(character);
+ }
+
+ if (auto nameAndString = HTTPHeaderNamesHash::findHeaderNameImpl(reinterpret_cast<const char*>(characters), length)) {
+ headerName = nameAndString->headerName;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+StringView httpHeaderNameString(HTTPHeaderName headerName)
+{
+ ASSERT(static_cast<unsigned>(headerName) < numHTTPHeaderNames);
+
+ const auto& name = headerNameStrings[static_cast<unsigned>(headerName)];
+
+ return StringView { reinterpret_cast<const LChar*>(name.name), static_cast<unsigned>(name.length) };
+}
+
+} // namespace WebCore
+
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+''')
+
+gperf_file.close()
+
+header_file = open('HTTPHeaderNames.h', 'w')
+header_file.write('''
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/// This file is generated by create-http-header-name-table, do not edit.
+
+#ifndef HTTPHeaderNames_h
+#define HTTPHeaderNames_h
+
+#include <wtf/Forward.h>
+
+namespace WebCore {
+
+enum class HTTPHeaderName {
+''')
+
+for http_header_name in http_header_names:
+ header_file.write(' %s,\n' % http_header_name_to_id[http_header_name])
+
+header_file.write('};\n\n')
+header_file.write('const unsigned numHTTPHeaderNames = %u;\n' % len(http_header_names));
+header_file.write('const size_t minHTTPHeaderNameLength = %u;\n' % len(min(http_header_names, key=len)));
+header_file.write('const size_t maxHTTPHeaderNameLength = %u;\n' % len(max(http_header_names, key=len)));
+header_file.write('''
+bool findHTTPHeaderName(StringView, HTTPHeaderName&);
+StringView httpHeaderNameString(HTTPHeaderName);
+
+} // namespace WebCore
+
+#endif // HTTPHeaderNames_h
+''')
+header_file.close()
+
+gperf = os.getenv('GPERF') or 'gperf'
+
+if os.system('%s --key-positions="*" -D -n -s 2 HTTPHeaderNames.gperf --output-file=HTTPHeaderNames.cpp' % gperf):
+ sys.stderr.write('Failed to run gperf.')
+ exit(1)
</ins><span class="cx">Property changes on: trunk/Source/WebCore/platform/network/create-http-header-name-table
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
</div>
</body>
</html>