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

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

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 ScopedLock with(session_access_); 109 ScopedLock with(session_access_);
110 110
111 // If another session is already established terminate this one. 111 // If another session is already established terminate this one.
112 if (session_ != NULL) { 112 if (session_ != NULL) {
113 client->Send(kCreateSessionMessage, StrLength(kCreateSessionMessage)); 113 client->Send(kCreateSessionMessage, StrLength(kCreateSessionMessage));
114 delete client; 114 delete client;
115 return; 115 return;
116 } 116 }
117 117
118 // Create a new session and hook up the debug message handler. 118 // Create a new session and hook up the debug message handler.
119 session_ = new DebuggerAgentSession(isolate(), this, client); 119 session_ = new DebuggerAgentSession(this, client);
120 v8::Debug::SetMessageHandler2(DebuggerAgentMessageHandler); 120 isolate_->debugger()->SetMessageHandler(DebuggerAgentMessageHandler);
121 session_->Start(); 121 session_->Start();
122 } 122 }
123 123
124 124
125 void DebuggerAgent::CloseSession() { 125 void DebuggerAgent::CloseSession() {
126 ScopedLock with(session_access_); 126 ScopedLock with(session_access_);
127 127
128 // Terminate the session. 128 // Terminate the session.
129 if (session_ != NULL) { 129 if (session_ != NULL) {
130 session_->Shutdown(); 130 session_->Shutdown();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 len++; 196 len++;
197 } 197 }
198 ScopedVector<int16_t> temp(len + 1); 198 ScopedVector<int16_t> temp(len + 1);
199 buf.Reset(msg, StrLength(msg)); 199 buf.Reset(msg, StrLength(msg));
200 for (int i = 0; i < len; i++) { 200 for (int i = 0; i < len; i++) {
201 temp[i] = buf.GetNext(); 201 temp[i] = buf.GetNext();
202 } 202 }
203 203
204 // Send the request received to the debugger. 204 // Send the request received to the debugger.
205 v8::Debug::SendCommand(reinterpret_cast<const uint16_t *>(temp.start()), 205 v8::Debug::SendCommand(reinterpret_cast<const uint16_t *>(temp.start()),
206 len); 206 len,
207 NULL,
208 reinterpret_cast<v8::Isolate*>(agent_->isolate()));
207 209
208 if (is_closing_session) { 210 if (is_closing_session) {
209 // Session is closed. 211 // Session is closed.
210 agent_->OnSessionClosed(this); 212 agent_->OnSessionClosed(this);
211 return; 213 return;
212 } 214 }
213 } 215 }
214 } 216 }
215 217
216 218
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 return total_received; 440 return total_received;
439 } 441 }
440 total_received += received; 442 total_received += received;
441 } 443 }
442 return total_received; 444 return total_received;
443 } 445 }
444 446
445 } } // namespace v8::internal 447 } } // namespace v8::internal
446 448
447 #endif // ENABLE_DEBUGGER_SUPPORT 449 #endif // ENABLE_DEBUGGER_SUPPORT
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698