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 "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 2466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2477 if (handler == NULL) { | 2477 if (handler == NULL) { |
| 2478 js->PrintError(kFeatureDisabled, | 2478 js->PrintError(kFeatureDisabled, |
| 2479 "A library tag handler must be installed."); | 2479 "A library tag handler must be installed."); |
| 2480 return true; | 2480 return true; |
| 2481 } | 2481 } |
| 2482 if (isolate->IsReloading()) { | 2482 if (isolate->IsReloading()) { |
| 2483 js->PrintError(kIsolateIsReloading, | 2483 js->PrintError(kIsolateIsReloading, |
| 2484 "This isolate is being reloaded."); | 2484 "This isolate is being reloaded."); |
| 2485 return true; | 2485 return true; |
| 2486 } | 2486 } |
| 2487 DebuggerStackTrace* stack = isolate->debugger()->StackTrace(); | 2487 if (!isolate->CanReload()) { |
| 2488 ASSERT(isolate->CanReload()); | |
| 2489 | |
| 2490 if (stack->Length() > 0) { | |
| 2491 // TODO(turnidge): We need to support this case. | |
| 2492 js->PrintError(kFeatureDisabled, | 2488 js->PrintError(kFeatureDisabled, |
| 2493 "Source can only be reloaded when stack is empty."); | 2489 "This isolate cannot reload sources right now."); |
| 2494 return true; | 2490 return true; |
| 2495 } else { | |
| 2496 isolate->ReloadSources(); | |
| 2497 } | 2491 } |
| 2498 | 2492 |
| 2499 PrintSuccess(js); | 2493 isolate->ReloadSources(); |
| 2494 | |
| 2495 const Error& error = Error::Handle(isolate->sticky_reload_error()); | |
| 2496 | |
| 2497 if (error.IsNull()) { | |
| 2498 PrintSuccess(js); | |
| 2499 } else { | |
| 2500 // Clear the sticky error. | |
| 2501 isolate->clear_sticky_reload_error(); | |
| 2502 js->PrintError(kIsolateReloadFailed, | |
| 2503 "Isolate reload failed: %s", error.ToErrorCString()); | |
| 2504 } | |
| 2500 return true; | 2505 return true; |
|
Florian Schneider
2016/06/16 17:30:00
This function never seems to return false. Is the
Cutch
2016/06/16 18:02:26
A service protocol handler can return false if the
| |
| 2501 } | 2506 } |
| 2502 | 2507 |
| 2503 | 2508 |
| 2504 static bool AddBreakpointCommon(Thread* thread, | 2509 static bool AddBreakpointCommon(Thread* thread, |
| 2505 JSONStream* js, | 2510 JSONStream* js, |
| 2506 const String& script_uri) { | 2511 const String& script_uri) { |
| 2507 if (!thread->isolate()->compilation_allowed()) { | 2512 if (!thread->isolate()->compilation_allowed()) { |
| 2508 js->PrintError(kFeatureDisabled, | 2513 js->PrintError(kFeatureDisabled, |
| 2509 "Cannot use breakpoints when running a precompiled program."); | 2514 "Cannot use breakpoints when running a precompiled program."); |
| 2510 return true; | 2515 return true; |
| (...skipping 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4261 if (strcmp(method_name, method.name) == 0) { | 4266 if (strcmp(method_name, method.name) == 0) { |
| 4262 return &method; | 4267 return &method; |
| 4263 } | 4268 } |
| 4264 } | 4269 } |
| 4265 return NULL; | 4270 return NULL; |
| 4266 } | 4271 } |
| 4267 | 4272 |
| 4268 #endif // !PRODUCT | 4273 #endif // !PRODUCT |
| 4269 | 4274 |
| 4270 } // namespace dart | 4275 } // namespace dart |
| OLD | NEW |