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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 #include "v8.h" | 29 #include "v8.h" |
30 #include "debug-agent.h" | 30 #include "debug-agent.h" |
31 | 31 |
32 #ifdef ENABLE_DEBUGGER_SUPPORT | 32 #ifdef ENABLE_DEBUGGER_SUPPORT |
33 namespace v8 { namespace internal { | 33 namespace v8 { namespace internal { |
34 | 34 |
35 // Public V8 debugger API message handler function. This function just delegates | 35 // Public V8 debugger API message handler function. This function just delegates |
36 // to the debugger agent through it's data parameter. | 36 // to the debugger agent through it's data parameter. |
37 void DebuggerAgentMessageHandler(const uint16_t* message, int length, | 37 void DebuggerAgentMessageHandler(const uint16_t* message, int length, |
38 void *data) { | 38 v8::Debug::ClientData* client_data) { |
39 reinterpret_cast<DebuggerAgent*>(data)->DebuggerMessage(message, length); | 39 DebuggerAgent::instance_->DebuggerMessage(message, length); |
40 } | 40 } |
41 | 41 |
| 42 // static |
| 43 DebuggerAgent* DebuggerAgent::instance_ = NULL; |
42 | 44 |
43 // Debugger agent main thread. | 45 // Debugger agent main thread. |
44 void DebuggerAgent::Run() { | 46 void DebuggerAgent::Run() { |
45 const int kOneSecondInMicros = 1000000; | 47 const int kOneSecondInMicros = 1000000; |
46 | 48 |
47 // Allow this socket to reuse port even if still in TIME_WAIT. | 49 // Allow this socket to reuse port even if still in TIME_WAIT. |
48 server_->SetReuseAddress(true); | 50 server_->SetReuseAddress(true); |
49 | 51 |
50 // First bind the socket to the requested port. | 52 // First bind the socket to the requested port. |
51 bool bound = false; | 53 bool bound = false; |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 return total_received; | 408 return total_received; |
407 } | 409 } |
408 total_received += received; | 410 total_received += received; |
409 } | 411 } |
410 return total_received; | 412 return total_received; |
411 } | 413 } |
412 | 414 |
413 } } // namespace v8::internal | 415 } } // namespace v8::internal |
414 | 416 |
415 #endif // ENABLE_DEBUGGER_SUPPORT | 417 #endif // ENABLE_DEBUGGER_SUPPORT |
OLD | NEW |