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

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

Issue 8588040: Add a mid-sized integration test for the Dart Embedding Api which (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/lib/isolate.cc » ('j') | runtime/lib/isolate.dart » ('J')
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 INCLUDE_DART_API_H_ 5 #ifndef INCLUDE_DART_API_H_
6 #define INCLUDE_DART_API_H_ 6 #define INCLUDE_DART_API_H_
7 7
8 /** \mainpage Dart Embedding API Reference 8 /** \mainpage Dart Embedding API Reference
9 * 9 *
10 * Dart is a class-based programming language for creating structured 10 * Dart is a class-based programming language for creating structured
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 * 438 *
439 * This function waits for incoming messages for the current 439 * This function waits for incoming messages for the current
440 * isolate. As new messages arrive, they are handled using 440 * isolate. As new messages arrive, they are handled using
441 * Dart_HandleMessage. The routine exits when all ports to the 441 * Dart_HandleMessage. The routine exits when all ports to the
442 * current isolate are closed. 442 * current isolate are closed.
443 */ 443 */
444 DART_EXPORT Dart_Handle Dart_RunLoop(); 444 DART_EXPORT Dart_Handle Dart_RunLoop();
445 // TODO(turnidge): Should this be removed from the public api? 445 // TODO(turnidge): Should this be removed from the public api?
446 446
447 /** 447 /**
448 * Gets the main Dart_Port for the current isolate.
Anton Muhin 2011/11/23 19:28:14 nit: 'main' sounds too generic to me at least.
turnidge 2011/11/23 21:45:37 What do you think it should be called? Open to su
449 */
450 DART_EXPORT Dart_Port Dart_GetMainPort();
451
452 /**
453 * Does the current isolate have active ports?
454 */
455 DART_EXPORT bool Dart_IsolateHasActivePorts();
456
457 /**
448 * Posts a message for some isolate. The message is built from a raw 458 * Posts a message for some isolate. The message is built from a raw
449 * array. 459 * array.
450 * 460 *
451 * \param port The destination port. 461 * \param port The destination port.
452 * \param length The length of the data array. 462 * \param length The length of the data array.
453 * \param data A data array to be sent in the message. 463 * \param data A data array to be sent in the message.
454 * 464 *
455 * \return True if the message was posted. 465 * \return True if the message was posted.
456 */ 466 */
457 DART_EXPORT bool Dart_PostIntArray(Dart_Port port, 467 DART_EXPORT bool Dart_PostIntArray(Dart_Port port,
458 intptr_t length, 468 intptr_t length,
459 intptr_t* data); 469 intptr_t* data);
460 // TODO(turnidge): Should this be intptr_t or some fixed length type? 470 // TODO(turnidge): Should this be intptr_t or some fixed length type?
461 // TODO(turnidge): Reverse length/data for consistency. 471 // TODO(turnidge): Reverse length/data for consistency.
462 472
463 /** 473 /**
464 * Posts a message for some isolate. The message is a serialized 474 * Posts a message for some isolate. The message is a serialized
465 * object. 475 * object.
466 * 476 *
467 * Requires there to be a current isolate. 477 * Requires there to be a current isolate.
468 * 478 *
469 * \param port The destination port. 479 * \param port The destination port.
470 * \param object An object from the current isolate. 480 * \param object An object from the current isolate.
471 * 481 *
472 * \return True if the message was posted. 482 * \return True if the message was posted.
473 */ 483 */
474 DART_EXPORT bool Dart_Post(Dart_Port port, Dart_Handle object); 484 DART_EXPORT bool Dart_Post(Dart_Port port, Dart_Handle object);
475 485
486 /**
487 * Returns a new SendPort with the provided id.
488 */
489 DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port);
490
491 /**
492 * Returns a new ReceivePort with the provided id.
493 */
494 DART_EXPORT Dart_Handle Dart_NewReceivePort(Dart_Port port);
495
476 // --- Scopes ---- 496 // --- Scopes ----
477 497
478 /** 498 /**
479 * Enters a new scope. 499 * Enters a new scope.
480 * 500 *
481 * All new local handles will be created in this scope. Additionally, 501 * All new local handles will be created in this scope. Additionally,
482 * some functions may return "scope allocated" memory which is only 502 * some functions may return "scope allocated" memory which is only
483 * valid within this scope. 503 * valid within this scope.
484 * 504 *
485 * Requires there to be a current isolate. 505 * Requires there to be a current isolate.
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 1224
1205 // --- Profiling support ---- 1225 // --- Profiling support ----
1206 1226
1207 // External pprof support for gathering and dumping symbolic 1227 // External pprof support for gathering and dumping symbolic
1208 // information that can be used for better profile reports for 1228 // information that can be used for better profile reports for
1209 // dynamically generated code. 1229 // dynamically generated code.
1210 DART_EXPORT void Dart_InitPprofSupport(); 1230 DART_EXPORT void Dart_InitPprofSupport();
1211 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); 1231 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size);
1212 1232
1213 #endif // INCLUDE_DART_API_H_ 1233 #endif // INCLUDE_DART_API_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/isolate.cc » ('j') | runtime/lib/isolate.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698