| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 SHUTDOWN_ON_ERROR(result); | 163 SHUTDOWN_ON_ERROR(result); |
| 164 result = Dart_FinalizeLoading(false); | 164 result = Dart_FinalizeLoading(false); |
| 165 SHUTDOWN_ON_ERROR(result); | 165 SHUTDOWN_ON_ERROR(result); |
| 166 return true; | 166 return true; |
| 167 } | 167 } |
| 168 | 168 |
| 169 | 169 |
| 170 bool VmService::Setup(const char* server_ip, | 170 bool VmService::Setup(const char* server_ip, |
| 171 intptr_t server_port, | 171 intptr_t server_port, |
| 172 bool running_precompiled, | 172 bool running_precompiled, |
| 173 bool dev_mode_server) { | 173 bool dev_mode_server, |
| 174 bool trace_loading) { |
| 174 Dart_Isolate isolate = Dart_CurrentIsolate(); | 175 Dart_Isolate isolate = Dart_CurrentIsolate(); |
| 175 ASSERT(isolate != NULL); | 176 ASSERT(isolate != NULL); |
| 176 SetServerAddress(""); | 177 SetServerAddress(""); |
| 177 | 178 |
| 178 Dart_Handle result; | 179 Dart_Handle result; |
| 179 | 180 |
| 180 // Prepare builtin and its dependent libraries for use to resolve URIs. | 181 // Prepare builtin and its dependent libraries for use to resolve URIs. |
| 181 // Set up various closures, e.g: printing, timers etc. | 182 // Set up various closures, e.g: printing, timers etc. |
| 182 // Set up 'package root' for URI resolution. | 183 // Set up 'package root' for URI resolution. |
| 183 result = DartUtils::PrepareForScriptLoading(true, false); | 184 result = DartUtils::PrepareForScriptLoading(true, false); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 // Are we running on Fuchsia? | 251 // Are we running on Fuchsia? |
| 251 #if defined(HOST_OS_FUCHSIA) | 252 #if defined(HOST_OS_FUCHSIA) |
| 252 Dart_Handle is_fuchsia = Dart_True(); | 253 Dart_Handle is_fuchsia = Dart_True(); |
| 253 #else | 254 #else |
| 254 Dart_Handle is_fuchsia = Dart_False(); | 255 Dart_Handle is_fuchsia = Dart_False(); |
| 255 #endif | 256 #endif |
| 256 result = | 257 result = |
| 257 Dart_SetField(library, DartUtils::NewString("_isFuchsia"), is_fuchsia); | 258 Dart_SetField(library, DartUtils::NewString("_isFuchsia"), is_fuchsia); |
| 258 SHUTDOWN_ON_ERROR(result); | 259 SHUTDOWN_ON_ERROR(result); |
| 259 | 260 |
| 261 if (trace_loading) { |
| 262 result = Dart_SetField(library, DartUtils::NewString("_traceLoading"), |
| 263 Dart_True()); |
| 264 SHUTDOWN_ON_ERROR(result); |
| 265 } |
| 266 |
| 260 // Get _getWatchSignalInternal from dart:io. | 267 // Get _getWatchSignalInternal from dart:io. |
| 261 Dart_Handle dart_io_str = Dart_NewStringFromCString(DartUtils::kIOLibURL); | 268 Dart_Handle dart_io_str = Dart_NewStringFromCString(DartUtils::kIOLibURL); |
| 262 SHUTDOWN_ON_ERROR(dart_io_str); | 269 SHUTDOWN_ON_ERROR(dart_io_str); |
| 263 Dart_Handle io_lib = Dart_LookupLibrary(dart_io_str); | 270 Dart_Handle io_lib = Dart_LookupLibrary(dart_io_str); |
| 264 SHUTDOWN_ON_ERROR(io_lib); | 271 SHUTDOWN_ON_ERROR(io_lib); |
| 265 Dart_Handle function_name = | 272 Dart_Handle function_name = |
| 266 Dart_NewStringFromCString("_getWatchSignalInternal"); | 273 Dart_NewStringFromCString("_getWatchSignalInternal"); |
| 267 SHUTDOWN_ON_ERROR(function_name); | 274 SHUTDOWN_ON_ERROR(function_name); |
| 268 Dart_Handle signal_watch = Dart_Invoke(io_lib, function_name, 0, NULL); | 275 Dart_Handle signal_watch = Dart_Invoke(io_lib, function_name, 0, NULL); |
| 269 SHUTDOWN_ON_ERROR(signal_watch); | 276 SHUTDOWN_ON_ERROR(signal_watch); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 Dart_Handle source = GetSource(url_string); | 372 Dart_Handle source = GetSource(url_string); |
| 366 if (Dart_IsError(source)) { | 373 if (Dart_IsError(source)) { |
| 367 return source; | 374 return source; |
| 368 } | 375 } |
| 369 return Dart_LoadSource(library, url, Dart_Null(), source, 0, 0); | 376 return Dart_LoadSource(library, url, Dart_Null(), source, 0, 0); |
| 370 } | 377 } |
| 371 | 378 |
| 372 | 379 |
| 373 } // namespace bin | 380 } // namespace bin |
| 374 } // namespace dart | 381 } // namespace dart |
| OLD | NEW |