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

Unified Diff: test/inspector/task-runner.cc

Issue 2384373002: [inspector] introduced exceptionThrown support in test runner (Closed)
Patch Set: addressed comments Created 4 years, 2 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 | « test/inspector/task-runner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/task-runner.cc
diff --git a/test/inspector/task-runner.cc b/test/inspector/task-runner.cc
index 841a5fcd680cb41ce001e80ddfce8fa5596bfb59..d614c88bc48d7294895bc5d23da8a50ff2566a01 100644
--- a/test/inspector/task-runner.cc
+++ b/test/inspector/task-runner.cc
@@ -23,9 +23,11 @@ void ReportUncaughtException(v8::Isolate* isolate,
} // namespace
TaskRunner::TaskRunner(v8::ExtensionConfiguration* extensions,
+ bool catch_exceptions,
v8::base::Semaphore* ready_semaphore)
: Thread(Options("Task Runner")),
extensions_(extensions),
+ catch_exceptions_(catch_exceptions),
ready_semaphore_(ready_semaphore),
isolate_(nullptr),
process_queue_semaphore_(0),
@@ -64,14 +66,19 @@ void TaskRunner::RunMessageLoop(bool only_protocol) {
while (nested_loop_count_ == loop_number) {
TaskRunner::Task* task = GetNext(only_protocol);
v8::Isolate::Scope isolate_scope(isolate_);
- v8::TryCatch try_catch(isolate_);
- task->Run(isolate_, context_);
- delete task;
- if (try_catch.HasCaught()) {
- ReportUncaughtException(isolate_, try_catch);
- fflush(stdout);
- fflush(stderr);
- _exit(0);
+ if (catch_exceptions_) {
+ v8::TryCatch try_catch(isolate_);
+ task->Run(isolate_, context_);
+ delete task;
+ if (try_catch.HasCaught()) {
+ ReportUncaughtException(isolate_, try_catch);
+ fflush(stdout);
+ fflush(stderr);
+ _exit(0);
+ }
+ } else {
+ task->Run(isolate_, context_);
+ delete task;
}
}
}
« no previous file with comments | « test/inspector/task-runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698