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

Unified Diff: runtime/include/dart_api.h

Issue 9235063: Implementation of message reader for converting a message snapshot into a C structure (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed first round of review comments from asive@ and turnidge@ Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/raw_object_snapshot.cc » ('j') | runtime/vm/snapshot_test.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 1fc3f4e26902ed9ac4c475f8e3b0515973b04509..a31dd9a271d882a267f8c48d21728a1eda34293e 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -1360,4 +1360,41 @@ DART_EXPORT Dart_Handle Dart_SetNativeResolver(
DART_EXPORT void Dart_InitPprofSupport();
DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size);
+// --- Message encoding/decoding ----
+
+/**
+ * A Dart_CObject is used for representing Dart objects as native C
+ * data outside the Dart heap. These objects are totally detached from
+ * the Dart heap. Only a subset of the Dart objects have a
+ * representation as a Dart_CObject.
+ */
+struct Dart_CObject {
+ enum Type {
+ kNull,
+ kBool,
+ kInt32,
+ kDouble,
+ kString,
+ kArray
+ };
+ Type type;
+ union {
+ bool as_bool;
+ int32_t as_int32;
+ double as_double;
+ char* as_string;
+ struct {
+ int length;
+ Dart_CObject** values;
+ } as_array;
+ } value;
+};
+
+/**
+ * A Dart_CMessage is used for encoding and decoding messages from native code.
+ */
+struct Dart_CMessage {
+ Dart_CObject** message;
+};
+
#endif // INCLUDE_DART_API_H_
« no previous file with comments | « no previous file | runtime/vm/raw_object_snapshot.cc » ('j') | runtime/vm/snapshot_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698