OLD | NEW |
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 "bin/vmservice_impl.h" | 5 #include "bin/vmservice_impl.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 | 8 |
9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 }; | 87 }; |
88 | 88 |
89 const char* VmService::error_msg_ = NULL; | 89 const char* VmService::error_msg_ = NULL; |
90 | 90 |
91 bool VmService::Start(const char *server_ip, intptr_t server_port) { | 91 bool VmService::Start(const char *server_ip, intptr_t server_port) { |
92 bool r = _Start(server_ip, server_port); | 92 bool r = _Start(server_ip, server_port); |
93 if (!r) { | 93 if (!r) { |
94 return r; | 94 return r; |
95 } | 95 } |
96 // Start processing messages in a new thread. | 96 // Start processing messages in a new thread. |
97 dart::Thread::Start(ThreadMain, static_cast<uword>(NULL)); | 97 Thread::Start(ThreadMain, static_cast<uword>(NULL)); |
98 return true; | 98 return true; |
99 } | 99 } |
100 | 100 |
101 | 101 |
102 bool VmService::_Start(const char *server_ip, intptr_t server_port) { | 102 bool VmService::_Start(const char *server_ip, intptr_t server_port) { |
103 ASSERT(Dart_CurrentIsolate() == NULL); | 103 ASSERT(Dart_CurrentIsolate() == NULL); |
104 Dart_Isolate isolate = Dart_GetServiceIsolate(NULL); | 104 Dart_Isolate isolate = Dart_GetServiceIsolate(NULL); |
105 if (isolate == NULL) { | 105 if (isolate == NULL) { |
106 error_msg_ = "Internal error."; | 106 error_msg_ = "Internal error."; |
107 return false; | 107 return false; |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 printf("Service exited with an error:\n%s\n", Dart_GetError(result)); | 301 printf("Service exited with an error:\n%s\n", Dart_GetError(result)); |
302 } | 302 } |
303 Dart_ExitScope(); | 303 Dart_ExitScope(); |
304 Dart_ExitIsolate(); | 304 Dart_ExitIsolate(); |
305 } | 305 } |
306 | 306 |
307 | 307 |
308 | 308 |
309 } // namespace bin | 309 } // namespace bin |
310 } // namespace dart | 310 } // namespace dart |
OLD | NEW |