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

Unified Diff: src/d8.h

Issue 2703563002: [ESNext] Implement DynamicImportCall (Closed)
Patch Set: fix build 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: src/d8.h
diff --git a/src/d8.h b/src/d8.h
index 21e4c4f0833c9f26da1b49813c1606d3d06351b5..c581a48667cc9f1127f7afc48391d990e76ae56a 100644
--- a/src/d8.h
+++ b/src/d8.h
@@ -280,6 +280,21 @@ class Worker {
base::Atomic32 running_;
};
+class DynamicImportData {
adamk 2017/03/15 21:36:44 All-public things generally use "struct" instead o
gsathya 2017/03/16 00:59:24 Done.
+ public:
+ explicit DynamicImportData(Isolate* isolate, Local<String> referrer,
adamk 2017/03/15 21:36:44 No need for "explicit" here, since this constructo
gsathya 2017/03/16 00:59:24 Done.
+ Local<String> specifier, Local<Promise> promise)
+ : isolate_(isolate) {
+ referrer_.Reset(isolate_, referrer);
adamk 2017/03/15 21:36:43 Rather than calling Reset, you should be able to u
gsathya 2017/03/16 00:59:24 Nope, globals don't seem to have that constructor.
+ specifier_.Reset(isolate_, specifier);
+ promise_.Reset(isolate_, promise);
+ }
+
+ Isolate* isolate_;
adamk 2017/03/15 21:36:43 Style: public data members should not have a trail
gsathya 2017/03/16 00:59:24 Done.
+ Global<String> referrer_;
+ Global<String> specifier_;
+ Global<Promise> promise_;
+};
class ShellOptions {
public:
@@ -440,7 +455,11 @@ class Shell : public i::AllStatic {
static void SetUMask(const v8::FunctionCallbackInfo<v8::Value>& args);
static void MakeDirectory(const v8::FunctionCallbackInfo<v8::Value>& args);
static void RemoveDirectory(const v8::FunctionCallbackInfo<v8::Value>& args);
-
+ static void HostImportModuleDynamically(Isolate* isolate,
+ Local<String> source_url,
+ Local<String> specifier,
+ Local<Promise> promise);
+ static void DoHostImportModuleDynamically(void* data);
static void AddOSMethods(v8::Isolate* isolate,
Local<ObjectTemplate> os_template);
@@ -482,6 +501,9 @@ class Shell : public i::AllStatic {
int index);
static MaybeLocal<Module> FetchModuleTree(v8::Local<v8::Context> context,
const std::string& file_name);
+ static MaybeLocal<Module> DynamicFetchModuleTree(
+ v8::Local<v8::Context> context, v8::Local<v8::Promise> promise,
+ const std::string& file_name);
};

Powered by Google App Engine
This is Rietveld 408576698