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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_D8_H_ 5 #ifndef V8_D8_H_
6 #define V8_D8_H_ 6 #define V8_D8_H_
7 7
8 #include <iterator> 8 #include <iterator>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 base::Semaphore in_semaphore_; 274 base::Semaphore in_semaphore_;
275 base::Semaphore out_semaphore_; 275 base::Semaphore out_semaphore_;
276 SerializationDataQueue in_queue_; 276 SerializationDataQueue in_queue_;
277 SerializationDataQueue out_queue_; 277 SerializationDataQueue out_queue_;
278 base::Thread* thread_; 278 base::Thread* thread_;
279 char* script_; 279 char* script_;
280 base::Atomic32 running_; 280 base::Atomic32 running_;
281 }; 281 };
282 282
283 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.
284 public:
285 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.
286 Local<String> specifier, Local<Promise> promise)
287 : isolate_(isolate) {
288 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.
289 specifier_.Reset(isolate_, specifier);
290 promise_.Reset(isolate_, promise);
291 }
292
293 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.
294 Global<String> referrer_;
295 Global<String> specifier_;
296 Global<Promise> promise_;
297 };
283 298
284 class ShellOptions { 299 class ShellOptions {
285 public: 300 public:
286 ShellOptions() 301 ShellOptions()
287 : script_executed(false), 302 : script_executed(false),
288 send_idle_notification(false), 303 send_idle_notification(false),
289 invoke_weak_callbacks(false), 304 invoke_weak_callbacks(false),
290 omit_quit(false), 305 omit_quit(false),
291 stress_opt(false), 306 stress_opt(false),
292 stress_deopt(false), 307 stress_deopt(false),
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 // with the current umask. Intermediate directories are created if necessary. 448 // with the current umask. Intermediate directories are created if necessary.
434 // An exception is not thrown if the directory already exists. Analogous to 449 // An exception is not thrown if the directory already exists. Analogous to
435 // the "mkdir -p" command. 450 // the "mkdir -p" command.
436 static void System(const v8::FunctionCallbackInfo<v8::Value>& args); 451 static void System(const v8::FunctionCallbackInfo<v8::Value>& args);
437 static void ChangeDirectory(const v8::FunctionCallbackInfo<v8::Value>& args); 452 static void ChangeDirectory(const v8::FunctionCallbackInfo<v8::Value>& args);
438 static void SetEnvironment(const v8::FunctionCallbackInfo<v8::Value>& args); 453 static void SetEnvironment(const v8::FunctionCallbackInfo<v8::Value>& args);
439 static void UnsetEnvironment(const v8::FunctionCallbackInfo<v8::Value>& args); 454 static void UnsetEnvironment(const v8::FunctionCallbackInfo<v8::Value>& args);
440 static void SetUMask(const v8::FunctionCallbackInfo<v8::Value>& args); 455 static void SetUMask(const v8::FunctionCallbackInfo<v8::Value>& args);
441 static void MakeDirectory(const v8::FunctionCallbackInfo<v8::Value>& args); 456 static void MakeDirectory(const v8::FunctionCallbackInfo<v8::Value>& args);
442 static void RemoveDirectory(const v8::FunctionCallbackInfo<v8::Value>& args); 457 static void RemoveDirectory(const v8::FunctionCallbackInfo<v8::Value>& args);
443 458 static void HostImportModuleDynamically(Isolate* isolate,
459 Local<String> source_url,
460 Local<String> specifier,
461 Local<Promise> promise);
462 static void DoHostImportModuleDynamically(void* data);
444 static void AddOSMethods(v8::Isolate* isolate, 463 static void AddOSMethods(v8::Isolate* isolate,
445 Local<ObjectTemplate> os_template); 464 Local<ObjectTemplate> os_template);
446 465
447 static const char* kPrompt; 466 static const char* kPrompt;
448 static ShellOptions options; 467 static ShellOptions options;
449 static ArrayBuffer::Allocator* array_buffer_allocator; 468 static ArrayBuffer::Allocator* array_buffer_allocator;
450 469
451 private: 470 private:
452 static Global<Context> evaluation_context_; 471 static Global<Context> evaluation_context_;
453 static base::OnceType quit_once_; 472 static base::OnceType quit_once_;
(...skipping 21 matching lines...) Expand all
475 static void RunShell(Isolate* isolate); 494 static void RunShell(Isolate* isolate);
476 static bool SetOptions(int argc, char* argv[]); 495 static bool SetOptions(int argc, char* argv[]);
477 static Local<ObjectTemplate> CreateGlobalTemplate(Isolate* isolate); 496 static Local<ObjectTemplate> CreateGlobalTemplate(Isolate* isolate);
478 static MaybeLocal<Context> CreateRealm( 497 static MaybeLocal<Context> CreateRealm(
479 const v8::FunctionCallbackInfo<v8::Value>& args, int index, 498 const v8::FunctionCallbackInfo<v8::Value>& args, int index,
480 v8::MaybeLocal<Value> global_object); 499 v8::MaybeLocal<Value> global_object);
481 static void DisposeRealm(const v8::FunctionCallbackInfo<v8::Value>& args, 500 static void DisposeRealm(const v8::FunctionCallbackInfo<v8::Value>& args,
482 int index); 501 int index);
483 static MaybeLocal<Module> FetchModuleTree(v8::Local<v8::Context> context, 502 static MaybeLocal<Module> FetchModuleTree(v8::Local<v8::Context> context,
484 const std::string& file_name); 503 const std::string& file_name);
504 static MaybeLocal<Module> DynamicFetchModuleTree(
505 v8::Local<v8::Context> context, v8::Local<v8::Promise> promise,
506 const std::string& file_name);
485 }; 507 };
486 508
487 509
488 } // namespace v8 510 } // namespace v8
489 511
490 512
491 #endif // V8_D8_H_ 513 #endif // V8_D8_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698