Index: third_party/WebKit/Source/modules/fetch/Response.h |
diff --git a/third_party/WebKit/Source/modules/fetch/Response.h b/third_party/WebKit/Source/modules/fetch/Response.h |
index 291c6fb5e5278e948153da1a75130d0eefeb3b03..900d3d9b54e4e2eb99b363913cbf123e83e3011a 100644 |
--- a/third_party/WebKit/Source/modules/fetch/Response.h |
+++ b/third_party/WebKit/Source/modules/fetch/Response.h |
@@ -26,7 +26,31 @@ class ScriptState; |
class WebServiceWorkerResponse; |
class MODULES_EXPORT Response final : public Body { |
- DEFINE_WRAPPERTYPEINFO(); |
+ public: |
+ const WrapperTypeInfo* wrapperTypeInfo() const override { |
+ return &s_wrapperTypeInfoOverride; |
+ } |
+ |
+ private: |
+ // We want to overload in blink V8-provided APIs - namely, WebAssembly.compile |
+ // and WebAssembly.instantiate. Refer to: |
+ // https://github.com/WebAssembly/design/blob/master/Web.md#additional-web-embedding-api |
+ // |
+ // The overloads need to be implemented blink-side because they work with web |
+ // APIs (Response). To achieve this, we use purposefully-built injection |
+ // points exposed by V8 and initialize them when the Response APIs are |
+ // initialized. At the moment, this requires working around the generated |
+ // code: we redefine the WrapperTypeInfo and insert the installerOveride, |
+ // which injects the overloads and then continues with the usual |
+ // initialization. |
+ // |
+ // https://crbug.com/708238 for tracking. |
+ static v8::Local<v8::FunctionTemplate> installerOverride( |
+ v8::Isolate*, |
+ const DOMWrapperWorld&); |
+ static const WrapperTypeInfo& s_wrapperTypeInfo; |
+ static const WrapperTypeInfo s_wrapperTypeInfoOverride; |
+ |
WTF_MAKE_NONCOPYABLE(Response); |
public: |