Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(546)

Unified Diff: third_party/WebKit/Source/modules/fetch/Response.h

Issue 2780693003: [wasm] response-based compile APIs (Closed)
Patch Set: . Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..b294c4199f94983dfcc9d5fdc267c33371ae079a 100644
--- a/third_party/WebKit/Source/modules/fetch/Response.h
+++ b/third_party/WebKit/Source/modules/fetch/Response.h
@@ -26,7 +26,29 @@ 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.
+ 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:

Powered by Google App Engine
This is Rietveld 408576698