<!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>[200313] 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/200313">200313</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-05-01 17:17:55 -0700 (Sun, 01 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update Fetch to use enum class instead of string for enumerations
https://bugs.webkit.org/show_bug.cgi?id=157241

Reviewed by Chris Dumez.

Source/WebCore:

* Modules/fetch/FetchOptions.h: Changed this class into a struct,
getting rid of all the getter and setter functions. Moved all the
enumeration types out of this class to the WebCore namespace level
and gave them all the names and values that match the ones from the
IDL file.

* Modules/fetch/FetchRequest.cpp:
(WebCore::setReferrerPolicy): Updated for the changes to FetchOptions.
The string matching here will likely go away when we change dictionary
so it sets up a structure, which will parse the enumeration values, but
that won't be for a while, so this stays for now.
(WebCore::setMode): Ditto.
(WebCore::setCredentials): Ditto.
(WebCore::setCache): Ditto.
(WebCore::setRedirect): Ditto.
(WebCore::buildOptions): Updated for changes to FetchOptions.
(WebCore::buildHeaders): Ditto.
(WebCore::FetchRequest::create): Ditto.
(WebCore::FetchRequest::type): Moved this to the header and changed its
return type to the enum; it's not just a single return statement.
(WebCore::FetchRequest::destination): Ditto.
(WebCore::FetchRequest::referrerPolicy): Ditto.
(WebCore::FetchRequest::mode): Ditto.
(WebCore::FetchRequest::credentials): Ditto.
(WebCore::FetchRequest::cache): Ditto.
(WebCore::FetchRequest::redirect): Ditto.

* Modules/fetch/FetchRequest.h: Changed all the getters that return
enumerations to return the enum class values instead of strings.
Put all the inline versions here in the header.

* bindings/scripts/CodeGenerator.pm: Removed the seven enum types that
are in FetchRequest.idl from the list of &quot;string-based&quot; enums.

* dom/Document.cpp:
(WebCore::Document::Document): Updated for the change where I
renamed ReferrerPolicy to ReferrerHeaderPolicy, at least for now.
(WebCore::Document::processReferrerPolicy): Ditto.
(WebCore::Document::applyContentDispositionAttachmentSandbox): Ditto.
* dom/Document.h: Ditto.
* loader/FrameNetworkingContext.h: Ditto.
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::generateReferrerHeader): Ditto.
* page/SecurityPolicy.h: Ditto.

* platform/ReferrerPolicy.h: Renamed this enum from ReferrerPolicy to
ReferrerHeaderPolicy, since the one specified in the Fetch API has the
name ReferrerPolicy. I think the best way to resolve this longer term is
to merge them since they really do represent the same concept, although
the one from the Fetch API has a few more features.

Source/WebKit2:

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::loadResource): Updated for the change where I
renamed ReferrerPolicy to ReferrerHeaderPolicy, at least for now.
(WebKit::WebLoaderStrategy::schedulePluginStreamLoad): Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchOptionsh">trunk/Source/WebCore/Modules/fetch/FetchOptions.h</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchRequestcpp">trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchRequesth">trunk/Source/WebCore/Modules/fetch/FetchRequest.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorpm">trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameNetworkingContexth">trunk/Source/WebCore/loader/FrameNetworkingContext.h</a></li>
<li><a href="#trunkSourceWebCorepageSecurityPolicycpp">trunk/Source/WebCore/page/SecurityPolicy.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSecurityPolicyh">trunk/Source/WebCore/page/SecurityPolicy.h</a></li>
<li><a href="#trunkSourceWebCoreplatformReferrerPolicyh">trunk/Source/WebCore/platform/ReferrerPolicy.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkWebLoaderStrategycpp">trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200312 => 200313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-01 21:30:50 UTC (rev 200312)
+++ trunk/Source/WebCore/ChangeLog        2016-05-02 00:17:55 UTC (rev 200313)
</span><span class="lines">@@ -1,3 +1,61 @@
</span><ins>+2016-05-01  Darin Adler  &lt;darin@apple.com&gt;
+
+        Update Fetch to use enum class instead of string for enumerations
+        https://bugs.webkit.org/show_bug.cgi?id=157241
+
+        Reviewed by Chris Dumez.
+
+        * Modules/fetch/FetchOptions.h: Changed this class into a struct,
+        getting rid of all the getter and setter functions. Moved all the
+        enumeration types out of this class to the WebCore namespace level
+        and gave them all the names and values that match the ones from the
+        IDL file.
+
+        * Modules/fetch/FetchRequest.cpp:
+        (WebCore::setReferrerPolicy): Updated for the changes to FetchOptions.
+        The string matching here will likely go away when we change dictionary
+        so it sets up a structure, which will parse the enumeration values, but
+        that won't be for a while, so this stays for now.
+        (WebCore::setMode): Ditto.
+        (WebCore::setCredentials): Ditto.
+        (WebCore::setCache): Ditto.
+        (WebCore::setRedirect): Ditto.
+        (WebCore::buildOptions): Updated for changes to FetchOptions.
+        (WebCore::buildHeaders): Ditto.
+        (WebCore::FetchRequest::create): Ditto.
+        (WebCore::FetchRequest::type): Moved this to the header and changed its
+        return type to the enum; it's not just a single return statement.
+        (WebCore::FetchRequest::destination): Ditto.
+        (WebCore::FetchRequest::referrerPolicy): Ditto.
+        (WebCore::FetchRequest::mode): Ditto.
+        (WebCore::FetchRequest::credentials): Ditto.
+        (WebCore::FetchRequest::cache): Ditto.
+        (WebCore::FetchRequest::redirect): Ditto.
+
+        * Modules/fetch/FetchRequest.h: Changed all the getters that return
+        enumerations to return the enum class values instead of strings.
+        Put all the inline versions here in the header.
+
+        * bindings/scripts/CodeGenerator.pm: Removed the seven enum types that
+        are in FetchRequest.idl from the list of &quot;string-based&quot; enums.
+
+        * dom/Document.cpp:
+        (WebCore::Document::Document): Updated for the change where I
+        renamed ReferrerPolicy to ReferrerHeaderPolicy, at least for now.
+        (WebCore::Document::processReferrerPolicy): Ditto.
+        (WebCore::Document::applyContentDispositionAttachmentSandbox): Ditto.
+        * dom/Document.h: Ditto.
+        * loader/FrameNetworkingContext.h: Ditto.
+        * page/SecurityPolicy.cpp:
+        (WebCore::SecurityPolicy::generateReferrerHeader): Ditto.
+        * page/SecurityPolicy.h: Ditto.
+
+        * platform/ReferrerPolicy.h: Renamed this enum from ReferrerPolicy to
+        ReferrerHeaderPolicy, since the one specified in the Fetch API has the
+        name ReferrerPolicy. I think the best way to resolve this longer term is
+        to merge them since they really do represent the same concept, although
+        the one from the Fetch API has a few more features.
+
</ins><span class="cx"> 2016-05-01  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed attempt to fix Windows build after r200288.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchOptionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchOptions.h (200312 => 200313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchOptions.h        2016-05-01 21:30:50 UTC (rev 200312)
+++ trunk/Source/WebCore/Modules/fetch/FetchOptions.h        2016-05-02 00:17:55 UTC (rev 200313)
</span><span class="lines">@@ -26,107 +26,30 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef FetchOptions_h
-#define FetchOptions_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(FETCH_API)
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class FetchOptions {
-public:
-    enum class Type {
-        Default,
-        Audio,
-        Font,
-        Image,
-        Script,
-        Style,
-        Track,
-        Video
-    };
-    enum class Destination {
-        Default,
-        Document,
-        SharedWorker,
-        Subresource,
-        Unknown,
-        Worker
-    };
-    enum class Mode {
-        NoCors,
-        Navigate,
-        SameOrigin,
-        Cors
-    };
-    enum class Credentials {
-        Omit,
-        SameOrigin,
-        Include
-    };
-    enum class Cache {
-        Default,
-        NoStore,
-        Reload,
-        NoCache,
-        ForceCache,
-    };
-    enum class Redirect {
-        Follow,
-        Error,
-        Manual
-    };
-    enum class ReferrerPolicy {
-        Empty,
-        NoReferrer,
-        NoReferrerWhenDowngrade,
-        OriginOnly,
-        OriginWhenCrossOrigin,
-        UnsafeURL
-    };
</del><ins>+enum class ReferrerPolicy { EmptyString, NoReferrer, NoReferrerWhenDowngrade, OriginOnly, OriginWhenCrossOrigin, UnsafeUrl };
+enum class RequestCache { Default, NoStore, Reload, NoCache, ForceCache };
+enum class RequestCredentials { Omit, SameOrigin, Include };
+enum class RequestDestination { EmptyString, Document, Sharedworker, Subresource, Unknown, Worker };
+enum class RequestMode { Navigate, SameOrigin, NoCors, Cors };
+enum class RequestRedirect { Follow, Error, Manual };
+enum class RequestType { EmptyString, Audio, Font, Image, Script, Style, Track, Video };
</ins><span class="cx"> 
</span><del>-    FetchOptions() { }
-    FetchOptions(Type, Destination, Mode, Credentials, Cache, Redirect, ReferrerPolicy);
-
-    Type type() const { return m_type; }
-    Destination destination() const { return m_destination; }
-    Mode mode() const { return m_mode; }
-    Credentials credentials() const { return m_credentials; }
-    Cache cache() const { return m_cache; }
-    Redirect redirect() const { return m_redirect; }
-    ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; }
-
-    void setType(Type type) { m_type = type; }
-    void setDestination(Destination destination) { m_destination = destination; }
-    void setMode(Mode mode) { m_mode = mode; }
-    void setCredentials(Credentials credentials) { m_credentials = credentials; }
-    void setCache(Cache cache) { m_cache = cache; }
-    void setRedirect(Redirect redirect) { m_redirect = redirect; }
-    void setReferrerPolicy(ReferrerPolicy referrerPolicy) { m_referrerPolicy = referrerPolicy; }
-
-private:
-    Type m_type = Type::Default;
-    Destination m_destination = Destination::Default;
-    Mode m_mode = Mode::NoCors;
-    Credentials m_credentials = Credentials::Omit;
-    Cache m_cache = Cache::Default;
-    Redirect m_redirect = Redirect:: Follow;
-    ReferrerPolicy m_referrerPolicy = ReferrerPolicy::Empty;
</del><ins>+struct FetchOptions {
+    RequestType type { RequestType::EmptyString };
+    RequestDestination destination { RequestDestination::EmptyString };
+    RequestMode mode { RequestMode::NoCors };
+    RequestCredentials credentials { RequestCredentials::Omit };
+    RequestCache cache { RequestCache::Default };
+    RequestRedirect redirect { RequestRedirect::Follow };
+    ReferrerPolicy referrerPolicy { ReferrerPolicy::EmptyString };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-inline FetchOptions::FetchOptions(Type type, Destination destination, Mode mode, Credentials credentials, Cache cache, Redirect redirect, ReferrerPolicy referrerPolicy)
-    : m_type(type)
-    , m_destination(destination)
-    , m_mode(mode)
-    , m_credentials(credentials)
-    , m_cache(cache)
-    , m_redirect(redirect)
-    , m_referrerPolicy(referrerPolicy)
-{
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(FETCH_API)
</span><del>-
-#endif // FetchOptions_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp (200312 => 200313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp        2016-05-01 21:30:50 UTC (rev 200312)
+++ trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp        2016-05-02 00:17:55 UTC (rev 200313)
</span><span class="lines">@@ -42,17 +42,17 @@
</span><span class="cx"> static bool setReferrerPolicy(FetchOptions&amp; options, const String&amp; referrerPolicy)
</span><span class="cx"> {
</span><span class="cx">     if (referrerPolicy.isEmpty())
</span><del>-        options.setReferrerPolicy(FetchOptions::ReferrerPolicy::Empty);
</del><ins>+        options.referrerPolicy = ReferrerPolicy::EmptyString;
</ins><span class="cx">     else if (referrerPolicy == &quot;no-referrer&quot;)
</span><del>-        options.setReferrerPolicy(FetchOptions::ReferrerPolicy::NoReferrer);
</del><ins>+        options.referrerPolicy = ReferrerPolicy::NoReferrer;
</ins><span class="cx">     else if (referrerPolicy == &quot;no-referrer-when-downgrade&quot;)
</span><del>-        options.setReferrerPolicy(FetchOptions::ReferrerPolicy::NoReferrerWhenDowngrade);
</del><ins>+        options.referrerPolicy = ReferrerPolicy::NoReferrerWhenDowngrade;
</ins><span class="cx">     else if (referrerPolicy == &quot;origin-only&quot;)
</span><del>-        options.setReferrerPolicy(FetchOptions::ReferrerPolicy::OriginOnly);
</del><ins>+        options.referrerPolicy = ReferrerPolicy::OriginOnly;
</ins><span class="cx">     else if (referrerPolicy == &quot;origin-when-cross-origin&quot;)
</span><del>-        options.setReferrerPolicy(FetchOptions::ReferrerPolicy::OriginWhenCrossOrigin);
</del><ins>+        options.referrerPolicy = ReferrerPolicy::OriginWhenCrossOrigin;
</ins><span class="cx">     else if (referrerPolicy == &quot;unsafe-url&quot;)
</span><del>-        options.setReferrerPolicy(FetchOptions::ReferrerPolicy::UnsafeURL);
</del><ins>+        options.referrerPolicy = ReferrerPolicy::UnsafeUrl;
</ins><span class="cx">     else
</span><span class="cx">         return false;
</span><span class="cx">     return true;
</span><span class="lines">@@ -61,13 +61,13 @@
</span><span class="cx"> static bool setMode(FetchOptions&amp; options, const String&amp; mode)
</span><span class="cx"> {
</span><span class="cx">     if (mode == &quot;navigate&quot;)
</span><del>-        options.setMode(FetchOptions::Mode::Navigate);
</del><ins>+        options.mode = RequestMode::Navigate;
</ins><span class="cx">     else if (mode == &quot;same-origin&quot;)
</span><del>-        options.setMode(FetchOptions::Mode::SameOrigin);
</del><ins>+        options.mode = RequestMode::SameOrigin;
</ins><span class="cx">     else if (mode == &quot;no-cors&quot;)
</span><del>-        options.setMode(FetchOptions::Mode::NoCors);
</del><ins>+        options.mode = RequestMode::NoCors;
</ins><span class="cx">     else if (mode == &quot;cors&quot;)
</span><del>-        options.setMode(FetchOptions::Mode::Cors);
</del><ins>+        options.mode = RequestMode::Cors;
</ins><span class="cx">     else
</span><span class="cx">         return false;
</span><span class="cx">     return true;
</span><span class="lines">@@ -76,11 +76,11 @@
</span><span class="cx"> static bool setCredentials(FetchOptions&amp; options, const String&amp; credentials)
</span><span class="cx"> {
</span><span class="cx">     if (credentials == &quot;omit&quot;)
</span><del>-        options.setCredentials(FetchOptions::Credentials::Omit);
</del><ins>+        options.credentials = RequestCredentials::Omit;
</ins><span class="cx">     else if (credentials == &quot;same-origin&quot;)
</span><del>-        options.setCredentials(FetchOptions::Credentials::SameOrigin);
</del><ins>+        options.credentials = RequestCredentials::SameOrigin;
</ins><span class="cx">     else if (credentials == &quot;include&quot;)
</span><del>-        options.setCredentials(FetchOptions::Credentials::Include);
</del><ins>+        options.credentials = RequestCredentials::Include;
</ins><span class="cx">     else
</span><span class="cx">         return false;
</span><span class="cx">     return true;
</span><span class="lines">@@ -89,15 +89,15 @@
</span><span class="cx"> static bool setCache(FetchOptions&amp; options, const String&amp; cache)
</span><span class="cx"> {
</span><span class="cx">     if (cache == &quot;default&quot;)
</span><del>-        options.setCache(FetchOptions::Cache::Default);
</del><ins>+        options.cache = RequestCache::Default;
</ins><span class="cx">     else if (cache == &quot;no-store&quot;)
</span><del>-        options.setCache(FetchOptions::Cache::NoStore);
</del><ins>+        options.cache = RequestCache::NoStore;
</ins><span class="cx">     else if (cache == &quot;reload&quot;)
</span><del>-        options.setCache(FetchOptions::Cache::Reload);
</del><ins>+        options.cache = RequestCache::Reload;
</ins><span class="cx">     else if (cache == &quot;no-cache&quot;)
</span><del>-        options.setCache(FetchOptions::Cache::NoCache);
</del><ins>+        options.cache = RequestCache::NoCache;
</ins><span class="cx">     else if (cache == &quot;force-cache&quot;)
</span><del>-        options.setCache(FetchOptions::Cache::ForceCache);
</del><ins>+        options.cache = RequestCache::ForceCache;
</ins><span class="cx">     else
</span><span class="cx">         return false;
</span><span class="cx">     return true;
</span><span class="lines">@@ -106,11 +106,11 @@
</span><span class="cx"> static bool setRedirect(FetchOptions&amp; options, const String&amp; redirect)
</span><span class="cx"> {
</span><span class="cx">     if (redirect == &quot;follow&quot;)
</span><del>-        options.setRedirect(FetchOptions::Redirect::Follow);
</del><ins>+        options.redirect = RequestRedirect::Follow;
</ins><span class="cx">     else if (redirect == &quot;error&quot;)
</span><del>-        options.setRedirect(FetchOptions::Redirect::Error);
</del><ins>+        options.redirect = RequestRedirect::Error;
</ins><span class="cx">     else if (redirect == &quot;manual&quot;)
</span><del>-        options.setRedirect(FetchOptions::Redirect::Manual);
</del><ins>+        options.redirect = RequestRedirect::Manual;
</ins><span class="cx">     else
</span><span class="cx">         return false;
</span><span class="cx">     return true;
</span><span class="lines">@@ -173,7 +173,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (init.get(&quot;mode&quot;, value) &amp;&amp; !setMode(request.options, value))
</span><span class="cx">         return false;
</span><del>-    if (request.options.mode() == FetchOptions::Mode::Navigate)
</del><ins>+    if (request.options.mode == RequestMode::Navigate)
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (init.get(&quot;credentials&quot;, value) &amp;&amp; !setCredentials(request.options, value))
</span><span class="lines">@@ -196,7 +196,7 @@
</span><span class="cx"> static RefPtr&lt;FetchHeaders&gt; buildHeaders(const Dictionary&amp; init, const FetchRequest::InternalRequest&amp; request, const FetchHeaders* inputHeaders = nullptr)
</span><span class="cx"> {
</span><span class="cx">     FetchHeaders::Guard guard = FetchHeaders::Guard::Request;
</span><del>-    if (request.options.mode() == FetchOptions::Mode::NoCors) {
</del><ins>+    if (request.options.mode == RequestMode::NoCors) {
</ins><span class="cx">         const String&amp; method = request.request.httpMethod();
</span><span class="cx">         if (method != &quot;GET&quot; &amp;&amp; method != &quot;POST&quot; &amp;&amp; method != &quot;HEAD&quot;)
</span><span class="cx">             return nullptr;
</span><span class="lines">@@ -244,8 +244,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     FetchRequest::InternalRequest internalRequest;
</span><del>-    internalRequest.options.setMode(FetchOptions::Mode::Cors);
-    internalRequest.options.setCredentials(FetchOptions::Credentials::Omit);
</del><ins>+    internalRequest.options.mode = RequestMode::Cors;
+    internalRequest.options.credentials = RequestCredentials::Omit;
</ins><span class="cx">     internalRequest.referrer = ASCIILiteral(&quot;client&quot;);
</span><span class="cx">     internalRequest.request.setURL(requestURL);
</span><span class="cx"> 
</span><span class="lines">@@ -301,70 +301,6 @@
</span><span class="cx">     return adoptRef(*new FetchRequest(context, WTFMove(body), headers.releaseNonNull(), WTFMove(internalRequest)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String FetchRequest::type() const
-{
-    switch (m_internalRequest.options.type()) {
-    case FetchOptions::Type::Default:
-        return String();
-    case FetchOptions::Type::Audio :
-        return ASCIILiteral(&quot;audio&quot;);
-    case FetchOptions::Type::Font :
-        return ASCIILiteral(&quot;font&quot;);
-    case FetchOptions::Type::Image :
-        return ASCIILiteral(&quot;image&quot;);
-    case FetchOptions::Type::Script :
-        return ASCIILiteral(&quot;script&quot;);
-    case FetchOptions::Type::Style :
-        return ASCIILiteral(&quot;style&quot;);
-    case FetchOptions::Type::Track :
-        return ASCIILiteral(&quot;track&quot;);
-    case FetchOptions::Type::Video :
-        return ASCIILiteral(&quot;video&quot;);
-    };
-    ASSERT_NOT_REACHED();
-    return String();
-}
-
-String FetchRequest::destination() const
-{
-    switch (m_internalRequest.options.destination()) {
-    case FetchOptions::Destination::Default:
-        return String();
-    case FetchOptions::Destination::Document:
-        return ASCIILiteral(&quot;document&quot;);
-    case FetchOptions::Destination::SharedWorker:
-        return ASCIILiteral(&quot;sharedworker&quot;);
-    case FetchOptions::Destination::Subresource:
-        return ASCIILiteral(&quot;subresource&quot;);
-    case FetchOptions::Destination::Unknown:
-        return ASCIILiteral(&quot;unknown&quot;);
-    case FetchOptions::Destination::Worker:
-        return ASCIILiteral(&quot;worker&quot;);
-    }
-    ASSERT_NOT_REACHED();
-    return String();
-}
-
-String FetchRequest::referrerPolicy() const
-{
-    switch (m_internalRequest.options.referrerPolicy()) {
-    case FetchOptions::ReferrerPolicy::Empty:
-        return String();
-    case FetchOptions::ReferrerPolicy::NoReferrer:
-        return ASCIILiteral(&quot;no-referrer&quot;);
-    case FetchOptions::ReferrerPolicy::NoReferrerWhenDowngrade:
-        return ASCIILiteral(&quot;no-referrer-when-downgrade&quot;);
-    case FetchOptions::ReferrerPolicy::OriginOnly:
-        return ASCIILiteral(&quot;origin-only&quot;);
-    case FetchOptions::ReferrerPolicy::OriginWhenCrossOrigin:
-        return ASCIILiteral(&quot;origin-when-cross-origin&quot;);
-    case FetchOptions::ReferrerPolicy::UnsafeURL:
-        return ASCIILiteral(&quot;unsafe-url&quot;);
-    }
-    ASSERT_NOT_REACHED();
-    return String();
-}
-
</del><span class="cx"> String FetchRequest::referrer() const
</span><span class="cx"> {
</span><span class="cx">     if (m_internalRequest.referrer == &quot;no-referrer&quot;)
</span><span class="lines">@@ -374,68 +310,6 @@
</span><span class="cx">     return m_internalRequest.referrer;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String FetchRequest::mode() const
-{
-    switch (m_internalRequest.options.mode()) {
-    case FetchOptions::Mode::Navigate:
-        return ASCIILiteral(&quot;navigate&quot;);
-    case FetchOptions::Mode::SameOrigin:
-        return ASCIILiteral(&quot;same-origin&quot;);
-    case FetchOptions::Mode::NoCors:
-        return ASCIILiteral(&quot;no-cors&quot;);
-    case FetchOptions::Mode::Cors:
-        return ASCIILiteral(&quot;cors&quot;);
-    };
-    ASSERT_NOT_REACHED();
-    return String();
-}
-
-String FetchRequest::credentials() const
-{
-    switch (m_internalRequest.options.credentials()) {
-    case FetchOptions::Credentials::Omit:
-        return ASCIILiteral(&quot;omit&quot;);
-    case FetchOptions::Credentials::SameOrigin:
-        return ASCIILiteral(&quot;same-origin&quot;);
-    case FetchOptions::Credentials::Include:
-        return ASCIILiteral(&quot;include&quot;);
-    };
-    ASSERT_NOT_REACHED();
-    return String();
-}
-
-String FetchRequest::cache() const
-{
-    switch (m_internalRequest.options.cache()) {
-    case FetchOptions::Cache::Default:
-        return ASCIILiteral(&quot;default&quot;);
-    case FetchOptions::Cache::NoStore:
-        return ASCIILiteral(&quot;no-store&quot;);
-    case FetchOptions::Cache::Reload:
-        return ASCIILiteral(&quot;reload&quot;);
-    case FetchOptions::Cache::NoCache:
-        return ASCIILiteral(&quot;no-cache&quot;);
-    case FetchOptions::Cache::ForceCache:
-        return ASCIILiteral(&quot;force-cache&quot;);
-    }
-    ASSERT_NOT_REACHED();
-    return String();
-}
-
-String FetchRequest::redirect() const
-{
-    switch (m_internalRequest.options.redirect()) {
-    case FetchOptions::Redirect::Follow:
-        return ASCIILiteral(&quot;follow&quot;);
-    case FetchOptions::Redirect::Error:
-        return ASCIILiteral(&quot;error&quot;);
-    case FetchOptions::Redirect::Manual:
-        return ASCIILiteral(&quot;manual&quot;);
-    }
-    ASSERT_NOT_REACHED();
-    return String();
-}
-
</del><span class="cx"> ResourceRequest FetchRequest::internalRequest() const
</span><span class="cx"> {
</span><span class="cx">     ResourceRequest request = m_internalRequest.request;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchRequest.h (200312 => 200313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchRequest.h        2016-05-01 21:30:50 UTC (rev 200312)
+++ trunk/Source/WebCore/Modules/fetch/FetchRequest.h        2016-05-02 00:17:55 UTC (rev 200313)
</span><span class="lines">@@ -48,19 +48,18 @@
</span><span class="cx">     static RefPtr&lt;FetchRequest&gt; create(ScriptExecutionContext&amp;, FetchRequest&amp;, const Dictionary&amp;, ExceptionCode&amp;);
</span><span class="cx">     static RefPtr&lt;FetchRequest&gt; create(ScriptExecutionContext&amp;, const String&amp;, const Dictionary&amp;, ExceptionCode&amp;);
</span><span class="cx"> 
</span><del>-    // Request API
</del><span class="cx">     const String&amp; method() const { return m_internalRequest.request.httpMethod(); }
</span><span class="cx">     const String&amp; url() const { return m_internalRequest.request.url().string(); }
</span><span class="cx">     FetchHeaders&amp; headers() { return m_headers.get(); }
</span><span class="cx"> 
</span><del>-    String type() const;
-    String destination() const;
</del><ins>+    RequestType type() const;
+    RequestDestination destination() const;
</ins><span class="cx">     String referrer() const;
</span><del>-    String referrerPolicy() const;
-    String mode() const;
-    String credentials() const;
-    String cache() const;
-    String redirect() const;
</del><ins>+    ReferrerPolicy referrerPolicy() const;
+    RequestMode mode() const;
+    RequestCredentials credentials() const;
+    RequestCache cache() const;
+    RequestRedirect redirect() const;
</ins><span class="cx">     const String&amp; integrity() const { return m_internalRequest.integrity; }
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;FetchRequest&gt; clone(ScriptExecutionContext&amp;, ExceptionCode&amp;);
</span><span class="lines">@@ -93,6 +92,41 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline RequestCache FetchRequest::cache() const
+{
+    return m_internalRequest.options.cache;
+}
+
+inline RequestCredentials FetchRequest::credentials() const
+{
+    return m_internalRequest.options.credentials;
+}
+
+inline RequestDestination FetchRequest::destination() const
+{
+    return m_internalRequest.options.destination;
+}
+
+inline RequestMode FetchRequest::mode() const
+{
+    return m_internalRequest.options.mode;
+}
+
+inline RequestRedirect FetchRequest::redirect() const
+{
+    return m_internalRequest.options.redirect;
+}
+
+inline ReferrerPolicy FetchRequest::referrerPolicy() const
+{
+    return m_internalRequest.options.referrerPolicy;
+}
+
+inline RequestType FetchRequest::type() const
+{
+    return m_internalRequest.options.type;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(FETCH_API)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (200312 => 200313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-05-01 21:30:50 UTC (rev 200312)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-05-02 00:17:55 UTC (rev 200313)
</span><span class="lines">@@ -133,13 +133,6 @@
</span><span class="cx"> # enumeration to using an actual enum class in the C++. Once that is done, we should
</span><span class="cx"> # remove this hash and the function that calls it.
</span><span class="cx"> my %stringBasedEnumerationHash = (
</span><del>-    &quot;ReferrerPolicy&quot; =&gt; 1,
-    &quot;RequestCache&quot; =&gt; 1,
-    &quot;RequestCredentials&quot; =&gt; 1,
-    &quot;RequestDestination&quot; =&gt; 1,
-    &quot;RequestMode&quot; =&gt; 1,
-    &quot;RequestRedirect&quot; =&gt; 1,
-    &quot;RequestType&quot; =&gt; 1,
</del><span class="cx">     &quot;TextTrackKind&quot; =&gt; 1,
</span><span class="cx">     &quot;TextTrackMode&quot; =&gt; 1,
</span><span class="cx"> );
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (200312 => 200313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-05-01 21:30:50 UTC (rev 200312)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-05-02 00:17:55 UTC (rev 200313)
</span><span class="lines">@@ -521,7 +521,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     , m_loadEventDelayCount(0)
</span><span class="cx">     , m_loadEventDelayTimer(*this, &amp;Document::loadEventDelayTimerFired)
</span><del>-    , m_referrerPolicy(ReferrerPolicyDefault)
</del><ins>+    , m_referrerPolicy(ReferrerHeaderPolicy::Default)
</ins><span class="cx">     , m_writeRecursionIsTooDeep(false)
</span><span class="cx">     , m_writeRecursionDepth(0)
</span><span class="cx">     , m_lastHandledUserGestureTimestamp(0)
</span><span class="lines">@@ -3360,16 +3360,16 @@
</span><span class="cx">     // Note that we're supporting both the standard and legacy keywords for referrer
</span><span class="cx">     // policies, as defined by http://www.w3.org/TR/referrer-policy/#referrer-policy-delivery-meta
</span><span class="cx">     if (equalLettersIgnoringASCIICase(policy, &quot;no-referrer&quot;) || equalLettersIgnoringASCIICase(policy, &quot;never&quot;))
</span><del>-        setReferrerPolicy(ReferrerPolicyNever);
</del><ins>+        setReferrerPolicy(ReferrerHeaderPolicy::Never);
</ins><span class="cx">     else if (equalLettersIgnoringASCIICase(policy, &quot;unsafe-url&quot;) || equalLettersIgnoringASCIICase(policy, &quot;always&quot;))
</span><del>-        setReferrerPolicy(ReferrerPolicyAlways);
</del><ins>+        setReferrerPolicy(ReferrerHeaderPolicy::Always);
</ins><span class="cx">     else if (equalLettersIgnoringASCIICase(policy, &quot;origin&quot;))
</span><del>-        setReferrerPolicy(ReferrerPolicyOrigin);
</del><ins>+        setReferrerPolicy(ReferrerHeaderPolicy::Origin);
</ins><span class="cx">     else if (equalLettersIgnoringASCIICase(policy, &quot;no-referrer-when-downgrade&quot;) || equalLettersIgnoringASCIICase(policy, &quot;default&quot;))
</span><del>-        setReferrerPolicy(ReferrerPolicyDefault);
</del><ins>+        setReferrerPolicy(ReferrerHeaderPolicy::Default);
</ins><span class="cx">     else {
</span><span class="cx">         addConsoleMessage(MessageSource::Rendering, MessageLevel::Error, &quot;Failed to set referrer policy: The value '&quot; + policy + &quot;' is not one of 'no-referrer', 'origin', 'no-referrer-when-downgrade', or 'unsafe-url'. Defaulting to 'no-referrer'.&quot;);
</span><del>-        setReferrerPolicy(ReferrerPolicyNever);
</del><ins>+        setReferrerPolicy(ReferrerHeaderPolicy::Never);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -6937,7 +6937,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(shouldEnforceContentDispositionAttachmentSandbox());
</span><span class="cx"> 
</span><del>-    setReferrerPolicy(ReferrerPolicyNever);
</del><ins>+    setReferrerPolicy(ReferrerHeaderPolicy::Never);
</ins><span class="cx">     if (!isMediaDocument())
</span><span class="cx">         enforceSandboxFlags(SandboxAll);
</span><span class="cx">     else
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (200312 => 200313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-05-01 21:30:50 UTC (rev 200312)
+++ trunk/Source/WebCore/dom/Document.h        2016-05-02 00:17:55 UTC (rev 200313)
</span><span class="lines">@@ -361,8 +361,8 @@
</span><span class="cx">     bool didDispatchViewportPropertiesChanged() const { return m_didDispatchViewportPropertiesChanged; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void setReferrerPolicy(ReferrerPolicy referrerPolicy) { m_referrerPolicy = referrerPolicy; }
-    ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; }
</del><ins>+    void setReferrerPolicy(ReferrerHeaderPolicy referrerPolicy) { m_referrerPolicy = referrerPolicy; }
+    ReferrerHeaderPolicy referrerPolicy() const { return m_referrerPolicy; }
</ins><span class="cx"> 
</span><span class="cx">     DocumentType* doctype() const;
</span><span class="cx"> 
</span><span class="lines">@@ -1640,7 +1640,7 @@
</span><span class="cx"> 
</span><span class="cx">     ViewportArguments m_viewportArguments;
</span><span class="cx"> 
</span><del>-    ReferrerPolicy m_referrerPolicy;
</del><ins>+    ReferrerHeaderPolicy m_referrerPolicy;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_TIMING)
</span><span class="cx">     DocumentTiming m_documentTiming;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameNetworkingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameNetworkingContext.h (200312 => 200313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameNetworkingContext.h        2016-05-01 21:30:50 UTC (rev 200312)
+++ trunk/Source/WebCore/loader/FrameNetworkingContext.h        2016-05-02 00:17:55 UTC (rev 200313)
</span><span class="lines">@@ -17,8 +17,7 @@
</span><span class="cx">     Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx"> 
</span><del>-#ifndef FrameNetworkingContext_h
-#define FrameNetworkingContext_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="lines">@@ -40,7 +39,7 @@
</span><span class="cx">         if (!m_frame)
</span><span class="cx">             return true;
</span><span class="cx"> 
</span><del>-        return m_frame-&gt;document()-&gt;referrerPolicy() == ReferrerPolicyDefault;
</del><ins>+        return m_frame-&gt;document()-&gt;referrerPolicy() == ReferrerHeaderPolicy::Default;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="lines">@@ -58,5 +57,3 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><del>-
-#endif // FrameNetworkingContext_h
</del></span></pre></div>
<a id="trunkSourceWebCorepageSecurityPolicycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/SecurityPolicy.cpp (200312 => 200313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/SecurityPolicy.cpp        2016-05-01 21:30:50 UTC (rev 200312)
+++ trunk/Source/WebCore/page/SecurityPolicy.cpp        2016-05-02 00:17:55 UTC (rev 200313)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">     return !URLIsSecureURL;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String SecurityPolicy::generateReferrerHeader(ReferrerPolicy referrerPolicy, const URL&amp; url, const String&amp; referrer)
</del><ins>+String SecurityPolicy::generateReferrerHeader(ReferrerHeaderPolicy referrerPolicy, const URL&amp; url, const String&amp; referrer)
</ins><span class="cx"> {
</span><span class="cx">     if (referrer.isEmpty())
</span><span class="cx">         return String();
</span><span class="lines">@@ -75,11 +75,11 @@
</span><span class="cx">         return String();
</span><span class="cx"> 
</span><span class="cx">     switch (referrerPolicy) {
</span><del>-    case ReferrerPolicyNever:
</del><ins>+    case ReferrerHeaderPolicy::Never:
</ins><span class="cx">         return String();
</span><del>-    case ReferrerPolicyAlways:
</del><ins>+    case ReferrerHeaderPolicy::Always:
</ins><span class="cx">         return referrer;
</span><del>-    case ReferrerPolicyOrigin: {
</del><ins>+    case ReferrerHeaderPolicy::Origin: {
</ins><span class="cx">         String origin = SecurityOrigin::createFromString(referrer)-&gt;toString();
</span><span class="cx">         if (origin == &quot;null&quot;)
</span><span class="cx">             return String();
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">         // to turn it into a canonical URL we can use as referrer.
</span><span class="cx">         return origin + &quot;/&quot;;
</span><span class="cx">     }
</span><del>-    case ReferrerPolicyDefault:
</del><ins>+    case ReferrerHeaderPolicy::Default:
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageSecurityPolicyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/SecurityPolicy.h (200312 => 200313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/SecurityPolicy.h        2016-05-01 21:30:50 UTC (rev 200312)
+++ trunk/Source/WebCore/page/SecurityPolicy.h        2016-05-02 00:17:55 UTC (rev 200313)
</span><span class="lines">@@ -26,28 +26,26 @@
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef SecurityPolicy_h
-#define SecurityPolicy_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;ReferrerPolicy.h&quot;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class URL;
</del><span class="cx"> class SecurityOrigin;
</span><ins>+class URL;
</ins><span class="cx"> 
</span><span class="cx"> class SecurityPolicy {
</span><span class="cx"> public:
</span><del>-    // True if the referrer should be omitted according to the
-    // ReferrerPolicyDefault. If you intend to send a referrer header, you
-    // should use generateReferrerHeader instead.
</del><ins>+    // True if the referrer should be omitted according to ReferrerHeaderPolicy::Default.
+    // If you intend to send a referrer header, you should use generateReferrerHeader instead.
</ins><span class="cx">     WEBCORE_EXPORT static bool shouldHideReferrer(const URL&amp;, const String&amp; referrer);
</span><span class="cx"> 
</span><span class="cx">     // Returns the referrer modified according to the referrer policy for a
</span><span class="cx">     // navigation to a given URL. If the referrer returned is empty, the
</span><span class="cx">     // referrer header should be omitted.
</span><del>-    WEBCORE_EXPORT static String generateReferrerHeader(ReferrerPolicy, const URL&amp;, const String&amp; referrer);
</del><ins>+    WEBCORE_EXPORT static String generateReferrerHeader(ReferrerHeaderPolicy, const URL&amp;, const String&amp; referrer);
</ins><span class="cx"> 
</span><span class="cx">     enum LocalLoadPolicy {
</span><span class="cx">         AllowLocalLoadsForAll, // No restriction on local loads.
</span><span class="lines">@@ -68,5 +66,3 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // SecurityPolicy_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformReferrerPolicyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ReferrerPolicy.h (200312 => 200313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ReferrerPolicy.h        2016-05-01 21:30:50 UTC (rev 200312)
+++ trunk/Source/WebCore/platform/ReferrerPolicy.h        2016-05-02 00:17:55 UTC (rev 200313)
</span><span class="lines">@@ -29,20 +29,22 @@
</span><span class="cx">  *
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef ReferrerPolicy_h
-#define ReferrerPolicy_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-enum ReferrerPolicy {
-    ReferrerPolicyAlways,
-    ReferrerPolicyDefault,
-    ReferrerPolicyNever,
-    // Same as ReferrerPolicyAlways, except that only the origin of the
-    // referring URL is send.
-    ReferrerPolicyOrigin,
</del><ins>+// The following is needed to compile on GTK because of a macro defined in X11.h.
+// FIXME: Move this workaround to a global location, perhaps config.h; maybe a GTK-specific location.
+#undef Always
+
+// FIXME: Merge this with the ReferrerPolicy defined in the Fetch specification.
+// FIXME: Rename back to ReferrerPolicy even before that, if we find a way.
+enum class ReferrerHeaderPolicy {
+    Always,
+    Default,
+    Never,
+    // Same as Always, except that only the origin of the referring URL is sent.
+    Origin,
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><del>-
-#endif // ReferrerPolicy_h
</del></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (200312 => 200313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-05-01 21:30:50 UTC (rev 200312)
+++ trunk/Source/WebKit2/ChangeLog        2016-05-02 00:17:55 UTC (rev 200313)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-05-01  Darin Adler  &lt;darin@apple.com&gt;
+
+        Update Fetch to use enum class instead of string for enumerations
+        https://bugs.webkit.org/show_bug.cgi?id=157241
+
+        Reviewed by Chris Dumez.
+
+        * WebProcess/Network/WebLoaderStrategy.cpp:
+        (WebKit::WebLoaderStrategy::loadResource): Updated for the change where I
+        renamed ReferrerPolicy to ReferrerHeaderPolicy, at least for now.
+        (WebKit::WebLoaderStrategy::schedulePluginStreamLoad): Ditto.
+
</ins><span class="cx"> 2016-05-01  Konstantin Tokarev  &lt;annulen@yandex.ru&gt;
</span><span class="cx"> 
</span><span class="cx">         Fixed build with !ENABLED(DATABASE_PROCESS).
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkWebLoaderStrategycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp (200312 => 200313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp        2016-05-01 21:30:50 UTC (rev 200312)
+++ trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp        2016-05-02 00:17:55 UTC (rev 200313)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;SubresourceLoader&gt; loader = SubresourceLoader::create(frame, resource, request, options);
</span><span class="cx">     if (loader)
</span><del>-        scheduleLoad(loader.get(), resource, frame-&gt;document()-&gt;referrerPolicy() == ReferrerPolicyDefault);
</del><ins>+        scheduleLoad(loader.get(), resource, frame-&gt;document()-&gt;referrerPolicy() == ReferrerHeaderPolicy::Default);
</ins><span class="cx">     return loader;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;NetscapePlugInStreamLoader&gt; loader = NetscapePlugInStreamLoader::create(frame, client, request);
</span><span class="cx">     if (loader)
</span><del>-        scheduleLoad(loader.get(), 0, frame-&gt;document()-&gt;referrerPolicy() == ReferrerPolicyDefault);
</del><ins>+        scheduleLoad(loader.get(), 0, frame-&gt;document()-&gt;referrerPolicy() == ReferrerHeaderPolicy::Default);
</ins><span class="cx">     return loader;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>