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

Side by Side Diff: tools/deep_memory_profiler/visualizer/static/profiler.js

Issue 23781012: Upload file to app engine and generate public url for dmprof visualizer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use blobstore to store json file Created 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * This class provides data access interface for dump file profiler. 6 * This class provides data access interface for dump file profiler.
7 * @constructor 7 * @constructor
8 */ 8 */
9 var Profiler = function(jsonData) { 9 var Profiler = function(jsonData, template) {
10 this.jsonData_ = jsonData; 10 this.jsonData_ = jsonData;
11 // Initialize template with templates information. 11 // Initialize template with templates information.
12 this.template_ = jsonData.templates['l2']; 12 this.template_ = template || jsonData.templates['l2'];
13 // Initialize selected category, and nothing selected at first. 13 // Initialize selected category, and nothing selected at first.
14 this.selected_ = null; 14 this.selected_ = null;
15 15
16 // Trigger event. 16 // Trigger event.
17 this.callbacks_ = {}; 17 this.callbacks_ = {};
18 }; 18 };
19 19
20 /** 20 /**
21 * Mimic Eventemitter in node. Add new listener for event. 21 * Mimic Eventemitter in node. Add new listener for event.
22 * @param {string} event 22 * @param {string} event
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 localUnits = localUnits.map(function(unitID) { 282 localUnits = localUnits.map(function(unitID) {
283 return parseInt(unitID, 10); 283 return parseInt(unitID, 10);
284 }); 284 });
285 285
286 var retVal = 286 var retVal =
287 self.accumulate_(self.template_, snapshot, worldUnits, localUnits); 287 self.accumulate_(self.template_, snapshot, worldUnits, localUnits);
288 calModelId(retVal.model, []); 288 calModelId(retVal.model, []);
289 return retVal.model; 289 return retVal.model;
290 }); 290 });
291 }; 291 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698