#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/bindings/core/v8/v8_wasm_response_extensions.h"
#include "base/debug/dump_without_crashing.h"
#include "base/memory/scoped_refptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/numerics/safe_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "components/crash/core/common/crash_key.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/core/v8/to_v8_traits.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_response.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/fetch/body_stream_buffer.h"
#include "third_party/blink/renderer/core/fetch/fetch_data_loader.h"
#include "third_party/blink/renderer/core/fetch/response.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/workers/worker_backing_thread.h"
#include "third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h"
#include "third_party/blink/renderer/core/workers/worker_thread.h"
#include "third_party/blink/renderer/core/workers/worklet_global_scope.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/bindings/v8_per_isolate_data.h"
#include "third_party/blink/renderer/platform/crypto.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/loader/fetch/cached_metadata.h"
#include "third_party/blink/renderer/platform/loader/fetch/script_cached_metadata_handler.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_base.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
namespace blink {
namespace {
static const size_t kWireBytesDigestSize = …;
static const int kWasmModuleTag = …;
void SendCachedData(String response_url,
base::Time response_time,
String cache_storage_cache_name,
ExecutionContext* execution_context,
Vector<uint8_t> serialized_module) { … }
class WasmCodeCachingCallback { … };
class FetchDataLoaderForWasmStreaming final : public FetchDataLoader,
public BytesConsumer::Client { … };
class WasmDataLoaderClient final
: public GarbageCollected<WasmDataLoaderClient>,
public FetchDataLoader::Client { … };
void PropagateExceptionToWasmStreaming(
ExceptionState& exception_state,
std::shared_ptr<v8::WasmStreaming>& streaming) { … }
scoped_refptr<base::SingleThreadTaskRunner> GetContextTaskRunner(
ExecutionContext& execution_context) { … }
void StreamFromResponseCallback(
const v8::FunctionCallbackInfo<v8::Value>& args) { … }
}
void WasmResponseExtensions::Initialize(v8::Isolate* isolate) { … }
}