OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 void DebuggerAgent::OnSessionClosed(DebuggerAgentSession* session) { | 150 void DebuggerAgent::OnSessionClosed(DebuggerAgentSession* session) { |
151 // Don't do anything during termination. | 151 // Don't do anything during termination. |
152 if (terminate_) { | 152 if (terminate_) { |
153 return; | 153 return; |
154 } | 154 } |
155 | 155 |
156 // Terminate the session. | 156 // Terminate the session. |
157 ScopedLock with(session_access_); | 157 ScopedLock with(session_access_); |
158 ASSERT(session == session_); | 158 ASSERT(session == session_); |
159 if (session == session_) { | 159 if (session == session_) { |
160 CloseSession(); | 160 session_->Shutdown(); |
| 161 delete session_; |
| 162 session_ = NULL; |
161 } | 163 } |
162 } | 164 } |
163 | 165 |
164 | 166 |
165 void DebuggerAgentSession::Run() { | 167 void DebuggerAgentSession::Run() { |
166 // Send the hello message. | 168 // Send the hello message. |
167 bool ok = DebuggerAgentUtil::SendConnectMessage(client_, *agent_->name_); | 169 bool ok = DebuggerAgentUtil::SendConnectMessage(client_, *agent_->name_); |
168 if (!ok) return; | 170 if (!ok) return; |
169 | 171 |
170 while (true) { | 172 while (true) { |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 return total_received; | 460 return total_received; |
459 } | 461 } |
460 total_received += received; | 462 total_received += received; |
461 } | 463 } |
462 return total_received; | 464 return total_received; |
463 } | 465 } |
464 | 466 |
465 } } // namespace v8::internal | 467 } } // namespace v8::internal |
466 | 468 |
467 #endif // ENABLE_DEBUGGER_SUPPORT | 469 #endif // ENABLE_DEBUGGER_SUPPORT |
OLD | NEW |