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

Side by Side Diff: tools/cc-frame-viewer/app/viewer.js

Issue 12225131: [cc] Initial checkin of cc-frame-viewer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « tools/cc-frame-viewer/app/viewer.html ('k') | tools/cc-frame-viewer/build/__init__.py » ('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) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5 'use strict';
6
7 base.exportTo('ccfv', function() {
8 function assert(bool) {
9 if (bool)
10 return;
11 throw new Error("Expected true");
12 }
13
14 chromeapp.addEventListener('launch', init);
15 chrome.app.window.current().onClosed.addListener(onClosed);
16 chrome.app.window.current().focus();
17
18 var viewerEl;
19 function init(launch_event) {
20 viewerEl = document.querySelector('#viewer')
21 window.g_viewerEl = viewerEl;
22
23 var num_args = launch_event.args[0]
24 chromeapp.sendEvent('load', 'please', onLoadResult, onLoadError);
25 }
26
27 function onLoadResult(res) {
28 var trace = JSON.parse(res);
29
30 window.g_lastResult = trace;
31 var model = new ccfv.Model();
32 model.initFromTraceEvents(trace);
33 window.g_model = model;
34
35 var modelViewEl = new ccfv.ModelView();
36 modelViewEl.model = model;
37 window.g_modelViewEl = modelViewEl;
38
39 viewerEl.appendChild(modelViewEl);
40 }
41
42 function onLoadError(err) {
43 viewerEl.textContent = 'error loading: ' + err;
44 }
45
46 function onClosed() {
47 chromeapp.exit(1);
48 }
49
50 });
OLDNEW
« no previous file with comments | « tools/cc-frame-viewer/app/viewer.html ('k') | tools/cc-frame-viewer/build/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698