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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 9104041: Added API Dart_PostCMessage for posting a Dart_CMessage structure (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
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 #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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698