mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 17:31:47 +09:00
Issue #1442 - Part 11 - Response.body handling. https://bugzilla.mozilla.org/show_bug.cgi?id=1329298 Use BufferSource in webIDL. https://bugzilla.mozilla.org/show_bug.cgi?id=1337722
This commit is contained in:
parent
772ab8ac41
commit
a8a75090c0
14 changed files with 413 additions and 72 deletions
|
|
@ -24,6 +24,8 @@ namespace workers {
|
|||
class WorkerHolder;
|
||||
}
|
||||
|
||||
class FetchStreamHolder;
|
||||
|
||||
class FetchStream final : public nsIInputStreamCallback
|
||||
, public nsIObserver
|
||||
, public nsSupportsWeakReference
|
||||
|
|
@ -34,14 +36,20 @@ public:
|
|||
NS_DECL_NSIOBSERVER
|
||||
|
||||
static JSObject*
|
||||
Create(JSContext* aCx, nsIGlobalObject* aGlobal,
|
||||
nsIInputStream* aInputStream, ErrorResult& aRv);
|
||||
Create(JSContext* aCx, FetchStreamHolder* aStreamHolder,
|
||||
nsIGlobalObject* aGlobal, nsIInputStream* aInputStream,
|
||||
ErrorResult& aRv);
|
||||
|
||||
void
|
||||
Close();
|
||||
|
||||
static nsresult
|
||||
RetrieveInputStream(void* aUnderlyingReadableStreamSource,
|
||||
nsIInputStream** aInputStream);
|
||||
private:
|
||||
FetchStream(nsIGlobalObject* aGlobal, nsIInputStream* aInputStream);
|
||||
FetchStream(nsIGlobalObject* aGlobal,
|
||||
FetchStreamHolder* aStreamHolder,
|
||||
nsIInputStream* aInputStream);
|
||||
~FetchStream();
|
||||
|
||||
static void
|
||||
|
|
@ -76,7 +84,10 @@ private:
|
|||
ErrorPropagation(JSContext* aCx, JS::HandleObject aStream, nsresult aRv);
|
||||
|
||||
void
|
||||
CloseAndReleaseObjects();
|
||||
CloseAndReleaseObjects(JSContext* aCx, JS::HandleObject aStream);
|
||||
|
||||
void
|
||||
ReleaseObjects();
|
||||
|
||||
// Common methods
|
||||
|
||||
|
|
@ -104,6 +115,8 @@ private:
|
|||
State mState;
|
||||
|
||||
nsCOMPtr<nsIGlobalObject> mGlobal;
|
||||
RefPtr<FetchStreamHolder> mStreamHolder;
|
||||
nsCOMPtr<nsIEventTarget> mOwningEventTarget;
|
||||
|
||||
// This is the original inputStream received during the CTOR. It will be
|
||||
// converted into an nsIAsyncInputStream and stored into mInputStream at the
|
||||
|
|
@ -111,8 +124,6 @@ private:
|
|||
nsCOMPtr<nsIInputStream> mOriginalInputStream;
|
||||
nsCOMPtr<nsIAsyncInputStream> mInputStream;
|
||||
|
||||
nsCOMPtr<nsIEventTarget> mOwningEventTarget;
|
||||
|
||||
UniquePtr<workers::WorkerHolder> mWorkerHolder;
|
||||
|
||||
JS::Heap<JSObject*> mReadableStream;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue