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

Unified Diff: src/d8.cc

Issue 2897103002: [api] Expose Isolate::SetHostImportModuleDynamicallyCallback (Closed)
Patch Set: Rebase on master to resolve conflict Created 3 years, 7 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 | « src/api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index 5ca55bca6df8fae3c7a79cf288ea65415461674c..2a01e3e55e38e3de4d1cc4c0f70c868992d0674b 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -481,9 +481,9 @@ ScriptCompiler::CachedData* CompileForCachedData(
}
Isolate::CreateParams create_params;
create_params.array_buffer_allocator = Shell::array_buffer_allocator;
- create_params.host_import_module_dynamically_callback_ =
- Shell::HostImportModuleDynamically;
Isolate* temp_isolate = Isolate::New(create_params);
+ temp_isolate->SetHostImportModuleDynamicallyCallback(
+ Shell::HostImportModuleDynamically);
ScriptCompiler::CachedData* result = NULL;
{
Isolate::Scope isolate_scope(temp_isolate);
@@ -2313,9 +2313,9 @@ base::Thread::Options SourceGroup::GetThreadOptions() {
void SourceGroup::ExecuteInThread() {
Isolate::CreateParams create_params;
create_params.array_buffer_allocator = Shell::array_buffer_allocator;
- create_params.host_import_module_dynamically_callback_ =
- Shell::HostImportModuleDynamically;
Isolate* isolate = Isolate::New(create_params);
+ isolate->SetHostImportModuleDynamicallyCallback(
+ Shell::HostImportModuleDynamically);
Shell::EnsureEventLoopInitialized(isolate);
D8Console console(isolate);
@@ -2458,9 +2458,9 @@ void Worker::WaitForThread() {
void Worker::ExecuteInThread() {
Isolate::CreateParams create_params;
create_params.array_buffer_allocator = Shell::array_buffer_allocator;
- create_params.host_import_module_dynamically_callback_ =
- Shell::HostImportModuleDynamically;
Isolate* isolate = Isolate::New(create_params);
+ isolate->SetHostImportModuleDynamicallyCallback(
+ Shell::HostImportModuleDynamically);
D8Console console(isolate);
debug::SetConsoleDelegate(isolate, &console);
{
@@ -3107,9 +3107,6 @@ int Shell::Main(int argc, char* argv[]) {
create_params.add_histogram_sample_callback = AddHistogramSample;
}
- create_params.host_import_module_dynamically_callback_ =
- Shell::HostImportModuleDynamically;
-
if (i::trap_handler::UseTrapHandler()) {
if (!v8::V8::RegisterDefaultSignalHandler()) {
fprintf(stderr, "Could not register signal handler");
@@ -3118,6 +3115,8 @@ int Shell::Main(int argc, char* argv[]) {
}
Isolate* isolate = Isolate::New(create_params);
+ isolate->SetHostImportModuleDynamicallyCallback(
+ Shell::HostImportModuleDynamically);
jkrems 2017/05/26 15:55:31 This new-line is the only change from before - it
D8Console console(isolate);
{
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698