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

Unified Diff: src/debug-agent.h

Issue 7003108: "Deiceolate" Thread classes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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
Index: src/debug-agent.h
diff --git a/src/debug-agent.h b/src/debug-agent.h
index a25002e0a7f6e5c829cd0173329c1c47f45771bb..e16787197756f5ac7af5a4dc6b218df478dc903a 100644
--- a/src/debug-agent.h
+++ b/src/debug-agent.h
@@ -43,24 +43,27 @@ class DebuggerAgentSession;
// handles connection from a remote debugger.
class DebuggerAgent: public Thread {
public:
- DebuggerAgent(Isolate* isolate, const char* name, int port)
- : Thread(isolate, name),
+ DebuggerAgent(const char* name, int port)
+ : Thread(name),
+ isolate_(Isolate::Current()),
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(Isolate::Current()->debugger_agent_instance() == NULL);
- Isolate::Current()->set_debugger_agent_instance(this);
+ ASSERT(isolate_->debugger_agent_instance() == NULL);
+ isolate_->set_debugger_agent_instance(this);
}
~DebuggerAgent() {
- Isolate::Current()->set_debugger_agent_instance(NULL);
+ isolate_->set_debugger_agent_instance(NULL);
delete server_;
}
void Shutdown();
void WaitUntilListening();
+ Isolate* isolate() { return isolate_; }
+
private:
void Run();
void CreateSession(Socket* socket);
@@ -68,6 +71,7 @@ class DebuggerAgent: public Thread {
void CloseSession();
void OnSessionClosed(DebuggerAgentSession* session);
+ Isolate* isolate_;
SmartPointer<const char> name_; // Name of the embedding application.
int port_; // Port to use for the agent.
Socket* server_; // Server socket for listen/accept.
@@ -88,8 +92,8 @@ class DebuggerAgent: public Thread {
// debugger and sends debugger events/responses to the remote debugger.
class DebuggerAgentSession: public Thread {
public:
- DebuggerAgentSession(Isolate* isolate, DebuggerAgent* agent, Socket* client)
- : Thread(isolate, "v8:DbgAgntSessn"),
+ DebuggerAgentSession(DebuggerAgent* agent, Socket* client)
+ : Thread("v8:DbgAgntSessn"),
agent_(agent), client_(client) {}
void DebuggerMessage(Vector<uint16_t> message);

Powered by Google App Engine
This is Rietveld 408576698