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

Unified Diff: src/debug.h

Issue 812583003: Support tasks injection into a running VM. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressing comments. Created 6 years 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 | « src/api.cc ('k') | src/debug.cc » ('j') | test/cctest/test-debug.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.h
diff --git a/src/debug.h b/src/debug.h
index 4440d659dc18198e8c07bde4ca754efcbf7ab396..616f5b3915ec358f6926eb88a3d99ef50afbe555 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -5,6 +5,7 @@
#ifndef V8_DEBUG_H_
#define V8_DEBUG_H_
+#include <queue>
#include "src/allocation.h"
#include "src/arguments.h"
#include "src/assembler.h"
@@ -336,6 +337,21 @@ class LockingCommandMessageQueue BASE_EMBEDDED {
};
+class LockingTaskQueue {
+ public:
+ LockingTaskQueue();
+ ~LockingTaskQueue();
+ void Enqueue(v8::Task* task);
+ v8::Task* Dequeue();
+ void Clear();
+
+ private:
+ std::queue<v8::Task*> queue_;
+ base::Mutex mutex_;
+ DISALLOW_COPY_AND_ASSIGN(LockingTaskQueue);
+};
+
+
// This class contains the debugger support. The main purpose is to handle
// setting break points in the code.
//
@@ -363,6 +379,8 @@ class Debug {
v8::Debug::ClientData* client_data = NULL);
// Enqueue a debugger command to the command queue for event listeners.
void EnqueueDebugCommand(v8::Debug::ClientData* client_data = NULL);
+ void EnqueueEmbedderTask(v8::Task* task);
+ bool ProcessEmbedderTasks();
MUST_USE_RESULT MaybeHandle<Object> Call(Handle<JSFunction> fun,
Handle<Object> data);
Handle<Context> GetDebugContext();
@@ -593,6 +611,7 @@ class Debug {
base::Semaphore command_received_; // Signaled for each command received.
LockingCommandMessageQueue command_queue_;
LockingCommandMessageQueue event_command_queue_;
+ LockingTaskQueue embedder_task_queue_;
bool is_active_;
bool is_suppressed_;
« no previous file with comments | « src/api.cc ('k') | src/debug.cc » ('j') | test/cctest/test-debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698