Chromium Code Reviews| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 if (server_port < 0) { | 135 if (server_port < 0) { |
| 136 // Adjust server_port to port 0 which will result in the first available | 136 // Adjust server_port to port 0 which will result in the first available |
| 137 // port when the HTTP server is started. | 137 // port when the HTTP server is started. |
| 138 server_port = 0; | 138 server_port = 0; |
| 139 } | 139 } |
| 140 // Set initial state. | 140 // Set initial state. |
| 141 DartUtils::SetIntegerField(library, "_port", server_port); | 141 DartUtils::SetIntegerField(library, "_port", server_port); |
| 142 Dart_SetField(library, | 142 Dart_SetField(library, |
| 143 DartUtils::NewString("_autoStart"), | 143 DartUtils::NewString("_autoStart"), |
| 144 Dart_NewBoolean(auto_start)); | 144 Dart_NewBoolean(auto_start)); |
| 145 // We cannot register for signals on windows. | |
|
Anders Johnsen
2014/06/18 07:24:11
Remove this.
| |
| 146 #if defined(TARGET_OS_WINDOWS) | |
| 147 const bool is_windows = true; | |
| 148 #else | |
| 149 const bool is_windows = false; | |
| 150 #endif | |
| 151 Dart_SetField(library, | |
| 152 DartUtils::NewString("_isWindows"), | |
| 153 Dart_NewBoolean(is_windows)); | |
| 154 | |
| 145 // Invoke main. | 155 // Invoke main. |
| 146 result = Dart_Invoke(library, DartUtils::NewString("main"), 0, NULL); | 156 result = Dart_Invoke(library, DartUtils::NewString("main"), 0, NULL); |
| 147 SHUTDOWN_ON_ERROR(result); | 157 SHUTDOWN_ON_ERROR(result); |
| 148 // Load resources. | 158 // Load resources. |
| 149 result = LoadResources(library); | 159 result = LoadResources(library); |
| 150 SHUTDOWN_ON_ERROR(result); | 160 SHUTDOWN_ON_ERROR(result); |
| 151 | 161 |
| 152 Dart_ExitScope(); | 162 Dart_ExitScope(); |
| 153 Dart_ExitIsolate(); | 163 Dart_ExitIsolate(); |
| 154 | 164 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 289 printf("Service exited with an error:\n%s\n", Dart_GetError(result)); | 299 printf("Service exited with an error:\n%s\n", Dart_GetError(result)); |
| 290 } | 300 } |
| 291 Dart_ExitScope(); | 301 Dart_ExitScope(); |
| 292 Dart_ExitIsolate(); | 302 Dart_ExitIsolate(); |
| 293 } | 303 } |
| 294 | 304 |
| 295 | 305 |
| 296 | 306 |
| 297 } // namespace bin | 307 } // namespace bin |
| 298 } // namespace dart | 308 } // namespace dart |
| OLD | NEW |