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

Unified Diff: runtime/vm/isolate_reload.cc

Issue 2213753002: Fix reload service protocol reporting (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate_reload.cc
diff --git a/runtime/vm/isolate_reload.cc b/runtime/vm/isolate_reload.cc
index e635a7b1a71fd2b3e497c9fcf7ad892913ade4b6..8d78d01a59ac7bb39e60505c42e3136ccf3646b3 100644
--- a/runtime/vm/isolate_reload.cc
+++ b/runtime/vm/isolate_reload.cc
@@ -442,6 +442,7 @@ void IsolateReloadContext::Reload(bool force_reload) {
if (!modified_libs_->Contains(root_lib.index())) {
ASSERT(modified_libs_->IsEmpty());
reload_skipped_ = true;
+ ReportOnJSON(js_);
TIR_Print("---- SKIPPING RELOAD (No libraries were modified)\n");
return;
}
@@ -596,14 +597,20 @@ void IsolateReloadContext::CommonFinalizeTail() {
void IsolateReloadContext::ReportOnJSON(JSONStream* stream) {
- // Clear the buffer.
- stream->buffer()->Clear();
JSONObject jsobj(stream);
jsobj.AddProperty("type", "ReloadReport");
- jsobj.AddProperty("success", !HasReasonsForCancelling());
+ jsobj.AddProperty("success", reload_skipped_ || !HasReasonsForCancelling());
{
JSONObject details(&jsobj, "details");
- if (HasReasonsForCancelling()) {
+ if (reload_skipped_) {
+ // Reload was skipped.
+ const GrowableObjectArray& libs =
+ GrowableObjectArray::Handle(object_store()->libraries());
+ const intptr_t final_library_count = libs.Length();
+ details.AddProperty("savedLibraryCount", final_library_count);
+ details.AddProperty("loadedLibraryCount", static_cast<intptr_t>(0));
+ details.AddProperty("finalLibraryCount", final_library_count);
+ } else if (HasReasonsForCancelling()) {
// Reload was rejected.
JSONArray array(&jsobj, "notices");
for (intptr_t i = 0; i < reasons_to_cancel_reload_.length(); i++) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698