Index: modules/fetch/Response.idl |
diff --git a/modules/serviceworkers/Response.idl b/modules/fetch/Response.idl |
similarity index 50% |
rename from modules/serviceworkers/Response.idl |
rename to modules/fetch/Response.idl |
index d3cd258a63f9952fe7e3d9d17dcc502631e4b61d..5deaa680f4f3581a332d87b9d1cd9fb41f05f978 100644 |
--- a/modules/serviceworkers/Response.idl |
+++ b/modules/fetch/Response.idl |
@@ -6,26 +6,30 @@ |
enum ResponseType { "basic", "cors", "default", "error", "opaque" }; |
+// FIXME: Add union type: URLSearchParams |
+typedef (Blob or ArrayBuffer or ArrayBufferView or FormData or USVString) BodyInit; |
+ |
[ |
- // FIXME: Add ctors for FormData and URLSearchParams response bodies. |
- Constructor(ScalarValueString body, optional Dictionary responseInitDict), |
- Constructor(Blob? body, optional Dictionary responseInitDict), |
- Constructor(ArrayBuffer input, optional Dictionary requestInitDict), |
- Constructor(ArrayBufferView input, optional Dictionary requestInitDict), |
+ Constructor(optional BodyInit body, optional Dictionary responseInitDict), |
ConstructorCallWith=ExecutionContext, |
- RuntimeEnabled=ServiceWorker, |
- Exposed=ServiceWorker, |
+ Exposed=(Window,Worker), |
RaisesException=Constructor, |
+ ActiveDOMObject, |
GarbageCollected, |
+ TypeChecking=Interface, |
] interface Response { |
- // FIXME: Implement redirect(). |
+ [CallWith=ExecutionContext] static Response error(); |
+ [CallWith=ExecutionContext, RaisesException] static Response redirect(USVString url, optional unsigned short status = 302); |
readonly attribute ResponseType type; |
- readonly attribute ScalarValueString url; |
+ readonly attribute USVString url; |
readonly attribute unsigned short status; |
+ readonly attribute boolean ok; |
readonly attribute ByteString statusText; |
readonly attribute Headers headers; |
- Response clone(); |
+ [RaisesException] Response clone(); |
+ |
+ readonly attribute ReadableByteStream body; |
}; |
Response implements Body; |