OLD | NEW |
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 if (session_ != NULL) { | 100 if (session_ != NULL) { |
101 static const char* message = "Remote debugging session already active\r\n"; | 101 static const char* message = "Remote debugging session already active\r\n"; |
102 | 102 |
103 client->Send(message, strlen(message)); | 103 client->Send(message, strlen(message)); |
104 delete client; | 104 delete client; |
105 return; | 105 return; |
106 } | 106 } |
107 | 107 |
108 // Create a new session and hook up the debug message handler. | 108 // Create a new session and hook up the debug message handler. |
109 session_ = new DebuggerAgentSession(this, client); | 109 session_ = new DebuggerAgentSession(this, client); |
110 v8::Debug::SetMessageHandler(DebuggerAgentMessageHandler, this); | 110 v8::Debug::SetMessageHandler(DebuggerAgentMessageHandler); |
111 session_->Start(); | 111 session_->Start(); |
112 } | 112 } |
113 | 113 |
114 | 114 |
115 void DebuggerAgent::CloseSession() { | 115 void DebuggerAgent::CloseSession() { |
116 ScopedLock with(session_access_); | 116 ScopedLock with(session_access_); |
117 | 117 |
118 // Terminate the session. | 118 // Terminate the session. |
119 if (session_ != NULL) { | 119 if (session_ != NULL) { |
120 session_->Shutdown(); | 120 session_->Shutdown(); |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 return total_received; | 408 return total_received; |
409 } | 409 } |
410 total_received += received; | 410 total_received += received; |
411 } | 411 } |
412 return total_received; | 412 return total_received; |
413 } | 413 } |
414 | 414 |
415 } } // namespace v8::internal | 415 } } // namespace v8::internal |
416 | 416 |
417 #endif // ENABLE_DEBUGGER_SUPPORT | 417 #endif // ENABLE_DEBUGGER_SUPPORT |
OLD | NEW |