diff --git a/dom/fetch/Fetch.cpp b/dom/fetch/Fetch.cpp index 6a6b4faaf8..42c9fc74f9 100644 --- a/dom/fetch/Fetch.cpp +++ b/dom/fetch/Fetch.cpp @@ -1000,5 +1000,24 @@ template void FetchBody::SetMimeType(); +template +void +FetchBody::GetBody(JSContext* aCx, + JS::MutableHandle aMessage) +{ + // TODO +} + +template +void +FetchBody::GetBody(JSContext* aCx, + JS::MutableHandle aMessage); + +template +void +FetchBody::GetBody(JSContext* aCx, + JS::MutableHandle aMessage); + + } // namespace dom } // namespace mozilla diff --git a/dom/fetch/Fetch.h b/dom/fetch/Fetch.h index 73d5c15199..bc2df62689 100644 --- a/dom/fetch/Fetch.h +++ b/dom/fetch/Fetch.h @@ -147,6 +147,10 @@ public: return ConsumeBody(CONSUME_TEXT, aRv); } + void + GetBody(JSContext* aCx, + JS::MutableHandle aMessage); + // Utility public methods accessed by various runnables. void diff --git a/dom/fetch/Request.h b/dom/fetch/Request.h index 8c01cbd799..8a22f1340b 100644 --- a/dom/fetch/Request.h +++ b/dom/fetch/Request.h @@ -128,6 +128,8 @@ public: void GetBody(nsIInputStream** aStream) { return mRequest->GetBody(aStream); } + using FetchBody::GetBody; + void SetBody(nsIInputStream* aStream) { return mRequest->SetBody(aStream); } diff --git a/dom/fetch/Response.h b/dom/fetch/Response.h index fa2ced87d8..61f1427f93 100644 --- a/dom/fetch/Response.h +++ b/dom/fetch/Response.h @@ -105,6 +105,8 @@ public: void GetBody(nsIInputStream** aStream) { return mInternalResponse->GetBody(aStream); } + using FetchBody::GetBody; + static already_AddRefed Error(const GlobalObject& aGlobal); diff --git a/dom/webidl/Response.webidl b/dom/webidl/Response.webidl index 08f31fe29a..adaa70d66d 100644 --- a/dom/webidl/Response.webidl +++ b/dom/webidl/Response.webidl @@ -30,6 +30,11 @@ interface Response { }; Response implements Body; +// This should be part of Body but we don't want to expose body to request yet. +partial interface Response { + readonly attribute ReadableStream? body; +}; + dictionary ResponseInit { unsigned short status = 200; ByteString statusText = "OK";