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

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

Issue 2196723002: Refactor how we report reload results (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: tweak Created 4 years, 4 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') | runtime/vm/unit_test.cc » ('j') | 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 2475 matching lines...) Expand 10 before | Expand all | Expand 10 after
2486 return true; 2486 return true;
2487 } 2487 }
2488 if (!isolate->CanReload()) { 2488 if (!isolate->CanReload()) {
2489 js->PrintError(kFeatureDisabled, 2489 js->PrintError(kFeatureDisabled,
2490 "This isolate cannot reload sources right now."); 2490 "This isolate cannot reload sources right now.");
2491 return true; 2491 return true;
2492 } 2492 }
2493 const bool force_reload = 2493 const bool force_reload =
2494 BoolParameter::Parse(js->LookupParam("force"), false); 2494 BoolParameter::Parse(js->LookupParam("force"), false);
2495 2495
2496 isolate->ReloadSources(force_reload); 2496 isolate->ReloadSources(js, force_reload);
2497 2497
2498 const Error& error = Error::Handle(isolate->sticky_reload_error());
2499
2500 if (error.IsNull()) {
2501 PrintSuccess(js);
2502 } else {
2503 // Clear the sticky error.
2504 isolate->clear_sticky_reload_error();
2505 js->PrintError(kIsolateReloadFailed,
2506 "Isolate reload failed: %s", error.ToErrorCString());
2507 }
2508 return true; 2498 return true;
2509 } 2499 }
2510 2500
2511 2501
2512 static bool AddBreakpointCommon(Thread* thread, 2502 static bool AddBreakpointCommon(Thread* thread,
2513 JSONStream* js, 2503 JSONStream* js,
2514 const String& script_uri) { 2504 const String& script_uri) {
2515 if (!thread->isolate()->compilation_allowed()) { 2505 if (!thread->isolate()->compilation_allowed()) {
2516 js->PrintError(kFeatureDisabled, 2506 js->PrintError(kFeatureDisabled,
2517 "Cannot use breakpoints when running a precompiled program."); 2507 "Cannot use breakpoints when running a precompiled program.");
(...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after
4134 if (strcmp(method_name, method.name) == 0) { 4124 if (strcmp(method_name, method.name) == 0) {
4135 return &method; 4125 return &method;
4136 } 4126 }
4137 } 4127 }
4138 return NULL; 4128 return NULL;
4139 } 4129 }
4140 4130
4141 #endif // !PRODUCT 4131 #endif // !PRODUCT
4142 4132
4143 } // namespace dart 4133 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object_reload.cc ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698