| OLD | NEW |
| 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 Loading... |
| 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 | |
| 284 class ShellOptions { | 283 class ShellOptions { |
| 285 public: | 284 public: |
| 286 ShellOptions() | 285 ShellOptions() |
| 287 : script_executed(false), | 286 : script_executed(false), |
| 288 send_idle_notification(false), | 287 send_idle_notification(false), |
| 289 invoke_weak_callbacks(false), | 288 invoke_weak_callbacks(false), |
| 290 omit_quit(false), | 289 omit_quit(false), |
| 291 stress_opt(false), | 290 stress_opt(false), |
| 292 stress_deopt(false), | 291 stress_deopt(false), |
| 293 stress_runs(1), | 292 stress_runs(1), |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 // with the current umask. Intermediate directories are created if necessary. | 432 // with the current umask. Intermediate directories are created if necessary. |
| 434 // An exception is not thrown if the directory already exists. Analogous to | 433 // An exception is not thrown if the directory already exists. Analogous to |
| 435 // the "mkdir -p" command. | 434 // the "mkdir -p" command. |
| 436 static void System(const v8::FunctionCallbackInfo<v8::Value>& args); | 435 static void System(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 437 static void ChangeDirectory(const v8::FunctionCallbackInfo<v8::Value>& args); | 436 static void ChangeDirectory(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 438 static void SetEnvironment(const v8::FunctionCallbackInfo<v8::Value>& args); | 437 static void SetEnvironment(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 439 static void UnsetEnvironment(const v8::FunctionCallbackInfo<v8::Value>& args); | 438 static void UnsetEnvironment(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 440 static void SetUMask(const v8::FunctionCallbackInfo<v8::Value>& args); | 439 static void SetUMask(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 441 static void MakeDirectory(const v8::FunctionCallbackInfo<v8::Value>& args); | 440 static void MakeDirectory(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 442 static void RemoveDirectory(const v8::FunctionCallbackInfo<v8::Value>& args); | 441 static void RemoveDirectory(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 442 static void HostImportModuleDynamically(Isolate* isolate, |
| 443 Local<String> referrer, |
| 444 Local<String> specifier, |
| 445 Local<DynamicImportResult> result); |
| 443 | 446 |
| 447 // Data is of type DynamicImportData*. We use void* here to be able |
| 448 // to conform with MicrotaskCallback interface and enqueue this |
| 449 // function in the microtask queue. |
| 450 static void DoHostImportModuleDynamically(void* data); |
| 444 static void AddOSMethods(v8::Isolate* isolate, | 451 static void AddOSMethods(v8::Isolate* isolate, |
| 445 Local<ObjectTemplate> os_template); | 452 Local<ObjectTemplate> os_template); |
| 446 | 453 |
| 447 static const char* kPrompt; | 454 static const char* kPrompt; |
| 448 static ShellOptions options; | 455 static ShellOptions options; |
| 449 static ArrayBuffer::Allocator* array_buffer_allocator; | 456 static ArrayBuffer::Allocator* array_buffer_allocator; |
| 450 | 457 |
| 451 private: | 458 private: |
| 452 static Global<Context> evaluation_context_; | 459 static Global<Context> evaluation_context_; |
| 453 static base::OnceType quit_once_; | 460 static base::OnceType quit_once_; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 482 int index); | 489 int index); |
| 483 static MaybeLocal<Module> FetchModuleTree(v8::Local<v8::Context> context, | 490 static MaybeLocal<Module> FetchModuleTree(v8::Local<v8::Context> context, |
| 484 const std::string& file_name); | 491 const std::string& file_name); |
| 485 }; | 492 }; |
| 486 | 493 |
| 487 | 494 |
| 488 } // namespace v8 | 495 } // namespace v8 |
| 489 | 496 |
| 490 | 497 |
| 491 #endif // V8_D8_H_ | 498 #endif // V8_D8_H_ |
| OLD | NEW |