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

Unified Diff: src/api.cc

Issue 2406973003: Revert of [modules] Store Module metadata in per-Context EmbedderData (Closed)
Patch Set: Created 4 years, 2 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 | « include/v8.h ('k') | src/d8.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 65b99672a917f0958619e6d03d83b20401571a6a..82ace9c55be6c16cbfa0e9201a910d67ba7a5f12 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1900,13 +1900,22 @@
return ToApiHandle<String>(i::handle(module_requests->get(i), isolate));
}
-int Module::GetIdentityHash() const { return Utils::OpenHandle(this)->hash(); }
+void Module::SetEmbedderData(Local<Value> data) {
+ Utils::OpenHandle(this)->set_embedder_data(*Utils::OpenHandle(*data));
+}
+
+Local<Value> Module::GetEmbedderData() const {
+ auto self = Utils::OpenHandle(this);
+ return ToApiHandle<Value>(
+ i::handle(self->embedder_data(), self->GetIsolate()));
+}
bool Module::Instantiate(Local<Context> context,
- Module::ResolveCallback callback) {
+ Module::ResolveCallback callback,
+ Local<Value> callback_data) {
PREPARE_FOR_EXECUTION_BOOL(context, Module, Instantiate);
- has_pending_exception =
- !i::Module::Instantiate(Utils::OpenHandle(this), context, callback);
+ has_pending_exception = !i::Module::Instantiate(
+ Utils::OpenHandle(this), context, callback, callback_data);
RETURN_ON_FAILED_EXECUTION_BOOL();
return true;
}
« no previous file with comments | « include/v8.h ('k') | src/d8.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698