<!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>[209231] 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/209231">209231</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-12-01 21:31:07 -0800 (Thu, 01 Dec 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Stop using WebCore::Dictionary in bindings for Fetch
https://bugs.webkit.org/show_bug.cgi?id=165241
Reviewed by Chris Dumez.
* Modules/fetch/DOMWindowFetch.idl: Use RequestInit instead of Dictionary.
No effect on code generated since this is a JSBuiltin.
* Modules/fetch/FetchRequest.cpp:
(WebCore::setReferrerPolicy): Deleted. Bindings handle this now.
(WebCore::setMode): Ditto.
(WebCore::setCredentials): Ditto.
(WebCore::setCache): Ditto.
(WebCore::setRedirect): Ditto.
(WebCore::setReferrer): Changed argument from Dictionary to String.
(WebCore::buildOptions): Changed argument from Dictionary to FetchRequest::Init,
and simplified the code accordingly.
(WebCore::FetchRequest::initializeOptions): Ditto.
(WebCore::FetchRequest::initializeWith): Ditto.
* Modules/fetch/FetchRequest.h: Updated for above changes. Also added the Init struct.
* Modules/fetch/FetchRequest.idl: Added missing "only-if-cached" value to RequestCache.
Added RequestInit dictionary and used it instead of Dictionary. Used more-specific string
types for the method and referrer attributes; no effect at runtime, since the code for
getters is the same for ByteString, USVString, and DOMString and these are read-only.
* Modules/fetch/WorkerGlobalScopeFetch.idl: Use RequestInit instead of Dictionary.
No effect on code generated since this is a JSBuiltin.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchDOMWindowFetchidl">trunk/Source/WebCore/Modules/fetch/DOMWindowFetch.idl</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="#trunkSourceWebCoreModulesfetchFetchRequestidl">trunk/Source/WebCore/Modules/fetch/FetchRequest.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchWorkerGlobalScopeFetchidl">trunk/Source/WebCore/Modules/fetch/WorkerGlobalScopeFetch.idl</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (209230 => 209231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-02 03:30:37 UTC (rev 209230)
+++ trunk/Source/WebCore/ChangeLog        2016-12-02 05:31:07 UTC (rev 209231)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2016-11-30 Darin Adler <darin@apple.com>
+
+ Stop using WebCore::Dictionary in bindings for Fetch
+ https://bugs.webkit.org/show_bug.cgi?id=165241
+
+ Reviewed by Chris Dumez.
+
+ * Modules/fetch/DOMWindowFetch.idl: Use RequestInit instead of Dictionary.
+ No effect on code generated since this is a JSBuiltin.
+
+ * Modules/fetch/FetchRequest.cpp:
+ (WebCore::setReferrerPolicy): Deleted. Bindings handle this now.
+ (WebCore::setMode): Ditto.
+ (WebCore::setCredentials): Ditto.
+ (WebCore::setCache): Ditto.
+ (WebCore::setRedirect): Ditto.
+ (WebCore::setReferrer): Changed argument from Dictionary to String.
+ (WebCore::buildOptions): Changed argument from Dictionary to FetchRequest::Init,
+ and simplified the code accordingly.
+ (WebCore::FetchRequest::initializeOptions): Ditto.
+ (WebCore::FetchRequest::initializeWith): Ditto.
+ * Modules/fetch/FetchRequest.h: Updated for above changes. Also added the Init struct.
+
+ * Modules/fetch/FetchRequest.idl: Added missing "only-if-cached" value to RequestCache.
+ Added RequestInit dictionary and used it instead of Dictionary. Used more-specific string
+ types for the method and referrer attributes; no effect at runtime, since the code for
+ getters is the same for ByteString, USVString, and DOMString and these are read-only.
+
+ * Modules/fetch/WorkerGlobalScopeFetch.idl: Use RequestInit instead of Dictionary.
+ No effect on code generated since this is a JSBuiltin.
+
</ins><span class="cx"> 2016-12-01 Jiewen Tan <jiewen_tan@apple.com>
</span><span class="cx">
</span><span class="cx"> Add a runtime flag for SubtleCrypto
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchDOMWindowFetchidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/DOMWindowFetch.idl (209230 => 209231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/DOMWindowFetch.idl        2016-12-02 03:30:37 UTC (rev 209230)
+++ trunk/Source/WebCore/Modules/fetch/DOMWindowFetch.idl        2016-12-02 05:31:07 UTC (rev 209231)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> Conditional=FETCH_API,
</span><span class="cx"> EnabledAtRuntime=FetchAPI,
</span><span class="cx"> ] partial interface DOMWindow {
</span><del>- [JSBuiltin] Promise<Response> fetch(any input, optional Dictionary init);
-
</del><ins>+ [JSBuiltin] Promise<Response> fetch(any input, optional RequestInit init);
</ins><span class="cx"> [PrivateIdentifier, ImplementedAs=fetch] Promise<Response> fetchRequest(FetchRequest request);
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp (209230 => 209231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp        2016-12-02 03:30:37 UTC (rev 209230)
+++ trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp        2016-12-02 05:31:07 UTC (rev 209231)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FETCH_API)
</span><span class="cx">
</span><del>-#include "Dictionary.h"
</del><span class="cx"> #include "ExceptionCode.h"
</span><span class="cx"> #include "HTTPParsers.h"
</span><span class="cx"> #include "ScriptExecutionContext.h"
</span><span class="lines">@@ -39,85 +38,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-static std::optional<Exception> setReferrerPolicy(FetchOptions& options, const String& referrerPolicy)
-{
- if (referrerPolicy.isEmpty())
- options.referrerPolicy = FetchOptions::ReferrerPolicy::EmptyString;
- else if (referrerPolicy == "no-referrer")
- options.referrerPolicy = FetchOptions::ReferrerPolicy::NoReferrer;
- else if (referrerPolicy == "no-referrer-when-downgrade")
- options.referrerPolicy = FetchOptions::ReferrerPolicy::NoReferrerWhenDowngrade;
- else if (referrerPolicy == "origin")
- options.referrerPolicy = FetchOptions::ReferrerPolicy::Origin;
- else if (referrerPolicy == "origin-when-cross-origin")
- options.referrerPolicy = FetchOptions::ReferrerPolicy::OriginWhenCrossOrigin;
- else if (referrerPolicy == "unsafe-url")
- options.referrerPolicy = FetchOptions::ReferrerPolicy::UnsafeUrl;
- else
- return Exception { TypeError, ASCIILiteral("Bad referrer policy value.") };
- return std::nullopt;
-}
-
-static std::optional<Exception> setMode(FetchOptions& options, const String& mode)
-{
- if (mode == "navigate")
- options.mode = FetchOptions::Mode::Navigate;
- else if (mode == "same-origin")
- options.mode = FetchOptions::Mode::SameOrigin;
- else if (mode == "no-cors")
- options.mode = FetchOptions::Mode::NoCors;
- else if (mode == "cors")
- options.mode = FetchOptions::Mode::Cors;
- else
- return Exception { TypeError, ASCIILiteral("Bad fetch mode value.") };
- return std::nullopt;
-}
-
-static std::optional<Exception> setCredentials(FetchOptions& options, const String& credentials)
-{
- if (credentials == "omit")
- options.credentials = FetchOptions::Credentials::Omit;
- else if (credentials == "same-origin")
- options.credentials = FetchOptions::Credentials::SameOrigin;
- else if (credentials == "include")
- options.credentials = FetchOptions::Credentials::Include;
- else
- return Exception { TypeError, ASCIILiteral("Bad credentials mode value.") };
- return std::nullopt;
-}
-
-static std::optional<Exception> setCache(FetchOptions& options, const String& cache)
-{
- if (cache == "default")
- options.cache = FetchOptions::Cache::Default;
- else if (cache == "no-store")
- options.cache = FetchOptions::Cache::NoStore;
- else if (cache == "reload")
- options.cache = FetchOptions::Cache::Reload;
- else if (cache == "no-cache")
- options.cache = FetchOptions::Cache::NoCache;
- else if (cache == "force-cache")
- options.cache = FetchOptions::Cache::ForceCache;
- else if (cache == "only-if-cached")
- options.cache = FetchOptions::Cache::OnlyIfCached;
- else
- return Exception { TypeError, ASCIILiteral("Bad cache mode value.") };
- return std::nullopt;
-}
-
-static std::optional<Exception> setRedirect(FetchOptions& options, const String& redirect)
-{
- if (redirect == "follow")
- options.redirect = FetchOptions::Redirect::Follow;
- else if (redirect == "error")
- options.redirect = FetchOptions::Redirect::Error;
- else if (redirect == "manual")
- options.redirect = FetchOptions::Redirect::Manual;
- else
- return Exception { TypeError, ASCIILiteral("Bad redirect mode value.") };
- return std::nullopt;
-}
-
</del><span class="cx"> static std::optional<Exception> setMethod(ResourceRequest& request, const String& initMethod)
</span><span class="cx"> {
</span><span class="cx"> if (!isValidHTTPToken(initMethod))
</span><span class="lines">@@ -132,11 +52,8 @@
</span><span class="cx"> return std::nullopt;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static std::optional<Exception> setReferrer(FetchRequest::InternalRequest& request, ScriptExecutionContext& context, const Dictionary& init)
</del><ins>+static std::optional<Exception> setReferrer(FetchRequest::InternalRequest& request, ScriptExecutionContext& context, const String& referrer)
</ins><span class="cx"> {
</span><del>- String referrer;
- if (!init.get("referrer", referrer))
- return std::nullopt;
</del><span class="cx"> if (referrer.isEmpty()) {
</span><span class="cx"> request.referrer = ASCIILiteral("no-referrer");
</span><span class="cx"> return std::nullopt;
</span><span class="lines">@@ -158,61 +75,43 @@
</span><span class="cx"> return std::nullopt;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static std::optional<Exception> buildOptions(FetchRequest::InternalRequest& request, ScriptExecutionContext& context, const Dictionary& init)
</del><ins>+static std::optional<Exception> buildOptions(FetchRequest::InternalRequest& request, ScriptExecutionContext& context, const FetchRequest::Init& init)
</ins><span class="cx"> {
</span><del>- JSC::JSValue window;
- if (init.get("window", window)) {
- if (!window.isNull())
- return Exception { TypeError, ASCIILiteral("Window can only be null.") };
- }
</del><ins>+ if (!init.window.isUndefinedOrNull())
+ return Exception { TypeError, ASCIILiteral("Window can only be null.") };
</ins><span class="cx">
</span><del>- auto exception = setReferrer(request, context, init);
- if (exception)
- return exception;
-
- String value;
- if (init.get("referrerPolicy", value)) {
- exception = setReferrerPolicy(request.options, value);
- if (exception)
</del><ins>+ if (!init.referrer.isNull()) {
+ if (auto exception = setReferrer(request, context, init.referrer))
</ins><span class="cx"> return exception;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (init.get("mode", value)) {
- exception = setMode(request.options, value);
- if (exception)
- return exception;
- }
</del><ins>+ if (init.referrerPolicy)
+ request.options.referrerPolicy = init.referrerPolicy.value();
+
+ if (init.mode)
+ request.options.mode = init.mode.value();
</ins><span class="cx"> if (request.options.mode == FetchOptions::Mode::Navigate)
</span><span class="cx"> return Exception { TypeError, ASCIILiteral("Request constructor does not accept navigate fetch mode.") };
</span><span class="cx">
</span><del>- if (init.get("credentials", value)) {
- exception = setCredentials(request.options, value);
- if (exception)
- return exception;
- }
</del><ins>+ if (init.credentials)
+ request.options.credentials = init.credentials.value();
</ins><span class="cx">
</span><del>- if (init.get("cache", value)) {
- exception = setCache(request.options, value);
- if (exception)
- return exception;
- }
-
</del><ins>+ if (init.cache)
+ request.options.cache = init.cache.value();
</ins><span class="cx"> if (request.options.cache == FetchOptions::Cache::OnlyIfCached && request.options.mode != FetchOptions::Mode::SameOrigin)
</span><span class="cx"> return Exception { TypeError, ASCIILiteral("only-if-cached cache option requires fetch mode to be same-origin.") };
</span><span class="cx">
</span><del>- if (init.get("redirect", value)) {
- exception = setRedirect(request.options, value);
- if (exception)
- return exception;
- }
</del><ins>+ if (init.redirect)
+ request.options.redirect = init.redirect.value();
</ins><span class="cx">
</span><del>- init.get("integrity", request.integrity);
</del><ins>+ if (!init.integrity.isNull())
+ request.integrity = init.integrity;
</ins><span class="cx">
</span><del>- if (init.get("method", value)) {
- exception = setMethod(request.request, value);
- if (exception)
</del><ins>+ if (!init.method.isNull()) {
+ if (auto exception = setMethod(request.request, init.method))
</ins><span class="cx"> return exception;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> return std::nullopt;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -221,7 +120,7 @@
</span><span class="cx"> return internalRequest.request.httpMethod() != "GET" && internalRequest.request.httpMethod() != "HEAD";
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ExceptionOr<FetchHeaders&> FetchRequest::initializeOptions(const Dictionary& init)
</del><ins>+ExceptionOr<FetchHeaders&> FetchRequest::initializeOptions(const Init& init)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(scriptExecutionContext());
</span><span class="cx">
</span><span class="lines">@@ -240,7 +139,7 @@
</span><span class="cx"> return m_headers.get();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ExceptionOr<FetchHeaders&> FetchRequest::initializeWith(const String& url, const Dictionary& init)
</del><ins>+ExceptionOr<FetchHeaders&> FetchRequest::initializeWith(const String& url, const Init& init)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(scriptExecutionContext());
</span><span class="cx"> // FIXME: Tighten the URL parsing algorithm according https://url.spec.whatwg.org/#concept-url-parser.
</span><span class="lines">@@ -257,7 +156,7 @@
</span><span class="cx"> return initializeOptions(init);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ExceptionOr<FetchHeaders&> FetchRequest::initializeWith(FetchRequest& input, const Dictionary& init)
</del><ins>+ExceptionOr<FetchHeaders&> FetchRequest::initializeWith(FetchRequest& input, const Init& init)
</ins><span class="cx"> {
</span><span class="cx"> if (input.isDisturbedOrLocked())
</span><span class="cx"> return Exception {TypeError, ASCIILiteral("Request input is disturbed or locked.") };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchRequest.h (209230 => 209231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchRequest.h        2016-12-02 03:30:37 UTC (rev 209230)
+++ trunk/Source/WebCore/Modules/fetch/FetchRequest.h        2016-12-02 05:31:07 UTC (rev 209231)
</span><span class="lines">@@ -38,15 +38,36 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class Dictionary;
</del><ins>+class Blob;
</ins><span class="cx"> class ScriptExecutionContext;
</span><ins>+class URLSearchParams;
</ins><span class="cx">
</span><span class="cx"> class FetchRequest final : public FetchBodyOwner {
</span><span class="cx"> public:
</span><span class="cx"> static Ref<FetchRequest> create(ScriptExecutionContext& context) { return adoptRef(*new FetchRequest(context, std::nullopt, FetchHeaders::create(FetchHeaders::Guard::Request), { })); }
</span><span class="cx">
</span><del>- ExceptionOr<FetchHeaders&> initializeWith(FetchRequest&, const Dictionary&);
- ExceptionOr<FetchHeaders&> initializeWith(const String&, const Dictionary&);
</del><ins>+ using Cache = FetchOptions::Cache;
+ using Credentials = FetchOptions::Credentials;
+ using Destination = FetchOptions::Destination;
+ using Mode = FetchOptions::Mode;
+ using Redirect = FetchOptions::Redirect;
+ using ReferrerPolicy = FetchOptions::ReferrerPolicy;
+ using Type = FetchOptions::Type;
+
+ struct Init {
+ String method;
+ String referrer;
+ std::optional<ReferrerPolicy> referrerPolicy;
+ std::optional<Mode> mode;
+ std::optional<Credentials> credentials;
+ std::optional<Cache> cache;
+ std::optional<Redirect> redirect;
+ String integrity;
+ JSC::JSValue window;
+ };
+
+ ExceptionOr<FetchHeaders&> initializeWith(FetchRequest&, const Init&);
+ ExceptionOr<FetchHeaders&> initializeWith(const String&, const Init&);
</ins><span class="cx"> ExceptionOr<void> setBody(JSC::ExecState&, JSC::JSValue, FetchRequest*);
</span><span class="cx">
</span><span class="cx"> const String& method() const { return m_internalRequest.request.httpMethod(); }
</span><span class="lines">@@ -53,27 +74,13 @@
</span><span class="cx"> const String& url() const;
</span><span class="cx"> FetchHeaders& headers() { return m_headers.get(); }
</span><span class="cx">
</span><del>- using Type = FetchOptions::Type;
</del><span class="cx"> Type type() const;
</span><del>-
- using Destination = FetchOptions::Destination;
</del><span class="cx"> Destination destination() const;
</span><del>-
</del><span class="cx"> String referrer() const;
</span><del>-
- using ReferrerPolicy = FetchOptions::ReferrerPolicy;
</del><span class="cx"> ReferrerPolicy referrerPolicy() const;
</span><del>-
- using Mode = FetchOptions::Mode;
</del><span class="cx"> Mode mode() const;
</span><del>-
- using Credentials = FetchOptions::Credentials;
</del><span class="cx"> Credentials credentials() const;
</span><del>-
- using Cache = FetchOptions::Cache;
</del><span class="cx"> Cache cache() const;
</span><del>-
- using Redirect = FetchOptions::Redirect;
</del><span class="cx"> Redirect redirect() const;
</span><span class="cx">
</span><span class="cx"> const String& integrity() const { return m_internalRequest.integrity; }
</span><span class="lines">@@ -95,7 +102,7 @@
</span><span class="cx"> private:
</span><span class="cx"> FetchRequest(ScriptExecutionContext&, std::optional<FetchBody>&&, Ref<FetchHeaders>&&, InternalRequest&&);
</span><span class="cx">
</span><del>- ExceptionOr<FetchHeaders&> initializeOptions(const Dictionary&);
</del><ins>+ ExceptionOr<FetchHeaders&> initializeOptions(const Init&);
</ins><span class="cx">
</span><span class="cx"> const char* activeDOMObjectName() const final;
</span><span class="cx"> bool canSuspendForDocumentSuspension() const final;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchRequestidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchRequest.idl (209230 => 209231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchRequest.idl        2016-12-02 03:30:37 UTC (rev 209230)
+++ trunk/Source/WebCore/Modules/fetch/FetchRequest.idl        2016-12-02 05:31:07 UTC (rev 209231)
</span><span class="lines">@@ -30,14 +30,29 @@
</span><span class="cx"> enum RequestDestination { "", "document", "sharedworker", "subresource", "unknown", "worker" };
</span><span class="cx"> enum RequestMode { "navigate", "same-origin", "no-cors", "cors" };
</span><span class="cx"> enum RequestCredentials { "omit", "same-origin", "include" };
</span><del>-enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache" };
</del><ins>+enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" };
</ins><span class="cx"> enum RequestRedirect { "follow", "error", "manual" };
</span><span class="cx"> enum ReferrerPolicy { "", "no-referrer", "no-referrer-when-downgrade", "origin", "origin-when-cross-origin", "unsafe-url" };
</span><span class="cx">
</span><ins>+dictionary RequestInit {
+ ByteString method;
+ // FIXME: Should add: HeadersInit headers;
+ // FIXME: Should add: BodyInit? body;
+ USVString referrer;
+ ReferrerPolicy referrerPolicy;
+ RequestMode mode;
+ RequestCredentials credentials;
+ RequestCache cache;
+ RequestRedirect redirect;
+ DOMString integrity;
+ // FIXME: Should add: boolean keepalive;
+ any window; // can only be set to null
+};
+
</ins><span class="cx"> [
</span><span class="cx"> ActiveDOMObject,
</span><span class="cx"> Conditional=FETCH_API,
</span><del>- Constructor(any input, optional Dictionary init),
</del><ins>+ Constructor(any input, optional RequestInit init),
</ins><span class="cx"> EnabledAtRuntime=FetchAPI,
</span><span class="cx"> Exposed=(Window,Worker),
</span><span class="cx"> InterfaceName=Request,
</span><span class="lines">@@ -45,13 +60,13 @@
</span><span class="cx"> PrivateIdentifier,
</span><span class="cx"> PublicIdentifier,
</span><span class="cx"> ] interface FetchRequest {
</span><del>- readonly attribute DOMString method;
</del><ins>+ readonly attribute ByteString method;
</ins><span class="cx"> readonly attribute DOMString url;
</span><span class="cx"> readonly attribute FetchHeaders headers;
</span><span class="cx">
</span><span class="cx"> readonly attribute RequestType type;
</span><span class="cx"> readonly attribute RequestDestination destination;
</span><del>- readonly attribute DOMString referrer;
</del><ins>+ readonly attribute USVString referrer;
</ins><span class="cx"> readonly attribute ReferrerPolicy referrerPolicy;
</span><span class="cx"> readonly attribute RequestMode mode;
</span><span class="cx"> readonly attribute RequestCredentials credentials;
</span><span class="lines">@@ -61,8 +76,8 @@
</span><span class="cx">
</span><span class="cx"> [CallWith=ScriptExecutionContext, MayThrowException, NewObject] FetchRequest clone();
</span><span class="cx">
</span><del>- [MayThrowException, NewObject, PrivateIdentifier] FetchHeaders initializeWith(FetchRequest input, Dictionary init);
- [MayThrowException, NewObject, PrivateIdentifier] FetchHeaders initializeWith(DOMString input, Dictionary init);
</del><ins>+ [MayThrowException, NewObject, PrivateIdentifier] FetchHeaders initializeWith(FetchRequest input, RequestInit init);
+ [MayThrowException, NewObject, PrivateIdentifier] FetchHeaders initializeWith(DOMString input, RequestInit init);
</ins><span class="cx"> [CallWith=ScriptState, MayThrowException, PrivateIdentifier] void setBody(any body, FetchRequest? request);
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchWorkerGlobalScopeFetchidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/WorkerGlobalScopeFetch.idl (209230 => 209231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/WorkerGlobalScopeFetch.idl        2016-12-02 03:30:37 UTC (rev 209230)
+++ trunk/Source/WebCore/Modules/fetch/WorkerGlobalScopeFetch.idl        2016-12-02 05:31:07 UTC (rev 209231)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> Conditional=FETCH_API,
</span><span class="cx"> EnabledAtRuntime=FetchAPI,
</span><span class="cx"> ] partial interface WorkerGlobalScope {
</span><del>- [JSBuiltin] Promise<Response> fetch(any input, optional Dictionary init);
-
</del><ins>+ [JSBuiltin] Promise<Response> fetch(any input, optional RequestInit init);
</ins><span class="cx"> [PrivateIdentifier, ImplementedAs=fetch] Promise<Response> fetchRequest(FetchRequest request);
</span><span class="cx"> };
</span></span></pre>
</div>
</div>
</body>
</html>