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

Side by Side Diff: include/v8-debug.h

Issue 395013: Add DebugMessageDispatchHandler (Closed)
Patch Set: Created 11 years, 1 month 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
« no previous file with comments | « no previous file | src/api.cc » ('j') | test/cctest/test-debug.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 * A MessageHandler does not take posession of the message data, 181 * A MessageHandler does not take posession of the message data,
182 * and must not rely on the data persisting after the handler returns. 182 * and must not rely on the data persisting after the handler returns.
183 */ 183 */
184 typedef void (*MessageHandler2)(const Message& message); 184 typedef void (*MessageHandler2)(const Message& message);
185 185
186 /** 186 /**
187 * Debug host dispatch callback function. 187 * Debug host dispatch callback function.
188 */ 188 */
189 typedef void (*HostDispatchHandler)(); 189 typedef void (*HostDispatchHandler)();
190 190
191 /**
192 * Callback function for the host to ensure debug messages are processed.
193 */
194 typedef void (*DebugMessageDispatchHandler)();
195
191 // Set a C debug event listener. 196 // Set a C debug event listener.
192 static bool SetDebugEventListener(EventCallback that, 197 static bool SetDebugEventListener(EventCallback that,
193 Handle<Value> data = Handle<Value>()); 198 Handle<Value> data = Handle<Value>());
194 199
195 // Set a JavaScript debug event listener. 200 // Set a JavaScript debug event listener.
196 static bool SetDebugEventListener(v8::Handle<v8::Object> that, 201 static bool SetDebugEventListener(v8::Handle<v8::Object> that,
197 Handle<Value> data = Handle<Value>()); 202 Handle<Value> data = Handle<Value>());
198 203
199 // Break execution of JavaScript. 204 // Break execution of JavaScript.
200 static void DebugBreak(); 205 static void DebugBreak();
201 206
202 // Message based interface. The message protocol is JSON. NOTE the message 207 // Message based interface. The message protocol is JSON. NOTE the message
203 // handler thread is not supported any more parameter must be false. 208 // handler thread is not supported any more parameter must be false.
204 static void SetMessageHandler(MessageHandler handler, 209 static void SetMessageHandler(MessageHandler handler,
205 bool message_handler_thread = false); 210 bool message_handler_thread = false);
206 static void SetMessageHandler2(MessageHandler2 handler); 211 static void SetMessageHandler2(MessageHandler2 handler);
207 static void SendCommand(const uint16_t* command, int length, 212 static void SendCommand(const uint16_t* command, int length,
208 ClientData* client_data = NULL); 213 ClientData* client_data = NULL);
209 214
210 // Dispatch interface. 215 // Dispatch interface.
211 static void SetHostDispatchHandler(HostDispatchHandler handler, 216 static void SetHostDispatchHandler(HostDispatchHandler handler,
212 int period = 100); 217 int period = 100);
213 218
219 /**
220 * Register a callback function to be called when a debug message has been
221 * received and is ready to be precessed. For the debug messages to be
Søren Thygesen Gjesse 2009/11/18 08:40:57 precessed -> processed
222 * processed V8 needs to be entered, and in certain embedding scenarios this
223 * callback can be used to make sure V8 is entered for the debug message to
224 * be processed. Note that debug messages will only be processed if there is
225 * a V8 break. This can happen automatically by using the option
226 * --debugger-auto-break.
227 */
228 static void SetDebugMessageDispatchHandler(
229 DebugMessageDispatchHandler handler);
230
214 /** 231 /**
215 * Run a JavaScript function in the debugger. 232 * Run a JavaScript function in the debugger.
216 * \param fun the function to call 233 * \param fun the function to call
217 * \param data passed as second argument to the function 234 * \param data passed as second argument to the function
218 * With this call the debugger is entered and the function specified is called 235 * With this call the debugger is entered and the function specified is called
219 * with the execution state as the first argument. This makes it possible to 236 * with the execution state as the first argument. This makes it possible to
220 * get access to information otherwise not available during normal JavaScript 237 * get access to information otherwise not available during normal JavaScript
221 * execution e.g. details on stack frames. The following example show a 238 * execution e.g. details on stack frames. The following example show a
222 * JavaScript function which when passed to v8::Debug::Call will return the 239 * JavaScript function which when passed to v8::Debug::Call will return the
223 * current line of JavaScript execution. 240 * current line of JavaScript execution.
(...skipping 22 matching lines...) Expand all
246 }; 263 };
247 264
248 265
249 } // namespace v8 266 } // namespace v8
250 267
251 268
252 #undef EXPORT 269 #undef EXPORT
253 270
254 271
255 #endif // V8_V8_DEBUG_H_ 272 #endif // V8_V8_DEBUG_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | test/cctest/test-debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698