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

Unified Diff: src/debug-agent.h

Issue 6685088: Merge isolates to bleeding_edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 9 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 | « src/debug.cc ('k') | src/debug-agent.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug-agent.h
===================================================================
--- src/debug-agent.h (revision 7267)
+++ src/debug-agent.h (working copy)
@@ -43,18 +43,18 @@
// handles connection from a remote debugger.
class DebuggerAgent: public Thread {
public:
- explicit DebuggerAgent(const char* name, int port)
- : Thread(name),
+ DebuggerAgent(Isolate* isolate, const char* name, int port)
+ : Thread(isolate, name),
name_(StrDup(name)), port_(port),
server_(OS::CreateSocket()), terminate_(false),
session_access_(OS::CreateMutex()), session_(NULL),
terminate_now_(OS::CreateSemaphore(0)),
listening_(OS::CreateSemaphore(0)) {
- ASSERT(instance_ == NULL);
- instance_ = this;
+ ASSERT(Isolate::Current()->debugger_agent_instance() == NULL);
+ Isolate::Current()->set_debugger_agent_instance(this);
}
~DebuggerAgent() {
- instance_ = NULL;
+ Isolate::Current()->set_debugger_agent_instance(NULL);
delete server_;
}
@@ -77,8 +77,6 @@
Semaphore* terminate_now_; // Semaphore to signal termination.
Semaphore* listening_;
- static DebuggerAgent* instance_;
-
friend class DebuggerAgentSession;
friend void DebuggerAgentMessageHandler(const v8::Debug::Message& message);
@@ -90,8 +88,8 @@
// debugger and sends debugger events/responses to the remote debugger.
class DebuggerAgentSession: public Thread {
public:
- DebuggerAgentSession(DebuggerAgent* agent, Socket* client)
- : Thread("v8:DbgAgntSessn"),
+ DebuggerAgentSession(Isolate* isolate, DebuggerAgent* agent, Socket* client)
+ : Thread(isolate, "v8:DbgAgntSessn"),
agent_(agent), client_(client) {}
void DebuggerMessage(Vector<uint16_t> message);
@@ -112,8 +110,8 @@
// Utility methods factored out to be used by the D8 shell as well.
class DebuggerAgentUtil {
public:
- static const char* kContentLength;
- static int kContentLengthSize;
+ static const char* const kContentLength;
+ static const int kContentLengthSize;
static SmartPointer<char> ReceiveMessage(const Socket* conn);
static bool SendConnectMessage(const Socket* conn,
« no previous file with comments | « src/debug.cc ('k') | src/debug-agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698