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

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

Issue 9348048: Add support for medium integers to the native message format (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from asiva@ Created 8 years, 10 months 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/vm/dart_api_message.h » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 * A Dart_CObject is used for representing Dart objects as native C 541 * A Dart_CObject is used for representing Dart objects as native C
542 * data outside the Dart heap. These objects are totally detached from 542 * data outside the Dart heap. These objects are totally detached from
543 * the Dart heap. Only a subset of the Dart objects have a 543 * the Dart heap. Only a subset of the Dart objects have a
544 * representation as a Dart_CObject. 544 * representation as a Dart_CObject.
545 */ 545 */
546 struct Dart_CObject { 546 struct Dart_CObject {
547 enum Type { 547 enum Type {
548 kNull = 0, 548 kNull = 0,
549 kBool, 549 kBool,
550 kInt32, 550 kInt32,
551 kInt64,
551 kDouble, 552 kDouble,
552 kString, 553 kString,
553 kArray, 554 kArray,
554 kByteArray, 555 kByteArray,
555 kNumberOfTypes 556 kNumberOfTypes
556 }; 557 };
557 Type type; 558 Type type;
558 union { 559 union {
559 bool as_bool; 560 bool as_bool;
560 int32_t as_int32; 561 int32_t as_int32;
562 int64_t as_int64;
561 double as_double; 563 double as_double;
562 char* as_string; 564 char* as_string;
563 struct { 565 struct {
564 int length; 566 int length;
565 Dart_CObject** values; 567 Dart_CObject** values;
566 } as_array; 568 } as_array;
567 struct { 569 struct {
568 int length; 570 int length;
569 uint8_t* values; 571 uint8_t* values;
570 } as_byte_array; 572 } as_byte_array;
(...skipping 21 matching lines...) Expand all
592 * A native message handler. 594 * A native message handler.
593 * 595 *
594 * This handler is associated with a native port by calling 596 * This handler is associated with a native port by calling
595 * Dart_NewNativePort. 597 * Dart_NewNativePort.
596 * 598 *
597 * The message received is decoded into the message structure. The 599 * The message received is decoded into the message structure. The
598 * lifetime of the message data is controlled by the caller. All the 600 * lifetime of the message data is controlled by the caller. All the
599 * data references from the message are allocated by the caller and 601 * data references from the message are allocated by the caller and
600 * will be reclaimed when returning to it. 602 * will be reclaimed when returning to it.
601 */ 603 */
604
602 typedef void (*Dart_NativeMessageHandler)(Dart_Port dest_port_id, 605 typedef void (*Dart_NativeMessageHandler)(Dart_Port dest_port_id,
603 Dart_Port reply_port_id, 606 Dart_Port reply_port_id,
604 Dart_CObject* message); 607 Dart_CObject* message);
605 608
606 /** 609 /**
607 * Creates a new native port. When messages are received on this 610 * Creates a new native port. When messages are received on this
608 * native port, then they will be dispatched to the provided native 611 * native port, then they will be dispatched to the provided native
609 * message handler. 612 * message handler.
610 * 613 *
611 * \param name The name of this port in debugging messages. 614 * \param name The name of this port in debugging messages.
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 1468
1466 // --- Profiling support ---- 1469 // --- Profiling support ----
1467 1470
1468 // External pprof support for gathering and dumping symbolic 1471 // External pprof support for gathering and dumping symbolic
1469 // information that can be used for better profile reports for 1472 // information that can be used for better profile reports for
1470 // dynamically generated code. 1473 // dynamically generated code.
1471 DART_EXPORT void Dart_InitPprofSupport(); 1474 DART_EXPORT void Dart_InitPprofSupport();
1472 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); 1475 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size);
1473 1476
1474 #endif // INCLUDE_DART_API_H_ 1477 #endif // INCLUDE_DART_API_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698