Misc. cleanup in Modules/fetch
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Dec 2016 21:22:07 +0000 (21:22 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Dec 2016 21:22:07 +0000 (21:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=165240

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-12-01
Reviewed by Darin Adler.

* Modules/fetch/DOMWindowFetch.h:
* Modules/fetch/FetchBody.cpp:
* Modules/fetch/FetchBody.h:
* Modules/fetch/FetchBodyConsumer.cpp:
* Modules/fetch/FetchBodyOwner.cpp:
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchInternals.js:
(consumeStream):
* Modules/fetch/FetchLoader.cpp:
* Modules/fetch/FetchResponse.h:
Remove unnecessary includes and forward declarations.

* Modules/fetch/DOMWindowFetch.js:
(fetch):
* Modules/fetch/FetchResponse.js:
(initializeFetchResponse):
* Modules/fetch/WorkerGlobalScopeFetch.js:
(fetch):
Improve style.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209195 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/fetch/DOMWindowFetch.h
Source/WebCore/Modules/fetch/DOMWindowFetch.js
Source/WebCore/Modules/fetch/FetchBody.cpp
Source/WebCore/Modules/fetch/FetchBody.h
Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp
Source/WebCore/Modules/fetch/FetchBodyOwner.cpp
Source/WebCore/Modules/fetch/FetchBodyOwner.h
Source/WebCore/Modules/fetch/FetchInternals.js
Source/WebCore/Modules/fetch/FetchLoader.cpp
Source/WebCore/Modules/fetch/FetchResponse.h
Source/WebCore/Modules/fetch/FetchResponse.js
Source/WebCore/Modules/fetch/WorkerGlobalScopeFetch.js

index 05144da181d8b20009fe225e3d5a5ee63dbe58db..5fe40a9dc044b582be45d8a53a91661f88ca41e6 100644 (file)
@@ -1,3 +1,30 @@
+2016-12-01  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Misc. cleanup in Modules/fetch
+        https://bugs.webkit.org/show_bug.cgi?id=165240
+
+        Reviewed by Darin Adler.
+
+        * Modules/fetch/DOMWindowFetch.h:
+        * Modules/fetch/FetchBody.cpp:
+        * Modules/fetch/FetchBody.h:
+        * Modules/fetch/FetchBodyConsumer.cpp:
+        * Modules/fetch/FetchBodyOwner.cpp:
+        * Modules/fetch/FetchBodyOwner.h:
+        * Modules/fetch/FetchInternals.js:
+        (consumeStream):
+        * Modules/fetch/FetchLoader.cpp:
+        * Modules/fetch/FetchResponse.h:
+        Remove unnecessary includes and forward declarations.
+
+        * Modules/fetch/DOMWindowFetch.js:
+        (fetch):
+        * Modules/fetch/FetchResponse.js:
+        (initializeFetchResponse):
+        * Modules/fetch/WorkerGlobalScopeFetch.js:
+        (fetch):
+        Improve style.
+
 2016-12-01  Antoine Quint  <graouts@apple.com>
 
         [Modern Media Controls] Turn off text selection
index 8b16511b3ef863c68228ddb1c42ccad2d7bbdd47..b3d15757aadb32e1158615053ac136ee5dd2dc91 100644 (file)
@@ -36,7 +36,6 @@
 namespace WebCore {
 
 class DOMWindow;
-class Dictionary;
 class FetchRequest;
 
 class DOMWindowFetch {
index acd2efb62d0a4b0acaadce76cbfd2255d5621771..ef6d075eadc63f57429987e824171cd9a27ca21b 100644 (file)
@@ -31,7 +31,7 @@ function fetch(input, init)
 
     try {
         return @fetchRequest(new @Request(input, init));
-    } catch(e) {
+    } catch (e) {
         return @Promise.@reject(e);
     }
 }
index cf05f7b8281b009dc942d1f8ab5a5e355c6406ee..3f23dacd7e63bc1b1fba1ea83a665e78855d7402 100644 (file)
 
 #if ENABLE(FETCH_API)
 
-#include "Dictionary.h"
 #include "Document.h"
 #include "FetchBodyOwner.h"
 #include "FetchHeaders.h"
 #include "FetchResponseSource.h"
-#include "FormData.h"
 #include "HTTPHeaderValues.h"
 #include "HTTPParsers.h"
 #include "JSBlob.h"
index 52712fd1f1344526673b4a8165938327251efc9d..7cf4617e9f37c49a26e238bba9d0dc6db1fe7c9d 100644 (file)
@@ -46,9 +46,7 @@ class JSValue;
 
 namespace WebCore {
 
-class DOMFormData;
 class FetchBodyOwner;
-class FetchHeaders;
 class FetchResponseSource;
 class ScriptExecutionContext;
 
index 70f499150149584e53571c37bb41e19c42906179..b6430ab2530c6679b862367d3e5f93f3496c93d0 100644 (file)
@@ -32,7 +32,6 @@
 #if ENABLE(FETCH_API)
 
 #include "JSBlob.h"
-#include "JSDOMPromise.h"
 #include "TextResourceDecoder.h"
 
 namespace WebCore {
index ee4eaa2757cc6b70f815b947f2374ff16a3ac1cc..287c977b9390dd5456722b653e902dc410e5034e 100644 (file)
@@ -32,7 +32,6 @@
 #if ENABLE(FETCH_API)
 
 #include "FetchLoader.h"
-#include "FetchResponseSource.h"
 #include "HTTPParsers.h"
 #include "JSBlob.h"
 #include "ResourceResponse.h"
index 3a75d4bff43a236e73be05c17568b6bed61b440d..88e588f1cf198af46264223bda79db40fde3ae23 100644 (file)
 #include "ActiveDOMObject.h"
 #include "FetchBody.h"
 #include "FetchHeaders.h"
-#include "FetchLoader.h"
 #include "FetchLoaderClient.h"
 #include "FetchResponseSource.h"
 
 namespace WebCore {
 
+class FetchLoader;
+
 class FetchBodyOwner : public RefCounted<FetchBodyOwner>, public ActiveDOMObject {
 public:
     FetchBodyOwner(ScriptExecutionContext&, std::optional<FetchBody>&&, Ref<FetchHeaders>&&);
index e3b6f410a5b1aa1a257432151172b6210e5cb20b..f979db0bdb491cc30a1208c4ea68bd35e8c9040d 100644 (file)
@@ -71,7 +71,7 @@ function consumeStream(response, type)
             return @Promise.prototype.@then.@call(@readableStreamDefaultReaderRead(reader), pull);
         }
         return @Promise.prototype.@then.@call(@readableStreamDefaultReaderRead(reader), pull);
-    } catch(e) {
+    } catch (e) {
         return @Promise.@reject(e);
     }
 }
index fac1beaccbd4bf01ab7e693b55fdd96f47b50a5e..fc4fe7bc2bc8ee27b2fb4e79445f70d7cc3897ff 100644 (file)
@@ -43,7 +43,6 @@
 #include "SharedBuffer.h"
 #include "TextResourceDecoder.h"
 #include "ThreadableBlobRegistry.h"
-#include "ThreadableLoader.h"
 
 namespace WebCore {
 
index 6a6e67a2b56e0d6eef575c26b7bf02de99e8e645..c68701d6b20b94dcccaa99c209529964ced11824 100644 (file)
@@ -41,7 +41,6 @@ class JSValue;
 
 namespace WebCore {
 
-class Dictionary;
 class FetchRequest;
 class ReadableStreamSource;
 
index 8fd0688855a2a3ae677c78cc2f5bba1835b2cb3f..6f53924f1dcc5130bd61b2b1b3e47a6bf8da00b9 100644 (file)
@@ -46,7 +46,7 @@ function initializeFetchResponse(body, init)
         @fillFetchHeaders(this.headers, init.headers);
 
     if (body !== @undefined && body !== null) {
-        if (status == 101 || status == 204 || status == 205 || status == 304)
+        if (status === 101 || status === 204 || status === 205 || status === 304)
             @throwTypeError("Response cannot have a body with the given status");
 
         // FIXME: Use @isReadableStream once it is no longer guarded by READABLE_STREAM_API guard.
index acd2efb62d0a4b0acaadce76cbfd2255d5621771..ef6d075eadc63f57429987e824171cd9a27ca21b 100644 (file)
@@ -31,7 +31,7 @@ function fetch(input, init)
 
     try {
         return @fetchRequest(new @Request(input, init));
-    } catch(e) {
+    } catch (e) {
         return @Promise.@reject(e);
     }
 }