| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 * | 220 * |
| 221 * This message handler is deprecated. Use MessageHandler2 instead. | 221 * This message handler is deprecated. Use MessageHandler2 instead. |
| 222 */ | 222 */ |
| 223 typedef void (*MessageHandler)(const uint16_t* message, int length, | 223 typedef void (*MessageHandler)(const uint16_t* message, int length, |
| 224 ClientData* client_data); | 224 ClientData* client_data); |
| 225 | 225 |
| 226 /** | 226 /** |
| 227 * Debug message callback function. | 227 * Debug message callback function. |
| 228 * | 228 * |
| 229 * \param message the debug message handler message object | 229 * \param message the debug message handler message object |
| 230 | 230 * |
| 231 * A MessageHandler does not take possession of the message data, | 231 * A MessageHandler does not take possession of the message data, |
| 232 * and must not rely on the data persisting after the handler returns. | 232 * and must not rely on the data persisting after the handler returns. |
| 233 */ | 233 */ |
| 234 typedef void (*MessageHandler2)(const Message& message); | 234 typedef void (*MessageHandler2)(const Message& message); |
| 235 | 235 |
| 236 /** | 236 /** |
| 237 * Debug host dispatch callback function. | 237 * Debug host dispatch callback function. |
| 238 */ | 238 */ |
| 239 typedef void (*HostDispatchHandler)(); | 239 typedef void (*HostDispatchHandler)(); |
| 240 | 240 |
| 241 /** | 241 /** |
| 242 * Callback function for the host to ensure debug messages are processed. | 242 * Callback function for the host to ensure debug messages are processed. |
| 243 */ | 243 */ |
| 244 typedef void (*DebugMessageDispatchHandler)(); | 244 typedef void (*DebugMessageDispatchHandler)(); |
| 245 | 245 |
| 246 // Set a C debug event listener. | 246 // Set a C debug event listener. |
| 247 static bool SetDebugEventListener(EventCallback that, | 247 static bool SetDebugEventListener(EventCallback that, |
| 248 Handle<Value> data = Handle<Value>()); | 248 Handle<Value> data = Handle<Value>()); |
| 249 static bool SetDebugEventListener2(EventCallback2 that, | 249 static bool SetDebugEventListener2(EventCallback2 that, |
| 250 Handle<Value> data = Handle<Value>()); | 250 Handle<Value> data = Handle<Value>()); |
| 251 | 251 |
| 252 // Set a JavaScript debug event listener. | 252 // Set a JavaScript debug event listener. |
| 253 static bool SetDebugEventListener(v8::Handle<v8::Object> that, | 253 static bool SetDebugEventListener(v8::Handle<v8::Object> that, |
| 254 Handle<Value> data = Handle<Value>()); | 254 Handle<Value> data = Handle<Value>()); |
| 255 | 255 |
| 256 // Schedule a debugger break to happen when JavaScript code is run. | 256 // Schedule a debugger break to happen when JavaScript code is run |
| 257 static void DebugBreak(); | 257 // in the given isolate. If no isolate is provided the default |
| 258 // isolate is used. |
| 259 static void DebugBreak(Isolate* isolate = NULL); |
| 258 | 260 |
| 259 // Remove scheduled debugger break if it has not happened yet. | 261 // Remove scheduled debugger break in given isolate if it has not |
| 260 static void CancelDebugBreak(); | 262 // happened yet. If no isolate is provided the default isolate is |
| 263 // used. |
| 264 static void CancelDebugBreak(Isolate* isolate = NULL); |
| 261 | 265 |
| 262 // Break execution of JavaScript (this method can be invoked from a | 266 // Break execution of JavaScript in the given isolate (this method |
| 263 // non-VM thread) for further client command execution on a VM | 267 // can be invoked from a non-VM thread) for further client command |
| 264 // thread. Client data is then passed in EventDetails to | 268 // execution on a VM thread. Client data is then passed in |
| 265 // EventCallback at the moment when the VM actually stops. | 269 // EventDetails to EventCallback at the moment when the VM actually |
| 266 static void DebugBreakForCommand(ClientData* data = NULL); | 270 // stops. If no isolate is provided the default isolate is used. |
| 271 static void DebugBreakForCommand(ClientData* data = NULL, |
| 272 Isolate* isolate = NULL); |
| 267 | 273 |
| 268 // Message based interface. The message protocol is JSON. NOTE the message | 274 // Message based interface. The message protocol is JSON. NOTE the message |
| 269 // handler thread is not supported any more parameter must be false. | 275 // handler thread is not supported any more parameter must be false. |
| 270 static void SetMessageHandler(MessageHandler handler, | 276 static void SetMessageHandler(MessageHandler handler, |
| 271 bool message_handler_thread = false); | 277 bool message_handler_thread = false); |
| 272 static void SetMessageHandler2(MessageHandler2 handler); | 278 static void SetMessageHandler2(MessageHandler2 handler); |
| 273 static void SendCommand(const uint16_t* command, int length, | 279 static void SendCommand(const uint16_t* command, int length, |
| 274 ClientData* client_data = NULL); | 280 ClientData* client_data = NULL); |
| 275 | 281 |
| 276 // Dispatch interface. | 282 // Dispatch interface. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 }; | 381 }; |
| 376 | 382 |
| 377 | 383 |
| 378 } // namespace v8 | 384 } // namespace v8 |
| 379 | 385 |
| 380 | 386 |
| 381 #undef EXPORT | 387 #undef EXPORT |
| 382 | 388 |
| 383 | 389 |
| 384 #endif // V8_V8_DEBUG_H_ | 390 #endif // V8_V8_DEBUG_H_ |
| OLD | NEW |