diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/fetch/body_stream_buffer.h')
-rw-r--r-- | chromium/third_party/blink/renderer/core/fetch/body_stream_buffer.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/chromium/third_party/blink/renderer/core/fetch/body_stream_buffer.h b/chromium/third_party/blink/renderer/core/fetch/body_stream_buffer.h index 25b16f316f6..cf949e90612 100644 --- a/chromium/third_party/blink/renderer/core/fetch/body_stream_buffer.h +++ b/chromium/third_party/blink/renderer/core/fetch/body_stream_buffer.h @@ -6,7 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_FETCH_BODY_STREAM_BUFFER_H_ #include <memory> -#include "base/util/type_safety/pass_key.h" +#include "base/types/pass_key.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "services/network/public/mojom/chunked_data_pipe_getter.mojom-blink.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise.h" @@ -27,11 +27,12 @@ class EncodedFormData; class ExceptionState; class ReadableStream; class ScriptState; +class ScriptCachedMetadataHandler; class CORE_EXPORT BodyStreamBuffer final : public UnderlyingSourceBase, public BytesConsumer::Client { public: - using PassKey = util::PassKey<BodyStreamBuffer>; + using PassKey = base::PassKey<BodyStreamBuffer>; // Create a BodyStreamBuffer for |consumer|. // |consumer| must not have a client. @@ -42,6 +43,7 @@ class CORE_EXPORT BodyStreamBuffer final : public UnderlyingSourceBase, ScriptState*, BytesConsumer* consumer, AbortSignal* signal, + ScriptCachedMetadataHandler* cached_metadata_handler, scoped_refptr<BlobDataHandle> side_data_blob = nullptr); // Create() should be used instead of calling this constructor directly. @@ -49,10 +51,12 @@ class CORE_EXPORT BodyStreamBuffer final : public UnderlyingSourceBase, ScriptState*, BytesConsumer* consumer, AbortSignal* signal, + ScriptCachedMetadataHandler* cached_metadata_handler, scoped_refptr<BlobDataHandle> side_data_blob); BodyStreamBuffer(ScriptState*, ReadableStream* stream, + ScriptCachedMetadataHandler* cached_metadata_handler, scoped_refptr<BlobDataHandle> side_data_blob = nullptr); ReadableStream* Stream() { return stream_; } @@ -93,6 +97,15 @@ class CORE_EXPORT BodyStreamBuffer final : public UnderlyingSourceBase, bool IsAborted(); + // Returns the ScriptCachedMetadataHandler associated with the contents of + // this stream. This can return nullptr. Streams' ownership model applies, so + // this function is expected to be called by the owner of this stream. + ScriptCachedMetadataHandler* GetCachedMetadataHandler() { + DCHECK(!IsStreamLocked()); + DCHECK(!IsStreamDisturbed()); + return cached_metadata_handler_; + } + // Take the blob representing any side data associated with this body // stream. This must be called before the body is drained or begins // loading. @@ -131,6 +144,8 @@ class CORE_EXPORT BodyStreamBuffer final : public UnderlyingSourceBase, // We need this to ensure that we detect that abort has been signalled // correctly. Member<AbortSignal> signal_; + // CachedMetadata handler used for loading compiled WASM code. + Member<ScriptCachedMetadataHandler> cached_metadata_handler_; // Additional side data associated with this body stream. It should only be // retained until the body is drained or starts loading. Client code, such // as service workers, can call TakeSideDataBlob() prior to consumption. |