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

Unified Diff: runtime/observatory/web/timeline.js

Issue 1814813003: Collect samples for background threads. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | « runtime/observatory/lib/src/elements/timeline_page.dart ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/web/timeline.js
diff --git a/runtime/observatory/web/timeline.js b/runtime/observatory/web/timeline.js
index 9bdf46aa8fa1a3dbe3882b98a0ca2df87320e57a..402723d7fe298b57656da03de46aacf36abccc07 100644
--- a/runtime/observatory/web/timeline.js
+++ b/runtime/observatory/web/timeline.js
@@ -55,15 +55,21 @@ function gotReponse() {
function fetchTimelineOnLoad(event) {
var xhr = event.target;
var response = JSON.parse(xhr.responseText);
- var result = response['result'];
- var newStackFrames = result['stackFrames']; // Map.
- var newTraceEvents = result['traceEvents']; // List.
-
- // Merge in timeline events.
- traceObject.traceEvents = traceObject.traceEvents.concat(newTraceEvents);
- for (var key in newStackFrames) {
- if (newStackFrames.hasOwnProperty(key)) {
- traceObject.stackFrames[key] = newStackFrames[key];
+
+ if (response.error) {
+ // Maybe profiling is disabled.
+ console.log("ERROR " + response.error.message);
+ } else {
+ var result = response['result'];
+ var newStackFrames = result['stackFrames']; // Map.
+ var newTraceEvents = result['traceEvents']; // List.
+
+ // Merge in timeline events.
+ traceObject.traceEvents = traceObject.traceEvents.concat(newTraceEvents);
+ for (var key in newStackFrames) {
+ if (newStackFrames.hasOwnProperty(key)) {
+ traceObject.stackFrames[key] = newStackFrames[key];
+ }
}
}
« no previous file with comments | « runtime/observatory/lib/src/elements/timeline_page.dart ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698