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

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

Issue 1371193005: VM restart + shutdown fixes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: more code review Created 5 years, 2 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
« no previous file with comments | « runtime/vm/native_message_handler.h ('k') | runtime/vm/object.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 #include "vm/native_message_handler.h" 5 #include "vm/native_message_handler.h"
6 6
7 #include "vm/dart_api_message.h" 7 #include "vm/dart_api_message.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/message.h" 9 #include "vm/message.h"
10 #include "vm/snapshot.h" 10 #include "vm/snapshot.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 27
28 #if defined(DEBUG) 28 #if defined(DEBUG)
29 void NativeMessageHandler::CheckAccess() { 29 void NativeMessageHandler::CheckAccess() {
30 ASSERT(Isolate::Current() == NULL); 30 ASSERT(Isolate::Current() == NULL);
31 } 31 }
32 #endif 32 #endif
33 33
34 34
35 bool NativeMessageHandler::HandleMessage(Message* message) { 35 MessageHandler::MessageStatus NativeMessageHandler::HandleMessage(
36 Message* message) {
36 if (message->IsOOB()) { 37 if (message->IsOOB()) {
37 // We currently do not use OOB messages for native ports. 38 // We currently do not use OOB messages for native ports.
38 UNREACHABLE(); 39 UNREACHABLE();
39 } 40 }
40 // We create a native scope for handling the message. 41 // We create a native scope for handling the message.
41 // All allocation of objects for decoding the message is done in the 42 // All allocation of objects for decoding the message is done in the
42 // zone associated with this scope. 43 // zone associated with this scope.
43 ApiNativeScope scope; 44 ApiNativeScope scope;
44 ApiMessageReader reader(message->data(), message->len()); 45 ApiMessageReader reader(message->data(), message->len());
45 Dart_CObject* object = reader.ReadMessage(); 46 Dart_CObject* object = reader.ReadMessage();
46 (*func())(message->dest_port(), object); 47 (*func())(message->dest_port(), object);
47 delete message; 48 delete message;
48 return true; 49 return kOK;
49 } 50 }
50 51
51 } // namespace dart 52 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/native_message_handler.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698