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

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

Issue 2428213002: [inspector] finish test runner gracefully.. (Closed)
Patch Set: 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/inspector-test.cc ('k') | test/inspector/task-runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/task-runner.h
diff --git a/test/inspector/task-runner.h b/test/inspector/task-runner.h
index fc65ab7cdef3f96f8417bf9a70b077dd5c788659..d78cd390d686e7b15cb318a8398705aa9125ca01 100644
--- a/test/inspector/task-runner.h
+++ b/test/inspector/task-runner.h
@@ -8,6 +8,7 @@
#include "include/v8-inspector.h"
#include "include/v8-platform.h"
#include "include/v8.h"
+#include "src/base/atomic-utils.h"
#include "src/base/macros.h"
#include "src/base/platform/platform.h"
#include "src/locked-queue-inl.h"
@@ -39,6 +40,8 @@ class TaskRunner : public v8::base::Thread {
static TaskRunner* FromContext(v8::Local<v8::Context>);
+ void Terminate();
+
private:
void InitializeContext();
Task* GetNext(bool only_protocol);
@@ -51,15 +54,16 @@ class TaskRunner : public v8::base::Thread {
v8::Global<v8::Context> context_;
// deferred_queue_ combined with queue_ (in this order) have all tasks in the
- // correct order.
- // Sometimes we skip non-protocol tasks by moving them from queue_ to
- // deferred_queue_.
+ // correct order. Sometimes we skip non-protocol tasks by moving them from
+ // queue_ to deferred_queue_.
v8::internal::LockedQueue<Task*> queue_;
v8::internal::LockedQueue<Task*> deffered_queue_;
v8::base::Semaphore process_queue_semaphore_;
int nested_loop_count_;
+ v8::base::AtomicNumber<int> is_terminated_;
+
DISALLOW_COPY_AND_ASSIGN(TaskRunner);
};
« no previous file with comments | « test/inspector/inspector-test.cc ('k') | test/inspector/task-runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698