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 "vm/service.h" | 5 #include "vm/service.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
10 | 10 |
(...skipping 2541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2552 static const MethodParameter* reload_sources_params[] = { | 2552 static const MethodParameter* reload_sources_params[] = { |
2553 RUNNABLE_ISOLATE_PARAMETER, | 2553 RUNNABLE_ISOLATE_PARAMETER, |
2554 new BoolParameter("force", false), | 2554 new BoolParameter("force", false), |
2555 new BoolParameter("pause", false), | 2555 new BoolParameter("pause", false), |
2556 new StringParameter("rootLibUri", false), | 2556 new StringParameter("rootLibUri", false), |
2557 new StringParameter("packagesUri", false), | 2557 new StringParameter("packagesUri", false), |
2558 NULL, | 2558 NULL, |
2559 }; | 2559 }; |
2560 | 2560 |
2561 static bool ReloadSources(Thread* thread, JSONStream* js) { | 2561 static bool ReloadSources(Thread* thread, JSONStream* js) { |
| 2562 #if !defined(DART_PRECOMPILED_RUNTIME) |
2562 Isolate* isolate = thread->isolate(); | 2563 Isolate* isolate = thread->isolate(); |
2563 if (!isolate->compilation_allowed()) { | 2564 if (!isolate->compilation_allowed()) { |
2564 js->PrintError(kFeatureDisabled, | 2565 js->PrintError(kFeatureDisabled, |
2565 "Cannot reload source when running a precompiled program."); | 2566 "Cannot reload source when running a precompiled program."); |
2566 return true; | 2567 return true; |
2567 } | 2568 } |
2568 Dart_LibraryTagHandler handler = isolate->library_tag_handler(); | 2569 Dart_LibraryTagHandler handler = isolate->library_tag_handler(); |
2569 if (handler == NULL) { | 2570 if (handler == NULL) { |
2570 js->PrintError(kFeatureDisabled, | 2571 js->PrintError(kFeatureDisabled, |
2571 "A library tag handler must be installed."); | 2572 "A library tag handler must be installed."); |
(...skipping 17 matching lines...) Expand all Loading... |
2589 } | 2590 } |
2590 const bool force_reload = | 2591 const bool force_reload = |
2591 BoolParameter::Parse(js->LookupParam("force"), false); | 2592 BoolParameter::Parse(js->LookupParam("force"), false); |
2592 | 2593 |
2593 isolate->ReloadSources(js, force_reload, js->LookupParam("rootLibUri"), | 2594 isolate->ReloadSources(js, force_reload, js->LookupParam("rootLibUri"), |
2594 js->LookupParam("packagesUri")); | 2595 js->LookupParam("packagesUri")); |
2595 | 2596 |
2596 Service::CheckForPause(isolate, js); | 2597 Service::CheckForPause(isolate, js); |
2597 | 2598 |
2598 return true; | 2599 return true; |
| 2600 #else // !defined(DART_PRECOMPILED_RUNTIME) |
| 2601 js->PrintError(kFeatureDisabled, |
| 2602 "This isolate cannot reload sources right now."); |
| 2603 return true; |
| 2604 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
2599 } | 2605 } |
2600 | 2606 |
2601 void Service::CheckForPause(Isolate* isolate, JSONStream* stream) { | 2607 void Service::CheckForPause(Isolate* isolate, JSONStream* stream) { |
2602 // Should we pause? | 2608 // Should we pause? |
2603 isolate->set_should_pause_post_service_request( | 2609 isolate->set_should_pause_post_service_request( |
2604 BoolParameter::Parse(stream->LookupParam("pause"), false)); | 2610 BoolParameter::Parse(stream->LookupParam("pause"), false)); |
2605 } | 2611 } |
2606 | 2612 |
2607 RawError* Service::MaybePause(Isolate* isolate, const Error& error) { | 2613 RawError* Service::MaybePause(Isolate* isolate, const Error& error) { |
2608 // Don't pause twice. | 2614 // Don't pause twice. |
(...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4200 if (strcmp(method_name, method.name) == 0) { | 4206 if (strcmp(method_name, method.name) == 0) { |
4201 return &method; | 4207 return &method; |
4202 } | 4208 } |
4203 } | 4209 } |
4204 return NULL; | 4210 return NULL; |
4205 } | 4211 } |
4206 | 4212 |
4207 #endif // !PRODUCT | 4213 #endif // !PRODUCT |
4208 | 4214 |
4209 } // namespace dart | 4215 } // namespace dart |
OLD | NEW |