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

Unified Diff: include/v8.h

Issue 2228073002: [wasm] serialization: updated external APIs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [wasm] serialization: updated external APIs Created 4 years, 4 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
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 69bf17c33e5c901609e76e4af509c970cac5aab5..67110c619355526e8a0208517847f89ed1170cd8 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -18,6 +18,7 @@
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
+#include <memory>
#include <utility>
#include <vector>
@@ -3462,6 +3463,19 @@ class V8_EXPORT Proxy : public Object {
static void CheckCast(Value* obj);
};
+class V8_EXPORT WasmCompiledModule : public Object {
+ public:
+ typedef std::pair<std::unique_ptr<const uint8_t[]>, size_t> SerializedModule;
+
+ SerializedModule Serialize();
+ static MaybeLocal<WasmCompiledModule> Deserialize(
+ Isolate* isolate, const SerializedModule serialized_data);
+ V8_INLINE static WasmCompiledModule* Cast(Value* obj);
+
+ private:
+ WasmCompiledModule();
+ static void CheckCast(Value* obj);
+};
#ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
// The number of required internal fields can be defined by embedder.
@@ -8562,6 +8576,12 @@ Proxy* Proxy::Cast(v8::Value* value) {
return static_cast<Proxy*>(value);
}
+WasmCompiledModule* WasmCompiledModule::Cast(v8::Value* value) {
+#ifdef V8_ENABLE_CHECKS
+ CheckCast(value);
+#endif
+ return static_cast<WasmCompiledModule*>(value);
+}
Promise::Resolver* Promise::Resolver::Cast(v8::Value* value) {
#ifdef V8_ENABLE_CHECKS
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698