Diff
Modified: trunk/LayoutTests/ChangeLog (197048 => 197049)
--- trunk/LayoutTests/ChangeLog 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/LayoutTests/ChangeLog 2016-02-24 21:41:51 UTC (rev 197049)
@@ -1,3 +1,22 @@
+2016-02-24 Youenn Fablet <youenn.fab...@crf.canon.fr>
+
+ [Fetch API] Implement Fetch API Response
+ https://bugs.webkit.org/show_bug.cgi?id=154536
+
+ Reviewed by Alex Christensen.
+
+ Adding Response as constructor in global and worker scopes.
+
+ * js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
+ * js/dom/global-constructors-attributes-expected.txt:
+ * platform/efl/js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
+ * platform/efl/js/dom/global-constructors-attributes-expected.txt:
+ * platform/gtk/js/dom/global-constructors-attributes-expected.txt:
+ * platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
+ * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
+ * platform/mac/js/dom/global-constructors-attributes-expected.txt:
+ * platform/win/js/dom/global-constructors-attributes-expected.txt:
+
2016-02-24 Commit Queue <commit-qu...@webkit.org>
Unreviewed, rolling out r197033.
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (197048 => 197049)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2016-02-24 21:41:51 UTC (rev 197049)
@@ -1,5 +1,31 @@
2016-02-24 Youenn Fablet <youenn.fab...@crf.canon.fr>
+ [Fetch API] Implement Fetch API Response
+ https://bugs.webkit.org/show_bug.cgi?id=154536
+
+ Reviewed by Alex Christensen.
+
+ New tests covering fetch API.
+
+ * web-platform-tests/fetch/api/response/response-clone-expected.txt: Added.
+ * web-platform-tests/fetch/api/response/response-clone.html: Added.
+ * web-platform-tests/fetch/api/response/response-consume-expected.txt: Added.
+ * web-platform-tests/fetch/api/response/response-consume.html: Added.
+ * web-platform-tests/fetch/api/response/response-error-expected.txt: Added.
+ * web-platform-tests/fetch/api/response/response-error.html: Added.
+ * web-platform-tests/fetch/api/response/response-idl-expected.txt: Added.
+ * web-platform-tests/fetch/api/response/response-idl.html: Added.
+ * web-platform-tests/fetch/api/response/response-init-001-expected.txt: Added.
+ * web-platform-tests/fetch/api/response/response-init-001.html: Added.
+ * web-platform-tests/fetch/api/response/response-init-002-expected.txt: Added.
+ * web-platform-tests/fetch/api/response/response-init-002.html: Added.
+ * web-platform-tests/fetch/api/response/response-static-error-expected.txt: Added.
+ * web-platform-tests/fetch/api/response/response-static-error.html: Added.
+ * web-platform-tests/fetch/api/response/response-static-redirect-expected.txt: Added.
+ * web-platform-tests/fetch/api/response/response-static-redirect.html: Added.
+
+2016-02-24 Youenn Fablet <youenn.fab...@crf.canon.fr>
+
W3C importer should generate all web-platform-tests submodules descriptions
https://bugs.webkit.org/show_bug.cgi?id=154587
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone-expected.txt (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,7 @@
+
+PASS Check Response's clone with default values, without body
+PASS Check Response's clone has the expected attribute values
+FAIL Check orginal response's body after cloning null is not an object (evaluating 'response.body.getReader')
+FAIL Check cloned response's body null is not an object (evaluating 'clonedResponse.body.getReader')
+FAIL Cannot clone a disturbed response assert_true: response is disturbed expected true got false
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone.html (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone.html 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,66 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Response clone</title>
+ <meta name="help" href=""
+ <meta name="author" title="Canon Research France" href=""
+ <script src=""
+ <script src=""
+ </head>
+ <body>
+ <script src=""
+ <script>
+ var defaultValues = { "type" : "default",
+ "url" : "",
+ "ok" : true,
+ "status" : 200,
+ "statusText" : "OK"
+ };
+
+ var response = new Response();
+ var clonedResponse = response.clone();
+ test(function() {
+ for (var attributeName in defaultValues) {
+ var expectedValue = defaultValues[attributeName];
+ assert_equals(clonedResponse[attributeName], expectedValue,
+ "Expect default response." + attributeName + " is " + expectedValue);
+ }
+ }, "Check Response's clone with default values, without body");
+
+ var body = "This is response body";
+ var headersInit = { "name" : "value" };
+ var responseInit = { "status" : 200,
+ "statusText" : "GOOD",
+ "headers" : headersInit
+ };
+ var response = new Response(body, responseInit);
+ var clonedResponse = response.clone();
+ test(function() {
+ assert_equals(clonedResponse.status, responseInit["status"],
+ "Expect response.status is " + responseInit["status"]);
+ assert_equals(clonedResponse.statusText, responseInit["statusText"],
+ "Expect response.statusText is " + responseInit["statusText"]);
+ assert_equals(response.headers.get("name"), "value",
+ "Expect response.headers has name:value header");
+ }, "Check Response's clone has the expected attribute values");
+
+ async_test(function(test) {
+ readTextStream(response.body.getReader(), test, body);
+ }, "Check orginal response's body after cloning");
+
+ async_test(function(test) {
+ readTextStream(clonedResponse.body.getReader(), test, body);
+ }, "Check cloned response's body");
+
+ promise_test(function(test) {
+ var disturbedResponse = new Response();
+ return disturbedResponse.text().then(function() {
+ assert_true(disturbedResponse.bodyUsed, "response is disturbed");
+ assert_throws(new TypeError() , function() { disturbedResponse.clone(); },
+ "Expect TypeError exception");
+ });
+ }, "Cannot clone a disturbed response");
+ </script>
+ </body>
+</html>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-consume-expected.txt (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-consume-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-consume-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,7 @@
+
+PASS Consume response's body as text
+FAIL Consume response's body as blob promise_test: Unhandled rejection with value: undefined
+FAIL Consume response's body as arrayBuffer promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: TextDecoder"
+PASS Consume response's body as json
+FAIL Consume response's body as formData promise_test: Unhandled rejection with value: undefined
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-consume.html (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-consume.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-consume.html 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,82 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Response consume</title>
+ <meta name="help" href=""
+ <meta name="help" href=""
+ <meta name="author" title="Canon Research France" href=""
+ <script src=""
+ <script src=""
+ </head>
+ <body>
+ <script>
+ function checkBodyText(response, expectedBody) {
+ return response.text().then( function(bodyAsText) {
+ assert_equals(bodyAsText, expectedBody, "Retrieve and verify response's body");
+ assert_true(response.bodyUsed === true, "body as text: bodyUsed turned true");
+ });
+ }
+
+ function checkBodyBlob(response, expectedBody) {
+ return response.blob().then(function(bodyAsBlob) {
+ var promise = new Promise( function (resolve, reject) {
+ var reader = new FileReader();
+ reader._onload_ = function(evt) {
+ resolve(reader.result)
+ };
+ reader._onerror_ = function () {
+ reject("Blob's reader failed");
+ };
+ reader.readAsText(bodyAsBlob);
+ });
+ return promise.then(function(body) {
+ assert_equals(body, expectedBody, "Retrieve and verify response's body");
+ assert_true(response.bodyUsed === true, "body as blob: bodyUsed turned true");
+ });
+ });
+ }
+
+ function checkBodyArrayBuffer(response, expectedBody) {
+ return response.arrayBuffer().then( function(bodyAsArrayBuffer) {
+ var decoder = new TextDecoder("utf-8");
+ var strBody = decoder.decode(bodyAsArrayBuffer);
+ assert_equals(strBody, expectedBody, "Retrieve and verify response's body");
+ assert_true(response.bodyUsed === true, "body as arrayBuffer: bodyUsed turned true");
+ });
+ }
+
+ function checkBodyJson(response, expectedBody) {
+ return response.json().then(function(bodyAsJson) {
+ var strBody = JSON.stringify(bodyAsJson)
+ assert_equals(strBody, expectedBody, "Retrieve and verify response's body");
+ assert_true(response.bodyUsed === true, "body as json: bodyUsed turned true");
+ });
+ }
+
+ function checkBodyFormData(response, expectedBody) {
+ return response.formData().then(function(bodyAsFormData) {
+ for (var name of expectedBody.keys())
+ assert_equals(bodyAsFormData.get(name), expectedBody.get(name) , "Retrieve and verify response's body" );
+ assert_true(response.bodyUsed === true, "body as formData: bodyUsed turned true");
+ });
+ }
+
+ function checkResponseBody(body, bodyType, checkFunction) {
+ promise_test(function(test) {
+ var response = new Response(body);
+ assert_true(response.bodyUsed === false, "bodyUsed is false at init");
+ return checkFunction(response, body);
+ }, "Consume response's body as " + bodyType);
+ }
+
+ var formData = new FormData();
+ formData.append("name", "value")
+ checkResponseBody("This is response's body", "text", checkBodyText);
+ checkResponseBody("This is response's body", "blob", checkBodyBlob);
+ checkResponseBody("This is response's body", "arrayBuffer", checkBodyArrayBuffer);
+ checkResponseBody(JSON.stringify("This is response's body"), "json", checkBodyJson);
+ checkResponseBody(formData, "formData", checkBodyFormData);
+ </script>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-error-expected.txt (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-error-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-error-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,6 @@
+
+PASS Throws RangeError when responseInit's status is invalid
+FAIL Throws TypeError when responseInit's statusText is invalid assert_throws: Expect TypeError exception
+ function "function () { new Response("", { "statusText" : statusTex..." did not throw
+PASS Throws TypeError when building a response with body and a null body status
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-error.html (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-error.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-error.html 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Response error</title>
+ <meta name="help" href=""
+ <meta name="author" title="Canon Research France" href=""
+ <script src=""
+ <script src=""
+ </head>
+ <body>
+ <script>
+ test(function() {
+ var invalidStatus = [0, 100, 199, 600, 1000];
+ invalidStatus.forEach(function(status) {
+ assert_throws(new RangeError() , function() { new Response("", { "status" : status }); },
+ "Expect RangeError exception when status is " + status);
+ });
+ },"Throws RangeError when responseInit's status is invalid");
+
+ test(function() {
+ var invalidStatusText = ["\n", "Ā"];
+ invalidStatusText.forEach(function(statusText) {
+ assert_throws(new TypeError() , function() { new Response("", { "statusText" : statusText }); },
+ "Expect TypeError exception " + statusText);
+ });
+ },"Throws TypeError when responseInit's statusText is invalid");
+
+ test(function() {
+ var nullBodyStatus = [204, 205, 304];
+ nullBodyStatus.forEach(function(status) {
+ assert_throws(new TypeError() ,
+ function() { new Response("body", { "status" : status }); },
+ "Expect TypeError exception ");
+ });
+ },"Throws TypeError when building a response with body and a null body status");
+ </script>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-idl-expected.txt (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-idl-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-idl-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,47 @@
+
+PASS Response interface: existence and properties of interface object
+PASS Response interface object length
+PASS Response interface object name
+PASS Response interface: existence and properties of interface prototype object
+PASS Response interface: existence and properties of interface prototype object's "constructor" property
+PASS Response interface: operation error()
+PASS Response interface: operation redirect(USVString,unsigned short)
+PASS Response interface: attribute type
+PASS Response interface: attribute url
+PASS Response interface: attribute status
+PASS Response interface: attribute ok
+PASS Response interface: attribute statusText
+PASS Response interface: attribute headers
+PASS Response interface: attribute body
+PASS Response interface: operation clone()
+PASS Response interface: attribute bodyUsed
+FAIL Response interface: operation arrayBuffer() assert_throws: calling operation with this = null didn't throw TypeError function "function () {
+ memberHolderObject[member.n..." did not throw
+FAIL Response interface: operation blob() assert_throws: calling operation with this = null didn't throw TypeError function "function () {
+ memberHolderObject[member.n..." did not throw
+FAIL Response interface: operation formData() assert_throws: calling operation with this = null didn't throw TypeError function "function () {
+ memberHolderObject[member.n..." did not throw
+FAIL Response interface: operation json() assert_throws: calling operation with this = null didn't throw TypeError function "function () {
+ memberHolderObject[member.n..." did not throw
+FAIL Response interface: operation text() assert_throws: calling operation with this = null didn't throw TypeError function "function () {
+ memberHolderObject[member.n..." did not throw
+PASS Response must be primary interface of new Response()
+PASS Stringification of new Response()
+PASS Response interface: new Response() must inherit property "error" with the proper type (0)
+PASS Response interface: new Response() must inherit property "redirect" with the proper type (1)
+PASS Response interface: calling redirect(USVString,unsigned short) on new Response() with too few arguments must throw TypeError
+PASS Response interface: new Response() must inherit property "type" with the proper type (2)
+PASS Response interface: new Response() must inherit property "url" with the proper type (3)
+PASS Response interface: new Response() must inherit property "status" with the proper type (4)
+PASS Response interface: new Response() must inherit property "ok" with the proper type (5)
+PASS Response interface: new Response() must inherit property "statusText" with the proper type (6)
+PASS Response interface: new Response() must inherit property "headers" with the proper type (7)
+PASS Response interface: new Response() must inherit property "body" with the proper type (8)
+PASS Response interface: new Response() must inherit property "clone" with the proper type (9)
+PASS Response interface: new Response() must inherit property "bodyUsed" with the proper type (10)
+PASS Response interface: new Response() must inherit property "arrayBuffer" with the proper type (11)
+PASS Response interface: new Response() must inherit property "blob" with the proper type (12)
+PASS Response interface: new Response() must inherit property "formData" with the proper type (13)
+PASS Response interface: new Response() must inherit property "json" with the proper type (14)
+PASS Response interface: new Response() must inherit property "text" with the proper type (15)
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-idl.html (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-idl.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-idl.html 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,69 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Response idl interface</title>
+ <meta name="help" href=""
+ <meta name="author" title="Canon Research France" href=""
+ <script src=""
+ <script src=""
+ <script src=""
+ <script src=""
+ </head>
+ <body>
+ <script id="body-idl" type="text/plain">
+ typedef any JSON;
+ typedef (Blob or BufferSource or FormData or URLSearchParams or USVString) BodyInit;
+
+ [NoInterfaceObject,
+ Exposed=(Window,Worker)]
+ interface Body {
+ readonly attribute boolean bodyUsed;
+ [NewObject] Promise<ArrayBuffer> arrayBuffer();
+ [NewObject] Promise<Blob> blob();
+ [NewObject] Promise<FormData> formData();
+ [NewObject] Promise<JSON> json();
+ [NewObject] Promise<USVString> text();
+ };
+ </script>
+ <script id="response-idl" type="text/plain">
+ [Constructor(optional BodyInit body, optional ResponseInit init),
+ Exposed=(Window,Worker)]
+ interface Response {
+ [NewObject] static Response error();
+ [NewObject] static Response redirect(USVString url, optional unsigned short status = 302);
+
+ readonly attribute ResponseType type;
+
+ readonly attribute USVString url;
+ readonly attribute unsigned short status;
+ readonly attribute boolean ok;
+ readonly attribute ByteString statusText;
+ [SameObject] readonly attribute Headers headers;
+ [SameObject] readonly attribute ReadableStream body;
+
+ [NewObject] Response clone();
+ };
+ Response implements Body;
+
+ dictionary ResponseInit {
+ unsigned short status = 200;
+ ByteString statusText = "OK";
+ HeadersInit headers;
+ };
+
+ enum ResponseType { "basic", "cors", "default", "error", "opaque", "opaqueredirect" };
+ </script>
+ <script>
+ var idlsArray = new IdlArray();
+ var idl = document.getElementById("body-idl").innerHTML
+ idl += document.getElementById("response-idl").innerHTML
+
+ idlsArray.add_idls(idl);
+ idlsArray.add_untested_idls("interface Headers {};");
+ idlsArray.add_untested_idls("interface ReadableStream {};");
+ idlsArray.add_objects({ Response: ['new Response()'] });
+ idlsArray.test();
+ </script>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-init-001-expected.txt (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-init-001-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-init-001-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,10 @@
+
+PASS Check default value for type attribute
+PASS Check default value for url attribute
+PASS Check default value for ok attribute
+PASS Check default value for status attribute
+PASS Check default value for statusText attribute
+PASS Check default value for body attribute
+PASS Check status init values and associated getter
+PASS Check statusText init values and associated getter
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-init-001.html (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-init-001.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-init-001.html 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,63 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Response init: simple cases</title>
+ <meta name="help" href=""
+ <meta name="help" href=""
+ <meta name="author" title="Canon Research France" href=""
+ <script src=""
+ <script src=""
+ </head>
+ <body>
+ <script>
+ var defaultValues = { "type" : "default",
+ "url" : "",
+ "ok" : true,
+ "status" : 200,
+ "statusText" : "OK",
+ "body" : null
+ };
+
+ var statusCodes = { "givenValues" : [200, 300, 400, 500, 599],
+ "expectedValues" : [200, 300, 400, 500, 599]
+ };
+ var statusTexts = { "givenValues" : ["OK", "with space", String.fromCharCode(0x80)],
+ "expectedValues" : ["OK", "with space", String.fromCharCode(0x80)]
+ };
+ var initValuesDict = { "status" : statusCodes,
+ "statusText" : statusTexts
+ };
+
+ function isOkStatus(status) {
+ return 200 <= status && 299 >= status;
+ }
+
+ var response = new Response();
+ for (var attributeName in defaultValues) {
+ test(function() {
+ var expectedValue = defaultValues[attributeName];
+ assert_equals(response[attributeName], expectedValue,
+ "Expect default response." + attributeName + " is " + expectedValue);
+ }, "Check default value for " + attributeName + " attribute");
+ }
+
+ for (var attributeName in initValuesDict)
+ test(function() {
+ var valuesToTest = initValuesDict[attributeName];
+ for (var valueIdx in valuesToTest["givenValues"]) {
+ var givenValue = valuesToTest["givenValues"][valueIdx];
+ var expectedValue = valuesToTest["expectedValues"][valueIdx];
+ var responseInit = {};
+ responseInit[attributeName] = givenValue;
+ var response = new Response("", responseInit);
+ assert_equals(response[attributeName], expectedValue,
+ "Expect response." + attributeName + " is " + expectedValue +
+ " when initialized with " + givenValue);
+ assert_equals(response.ok, isOkStatus(response.status),
+ "Expect response.ok is " + isOkStatus(response.status));
+ }
+ }, "Check " + attributeName + " init values and associated getter");
+ </script>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-init-002-expected.txt (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-init-002-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-init-002-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,8 @@
+
+PASS Initialize Response with headers values
+FAIL Initialize Response's body with application/octet-binary promise_test: Unhandled rejection with value: undefined
+FAIL Initialize Response's body with multipart/form-data promise_test: Unhandled rejection with value: undefined
+FAIL Initialize Response's body with application/x-www-form-urlencoded;charset=UTF-8 assert_true: Content-Type header should be "application/x-www-form-urlencoded;charset=UTF-8" expected true got false
+PASS Initialize Response's body with text/plain;charset=UTF-8
+FAIL Read Response's body as readableStream null is not an object (evaluating 'response.body.getReader')
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-init-002.html (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-init-002.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-init-002.html 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,62 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Response init: body and headers</title>
+ <meta name="help" href=""
+ <meta name="help" href=""
+ <meta name="author" title="Canon Research France" href=""
+ <script src=""
+ <script src=""
+ </head>
+ <body>
+ <script src=""
+ <script>
+ test(function() {
+ var headerDict = {"name1": "value1",
+ "name2": "value2",
+ "name3": "value3"
+ };
+ var headers = new Headers(headerDict);
+ var response = new Response("", { "headers" : headers })
+ for (var name in headerDict) {
+ assert_equals(response.headers.get(name), headerDict[name],
+ "response's headers has " + name + " : " + headerDict[name]);
+ }
+ }, "Initialize Response with headers values");
+
+ function checkResponseInit(body, bodyType, expectedTextBody) {
+ promise_test(function(test) {
+ var response = new Response(body);
+ var resHeaders = response.headers;
+ var mime = resHeaders.get("Content-Type");
+ assert_true(mime && mime.search(bodyType) > -1, "Content-Type header should be \"" + bodyType + "\" ");
+ return response.text().then(function(bodyAsText) {
+ //not equals: cannot guess formData exact value
+ assert_true( bodyAsText.search(expectedTextBody) > -1, "Retrieve and verify response body");
+ });
+ }, "Initialize Response's body with " + bodyType);
+ }
+
+ var blob = new Blob(["This is a blob"], {type: "application/octet-binary"});
+ var formaData = new FormData();
+ formaData.append("name", "value");
+ var urlSearchParams = "URLSearchParams are not supported";
+ //avoid test timeout if not implemented
+ if (window.URLSearchParams)
+ urlSearchParams = new URLSearchParams("name=value");
+ var usvString = "This is a USVString"
+
+ checkResponseInit(blob, "application/octet-binary", "This is a blob");
+ checkResponseInit(formaData, "multipart/form-data", "name=\"name\"\r\n\r\nvalue");
+ checkResponseInit(urlSearchParams, "application/x-www-form-urlencoded;charset=UTF-8", "name=value");
+ checkResponseInit(usvString, "text/plain;charset=UTF-8", "This is a USVString");
+
+ async_test(function(test) {
+ var body = "This is response body";
+ var response = new Response(body);
+ readTextStream(response.body.getReader(), test, body);
+ }, "Read Response's body as readableStream");
+ </script>
+ </body>
+</html>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-static-error-expected.txt (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-static-error-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-static-error-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,3 @@
+
+PASS Check response returned by static method error()
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-static-error.html (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-static-error.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-static-error.html 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,23 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Response: error static method</title>
+ <meta name="help" href=""
+ <meta name="help" href=""
+ <meta name="author" title="Canon Research France" href=""
+ <script src=""
+ <script src=""
+ </head>
+ <body>
+ <script>
+ test(function() {
+ var responseError = Response.error();
+ assert_equals(responseError.type, "error", "Network error response's type is error");
+ assert_equals(responseError.status, 0, "Network error response's status is 0");
+ assert_equals(responseError.statusText, "", "Network error response's statusText is empty");
+ assert_equals(responseError.body, null, "Network error response's body is null");
+ }, "Check response returned by static method error()");
+ </script>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-static-redirect-expected.txt (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-static-redirect-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-static-redirect-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,4 @@
+
+PASS Check response returned by static method redirect()
+FAIL Check error returned when giving invalid parameters to redirect() assert_throws: Expect RangeError exception function "function () { Response.redirect("", invalidStatus); }" threw object "TypeError: Type error" ("TypeError") expected object "RangeError" ("RangeError")
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-static-redirect.html (0 => 197049)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-static-redirect.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-static-redirect.html 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,41 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Response: redirect static method</title>
+ <meta name="help" href=""
+ <meta name="help" href=""
+ <meta name="author" title="Canon Research France" href=""
+ <script src=""
+ <script src=""
+ </head>
+ <body>
+ <script>
+ test(function() {
+ var redirectStatus = [301, 302, 303, 307, 308];
+ var url = ""
+ redirectResponse = Response.redirect(url);
+ assert_equals(redirectResponse.status, 302, "Default redictect status is 302");
+ assert_equals(redirectResponse.headers.get("Location"), url,
+ "redirected response has Location header with the correct url");
+ for (var i in redirectStatus) {
+ var status = redirectStatus[i];
+ redirectResponse = Response.redirect(url, status);
+ assert_equals(redirectResponse.status, status, "Redictect status is " + status);
+ }
+ }, "Check response returned by static method redirect()");
+
+ test(function() {
+ var invalidRedirectStatus = [200, 309, 400, 500];
+ var invalidUrl = "This is not an url";
+ for (var i in invalidRedirectStatus) {
+ var invalidStatus = invalidRedirectStatus[i];
+ assert_throws(new RangeError() , function() { Response.redirect("", invalidStatus); },
+ "Expect RangeError exception");
+ }
+ assert_throws(new TypeError(), function() { Response.redirect(invalidUrl); },
+ "Expect TypeError exception");
+ }, "Check error returned when giving invalid parameters to redirect()");
+ </script>
+ </body>
+</html>
\ No newline at end of file
Modified: trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt (197048 => 197049)
--- trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -169,6 +169,11 @@
PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Response').value is Response
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('get') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('set') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Response').enumerable is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Response').configurable is true
PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Set').value is Set
PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Set').hasOwnProperty('get') is false
PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Set').hasOwnProperty('set') is false
Modified: trunk/LayoutTests/js/dom/global-constructors-attributes-expected.txt (197048 => 197049)
--- trunk/LayoutTests/js/dom/global-constructors-attributes-expected.txt 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/LayoutTests/js/dom/global-constructors-attributes-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -993,6 +993,11 @@
PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'Response').value is Response
+PASS Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').value is SQLException
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('set') is false
Modified: trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-dedicated-worker-expected.txt (197048 => 197049)
--- trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-dedicated-worker-expected.txt 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-dedicated-worker-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -69,6 +69,11 @@
PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Response').value is Response
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('get') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('set') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Response').enumerable is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Response').configurable is true
PASS [Worker] Object.getOwnPropertyDescriptor(global, 'URL').value is URL
PASS [Worker] Object.getOwnPropertyDescriptor(global, 'URL').hasOwnProperty('get') is false
PASS [Worker] Object.getOwnPropertyDescriptor(global, 'URL').hasOwnProperty('set') is false
Modified: trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt (197048 => 197049)
--- trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -1063,6 +1063,11 @@
PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'Response').value is Response
+PASS Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').value is SQLException
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('set') is false
Modified: trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt (197048 => 197049)
--- trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -1083,6 +1083,11 @@
PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'Response').value is Response
+PASS Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').value is SQLException
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('set') is false
Modified: trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt (197048 => 197049)
--- trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -1198,6 +1198,11 @@
PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'Response').value is Response
+PASS Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').value is SQLException
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('set') is false
Modified: trunk/LayoutTests/platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt (197048 => 197049)
--- trunk/LayoutTests/platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/LayoutTests/platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -1073,6 +1073,11 @@
PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'Response').value is Response
+PASS Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').value is SQLException
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('set') is false
Modified: trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt (197048 => 197049)
--- trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -1198,6 +1198,11 @@
PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'Response').value is Response
+PASS Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').value is SQLException
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('set') is false
Modified: trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt (197048 => 197049)
--- trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -913,6 +913,11 @@
PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'Response').value is Response
+PASS Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Response').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').value is SQLException
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('set') is false
Modified: trunk/Source/WebCore/CMakeLists.txt (197048 => 197049)
--- trunk/Source/WebCore/CMakeLists.txt 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/Source/WebCore/CMakeLists.txt 2016-02-24 21:41:51 UTC (rev 197049)
@@ -166,6 +166,7 @@
Modules/fetch/FetchBody.idl
Modules/fetch/FetchHeaders.idl
Modules/fetch/FetchRequest.idl
+ Modules/fetch/FetchResponse.idl
Modules/geolocation/Coordinates.idl
Modules/geolocation/Geolocation.idl
@@ -813,6 +814,7 @@
Modules/fetch/FetchBody.cpp
Modules/fetch/FetchHeaders.cpp
Modules/fetch/FetchRequest.cpp
+ Modules/fetch/FetchResponse.cpp
Modules/geolocation/Coordinates.cpp
Modules/geolocation/GeoNotifier.cpp
@@ -3665,6 +3667,7 @@
set(WebCore_BUILTINS_SOURCES
${WEBCORE_DIR}/Modules/fetch/FetchHeaders.js
+ ${WEBCORE_DIR}/Modules/fetch/FetchResponse.js
${WEBCORE_DIR}/Modules/mediastream/MediaDevices.js
${WEBCORE_DIR}/Modules/mediastream/NavigatorUserMedia.js
${WEBCORE_DIR}/Modules/mediastream/RTCPeerConnection.js
Modified: trunk/Source/WebCore/ChangeLog (197048 => 197049)
--- trunk/Source/WebCore/ChangeLog 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/Source/WebCore/ChangeLog 2016-02-24 21:41:51 UTC (rev 197049)
@@ -1,3 +1,61 @@
+2016-02-24 Youenn Fablet <youenn.fab...@crf.canon.fr>
+
+ [Fetch API] Implement Fetch API Response
+ https://bugs.webkit.org/show_bug.cgi?id=154536
+
+ Reviewed by Alex Christensen.
+
+ Tests: imported/w3c/web-platform-tests/fetch/api/response/response-clone.html
+ imported/w3c/web-platform-tests/fetch/api/response/response-consume.html
+ imported/w3c/web-platform-tests/fetch/api/response/response-error.html
+ imported/w3c/web-platform-tests/fetch/api/response/response-idl.html
+ imported/w3c/web-platform-tests/fetch/api/response/response-init-001.html
+ imported/w3c/web-platform-tests/fetch/api/response/response-init-002.html
+ imported/w3c/web-platform-tests/fetch/api/response/response-static-error.html
+ imported/w3c/web-platform-tests/fetch/api/response/response-static-redirect.html
+
+ Adding Fetch Response as FetchResponse class.
+ Constructor uses a built-in to pre-process the parameters.
+ Support of body as ReadableStream is missing.
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * Modules/fetch/FetchBody.h:
+ (WebCore::FetchBody::empty):
+ * Modules/fetch/FetchResponse.cpp: Added.
+ (WebCore::JSFetchResponse::body):
+ (WebCore::isRedirectStatus):
+ (WebCore::isNullBodyStatus):
+ (WebCore::FetchResponse::error):
+ (WebCore::FetchResponse::redirect):
+ (WebCore::FetchResponse::initializeWith):
+ (WebCore::FetchResponse::FetchResponse):
+ (WebCore::FetchResponse::clone):
+ (WebCore::FetchResponse::type):
+ * Modules/fetch/FetchResponse.h: Added.
+ (WebCore::FetchResponse::create):
+ (WebCore::FetchResponse::redirect):
+ (WebCore::FetchResponse::url):
+ (WebCore::FetchResponse::redirected):
+ (WebCore::FetchResponse::status):
+ (WebCore::FetchResponse::ok):
+ (WebCore::FetchResponse::statusText):
+ (WebCore::FetchResponse::headers):
+ (WebCore::FetchResponse::isDisturbed):
+ (WebCore::FetchResponse::arrayBuffer):
+ (WebCore::FetchResponse::formData):
+ (WebCore::FetchResponse::blob):
+ (WebCore::FetchResponse::json):
+ (WebCore::FetchResponse::text):
+ * Modules/fetch/FetchResponse.idl: Added.
+ * Modules/fetch/FetchResponse.js: Added.
+ (initializeFetchResponse):
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/WebCoreJSBuiltins.cpp:
+ * bindings/js/WebCoreJSBuiltins.h:
+ (WebCore::JSBuiltinFunctions::JSBuiltinFunctions):
+ (WebCore::JSBuiltinFunctions::fetchResponseBuiltins):
+
2016-02-24 Ryosuke Niwa <rn...@webkit.org>
A function named canTakeNextToken executing blocking scripts is misleading
Modified: trunk/Source/WebCore/DerivedSources.cpp (197048 => 197049)
--- trunk/Source/WebCore/DerivedSources.cpp 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/Source/WebCore/DerivedSources.cpp 2016-02-24 21:41:51 UTC (rev 197049)
@@ -156,6 +156,7 @@
#include "JSFetchBody.cpp"
#include "JSFetchHeaders.cpp"
#include "JSFetchRequest.cpp"
+#include "JSFetchResponse.cpp"
#include "JSFile.cpp"
#include "JSFileError.cpp"
#include "JSFileException.cpp"
Modified: trunk/Source/WebCore/DerivedSources.make (197048 => 197049)
--- trunk/Source/WebCore/DerivedSources.make 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/Source/WebCore/DerivedSources.make 2016-02-24 21:41:51 UTC (rev 197049)
@@ -82,6 +82,7 @@
$(WebCore)/Modules/fetch/FetchBody.idl \
$(WebCore)/Modules/fetch/FetchHeaders.idl \
$(WebCore)/Modules/fetch/FetchRequest.idl \
+ $(WebCore)/Modules/fetch/FetchResponse.idl \
$(WebCore)/Modules/gamepad/Gamepad.idl \
$(WebCore)/Modules/gamepad/GamepadButton.idl \
$(WebCore)/Modules/gamepad/GamepadEvent.idl \
@@ -1271,6 +1272,7 @@
WebCore_BUILTINS_SOURCES = \
$(WebCore)/Modules/fetch/FetchHeaders.js \
+ $(WebCore)/Modules/fetch/FetchResponse.js \
$(WebCore)/Modules/mediastream/MediaDevices.js \
$(WebCore)/Modules/mediastream/NavigatorUserMedia.js \
$(WebCore)/Modules/mediastream/RTCPeerConnection.js \
Modified: trunk/Source/WebCore/Modules/fetch/FetchBody.h (197048 => 197049)
--- trunk/Source/WebCore/Modules/fetch/FetchBody.h 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/Source/WebCore/Modules/fetch/FetchBody.h 2016-02-24 21:41:51 UTC (rev 197049)
@@ -70,6 +70,7 @@
static FetchBody fromJSValue(JSC::ExecState&, JSC::JSValue);
static FetchBody fromRequestBody(FetchBody*);
+ static FetchBody empty() { return FetchBody(); }
private:
template<typename T> bool processIfEmptyOrDisturbed(DOMPromise<T, ExceptionCode>&);
Added: trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp (0 => 197049)
--- trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp (rev 0)
+++ trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2016 Canon Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted, provided that the following conditions
+ * are required to be met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Canon Inc. nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "FetchResponse.h"
+
+#if ENABLE(FETCH_API)
+
+#include "Dictionary.h"
+#include "ExceptionCode.h"
+#include "JSFetchResponse.h"
+#include "ScriptExecutionContext.h"
+
+namespace WebCore {
+
+static inline bool isRedirectStatus(int status)
+{
+ return status == 301 || status == 302 || status == 303 || status == 307 || status == 308;
+}
+
+static inline bool isNullBodyStatus(int status)
+{
+ return status == 101 || status == 204 || status == 205 || status == 304;
+}
+
+Ref<FetchResponse> FetchResponse::error()
+{
+ return adoptRef(*new FetchResponse(Type::Error, FetchBody::empty(), FetchHeaders::create(FetchHeaders::Guard::Immutable), ResourceResponse()));
+}
+
+RefPtr<FetchResponse> FetchResponse::redirect(ScriptExecutionContext* context, const String& url, int status, ExceptionCode& ec)
+{
+ // FIXME: Tighten the URL parsing algorithm according https://url.spec.whatwg.org/#concept-url-parser.
+ URL requestURL = context->completeURL(url);
+ if (!requestURL.isValid() || !requestURL.user().isEmpty() || !requestURL.pass().isEmpty()) {
+ ec = TypeError;
+ return nullptr;
+ }
+ if (!isRedirectStatus(status)) {
+ ec = TypeError;
+ return nullptr;
+ }
+ RefPtr<FetchResponse> redirectResponse = adoptRef(*new FetchResponse(Type::Default, FetchBody::empty(), FetchHeaders::create(FetchHeaders::Guard::Immutable), ResourceResponse()));
+ redirectResponse->m_response.setHTTPStatusCode(status);
+ redirectResponse->m_headers->fastSet(HTTPHeaderName::Location, requestURL.string());
+ return redirectResponse;
+}
+
+void FetchResponse::initializeWith(const Dictionary& init, ExceptionCode& ec)
+{
+ int status;
+ if (!init.get("status", status)) {
+ ec = TypeError;
+ return;
+ }
+ if (status < 200 || status > 599) {
+ ec = RangeError;
+ return;
+ }
+
+ // FIXME: Validate reason phrase (https://tools.ietf.org/html/rfc7230#section-3.1.2).
+ String statusText;
+ if (!init.get("statusText", statusText)) {
+ ec = TypeError;
+ return;
+ }
+ m_response.setHTTPStatusCode(status);
+ m_response.setHTTPStatusText(statusText);
+
+ RefPtr<FetchHeaders> initialHeaders;
+ if (init.get("headers", initialHeaders))
+ m_headers->fill(initialHeaders.get());
+
+ JSC::JSValue body;
+ if (init.get("body", body)) {
+ if (isNullBodyStatus(status)) {
+ ec = TypeError;
+ return;
+ }
+ m_body = FetchBody::fromJSValue(*init.execState(), body);
+ if (m_headers->fastGet(HTTPHeaderName::ContentType).isEmpty() && !m_body.mimeType().isEmpty())
+ m_headers->fastSet(HTTPHeaderName::ContentType, m_body.mimeType());
+ }
+}
+
+FetchResponse::FetchResponse(Type type, FetchBody&& body, Ref<FetchHeaders>&& headers, ResourceResponse&& response)
+ : m_type(type)
+ , m_response(WTFMove(response))
+ , m_body(WTFMove(body))
+ , m_headers(WTFMove(headers))
+{
+}
+
+RefPtr<FetchResponse> FetchResponse::clone(ExceptionCode& ec)
+{
+ if (m_body.isDisturbed() || m_isLocked) {
+ ec = TypeError;
+ return nullptr;
+ }
+ RefPtr<FetchResponse> cloned = adoptRef(*new FetchResponse(m_type, FetchBody(m_body), FetchHeaders::create(headers()), ResourceResponse(m_response)));
+ cloned->m_isRedirected = m_isRedirected;
+ return cloned;
+}
+
+String FetchResponse::type() const
+{
+ switch (m_type) {
+ case Type::Basic:
+ return ASCIILiteral("basic");
+ case Type::Cors:
+ return ASCIILiteral("cors");
+ case Type::Default:
+ return ASCIILiteral("default");
+ case Type::Error:
+ return ASCIILiteral("error");
+ case Type::Opaque:
+ return ASCIILiteral("opaque");
+ case Type::OpaqueRedirect:
+ return ASCIILiteral("opaqueredirect");
+ };
+ ASSERT_NOT_REACHED();
+ return String();
+}
+
+// FIXME: Implement this, as a custom or through binding generator.
+JSC::JSValue JSFetchResponse::body(JSC::ExecState&) const
+{
+ return JSC::jsNull();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FETCH_API)
Added: trunk/Source/WebCore/Modules/fetch/FetchResponse.h (0 => 197049)
--- trunk/Source/WebCore/Modules/fetch/FetchResponse.h (rev 0)
+++ trunk/Source/WebCore/Modules/fetch/FetchResponse.h 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2016 Canon Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted, provided that the following conditions
+ * are required to be met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Canon Inc. nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FetchResponse_h
+#define FetchResponse_h
+
+#if ENABLE(FETCH_API)
+
+#include "FetchBody.h"
+#include "FetchHeaders.h"
+#include "ResourceResponse.h"
+
+namespace JSC {
+class ArrayBuffer;
+};
+
+namespace WebCore {
+
+class Dictionary;
+
+typedef int ExceptionCode;
+
+class FetchResponse : public RefCounted<FetchResponse> {
+public:
+ static Ref<FetchResponse> create() { return adoptRef(*new FetchResponse(Type::Default, FetchBody::empty(), FetchHeaders::create(FetchHeaders::Guard::Response), ResourceResponse())); }
+ static Ref<FetchResponse> error();
+ static RefPtr<FetchResponse> redirect(ScriptExecutionContext*, const String&, int, ExceptionCode&);
+ // FIXME: Binding generator should not require below method to handle optional status parameter.
+ static RefPtr<FetchResponse> redirect(ScriptExecutionContext* context, const String& url, ExceptionCode& ec) { return redirect(context, url, 302, ec); }
+
+ void initializeWith(const Dictionary&, ExceptionCode&);
+
+ String type() const;
+ const String& url() const { return m_response.url().string(); }
+ bool redirected() const { return m_isRedirected; }
+ int status() const { return m_response.httpStatusCode(); }
+ bool ok() const { return status() >= 200 && status() <= 299; }
+ const String& statusText() const { return m_response.httpStatusText(); }
+
+ FetchHeaders& headers() { return m_headers; }
+ RefPtr<FetchResponse> clone(ExceptionCode&);
+
+ // Body API
+ bool isDisturbed() const { return m_body.isDisturbed(); }
+ void arrayBuffer(FetchBody::ArrayBufferPromise&& promise) { m_body.arrayBuffer(WTFMove(promise)); }
+ void formData(FetchBody::FormDataPromise&& promise) { m_body.formData(WTFMove(promise)); }
+ void blob(FetchBody::BlobPromise&& promise) { m_body.blob(WTFMove(promise)); }
+ void json(JSC::ExecState& state, FetchBody::JSONPromise&& promise) { m_body.json(state, WTFMove(promise)); }
+ void text(FetchBody::TextPromise&& promise) { m_body.text(WTFMove(promise)); }
+
+private:
+ enum class Type { Basic, Cors, Default, Error, Opaque, OpaqueRedirect };
+
+ FetchResponse(Type, FetchBody&&, Ref<FetchHeaders>&&, ResourceResponse&&);
+
+ Type m_type;
+ ResourceResponse m_response;
+ FetchBody m_body;
+ Ref<FetchHeaders> m_headers;
+ bool m_isLocked = false;
+ bool m_isRedirected = false;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FETCH_API)
+
+#endif // FetchResponse_h
Added: trunk/Source/WebCore/Modules/fetch/FetchResponse.idl (0 => 197049)
--- trunk/Source/WebCore/Modules/fetch/FetchResponse.idl (rev 0)
+++ trunk/Source/WebCore/Modules/fetch/FetchResponse.idl 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2016 Canon Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted, provided that the following conditions
+ * are required to be met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Canon Inc. nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+enum ResponseType { "basic", "cors", "default", "error", "opaque", "opaqueredirect" };
+
+[
+ Conditional=FETCH_API,
+ GlobalContext=DOMWindow&WorkerGlobalScope,
+ ImplementationLacksVTable,
+ InterfaceName=Response,
+ JSBuiltinConstructor
+]
+interface FetchResponse {
+ // FIXME: NewObject does not seem to be supported for static methods.
+ static FetchResponse error();
+ [RaisesException, CallWith=ScriptExecutionContext] static FetchResponse redirect(DOMString url, optional unsigned short status = 302);
+
+ readonly attribute ResponseType type;
+
+ readonly attribute DOMString url;
+ readonly attribute boolean redirected;
+ readonly attribute unsigned short status;
+ readonly attribute boolean ok;
+ readonly attribute DOMString statusText;
+ // FIXME: Add support for SameObject keyword for headers
+ readonly attribute FetchHeaders headers;
+ [Custom, RaisesException] readonly attribute ReadableStream? body;
+
+ [NewObject, RaisesException] FetchResponse clone();
+
+ [Private, RaisesException] void initializeWith(Dictionary parameters);
+};
+FetchResponse implements FetchBody;
Added: trunk/Source/WebCore/Modules/fetch/FetchResponse.js (0 => 197049)
--- trunk/Source/WebCore/Modules/fetch/FetchResponse.js (rev 0)
+++ trunk/Source/WebCore/Modules/fetch/FetchResponse.js 2016-02-24 21:41:51 UTC (rev 197049)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2016 Canon Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CANON INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CANON INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// @conditional=ENABLE(FETCH_API)
+
+function initializeFetchResponse(body, init)
+{
+ "use strict";
+
+ let parameters = { };
+ if (init !== @undefined) {
+ if (!@isObject(init))
+ throw new @TypeError("Response init must be an object");
+ parameters.status = init.status;
+ parameters.statusText = init.statusText;
+ // FIXME: Shield this from user scripts.
+ if (init.headers)
+ parameters.headers = (this.headers.constructor === init.headers.constructor) ? init.headers : new this.headers.constructor(init.headers);
+ }
+
+ if (parameters.status === @undefined)
+ parameters.status = 200;
+ if (parameters.statusText === @undefined)
+ parameters.statusText = "OK";
+
+ if (body !== @undefined && body !== null)
+ parameters.body = body;
+
+ this.@initializeWith(parameters);
+ return this;
+}
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (197048 => 197049)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-02-24 21:41:51 UTC (rev 197049)
@@ -1497,6 +1497,7 @@
4127D5370F8AAB1D00E424F5 /* ScriptState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4127D5360F8AAB1D00E424F5 /* ScriptState.cpp */; };
4129DF851BB5B80700322A16 /* JSReadableStreamPrivateConstructors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4129DF831BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.cpp */; };
4129DF861BB5B80C00322A16 /* JSReadableStreamPrivateConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 4129DF841BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 413015D91C7B571400091C6E /* FetchResponse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 413015D51C7B570400091C6E /* FetchResponse.cpp */; };
4138D3351244054800323D33 /* EventContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 4138D3331244054800323D33 /* EventContext.h */; };
4138D3361244054800323D33 /* EventContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4138D3341244054800323D33 /* EventContext.cpp */; };
413C2C341BC29A8F0075204C /* JSDOMConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 413C2C331BC29A7B0075204C /* JSDOMConstructor.h */; };
@@ -2813,8 +2814,10 @@
7E474E1E12494DC900235364 /* SQLiteDatabaseTrackerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E474E1B12494DC900235364 /* SQLiteDatabaseTrackerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
7E474E1F12494DC900235364 /* SQLiteDatabaseTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E474E1C12494DC900235364 /* SQLiteDatabaseTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
7E474E2012494DC900235364 /* SQLiteDatabaseTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */; };
+ 7E4C96DD1AD4483500365A50 /* JSFetchRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C96D91AD4483500365A50 /* JSFetchRequest.h */; };
7E4C96DC1AD4483500365A50 /* JSFetchRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A50 /* JSFetchRequest.cpp */; };
- 7E4C96DD1AD4483500365A50 /* JSFetchRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C96D91AD4483500365A50 /* JSFetchRequest.h */; };
+ 8E4C96DD1AD4483500365A50 /* JSFetchResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E4C96D91AD4483500365A50 /* JSFetchResponse.h */; };
+ 8E4C96DC1AD4483500365A50 /* JSFetchResponse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E4C96D81AD4483500365A50 /* JSFetchResponse.cpp */; };
7E4DE10D198B10B60051CB02 /* DiskCacheMonitorCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E4DE10C198B10B60051CB02 /* DiskCacheMonitorCocoa.mm */; };
7E5D7A76161D3F8F00896C34 /* OESElementIndexUint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */; };
7E5D7A77161D3F8F00896C34 /* OESElementIndexUint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */; };
@@ -8960,6 +8963,10 @@
4129DF821BB5B7A600322A16 /* ReadableStreamReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamReader.h; sourceTree = "<group>"; };
4129DF831BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamPrivateConstructors.cpp; sourceTree = "<group>"; };
4129DF841BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamPrivateConstructors.h; sourceTree = "<group>"; };
+ 413015D51C7B570400091C6E /* FetchResponse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FetchResponse.cpp; sourceTree = "<group>"; };
+ 413015D61C7B570400091C6E /* FetchResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchResponse.h; sourceTree = "<group>"; };
+ 413015D71C7B570400091C6E /* FetchResponse.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FetchResponse.idl; sourceTree = "<group>"; };
+ 413015D81C7B570400091C6E /* FetchResponse.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = FetchResponse.js; sourceTree = "<group>"; };
4138D3331244054800323D33 /* EventContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventContext.h; sourceTree = "<group>"; };
4138D3341244054800323D33 /* EventContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventContext.cpp; sourceTree = "<group>"; };
413C2C331BC29A7B0075204C /* JSDOMConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMConstructor.h; sourceTree = "<group>"; };
@@ -10441,6 +10448,8 @@
7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLiteDatabaseTracker.cpp; sourceTree = "<group>"; };
7E4C96D81AD4483500365A50 /* JSFetchRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFetchRequest.cpp; sourceTree = "<group>"; };
7E4C96D91AD4483500365A50 /* JSFetchRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFetchRequest.h; sourceTree = "<group>"; };
+ 8E4C96D81AD4483500365A50 /* JSFetchResponse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFetchResponse.cpp; sourceTree = "<group>"; };
+ 8E4C96D91AD4483500365A50 /* JSFetchResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFetchResponse.h; sourceTree = "<group>"; };
7E4DE10C198B10B60051CB02 /* DiskCacheMonitorCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DiskCacheMonitorCocoa.mm; sourceTree = "<group>"; };
7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OESElementIndexUint.cpp; sourceTree = "<group>"; };
7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OESElementIndexUint.h; sourceTree = "<group>"; };
@@ -16753,6 +16762,10 @@
41F54F871C50C4F600338488 /* FetchRequest.cpp */,
41F54F881C50C4F600338488 /* FetchRequest.h */,
41F54F891C50C4F600338488 /* FetchRequest.idl */,
+ 413015D51C7B570400091C6E /* FetchResponse.cpp */,
+ 413015D61C7B570400091C6E /* FetchResponse.h */,
+ 413015D71C7B570400091C6E /* FetchResponse.idl */,
+ 413015D81C7B570400091C6E /* FetchResponse.js */,
);
path = fetch;
sourceTree = "<group>";
@@ -16766,6 +16779,8 @@
7E4C96D91AD4483500365A50 /* JSFetchRequest.h */,
7D4C96D81AD4483500365A50 /* JSFetchHeaders.cpp */,
7D4C96D91AD4483500365A50 /* JSFetchHeaders.h */,
+ 8E4C96D81AD4483500365A50 /* JSFetchResponse.cpp */,
+ 8E4C96D91AD4483500365A50 /* JSFetchResponse.h */,
);
name = FetchAPI;
sourceTree = "<group>";
@@ -26684,6 +26699,7 @@
65DF320209D1CC60000BE325 /* JSRange.h in Headers */,
7F4C96DD1AD4483500365A50 /* JSFetchBody.h in Headers */,
7E4C96DD1AD4483500365A50 /* JSFetchRequest.h in Headers */,
+ 8E4C96DD1AD4483500365A50 /* JSFetchResponse.h in Headers */,
7D4C96DD1AD4483500365A50 /* JSFetchHeaders.h in Headers */,
7C4C96DD1AD4483500365A50 /* JSReadableStream.h in Headers */,
6C4C96DF1AD4483500365A50 /* JSReadableStreamController.h in Headers */,
@@ -30426,6 +30442,7 @@
7F4C96DC1AD4483500365A50 /* JSFetchBody.cpp in Sources */,
7D4C96DC1AD4483500365A50 /* JSFetchHeaders.cpp in Sources */,
7E4C96DC1AD4483500365A50 /* JSFetchRequest.cpp in Sources */,
+ 8E4C96DC1AD4483500365A50 /* JSFetchResponse.cpp in Sources */,
7C4C96DC1AD4483500365A50 /* JSReadableStream.cpp in Sources */,
6C4C96DE1AD4483500365A50 /* JSReadableStreamController.cpp in Sources */,
4129DF851BB5B80700322A16 /* JSReadableStreamPrivateConstructors.cpp in Sources */,
@@ -30692,6 +30709,7 @@
D3F3D3671A69B1A50059FC2B /* JSWebGLRenderingContextBase.cpp in Sources */,
D3F3D36B1A69B7C50059FC2B /* JSWebGLRenderingContextBaseCustom.cpp in Sources */,
49EED14F1051971A00099FAB /* JSWebGLRenderingContextCustom.cpp in Sources */,
+ 413015D91C7B571400091C6E /* FetchResponse.cpp in Sources */,
6F995A331A70833700A735F4 /* JSWebGLSampler.cpp in Sources */,
49C7B9A21042D2D30009D447 /* JSWebGLShader.cpp in Sources */,
A07D3355152B630E001B6393 /* JSWebGLShaderPrecisionFormat.cpp in Sources */,
Modified: trunk/Source/WebCore/bindings/js/WebCoreJSBuiltins.cpp (197048 => 197049)
--- trunk/Source/WebCore/bindings/js/WebCoreJSBuiltins.cpp 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/Source/WebCore/bindings/js/WebCoreJSBuiltins.cpp 2016-02-24 21:41:51 UTC (rev 197049)
@@ -29,6 +29,7 @@
#include "ByteLengthQueuingStrategyBuiltins.cpp"
#include "CountQueuingStrategyBuiltins.cpp"
#include "FetchHeadersBuiltins.cpp"
+#include "FetchResponseBuiltins.cpp"
#include "MediaDevicesBuiltins.cpp"
#include "NavigatorUserMediaBuiltins.cpp"
#include "RTCPeerConnectionBuiltins.cpp"
Modified: trunk/Source/WebCore/bindings/js/WebCoreJSBuiltins.h (197048 => 197049)
--- trunk/Source/WebCore/bindings/js/WebCoreJSBuiltins.h 2016-02-24 21:37:24 UTC (rev 197048)
+++ trunk/Source/WebCore/bindings/js/WebCoreJSBuiltins.h 2016-02-24 21:41:51 UTC (rev 197049)
@@ -30,6 +30,7 @@
#include "ByteLengthQueuingStrategyBuiltins.h"
#include "CountQueuingStrategyBuiltins.h"
#include "FetchHeadersBuiltins.h"
+#include "FetchResponseBuiltins.h"
#include "MediaDevicesBuiltins.h"
#include "NavigatorUserMediaBuiltins.h"
#include "RTCPeerConnectionBuiltins.h"
@@ -51,6 +52,7 @@
: vm(v)
#if ENABLE(FETCH_API)
, m_fetchHeadersBuiltins(&vm)
+ , m_fetchResponseBuiltins(&vm)
#endif
#if ENABLE(STREAMS_API)
, m_byteLengthQueuingStrategyBuiltins(&vm)
@@ -81,6 +83,7 @@
}
#if ENABLE(FETCH_API)
FetchHeadersBuiltinsWrapper& fetchHeadersBuiltins() { return m_fetchHeadersBuiltins; }
+ FetchResponseBuiltinsWrapper& fetchResponseBuiltins() { return m_fetchResponseBuiltins; }
#endif
#if ENABLE(STREAMS_API)
ByteLengthQueuingStrategyBuiltinsWrapper& byteLengthQueuingStrategyBuiltins() { return m_byteLengthQueuingStrategyBuiltins; }
@@ -104,6 +107,7 @@
JSC::VM& vm;
#if ENABLE(FETCH_API)
FetchHeadersBuiltinsWrapper m_fetchHeadersBuiltins;
+ FetchResponseBuiltinsWrapper m_fetchResponseBuiltins;
#endif
#if ENABLE(STREAMS_API)
ByteLengthQueuingStrategyBuiltinsWrapper m_byteLengthQueuingStrategyBuiltins;