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

Unified Diff: tools/memory_inspector/memory_inspector/frontends/www_content/js/webservice.js

Issue 559023002: [Android] memory_inspector: bug / UI fixes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mi1_heapdump_sigstop
Patch Set: Created 6 years, 3 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
Index: tools/memory_inspector/memory_inspector/frontends/www_content/js/webservice.js
diff --git a/tools/memory_inspector/memory_inspector/frontends/www_content/js/webservice.js b/tools/memory_inspector/memory_inspector/frontends/www_content/js/webservice.js
index 437d3a4bc38eaea0c9cb1ced5fa228a1ae5aee17..2967d66ae58083caeb136e4c9cf63417f56ca716 100644
--- a/tools/memory_inspector/memory_inspector/frontends/www_content/js/webservice.js
+++ b/tools/memory_inspector/memory_inspector/frontends/www_content/js/webservice.js
@@ -6,6 +6,8 @@ webservice = new (function() {
this.AJAX_BASE_URL_ = '/ajax';
+this.onServerUnreachableOrTimeout = null;
+
this.ajaxRequest = function(path, responseCallback, errorCallback, postArgs) {
var reqType = postArgs ? 'POST' : 'GET';
var reqData = postArgs ? JSON.stringify(postArgs) : '';
@@ -23,6 +25,8 @@ this.ajaxRequest = function(path, responseCallback, errorCallback, postArgs) {
console.log(xhr.responseText);
if (errorCallback)
errorCallback(xhr.status, xhr.responseText);
+ if (xhr.readyState < 4 && this_.onServerUnreachableOrTimeout != null)
+ webservice.onServerUnreachableOrTimeout();
}
});
};

Powered by Google App Engine
This is Rietveld 408576698