OLD | NEW |
---|---|
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 #include "include/dart_api.h" | 5 #include "include/dart_api.h" |
6 | 6 |
7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
(...skipping 2490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2501 // --- Message encoding/decoding ---- | 2501 // --- Message encoding/decoding ---- |
2502 | 2502 |
2503 | 2503 |
2504 DART_EXPORT Dart_CMessage* Dart_DecodeMessage(uint8_t* message, | 2504 DART_EXPORT Dart_CMessage* Dart_DecodeMessage(uint8_t* message, |
2505 intptr_t length, | 2505 intptr_t length, |
2506 Allocator allocator) { | 2506 Allocator allocator) { |
2507 CMessageReader reader(message, length, allocator); | 2507 CMessageReader reader(message, length, allocator); |
2508 return reader.ReadMessage(); | 2508 return reader.ReadMessage(); |
2509 } | 2509 } |
2510 | 2510 |
2511 | |
2512 DART_EXPORT uint8_t* Dart_EncodeMessage(Dart_CMessage* message, | |
2513 Allocator allocator) { | |
2514 uint8_t* buffer = NULL; | |
2515 MessageWriter writer(&buffer, allocator); | |
2516 | |
2517 writer.WriteCMessage(message->object); | |
2518 return buffer; | |
2519 } | |
siva
2012/02/01 01:01:33
Ditto comment regarding the need for this in the A
Søren Gjesse
2012/02/02 14:25:59
Done.
| |
2520 | |
2511 } // namespace dart | 2521 } // namespace dart |
OLD | NEW |