diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/v8/src/d8/d8.h | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/v8/src/d8/d8.h')
-rw-r--r-- | chromium/v8/src/d8/d8.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/chromium/v8/src/d8/d8.h b/chromium/v8/src/d8/d8.h index bd49b81fd02..203e9edb0cb 100644 --- a/chromium/v8/src/d8/d8.h +++ b/chromium/v8/src/d8/d8.h @@ -234,6 +234,12 @@ class PerIsolateData { AsyncHooks* GetAsyncHooks() { return async_hooks_wrapper_; } + void RemoveUnhandledPromise(Local<Promise> promise); + void AddUnhandledPromise(Local<Promise> promise, Local<Message> message, + Local<Value> exception); + int HandleUnhandledPromiseRejections(); + size_t GetUnhandledPromiseCount(); + private: friend class Shell; friend class RealmScope; @@ -245,6 +251,8 @@ class PerIsolateData { Global<Value> realm_shared_; std::queue<Global<Function>> set_timeout_callbacks_; std::queue<Global<Context>> set_timeout_contexts_; + std::vector<std::tuple<Global<Promise>, Global<Message>, Global<Value>>> + unhandled_promises_; AsyncHooks* async_hooks_wrapper_; int RealmIndexOrThrow(const v8::FunctionCallbackInfo<v8::Value>& args, @@ -272,6 +280,7 @@ class ShellOptions { bool interactive_shell = false; bool test_shell = false; bool expected_to_throw = false; + bool ignore_unhandled_promises = false; bool mock_arraybuffer_allocator = false; size_t mock_arraybuffer_allocator_limit = 0; bool multi_mapped_mock_allocator = false; @@ -280,6 +289,7 @@ class ShellOptions { v8::ScriptCompiler::CompileOptions compile_options = v8::ScriptCompiler::kNoCompileOptions; CodeCacheOptions code_cache_options = CodeCacheOptions::kNoProduceCache; + bool streaming_compile = false; SourceGroup* isolate_sources = nullptr; const char* icu_data_file = nullptr; const char* icu_locale = nullptr; @@ -331,6 +341,11 @@ class Shell : public i::AllStatic { static bool EmptyMessageQueues(Isolate* isolate); static bool CompleteMessageLoop(Isolate* isolate); + static bool HandleUnhandledPromiseRejections(Isolate* isolate); + + static void PostForegroundTask(Isolate* isolate, std::unique_ptr<Task> task); + static void PostBlockingBackgroundTask(std::unique_ptr<Task> task); + static std::unique_ptr<SerializationData> SerializeValue( Isolate* isolate, Local<Value> value, Local<Value> transfer); static MaybeLocal<Value> DeserializeValue( @@ -434,6 +449,10 @@ class Shell : public i::AllStatic { Local<Module> module, Local<Object> meta); +#ifdef V8_FUZZILLI + static void Fuzzilli(const v8::FunctionCallbackInfo<v8::Value>& args); +#endif // V8_FUZZILLI + // Data is of type DynamicImportData*. We use void* here to be able // to conform with MicrotaskCallback interface and enqueue this // function in the microtask queue. @@ -446,6 +465,8 @@ class Shell : public i::AllStatic { static ArrayBuffer::Allocator* array_buffer_allocator; static void SetWaitUntilDone(Isolate* isolate, bool value); + static void NotifyStartStreamingTask(Isolate* isolate); + static void NotifyFinishStreamingTask(Isolate* isolate); static char* ReadCharsFromTcpPort(const char* name, int* size_out); @@ -462,6 +483,8 @@ class Shell : public i::AllStatic { static void Initialize(Isolate* isolate, D8Console* console, bool isOnMainThread = true); + static void PromiseRejectCallback(v8::PromiseRejectMessage reject_message); + private: static Global<Context> evaluation_context_; static base::OnceType quit_once_; @@ -506,10 +529,12 @@ class Shell : public i::AllStatic { // the isolate_status_ needs to be concurrency-safe. static base::LazyMutex isolate_status_lock_; static std::map<Isolate*, bool> isolate_status_; + static std::map<Isolate*, int> isolate_running_streaming_tasks_; static base::LazyMutex cached_code_mutex_; static std::map<std::string, std::unique_ptr<ScriptCompiler::CachedData>> cached_code_map_; + static std::atomic<int> unhandled_promise_rejections_; }; } // namespace v8 |