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

Side by Side Diff: src/debug-agent.h

Issue 6577036: [Isolates] Merge from bleeding_edge to isolates, revisions 6100-6300. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/debug.cc ('k') | src/debug-agent.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 25 matching lines...) Expand all
36 namespace internal { 36 namespace internal {
37 37
38 // Forward decelrations. 38 // Forward decelrations.
39 class DebuggerAgentSession; 39 class DebuggerAgentSession;
40 40
41 41
42 // Debugger agent which starts a socket listener on the debugger port and 42 // Debugger agent which starts a socket listener on the debugger port and
43 // handles connection from a remote debugger. 43 // handles connection from a remote debugger.
44 class DebuggerAgent: public Thread { 44 class DebuggerAgent: public Thread {
45 public: 45 public:
46 explicit DebuggerAgent(Isolate* isolate, const char* name, int port) 46 DebuggerAgent(Isolate* isolate, const char* name, int port)
47 : Thread(isolate), name_(StrDup(name)), port_(port), 47 : Thread(isolate, name),
48 name_(StrDup(name)), port_(port),
48 server_(OS::CreateSocket()), terminate_(false), 49 server_(OS::CreateSocket()), terminate_(false),
49 session_access_(OS::CreateMutex()), session_(NULL), 50 session_access_(OS::CreateMutex()), session_(NULL),
50 terminate_now_(OS::CreateSemaphore(0)), 51 terminate_now_(OS::CreateSemaphore(0)),
51 listening_(OS::CreateSemaphore(0)) { 52 listening_(OS::CreateSemaphore(0)) {
52 ASSERT(Isolate::Current()->debugger_agent_instance() == NULL); 53 ASSERT(Isolate::Current()->debugger_agent_instance() == NULL);
53 Isolate::Current()->set_debugger_agent_instance(this); 54 Isolate::Current()->set_debugger_agent_instance(this);
54 } 55 }
55 ~DebuggerAgent() { 56 ~DebuggerAgent() {
56 Isolate::Current()->set_debugger_agent_instance(NULL); 57 Isolate::Current()->set_debugger_agent_instance(NULL);
57 delete server_; 58 delete server_;
(...skipping 23 matching lines...) Expand all
81 82
82 DISALLOW_COPY_AND_ASSIGN(DebuggerAgent); 83 DISALLOW_COPY_AND_ASSIGN(DebuggerAgent);
83 }; 84 };
84 85
85 86
86 // Debugger agent session. The session receives requests from the remote 87 // Debugger agent session. The session receives requests from the remote
87 // debugger and sends debugger events/responses to the remote debugger. 88 // debugger and sends debugger events/responses to the remote debugger.
88 class DebuggerAgentSession: public Thread { 89 class DebuggerAgentSession: public Thread {
89 public: 90 public:
90 DebuggerAgentSession(Isolate* isolate, DebuggerAgent* agent, Socket* client) 91 DebuggerAgentSession(Isolate* isolate, DebuggerAgent* agent, Socket* client)
91 : Thread(isolate), agent_(agent), client_(client) {} 92 : Thread(isolate, "v8:DbgAgntSessn"),
93 agent_(agent), client_(client) {}
92 94
93 void DebuggerMessage(Vector<uint16_t> message); 95 void DebuggerMessage(Vector<uint16_t> message);
94 void Shutdown(); 96 void Shutdown();
95 97
96 private: 98 private:
97 void Run(); 99 void Run();
98 100
99 void DebuggerMessage(Vector<char> message); 101 void DebuggerMessage(Vector<char> message);
100 102
101 DebuggerAgent* agent_; 103 DebuggerAgent* agent_;
(...skipping 16 matching lines...) Expand all
118 static bool SendMessage(const Socket* conn, 120 static bool SendMessage(const Socket* conn,
119 const v8::Handle<v8::String> message); 121 const v8::Handle<v8::String> message);
120 static int ReceiveAll(const Socket* conn, char* data, int len); 122 static int ReceiveAll(const Socket* conn, char* data, int len);
121 }; 123 };
122 124
123 } } // namespace v8::internal 125 } } // namespace v8::internal
124 126
125 #endif // ENABLE_DEBUGGER_SUPPORT 127 #endif // ENABLE_DEBUGGER_SUPPORT
126 128
127 #endif // V8_DEBUG_AGENT_H_ 129 #endif // V8_DEBUG_AGENT_H_
OLDNEW
« 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