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, |