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

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

Issue 93873015: - Remove the reply_port from the VM internal message object. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « runtime/vm/message_test.cc ('k') | runtime/vm/port_test.cc » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_native_api.h" 5 #include "include/dart_native_api.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/dart_api_message.h" 9 #include "vm/dart_api_message.h"
10 #include "vm/dart_api_state.h" 10 #include "vm/dart_api_state.h"
(...skipping 13 matching lines...) Expand all
24 24
25 DART_EXPORT bool Dart_PostCObject(Dart_Port port_id, Dart_CObject* message) { 25 DART_EXPORT bool Dart_PostCObject(Dart_Port port_id, Dart_CObject* message) {
26 uint8_t* buffer = NULL; 26 uint8_t* buffer = NULL;
27 ApiMessageWriter writer(&buffer, allocator); 27 ApiMessageWriter writer(&buffer, allocator);
28 bool success = writer.WriteCMessage(message); 28 bool success = writer.WriteCMessage(message);
29 29
30 if (!success) return success; 30 if (!success) return success;
31 31
32 // Post the message at the given port. 32 // Post the message at the given port.
33 return PortMap::PostMessage(new Message( 33 return PortMap::PostMessage(new Message(
34 port_id, Message::kIllegalPort, buffer, writer.BytesWritten(), 34 port_id, buffer, writer.BytesWritten(), Message::kNormalPriority));
35 Message::kNormalPriority));
36 } 35 }
37 36
38 37
39 DART_EXPORT Dart_Port Dart_NewNativePort(const char* name, 38 DART_EXPORT Dart_Port Dart_NewNativePort(const char* name,
40 Dart_NativeMessageHandler handler, 39 Dart_NativeMessageHandler handler,
41 bool handle_concurrently) { 40 bool handle_concurrently) {
42 if (name == NULL) { 41 if (name == NULL) {
43 name = "<UnnamedNativePort>"; 42 name = "<UnnamedNativePort>";
44 } 43 }
45 if (handler == NULL) { 44 if (handler == NULL) {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 Dart_Handle result = Api::CheckIsolateState(isolate); 113 Dart_Handle result = Api::CheckIsolateState(isolate);
115 if (::Dart_IsError(result)) { 114 if (::Dart_IsError(result)) {
116 return result; 115 return result;
117 } 116 }
118 CHECK_CALLBACK_STATE(isolate); 117 CHECK_CALLBACK_STATE(isolate);
119 CompileAll(isolate, &result); 118 CompileAll(isolate, &result);
120 return result; 119 return result;
121 } 120 }
122 121
123 } // namespace dart 122 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/message_test.cc ('k') | runtime/vm/port_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698