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

Side by Side Diff: runtime/include/dart_tools_api.h

Issue 2483363002: clang-formats remaining files and adds a presubmit check. (Closed)
Patch Set: Format include file Created 4 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 | « runtime/include/dart_native_api.h ('k') | runtime/vm/bootstrap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef RUNTIME_INCLUDE_DART_TOOLS_API_H_ 5 #ifndef RUNTIME_INCLUDE_DART_TOOLS_API_H_
6 #define RUNTIME_INCLUDE_DART_TOOLS_API_H_ 6 #define RUNTIME_INCLUDE_DART_TOOLS_API_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 9
10 /** \mainpage Dart Tools Embedding API Reference 10 /** \mainpage Dart Tools Embedding API Reference
11 * 11 *
12 * This reference describes the Dart embedding API for tools. Tools include 12 * This reference describes the Dart embedding API for tools. Tools include
13 * a debugger, service protocol, and timeline. 13 * a debugger, service protocol, and timeline.
14 * 14 *
15 * NOTE: The APIs described in this file are unstable and subject to change. 15 * NOTE: The APIs described in this file are unstable and subject to change.
16 * 16 *
17 * This reference is generated from the header include/dart_tools_api.h. 17 * This reference is generated from the header include/dart_tools_api.h.
18 */ 18 */
19 19
20 20
21 /* 21 /*
22 * ======== 22 * ========
23 * Debugger 23 * Debugger
24 * ======== 24 * ========
25 */ 25 */
26 typedef struct _Dart_Breakpoint* Dart_Breakpoint; 26 typedef struct _Dart_Breakpoint* Dart_Breakpoint;
27 27
28 typedef struct _Dart_StackTrace* Dart_StackTrace; 28 typedef struct _Dart_StackTrace* Dart_StackTrace;
29 29
30 typedef struct _Dart_ActivationFrame* Dart_ActivationFrame; 30 typedef struct _Dart_ActivationFrame* Dart_ActivationFrame;
31 31
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 /** 149 /**
150 * Returns a string containing the source code of the given script 150 * Returns a string containing the source code of the given script
151 * in the given library. 151 * in the given library.
152 * 152 *
153 * Requires there to be a current isolate. 153 * Requires there to be a current isolate.
154 * 154 *
155 * \return A handle to string containing the source text if no error 155 * \return A handle to string containing the source text if no error
156 * occurs. 156 * occurs.
157 */ 157 */
158 DART_EXPORT Dart_Handle Dart_ScriptGetSource( 158 DART_EXPORT Dart_Handle Dart_ScriptGetSource(intptr_t library_id,
159 intptr_t library_id, 159 Dart_Handle script_url_in);
160 Dart_Handle script_url_in);
161 160
162 161
163 /** 162 /**
164 * Returns an array containing line number and token offset info 163 * Returns an array containing line number and token offset info
165 * for the given script. 164 * for the given script.
166 * 165 *
167 * Returns an array of numbers. Null values indicate the beginning of 166 * Returns an array of numbers. Null values indicate the beginning of
168 * a new line. The first number after null is the line number. 167 * a new line. The first number after null is the line number.
169 * The line number is followed by pairs of numbers, with the first value 168 * The line number is followed by pairs of numbers, with the first value
170 * being the "token offset" and the second value being the column number 169 * being the "token offset" and the second value being the column number
171 * of the token. 170 * of the token.
172 * The "token offset" is a value that is used to indicate a location 171 * The "token offset" is a value that is used to indicate a location
173 * in code, similarly to a "PC" address. 172 * in code, similarly to a "PC" address.
174 * Source lines with no tokens are omitted. 173 * Source lines with no tokens are omitted.
175 * 174 *
176 * Requires there to be a current isolate. 175 * Requires there to be a current isolate.
177 * 176 *
178 * \return A handle to an array or an error object. 177 * \return A handle to an array or an error object.
179 */ 178 */
180 DART_EXPORT Dart_Handle Dart_ScriptGetTokenInfo( 179 DART_EXPORT Dart_Handle Dart_ScriptGetTokenInfo(intptr_t library_id,
181 intptr_t library_id, 180 Dart_Handle script_url_in);
182 Dart_Handle script_url_in);
183 181
184 182
185 /** 183 /**
186 * Returns a string containing a generated source code of the given script 184 * Returns a string containing a generated source code of the given script
187 * in the given library. This is essentially used to pretty print dart code 185 * in the given library. This is essentially used to pretty print dart code
188 * generated from any tool (e.g: dart2dart). 186 * generated from any tool (e.g: dart2dart).
189 * 187 *
190 * Requires there to be a current isolate. 188 * Requires there to be a current isolate.
191 * 189 *
192 * \return A handle to string containing the source text if no error 190 * \return A handle to string containing the source text if no error
193 * occurs. 191 * occurs.
194 */ 192 */
195 DART_EXPORT Dart_Handle Dart_GenerateScriptSource(Dart_Handle library_url_in, 193 DART_EXPORT Dart_Handle Dart_GenerateScriptSource(Dart_Handle library_url_in,
196 Dart_Handle script_url_in); 194 Dart_Handle script_url_in);
197 195
198 196
199 /** 197 /**
200 * Sets a breakpoint at line \line_number in \script_url, or the closest 198 * Sets a breakpoint at line \line_number in \script_url, or the closest
201 * following line (within the same function) where a breakpoint can be set. 199 * following line (within the same function) where a breakpoint can be set.
202 * 200 *
203 * Requires there to be a current isolate. 201 * Requires there to be a current isolate.
204 * 202 *
205 * \return A handle containing the breakpoint id, which is an integer 203 * \return A handle containing the breakpoint id, which is an integer
206 * value, or an error object if a breakpoint could not be set. 204 * value, or an error object if a breakpoint could not be set.
207 */ 205 */
208 DART_EXPORT Dart_Handle Dart_SetBreakpoint( 206 DART_EXPORT Dart_Handle Dart_SetBreakpoint(Dart_Handle script_url,
209 Dart_Handle script_url, 207 intptr_t line_number);
210 intptr_t line_number);
211 208
212 /** 209 /**
213 * Deletes the breakpoint with the given id \pb_id. 210 * Deletes the breakpoint with the given id \pb_id.
214 * 211 *
215 * Requires there to be a current isolate. 212 * Requires there to be a current isolate.
216 * 213 *
217 * \return A handle to the True object if no error occurs. 214 * \return A handle to the True object if no error occurs.
218 */ 215 */
219 DART_EXPORT Dart_Handle Dart_RemoveBreakpoint(intptr_t bp_id); 216 DART_EXPORT Dart_Handle Dart_RemoveBreakpoint(intptr_t bp_id);
220 217
(...skipping 23 matching lines...) Expand all
244 /** 241 /**
245 * Sets a one-time breakpoint at the entry of the given function. 242 * Sets a one-time breakpoint at the entry of the given function.
246 * If class_name is the empty string, looks for a library function 243 * If class_name is the empty string, looks for a library function
247 * with the given name. 244 * with the given name.
248 * 245 *
249 * Requires there to be a current isolate. 246 * Requires there to be a current isolate.
250 * 247 *
251 * \return A handle containing the breakpoint id, which is an integer 248 * \return A handle containing the breakpoint id, which is an integer
252 * value, or an error object if a breakpoint could not be set. 249 * value, or an error object if a breakpoint could not be set.
253 */ 250 */
254 DART_EXPORT Dart_Handle Dart_SetBreakpointAtEntry( 251 DART_EXPORT Dart_Handle Dart_SetBreakpointAtEntry(Dart_Handle library,
255 Dart_Handle library, 252 Dart_Handle class_name,
256 Dart_Handle class_name, 253 Dart_Handle function_name);
257 Dart_Handle function_name);
258 254
259 255
260 /** 256 /**
261 * Sets a breakpoint at the entry of the given function. If class_name 257 * Sets a breakpoint at the entry of the given function. If class_name
262 * is the empty string, looks for a library function with the given 258 * is the empty string, looks for a library function with the given
263 * name. 259 * name.
264 * 260 *
265 * Requires there to be a current isolate. 261 * Requires there to be a current isolate.
266 * 262 *
267 * \return A handle to the True object if no error occurs. 263 * \return A handle to the True object if no error occurs.
268 */ 264 */
269 DART_EXPORT Dart_Handle Dart_OneTimeBreakAtEntry( 265 DART_EXPORT Dart_Handle Dart_OneTimeBreakAtEntry(Dart_Handle library,
270 Dart_Handle library, 266 Dart_Handle class_name,
271 Dart_Handle class_name, 267 Dart_Handle function_name);
272 Dart_Handle function_name);
273 268
274 269
275 /** 270 /**
276 * Can be called from the breakpoint handler. Sets the debugger to 271 * Can be called from the breakpoint handler. Sets the debugger to
277 * single step mode. 272 * single step mode.
278 * 273 *
279 * Requires there to be a current isolate. 274 * Requires there to be a current isolate.
280 */ 275 */
281 DART_EXPORT Dart_Handle Dart_SetStepOver(); 276 DART_EXPORT Dart_Handle Dart_SetStepOver();
282 277
(...skipping 15 matching lines...) Expand all
298 */ 293 */
299 DART_EXPORT Dart_Handle Dart_SetStepOut(); 294 DART_EXPORT Dart_Handle Dart_SetStepOut();
300 295
301 296
302 /** 297 /**
303 * Installs a handler callback function that gets called by the VM 298 * Installs a handler callback function that gets called by the VM
304 * when a breakpoint location has been reached or when stepping. 299 * when a breakpoint location has been reached or when stepping.
305 * 300 *
306 * Requires there to be a current isolate. 301 * Requires there to be a current isolate.
307 */ 302 */
308 DART_EXPORT void Dart_SetPausedEventHandler( 303 DART_EXPORT void Dart_SetPausedEventHandler(Dart_PausedEventHandler handler);
309 Dart_PausedEventHandler handler);
310 304
311 305
312 /** 306 /**
313 * Installs a callback function that gets called by the VM when 307 * Installs a callback function that gets called by the VM when
314 * a breakpoint has been resolved to an actual url and line number. 308 * a breakpoint has been resolved to an actual url and line number.
315 * 309 *
316 * Requires there to be a current isolate. 310 * Requires there to be a current isolate.
317 */ 311 */
318 DART_EXPORT void Dart_SetBreakpointResolvedHandler( 312 DART_EXPORT void Dart_SetBreakpointResolvedHandler(
319 Dart_BreakpointResolvedHandler handler); 313 Dart_BreakpointResolvedHandler handler);
320 314
321 /** 315 /**
322 * Installs a callback function that gets called by the VM when 316 * Installs a callback function that gets called by the VM when
323 * an exception has been thrown. 317 * an exception has been thrown.
324 * 318 *
325 * Requires there to be a current isolate. 319 * Requires there to be a current isolate.
326 */ 320 */
327 DART_EXPORT void Dart_SetExceptionThrownHandler( 321 DART_EXPORT void Dart_SetExceptionThrownHandler(
328 Dart_ExceptionThrownHandler handler); 322 Dart_ExceptionThrownHandler handler);
329 323
330 /** 324 /**
331 * Installs a callback function that gets called by the VM when 325 * Installs a callback function that gets called by the VM when
332 * an isolate event happens, e.g: 326 * an isolate event happens, e.g:
333 * - creation of a new isolate 327 * - creation of a new isolate
334 * - shutdown of an isolate 328 * - shutdown of an isolate
335 * - interruption of an isolate 329 * - interruption of an isolate
336 */ 330 */
337 DART_EXPORT void Dart_SetIsolateEventHandler(Dart_IsolateEventHandler handler); 331 DART_EXPORT void Dart_SetIsolateEventHandler(Dart_IsolateEventHandler handler);
338 332
339 // On which exceptions to pause. 333 // On which exceptions to pause.
340 typedef enum { 334 typedef enum {
341 kNoPauseOnExceptions = 1, 335 kNoPauseOnExceptions = 1,
342 kPauseOnUnhandledExceptions, 336 kPauseOnUnhandledExceptions,
343 kPauseOnAllExceptions, 337 kPauseOnAllExceptions,
344 kInvalidExceptionPauseInfo 338 kInvalidExceptionPauseInfo
345 } Dart_ExceptionPauseInfo; 339 } Dart_ExceptionPauseInfo;
346 340
347 /** 341 /**
348 * Define on which exceptions the debugger pauses. 342 * Define on which exceptions the debugger pauses.
349 * 343 *
350 * Requires there to be a current isolate. 344 * Requires there to be a current isolate.
351 */ 345 */
352 DART_EXPORT Dart_Handle Dart_SetExceptionPauseInfo( 346 DART_EXPORT Dart_Handle
353 Dart_ExceptionPauseInfo pause_info); 347 Dart_SetExceptionPauseInfo(Dart_ExceptionPauseInfo pause_info);
354 348
355 349
356 /** 350 /**
357 * Returns on which exceptions the debugger pauses. 351 * Returns on which exceptions the debugger pauses.
358 * 352 *
359 * Requires there to be a current isolate. 353 * Requires there to be a current isolate.
360 */ 354 */
361 DART_EXPORT Dart_ExceptionPauseInfo Dart_GetExceptionPauseInfo(); 355 DART_EXPORT Dart_ExceptionPauseInfo Dart_GetExceptionPauseInfo();
362 356
363 /** 357 /**
(...skipping 19 matching lines...) Expand all
383 377
384 378
385 /** 379 /**
386 * Returns in \length the number of activation frames in the given 380 * Returns in \length the number of activation frames in the given
387 * stack trace. 381 * stack trace.
388 * 382 *
389 * Requires there to be a current isolate. 383 * Requires there to be a current isolate.
390 * 384 *
391 * \return A handle to the True object if no error occurs. 385 * \return A handle to the True object if no error occurs.
392 */ 386 */
393 DART_EXPORT Dart_Handle Dart_StackTraceLength( 387 DART_EXPORT Dart_Handle Dart_StackTraceLength(Dart_StackTrace trace,
394 Dart_StackTrace trace, 388 intptr_t* length);
395 intptr_t* length);
396 389
397 390
398 /** 391 /**
399 * Returns in \frame the activation frame with index \frame_index. 392 * Returns in \frame the activation frame with index \frame_index.
400 * The activation frame at the top of stack has index 0. 393 * The activation frame at the top of stack has index 0.
401 * 394 *
402 * Requires there to be a current isolate. 395 * Requires there to be a current isolate.
403 * 396 *
404 * \return A handle to the True object if no error occurs. 397 * \return A handle to the True object if no error occurs.
405 */ 398 */
406 DART_EXPORT Dart_Handle Dart_GetActivationFrame( 399 DART_EXPORT Dart_Handle Dart_GetActivationFrame(Dart_StackTrace trace,
407 Dart_StackTrace trace, 400 int frame_index,
408 int frame_index, 401 Dart_ActivationFrame* frame);
409 Dart_ActivationFrame* frame);
410 402
411 403
412 /** 404 /**
413 * Returns information about the given activation frame. 405 * Returns information about the given activation frame.
414 * \function_name receives a string handle with the qualified 406 * \function_name receives a string handle with the qualified
415 * function name. 407 * function name.
416 * \script_url receives a string handle with the url of the 408 * \script_url receives a string handle with the url of the
417 * source script that contains the frame's function. 409 * source script that contains the frame's function.
418 * \line_number receives the line number in the script. 410 * \line_number receives the line number in the script.
419 * \col_number receives the column number in the script, or -1 if column 411 * \col_number receives the column number in the script, or -1 if column
420 * information is not available 412 * information is not available
421 * 413 *
422 * Any or all of the out parameters above may be NULL. 414 * Any or all of the out parameters above may be NULL.
423 * 415 *
424 * Requires there to be a current isolate. 416 * Requires there to be a current isolate.
425 * 417 *
426 * \return A valid handle if no error occurs during the operation. 418 * \return A valid handle if no error occurs during the operation.
427 */ 419 */
428 DART_EXPORT Dart_Handle Dart_ActivationFrameInfo( 420 DART_EXPORT Dart_Handle
429 Dart_ActivationFrame activation_frame, 421 Dart_ActivationFrameInfo(Dart_ActivationFrame activation_frame,
430 Dart_Handle* function_name, 422 Dart_Handle* function_name,
431 Dart_Handle* script_url, 423 Dart_Handle* script_url,
432 intptr_t* line_number, 424 intptr_t* line_number,
433 intptr_t* column_number); 425 intptr_t* column_number);
434 426
435 427
436 /** 428 /**
437 * Returns code location of the given activation frame. 429 * Returns code location of the given activation frame.
438 * 430 *
439 * \function_name receives a string handle with the qualified 431 * \function_name receives a string handle with the qualified
440 * function name. 432 * function name.
441 * \function receives a handle to the function. 433 * \function receives a handle to the function.
442 * \location.script_url receives a string handle with the url of 434 * \location.script_url receives a string handle with the url of
443 * the source script that contains the frame's function. 435 * the source script that contains the frame's function.
444 * Receives a null handle if there is no textual location 436 * Receives a null handle if there is no textual location
445 * that corresponds to the frame, e.g. for implicitly 437 * that corresponds to the frame, e.g. for implicitly
446 * generated constructors. 438 * generated constructors.
447 * \location.library_id receives the id of the library in which the 439 * \location.library_id receives the id of the library in which the
448 * function in this frame is defined. 440 * function in this frame is defined.
449 * \location.token_pos receives the token position in the script. 441 * \location.token_pos receives the token position in the script.
450 * 442 *
451 * Any of the out parameters above may be NULL. 443 * Any of the out parameters above may be NULL.
452 * 444 *
453 * Requires there to be a current isolate. 445 * Requires there to be a current isolate.
454 * 446 *
455 * \return A handle to the True object if no error occurs. 447 * \return A handle to the True object if no error occurs.
456 * A handle to the False object if there is no text 448 * A handle to the False object if there is no text
457 * position for the frame. 449 * position for the frame.
458 */ 450 */
459 DART_EXPORT Dart_Handle Dart_ActivationFrameGetLocation( 451 DART_EXPORT Dart_Handle
460 Dart_ActivationFrame activation_frame, 452 Dart_ActivationFrameGetLocation(Dart_ActivationFrame activation_frame,
461 Dart_Handle* function_name, 453 Dart_Handle* function_name,
462 Dart_Handle* function, 454 Dart_Handle* function,
463 Dart_CodeLocation* location); 455 Dart_CodeLocation* location);
464 456
465 /** 457 /**
466 * Returns frame pointer of the given activation frame. 458 * Returns frame pointer of the given activation frame.
467 * 459 *
468 * \frame_pointer receives the frame pointer for the frame. 460 * \frame_pointer receives the frame pointer for the frame.
469 * 461 *
470 * Requires there to be a current isolate. 462 * Requires there to be a current isolate.
471 * 463 *
472 * \return A handle to the True object if no error occurs. 464 * \return A handle to the True object if no error occurs.
473 */ 465 */
474 DART_EXPORT Dart_Handle Dart_ActivationFrameGetFramePointer( 466 DART_EXPORT Dart_Handle
475 Dart_ActivationFrame activation_frame, 467 Dart_ActivationFrameGetFramePointer(Dart_ActivationFrame activation_frame,
476 uintptr_t* frame_pointer); 468 uintptr_t* frame_pointer);
477 469
478 /** 470 /**
479 * Returns an array containing all the local variable names and values of 471 * Returns an array containing all the local variable names and values of
480 * the given \activation_frame. 472 * the given \activation_frame.
481 * 473 *
482 * Requires there to be a current isolate. 474 * Requires there to be a current isolate.
483 * 475 *
484 * \return A handle to an array containing variable names and 476 * \return A handle to an array containing variable names and
485 * corresponding values. The array is empty if the activation frame has 477 * corresponding values. The array is empty if the activation frame has
486 * no variables. If non-empty, variable names are at array offsets 2*n, 478 * no variables. If non-empty, variable names are at array offsets 2*n,
487 * values at offset 2*n+1. 479 * values at offset 2*n+1.
488 */ 480 */
489 DART_EXPORT Dart_Handle Dart_GetLocalVariables( 481 DART_EXPORT Dart_Handle
490 Dart_ActivationFrame activation_frame); 482 Dart_GetLocalVariables(Dart_ActivationFrame activation_frame);
491 483
492 484
493 /** 485 /**
494 * Returns origin class of a function. 486 * Returns origin class of a function.
495 * 487 *
496 * Requires there to be a current isolate. 488 * Requires there to be a current isolate.
497 * 489 *
498 * \return Returns the class id (a handle to an integer) of the class in 490 * \return Returns the class id (a handle to an integer) of the class in
499 * which \function is defined. Returns a null handle if \function is defined 491 * which \function is defined. Returns a null handle if \function is defined
500 * at the top level. Returns an error object otherwise. 492 * at the top level. Returns an error object otherwise.
(...skipping 11 matching lines...) Expand all
512 * corresponding values. Variable names are at array offsets 2*n, 504 * corresponding values. Variable names are at array offsets 2*n,
513 * values at offset 2*n+1. 505 * values at offset 2*n+1.
514 */ 506 */
515 DART_EXPORT Dart_Handle Dart_GetGlobalVariables(intptr_t library_id); 507 DART_EXPORT Dart_Handle Dart_GetGlobalVariables(intptr_t library_id);
516 508
517 509
518 /** 510 /**
519 * Execute the expression given in string \expr in the context 511 * Execute the expression given in string \expr in the context
520 * of stack frame \activation_frame. 512 * of stack frame \activation_frame.
521 */ 513 */
522 DART_EXPORT Dart_Handle Dart_ActivationFrameEvaluate( 514 DART_EXPORT Dart_Handle
523 Dart_ActivationFrame activation_frame, 515 Dart_ActivationFrameEvaluate(Dart_ActivationFrame activation_frame,
524 Dart_Handle expr_in); 516 Dart_Handle expr_in);
525 517
526 518
527 /** 519 /**
528 * Execute the expression given in string \expr in the context 520 * Execute the expression given in string \expr in the context
529 * of \target. 521 * of \target.
530 * 522 *
531 * Requires there to be a current isolate. 523 * Requires there to be a current isolate.
532 * 524 *
533 * The expression is evaluated in the context of \target. 525 * The expression is evaluated in the context of \target.
534 * If \target is a Dart object, the expression is evaluated as if 526 * If \target is a Dart object, the expression is evaluated as if
535 * it were an instance method of the class of the object. 527 * it were an instance method of the class of the object.
536 * If \target is a Class, the expression is evaluated as if it 528 * If \target is a Class, the expression is evaluated as if it
537 * were a static method of that class. 529 * were a static method of that class.
538 * If \target is a Library, the expression is evaluated as if it 530 * If \target is a Library, the expression is evaluated as if it
539 * were a top-level function in that library. 531 * were a top-level function in that library.
540 * 532 *
541 * \return A handle to the computed value, or an error object if 533 * \return A handle to the computed value, or an error object if
542 * the compilation of the expression fails, or if the evaluation throws 534 * the compilation of the expression fails, or if the evaluation throws
543 * an error. 535 * an error.
544 */ 536 */
545 DART_EXPORT Dart_Handle Dart_EvaluateExpr(Dart_Handle target, 537 DART_EXPORT Dart_Handle Dart_EvaluateExpr(Dart_Handle target, Dart_Handle expr);
546 Dart_Handle expr);
547 538
548 539
549 /** 540 /**
550 * Returns the class of the given \object. 541 * Returns the class of the given \object.
551 * 542 *
552 * Requires there to be a current isolate. 543 * Requires there to be a current isolate.
553 * 544 *
554 * \return A handle to the class object. 545 * \return A handle to the class object.
555 */ 546 */
556 DART_EXPORT Dart_Handle Dart_GetObjClass(Dart_Handle object); 547 DART_EXPORT Dart_Handle Dart_GetObjClass(Dart_Handle object);
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 * keys and values are flattened and stored in arrays. 767 * keys and values are flattened and stored in arrays.
777 * \param param_values The values associated with the keys. 768 * \param param_values The values associated with the keys.
778 * \param num_params The length of the param_keys and param_values arrays. 769 * \param num_params The length of the param_keys and param_values arrays.
779 * \param user_data The user_data pointer registered with this handler. 770 * \param user_data The user_data pointer registered with this handler.
780 * \param result A C string containing a valid JSON object. The returned 771 * \param result A C string containing a valid JSON object. The returned
781 * pointer will be freed by the VM by calling free. 772 * pointer will be freed by the VM by calling free.
782 * 773 *
783 * \return True if the result is a regular JSON-RPC response, false if the 774 * \return True if the result is a regular JSON-RPC response, false if the
784 * result is a JSON-RPC error. 775 * result is a JSON-RPC error.
785 */ 776 */
786 typedef bool (*Dart_ServiceRequestCallback)( 777 typedef bool (*Dart_ServiceRequestCallback)(const char* method,
787 const char* method, 778 const char** param_keys,
788 const char** param_keys, 779 const char** param_values,
789 const char** param_values, 780 intptr_t num_params,
790 intptr_t num_params, 781 void* user_data,
791 void* user_data, 782 const char** json_object);
792 const char** json_object);
793 783
794 784
795 /** 785 /**
796 * Register a Dart_ServiceRequestCallback to be called to handle 786 * Register a Dart_ServiceRequestCallback to be called to handle
797 * requests for the named rpc on a specific isolate. The callback will 787 * requests for the named rpc on a specific isolate. The callback will
798 * be invoked with the current isolate set to the request target. 788 * be invoked with the current isolate set to the request target.
799 * 789 *
800 * \param method The name of the method that this callback is responsible for. 790 * \param method The name of the method that this callback is responsible for.
801 * \param callback The callback to invoke. 791 * \param callback The callback to invoke.
802 * \param user_data The user data passed to the callback. 792 * \param user_data The user data passed to the callback.
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 * for these functions to change. 896 * for these functions to change.
907 */ 897 */
908 898
909 /** 899 /**
910 * A callback which determines whether the file at some url has been 900 * A callback which determines whether the file at some url has been
911 * modified since some time. If the file cannot be found, true should 901 * modified since some time. If the file cannot be found, true should
912 * be returned. 902 * be returned.
913 */ 903 */
914 typedef bool (*Dart_FileModifiedCallback)(const char* url, int64_t since); 904 typedef bool (*Dart_FileModifiedCallback)(const char* url, int64_t since);
915 905
916 DART_EXPORT Dart_Handle Dart_SetFileModifiedCallback( 906 DART_EXPORT Dart_Handle
917 Dart_FileModifiedCallback file_modified_callback); 907 Dart_SetFileModifiedCallback(Dart_FileModifiedCallback file_modified_callback);
918 908
919 /* 909 /*
920 * ======== 910 * ========
921 * Timeline 911 * Timeline
922 * ======== 912 * ========
923 */ 913 */
924 914
925 /** 915 /**
926 * Returns a timestamp in microseconds. This timestamp is suitable for 916 * Returns a timestamp in microseconds. This timestamp is suitable for
927 * passing into the timeline system. 917 * passing into the timeline system.
(...skipping 13 matching lines...) Expand all
941 /** Timeline stream for embedder provided events */ 931 /** Timeline stream for embedder provided events */
942 #define DART_TIMELINE_STREAM_EMBEDDER (1 << 4) 932 #define DART_TIMELINE_STREAM_EMBEDDER (1 << 4)
943 /** Timeline stream for GC events */ 933 /** Timeline stream for GC events */
944 #define DART_TIMELINE_STREAM_GC (1 << 5) 934 #define DART_TIMELINE_STREAM_GC (1 << 5)
945 /** Timeline stream for isolate events */ 935 /** Timeline stream for isolate events */
946 #define DART_TIMELINE_STREAM_ISOLATE (1 << 6) 936 #define DART_TIMELINE_STREAM_ISOLATE (1 << 6)
947 /** Timeline stream for VM events */ 937 /** Timeline stream for VM events */
948 #define DART_TIMELINE_STREAM_VM (1 << 7) 938 #define DART_TIMELINE_STREAM_VM (1 << 7)
949 939
950 /** All timeline streams */ 940 /** All timeline streams */
951 #define DART_TIMELINE_STREAM_ALL (DART_TIMELINE_STREAM_API | \ 941 #define DART_TIMELINE_STREAM_ALL \
952 DART_TIMELINE_STREAM_COMPILER | \ 942 (DART_TIMELINE_STREAM_API | DART_TIMELINE_STREAM_COMPILER | \
953 DART_TIMELINE_STREAM_DART | \ 943 DART_TIMELINE_STREAM_DART | DART_TIMELINE_STREAM_DEBUGGER | \
954 DART_TIMELINE_STREAM_DEBUGGER | \ 944 DART_TIMELINE_STREAM_EMBEDDER | DART_TIMELINE_STREAM_GC | \
955 DART_TIMELINE_STREAM_EMBEDDER | \ 945 DART_TIMELINE_STREAM_ISOLATE | DART_TIMELINE_STREAM_VM)
956 DART_TIMELINE_STREAM_GC | \
957 DART_TIMELINE_STREAM_ISOLATE | \
958 DART_TIMELINE_STREAM_VM)
959 946
960 /** Disable all timeline stream recording */ 947 /** Disable all timeline stream recording */
961 #define DART_TIMELINE_STREAM_DISABLE 0 948 #define DART_TIMELINE_STREAM_DISABLE 0
962 949
963 950
964 /** 951 /**
965 * Start recording timeline events for the entire VM (including all isolates). 952 * Start recording timeline events for the entire VM (including all isolates).
966 * 953 *
967 * \param stream_mask A bitmask of streams that should be recorded. 954 * \param stream_mask A bitmask of streams that should be recorded.
968 * 955 *
(...skipping 25 matching lines...) Expand all
994 * 981 *
995 * At the start of each stream state will be DART_STREAM_CONSUMER_STATE_START 982 * At the start of each stream state will be DART_STREAM_CONSUMER_STATE_START
996 * and buffer will be NULL. 983 * and buffer will be NULL.
997 * 984 *
998 * For each chunk of data the state will be DART_STREAM_CONSUMER_STATE_DATA 985 * For each chunk of data the state will be DART_STREAM_CONSUMER_STATE_DATA
999 * and buffer will not be NULL. 986 * and buffer will not be NULL.
1000 * 987 *
1001 * At the end of each stream state will be DART_STREAM_CONSUMER_STATE_FINISH 988 * At the end of each stream state will be DART_STREAM_CONSUMER_STATE_FINISH
1002 * and buffer will be NULL. 989 * and buffer will be NULL.
1003 */ 990 */
1004 typedef void (*Dart_StreamConsumer)( 991 typedef void (*Dart_StreamConsumer)(Dart_StreamConsumer_State state,
1005 Dart_StreamConsumer_State state, 992 const char* stream_name,
1006 const char* stream_name, 993 const uint8_t* buffer,
1007 const uint8_t* buffer, 994 intptr_t buffer_length,
1008 intptr_t buffer_length, 995 void* stream_callback_data);
1009 void* stream_callback_data);
1010 996
1011 /** 997 /**
1012 * Get the timeline for entire VM (including all isolates). 998 * Get the timeline for entire VM (including all isolates).
1013 * 999 *
1014 * NOTE: The timeline retrieved from this API call may not include the most 1000 * NOTE: The timeline retrieved from this API call may not include the most
1015 * recent events. 1001 * recent events.
1016 * 1002 *
1017 * \param consumer A Dart_StreamConsumer. 1003 * \param consumer A Dart_StreamConsumer.
1018 * \param user_data User data passed into consumer. 1004 * \param user_data User data passed into consumer.
1019 * 1005 *
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 * \param start_recording See Dart_EmbedderTimelineStartRecording. 1067 * \param start_recording See Dart_EmbedderTimelineStartRecording.
1082 * \param stop_recording See Dart_EmbedderTimelineStopRecording. 1068 * \param stop_recording See Dart_EmbedderTimelineStopRecording.
1083 * 1069 *
1084 * NOTE: To avoid races, this should be called before Dart_Initialize. 1070 * NOTE: To avoid races, this should be called before Dart_Initialize.
1085 */ 1071 */
1086 DART_EXPORT void Dart_SetEmbedderTimelineCallbacks( 1072 DART_EXPORT void Dart_SetEmbedderTimelineCallbacks(
1087 Dart_EmbedderTimelineStartRecording start_recording, 1073 Dart_EmbedderTimelineStartRecording start_recording,
1088 Dart_EmbedderTimelineStopRecording stop_recording); 1074 Dart_EmbedderTimelineStopRecording stop_recording);
1089 1075
1090 #endif // RUNTIME_INCLUDE_DART_TOOLS_API_H_ 1076 #endif // RUNTIME_INCLUDE_DART_TOOLS_API_H_
OLDNEW
« no previous file with comments | « runtime/include/dart_native_api.h ('k') | runtime/vm/bootstrap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698