Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: runtime/vm/service.cc

Issue 2070873002: Bug fixes for hot reload (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix an error message Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/object_reload.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/object_reload.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698