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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 // Are we running on Windows? | 249 // Are we running on Windows? |
250 #if defined(TARGET_OS_WINDOWS) | 250 #if defined(TARGET_OS_WINDOWS) |
251 Dart_Handle is_windows = Dart_True(); | 251 Dart_Handle is_windows = Dart_True(); |
252 #else | 252 #else |
253 Dart_Handle is_windows = Dart_False(); | 253 Dart_Handle is_windows = Dart_False(); |
254 #endif | 254 #endif |
255 result = | 255 result = |
256 Dart_SetField(library, DartUtils::NewString("_isWindows"), is_windows); | 256 Dart_SetField(library, DartUtils::NewString("_isWindows"), is_windows); |
257 SHUTDOWN_ON_ERROR(result); | 257 SHUTDOWN_ON_ERROR(result); |
258 | 258 |
| 259 // Are we running on Fuchsia? |
| 260 #if defined(TARGET_OS_FUCHSIA) |
| 261 Dart_Handle is_fuchsia = Dart_True(); |
| 262 #else |
| 263 Dart_Handle is_fuchsia = Dart_False(); |
| 264 #endif |
| 265 result = |
| 266 Dart_SetField(library, DartUtils::NewString("_isFuchsia"), is_fuchsia); |
| 267 SHUTDOWN_ON_ERROR(result); |
| 268 |
259 // Get _getWatchSignalInternal from dart:io. | 269 // Get _getWatchSignalInternal from dart:io. |
260 Dart_Handle dart_io_str = Dart_NewStringFromCString(DartUtils::kIOLibURL); | 270 Dart_Handle dart_io_str = Dart_NewStringFromCString(DartUtils::kIOLibURL); |
261 SHUTDOWN_ON_ERROR(dart_io_str); | 271 SHUTDOWN_ON_ERROR(dart_io_str); |
262 Dart_Handle io_lib = Dart_LookupLibrary(dart_io_str); | 272 Dart_Handle io_lib = Dart_LookupLibrary(dart_io_str); |
263 SHUTDOWN_ON_ERROR(io_lib); | 273 SHUTDOWN_ON_ERROR(io_lib); |
264 Dart_Handle function_name = | 274 Dart_Handle function_name = |
265 Dart_NewStringFromCString("_getWatchSignalInternal"); | 275 Dart_NewStringFromCString("_getWatchSignalInternal"); |
266 SHUTDOWN_ON_ERROR(function_name); | 276 SHUTDOWN_ON_ERROR(function_name); |
267 Dart_Handle signal_watch = Dart_Invoke(io_lib, function_name, 0, NULL); | 277 Dart_Handle signal_watch = Dart_Invoke(io_lib, function_name, 0, NULL); |
268 SHUTDOWN_ON_ERROR(signal_watch); | 278 SHUTDOWN_ON_ERROR(signal_watch); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 Dart_Handle source = GetSource(url_string); | 367 Dart_Handle source = GetSource(url_string); |
358 if (Dart_IsError(source)) { | 368 if (Dart_IsError(source)) { |
359 return source; | 369 return source; |
360 } | 370 } |
361 return Dart_LoadSource(library, url, source, 0, 0); | 371 return Dart_LoadSource(library, url, source, 0, 0); |
362 } | 372 } |
363 | 373 |
364 | 374 |
365 } // namespace bin | 375 } // namespace bin |
366 } // namespace dart | 376 } // namespace dart |
OLD | NEW |