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

Side by Side Diff: runtime/observatory/web/timeline_message_handler.js

Issue 1972523003: Improve Observatory Timeline UI (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/observatory/web/timeline.js ('k') | runtime/vm/timeline.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
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.
4
5 // This file is loaded before the about:tracing code is loaded so that we have
6 // an event listener registered early.
7
8 // Used to delay the initial timeline load until the timeline has finished
9 // loading.
10 timeline_loaded = false;
11 timeline_vm_address = undefined;
12 timeline_isolates = undefined;
13
14 function registerForMessages() {
15 window.addEventListener("message", onMessage, false);
16 }
17
18 registerForMessages();
19
20 function onMessage(event) {
21 var request = JSON.parse(event.data);
22 var method = request['method'];
23 var params = request['params'];
24 console.log('method: ' + method)
25 switch (method) {
26 case 'refresh':
27 if (!timeline_loaded) {
28 timeline_vm_address = params['vmAddress'];
29 timeline_isolates = params['isolateIds'];
30 console.log('Delaying timeline refresh until loaded.');
31 } else {
32 fetchTimeline(params['vmAddress'], params['isolateIds']);
33 }
34 break;
35 case 'clear':
36 clearTimeline();
37 break;
38 case 'save':
39 saveTimeline();
40 break;
41 case 'load':
42 loadTimeline();
43 break;
44 default:
45 console.log('Unknown method:' + method + '.');
46 }
47 }
48
49 console.log('message handler registered');
OLDNEW
« no previous file with comments | « runtime/observatory/web/timeline.js ('k') | runtime/vm/timeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698