<!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>[169937] trunk/Source</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/169937">169937</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-06-13 10:33:45 -0700 (Fri, 13 Jun 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add overloads of HTTPHeaderMap::find and remove that take enums
https://bugs.webkit.org/show_bug.cgi?id=133823
Reviewed by Sam Weinig.
Source/WebCore:
* WebCore.exp.in:
Update symbols.
* WebCore.xcodeproj/project.pbxproj:
Make HTTPHeaderNames.h private.
* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::contains):
Convert the enum value to a string and call the contains overload that takes a string.
(WebCore::HTTPHeaderMap::remove):
Convert the enum value to a string and call the remove overload that takes a string.
* platform/network/HTTPHeaderMap.h:
Add new overloads taking HTTPHeaderName and mark the versions taking string literals as deleted.
* platform/network/HTTPHeaderNames.in:
Add new header names.
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::clearHTTPAuthorization):
(WebCore::ResourceRequestBase::clearHTTPContentType):
(WebCore::ResourceRequestBase::clearHTTPReferrer):
(WebCore::ResourceRequestBase::clearHTTPOrigin):
(WebCore::ResourceRequestBase::clearHTTPUserAgent):
(WebCore::ResourceRequestBase::clearHTTPAccept):
Update functions to use HTTPHeaderName enums.
(WebCore::ResourceRequestBase::isConditional):
(WebCore::ResourceRequestBase::makeUnconditional):
Simplify these.
Source/WebKit2:
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::parsePostBuffer):
Update for WebCore changes.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkHTTPHeaderMapcpp">trunk/Source/WebCore/platform/network/HTTPHeaderMap.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkHTTPHeaderMaph">trunk/Source/WebCore/platform/network/HTTPHeaderMap.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkHTTPHeaderNamesin">trunk/Source/WebCore/platform/network/HTTPHeaderNames.in</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceRequestBasecpp">trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginViewcpp">trunk/Source/WebCore/plugins/PluginView.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsNetscapeNetscapeBrowserFuncscpp">trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (169936 => 169937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-13 16:12:27 UTC (rev 169936)
+++ trunk/Source/WebCore/ChangeLog        2014-06-13 17:33:45 UTC (rev 169937)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2014-06-12 Anders Carlsson <andersca@apple.com>
+
+ Add overloads of HTTPHeaderMap::find and remove that take enums
+ https://bugs.webkit.org/show_bug.cgi?id=133823
+
+ Reviewed by Sam Weinig.
+
+ * WebCore.exp.in:
+ Update symbols.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ Make HTTPHeaderNames.h private.
+
+ * platform/network/HTTPHeaderMap.cpp:
+ (WebCore::HTTPHeaderMap::contains):
+ Convert the enum value to a string and call the contains overload that takes a string.
+
+ (WebCore::HTTPHeaderMap::remove):
+ Convert the enum value to a string and call the remove overload that takes a string.
+
+ * platform/network/HTTPHeaderMap.h:
+ Add new overloads taking HTTPHeaderName and mark the versions taking string literals as deleted.
+
+ * platform/network/HTTPHeaderNames.in:
+ Add new header names.
+
+ * platform/network/ResourceRequestBase.cpp:
+ (WebCore::ResourceRequestBase::clearHTTPAuthorization):
+ (WebCore::ResourceRequestBase::clearHTTPContentType):
+ (WebCore::ResourceRequestBase::clearHTTPReferrer):
+ (WebCore::ResourceRequestBase::clearHTTPOrigin):
+ (WebCore::ResourceRequestBase::clearHTTPUserAgent):
+ (WebCore::ResourceRequestBase::clearHTTPAccept):
+ Update functions to use HTTPHeaderName enums.
+
+ (WebCore::ResourceRequestBase::isConditional):
+ (WebCore::ResourceRequestBase::makeUnconditional):
+ Simplify these.
+
</ins><span class="cx"> 2014-06-13 Jarek Czekalski <jarekczek@poczta.onet.pl>
</span><span class="cx">
</span><span class="cx"> [ATK] Fix text inside "span" block in "a" block was not accessible.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (169936 => 169937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-06-13 16:12:27 UTC (rev 169936)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-06-13 17:33:45 UTC (rev 169937)
</span><span class="lines">@@ -291,7 +291,7 @@
</span><span class="cx"> __ZN7WebCore13GraphicsLayerD2Ev
</span><span class="cx"> __ZN7WebCore13HTTPHeaderMap3addERKN3WTF12AtomicStringERKNS1_6StringE
</span><span class="cx"> __ZN7WebCore13HTTPHeaderMap3setERKN3WTF12AtomicStringERKNS1_6StringE
</span><del>-__ZN7WebCore13HTTPHeaderMap6removeEPKc
</del><ins>+__ZN7WebCore13HTTPHeaderMap6removeENS_14HTTPHeaderNameE
</ins><span class="cx"> __ZN7WebCore13HTTPHeaderMapC1Ev
</span><span class="cx"> __ZN7WebCore13HTTPHeaderMapD1Ev
</span><span class="cx"> __ZN7WebCore13HitTestResultC1ERKNS_11LayoutPointE
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (169936 => 169937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-06-13 16:12:27 UTC (rev 169936)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-06-13 17:33:45 UTC (rev 169937)
</span><span class="lines">@@ -790,6 +790,7 @@
</span><span class="cx">                 1AB1AE7B0C051FDE00139F4F /* zoomOutCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AB1AE790C051FDE00139F4F /* zoomOutCursor.png */; };
</span><span class="cx">                 1AB33DA512551E320024457A /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AB33DA412551E320024457A /* IOKit.framework */; };
</span><span class="cx">                 1AB5EBD0194A1D170059AC70 /* ShapeValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB5EBCF194A1D170059AC70 /* ShapeValue.cpp */; };
</span><ins>+                1AB5EBD2194A50F30059AC70 /* HTTPHeaderNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC900C21943C0A0008625B5 /* HTTPHeaderNames.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 1AB7FC680A8B92EC00D9D37B /* XPathEvaluator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7FC470A8B92EC00D9D37B /* XPathEvaluator.cpp */; };
</span><span class="cx">                 1AB7FC690A8B92EC00D9D37B /* XPathEvaluator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7FC480A8B92EC00D9D37B /* XPathEvaluator.h */; };
</span><span class="cx">                 1AB7FC6B0A8B92EC00D9D37B /* XPathExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7FC4A0A8B92EC00D9D37B /* XPathExpression.cpp */; };
</span><span class="lines">@@ -26356,6 +26357,7 @@
</span><span class="cx">                                 CDC69DD61632026C007C38DF /* WebCoreFullScreenWarningView.h in Headers */,
</span><span class="cx">                                 CD127DEE14F3098400E84779 /* WebCoreFullScreenWindow.h in Headers */,
</span><span class="cx">                                 BC53D911114310CC000D817E /* WebCoreJSClientData.h in Headers */,
</span><ins>+                                1AB5EBD2194A50F30059AC70 /* HTTPHeaderNames.h in Headers */,
</ins><span class="cx">                                 93F199BB08245E59001E9ABC /* WebCoreKeyboardUIMode.h in Headers */,
</span><span class="cx">                                 3140379B124BEA7F00AF40E4 /* WebCoreMotionManager.h in Headers */,
</span><span class="cx">                                 934D9BA70B8C1175007B42A9 /* WebCoreNSStringExtras.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkHTTPHeaderMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/HTTPHeaderMap.cpp (169936 => 169937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/HTTPHeaderMap.cpp        2014-06-13 16:12:27 UTC (rev 169936)
+++ trunk/Source/WebCore/platform/network/HTTPHeaderMap.cpp        2014-06-13 17:33:45 UTC (rev 169937)
</span><span class="lines">@@ -31,7 +31,9 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "HTTPHeaderMap.h"
</span><span class="cx">
</span><ins>+#include "HTTPHeaderNames.h"
</ins><span class="cx"> #include <utility>
</span><ins>+#include <wtf/text/StringView.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -97,6 +99,11 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+bool HTTPHeaderMap::contains(HTTPHeaderName name) const
+{
+ return m_headers.contains(httpHeaderNameString(name).toStringWithoutCopying());
+}
+
</ins><span class="cx"> String HTTPHeaderMap::get(const char* name) const
</span><span class="cx"> {
</span><span class="cx"> auto it = find(name);
</span><span class="lines">@@ -104,20 +111,15 @@
</span><span class="cx"> return String();
</span><span class="cx"> return it->value;
</span><span class="cx"> }
</span><del>-
-bool HTTPHeaderMap::contains(const char* name) const
-{
- return find(name) != end();
-}
</del><span class="cx">
</span><span class="cx"> HTTPHeaderMap::const_iterator HTTPHeaderMap::find(const char* name) const
</span><span class="cx"> {
</span><span class="cx"> return m_headers.find<CaseFoldingCStringTranslator>(name);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool HTTPHeaderMap::remove(const char* name)
</del><ins>+bool HTTPHeaderMap::remove(HTTPHeaderName name)
</ins><span class="cx"> {
</span><del>- return m_headers.remove(m_headers.find<CaseFoldingCStringTranslator>(name));
</del><ins>+ return m_headers.remove(httpHeaderNameString(name).toStringWithoutCopying());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkHTTPHeaderMaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/HTTPHeaderMap.h (169936 => 169937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/HTTPHeaderMap.h        2014-06-13 16:12:27 UTC (rev 169936)
+++ trunk/Source/WebCore/platform/network/HTTPHeaderMap.h        2014-06-13 17:33:45 UTC (rev 169937)
</span><span class="lines">@@ -36,6 +36,8 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+enum class HTTPHeaderName;
+
</ins><span class="cx"> typedef Vector<std::pair<String, String>> CrossThreadHTTPHeaderMapData;
</span><span class="cx">
</span><span class="cx"> // FIXME: Not every header fits into a map. Notably, multiple Set-Cookie header fields are needed to set multiple cookies.
</span><span class="lines">@@ -58,16 +60,18 @@
</span><span class="cx"> void clear() { m_headers.clear(); }
</span><span class="cx">
</span><span class="cx"> String get(const AtomicString& name) const;
</span><del>-
</del><span class="cx"> void set(const AtomicString& name, const String& value);
</span><span class="cx"> void add(const AtomicString& name, const String& value);
</span><span class="cx">
</span><del>- // Alternate accessors that are faster than converting the char* to AtomicString first.
- bool contains(const char*) const;
</del><ins>+ bool contains(HTTPHeaderName) const;
</ins><span class="cx"> String get(const char*) const;
</span><span class="cx"> const_iterator find(const char*) const;
</span><del>- bool remove(const char*);
</del><ins>+ bool remove(HTTPHeaderName);
</ins><span class="cx">
</span><ins>+ // Instead of passing a string literal to any of these functions, just use a HTTPHeaderName instead.
+ template<size_t length> bool contains(const char (&)[length]) = delete;
+ template<size_t length> bool remove(const char (&)[length]) = delete;
+
</ins><span class="cx"> const_iterator begin() const { return m_headers.begin(); }
</span><span class="cx"> const_iterator end() const { return m_headers.end(); }
</span><span class="cx">
</span><span class="lines">@@ -82,7 +86,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- HashMap<AtomicString, String, CaseFoldingHash> m_headers;
</del><ins>+ HashMapType m_headers;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkHTTPHeaderNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/HTTPHeaderNames.in (169936 => 169937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/HTTPHeaderNames.in        2014-06-13 16:12:27 UTC (rev 169936)
+++ trunk/Source/WebCore/platform/network/HTTPHeaderNames.in        2014-06-13 17:33:45 UTC (rev 169937)
</span><span class="lines">@@ -24,4 +24,15 @@
</span><span class="cx"> //
</span><span class="cx">
</span><span class="cx"> Accept
</span><ins>+Authorization
+Content-Length
+Content-Type
+If-Match
+If-Modified-Since
+If-None-Match
+If-Range
+If-Unmodified-Since
</ins><span class="cx"> Location
</span><ins>+Origin
+Referer
+User-Agent
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceRequestBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp (169936 => 169937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp        2014-06-13 16:12:27 UTC (rev 169936)
+++ trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp        2014-06-13 17:33:45 UTC (rev 169937)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "ResourceRequestBase.h"
</span><span class="cx">
</span><ins>+#include "HTTPHeaderNames.h"
</ins><span class="cx"> #include "ResourceRequest.h"
</span><span class="cx"> #include <wtf/PassOwnPtr.h>
</span><span class="cx">
</span><span class="lines">@@ -264,7 +265,7 @@
</span><span class="cx"> {
</span><span class="cx"> updateResourceRequest();
</span><span class="cx">
</span><del>- if (!m_httpHeaderFields.remove("Authorization"))
</del><ins>+ if (!m_httpHeaderFields.remove(HTTPHeaderName::Authorization))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (url().protocolIsInHTTPFamily())
</span><span class="lines">@@ -285,7 +286,7 @@
</span><span class="cx"> {
</span><span class="cx"> updateResourceRequest();
</span><span class="cx">
</span><del>- m_httpHeaderFields.remove("Content-Type");
</del><ins>+ m_httpHeaderFields.remove(HTTPHeaderName::ContentType);
</ins><span class="cx">
</span><span class="cx"> if (url().protocolIsInHTTPFamily())
</span><span class="cx"> m_platformRequestUpdated = false;
</span><span class="lines">@@ -305,7 +306,7 @@
</span><span class="cx"> {
</span><span class="cx"> updateResourceRequest();
</span><span class="cx">
</span><del>- m_httpHeaderFields.remove("Referer");
</del><ins>+ m_httpHeaderFields.remove(HTTPHeaderName::Referer);
</ins><span class="cx">
</span><span class="cx"> if (url().protocolIsInHTTPFamily())
</span><span class="cx"> m_platformRequestUpdated = false;
</span><span class="lines">@@ -325,7 +326,7 @@
</span><span class="cx"> {
</span><span class="cx"> updateResourceRequest();
</span><span class="cx">
</span><del>- m_httpHeaderFields.remove("Origin");
</del><ins>+ m_httpHeaderFields.remove(HTTPHeaderName::Origin);
</ins><span class="cx">
</span><span class="cx"> if (url().protocolIsInHTTPFamily())
</span><span class="cx"> m_platformRequestUpdated = false;
</span><span class="lines">@@ -345,7 +346,7 @@
</span><span class="cx"> {
</span><span class="cx"> updateResourceRequest();
</span><span class="cx">
</span><del>- m_httpHeaderFields.remove("User-Agent");
</del><ins>+ m_httpHeaderFields.remove(HTTPHeaderName::UserAgent);
</ins><span class="cx">
</span><span class="cx"> if (url().protocolIsInHTTPFamily())
</span><span class="cx"> m_platformRequestUpdated = false;
</span><span class="lines">@@ -365,7 +366,7 @@
</span><span class="cx"> {
</span><span class="cx"> updateResourceRequest();
</span><span class="cx">
</span><del>- m_httpHeaderFields.remove("Accept");
</del><ins>+ m_httpHeaderFields.remove(HTTPHeaderName::Accept);
</ins><span class="cx">
</span><span class="cx"> if (url().protocolIsInHTTPFamily())
</span><span class="cx"> m_platformRequestUpdated = false;
</span><span class="lines">@@ -511,22 +512,28 @@
</span><span class="cx"> return ResourceRequest::platformCompare(a, b);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static const HTTPHeaderName conditionalHeaderNames[] = {
+ HTTPHeaderName::IfMatch,
+ HTTPHeaderName::IfModifiedSince,
+ HTTPHeaderName::IfNoneMatch,
+ HTTPHeaderName::IfRange,
+ HTTPHeaderName::IfUnmodifiedSince
+};
+
</ins><span class="cx"> bool ResourceRequestBase::isConditional() const
</span><span class="cx"> {
</span><del>- return (m_httpHeaderFields.contains("If-Match") ||
- m_httpHeaderFields.contains("If-Modified-Since") ||
- m_httpHeaderFields.contains("If-None-Match") ||
- m_httpHeaderFields.contains("If-Range") ||
- m_httpHeaderFields.contains("If-Unmodified-Since"));
</del><ins>+ for (auto headerName : conditionalHeaderNames) {
+ if (m_httpHeaderFields.contains(headerName))
+ return true;
+ }
+
+ return false;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ResourceRequestBase::makeUnconditional()
</span><span class="cx"> {
</span><del>- m_httpHeaderFields.remove("If-Match");
- m_httpHeaderFields.remove("If-Modified-Since");
- m_httpHeaderFields.remove("If-None-Match");
- m_httpHeaderFields.remove("If-Range");
- m_httpHeaderFields.remove("If-Unmodified-Since");
</del><ins>+ for (auto headerName : conditionalHeaderNames)
+ m_httpHeaderFields.remove(headerName);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> double ResourceRequestBase::defaultTimeoutInterval()
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/PluginView.cpp (169936 => 169937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginView.cpp        2014-06-13 16:12:27 UTC (rev 169936)
+++ trunk/Source/WebCore/plugins/PluginView.cpp        2014-06-13 17:33:45 UTC (rev 169937)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> #include "GraphicsContext.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "HTMLPlugInElement.h"
</span><ins>+#include "HTTPHeaderNames.h"
</ins><span class="cx"> #include "Image.h"
</span><span class="cx"> #include "JSDOMBinding.h"
</span><span class="cx"> #include "JSDOMWindow.h"
</span><span class="lines">@@ -1165,7 +1166,7 @@
</span><span class="cx">
</span><span class="cx"> if (!contentLength.isNull())
</span><span class="cx"> dataLength = min(contentLength.toInt(), (int)dataLength);
</span><del>- headerFields.remove("Content-Length");
</del><ins>+ headerFields.remove(HTTPHeaderName::ContentLength);
</ins><span class="cx">
</span><span class="cx"> postData += location;
</span><span class="cx"> postDataLength = dataLength;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (169936 => 169937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-06-13 16:12:27 UTC (rev 169936)
+++ trunk/Source/WebKit2/ChangeLog        2014-06-13 17:33:45 UTC (rev 169937)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-06-12 Anders Carlsson <andersca@apple.com>
+
+ Add overloads of HTTPHeaderMap::find and remove that take enums
+ https://bugs.webkit.org/show_bug.cgi?id=133823
+
+ Reviewed by Sam Weinig.
+
+ * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
+ (WebKit::parsePostBuffer):
+ Update for WebCore changes.
+
</ins><span class="cx"> 2014-06-12 Benjamin Poulain <bpoulain@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS][WK2] Do not update the viewport configuration on load until the first viewport arguments is received
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsNetscapeNetscapeBrowserFuncscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp (169936 => 169937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp        2014-06-13 16:12:27 UTC (rev 169936)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp        2014-06-13 17:33:45 UTC (rev 169937)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include "NetscapePlugin.h"
</span><span class="cx"> #include "PluginController.h"
</span><span class="cx"> #include <WebCore/HTTPHeaderMap.h>
</span><ins>+#include <WebCore/HTTPHeaderNames.h>
</ins><span class="cx"> #include <WebCore/IdentifierRep.h>
</span><span class="cx"> #include <WebCore/NotImplemented.h>
</span><span class="cx"> #include <WebCore/ProtectionSpace.h>
</span><span class="lines">@@ -249,11 +250,10 @@
</span><span class="cx">
</span><span class="cx"> if (!contentLength.isNull())
</span><span class="cx"> dataLength = std::min(contentLength.toInt(), (int)dataLength);
</span><del>- headerFields.remove("Content-Length");
</del><ins>+ headerFields.remove(HTTPHeaderName::ContentLength);
</ins><span class="cx">
</span><span class="cx"> postBuffer += location;
</span><span class="cx"> postBufferSize = dataLength;
</span><del>-
</del><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>