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

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

Issue 24534002: Add share button to generate public url for dmprof visualizer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix review problems Created 7 years, 2 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 | « tools/deep_memory_profiler/visualizer/static/index.css ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, template) { 9 var Profiler = function(jsonData, template) {
10 this.jsonData_ = jsonData; 10 this.jsonData_ = jsonData;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 /** 53 /**
54 * Calcualte initial models according default template. 54 * Calcualte initial models according default template.
55 */ 55 */
56 Profiler.prototype.reparse = function() { 56 Profiler.prototype.reparse = function() {
57 this.models_ = this.parseTemplate_(); 57 this.models_ = this.parseTemplate_();
58 this.emit('changed', this.models_); 58 this.emit('changed', this.models_);
59 }; 59 };
60 60
61 /** 61 /**
62 * Get current breakdown template.
63 * @return {Object} current breakdown template.
64 */
65 Profiler.prototype.getTemplate = function() {
66 return this.template_;
67 };
68
69 /**
70 * Get run_id of current profiler.
71 * @return {string} run_id of current profiler.
72 */
73 Profiler.prototype.getRunId = function() {
74 return this.jsonData_['run_id'];
75 };
76
77 /**
62 * To be called by view when new model being selected. 78 * To be called by view when new model being selected.
63 * And then triggers all relative views to update. 79 * And then triggers all relative views to update.
64 */ 80 */
65 Profiler.prototype.setSelected = function(id) { 81 Profiler.prototype.setSelected = function(id) {
66 this.selected_ = id; 82 this.selected_ = id;
67 this.emit('changed:selected', id); 83 this.emit('changed:selected', id);
68 }; 84 };
69 85
70 /** 86 /**
71 * Get all models throughout the whole timeline of given id. 87 * Get all models throughout the whole timeline of given id.
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 localUnits = localUnits.map(function(unitID) { 298 localUnits = localUnits.map(function(unitID) {
283 return parseInt(unitID, 10); 299 return parseInt(unitID, 10);
284 }); 300 });
285 301
286 var retVal = 302 var retVal =
287 self.accumulate_(self.template_, snapshot, worldUnits, localUnits); 303 self.accumulate_(self.template_, snapshot, worldUnits, localUnits);
288 calModelId(retVal.model, []); 304 calModelId(retVal.model, []);
289 return retVal.model; 305 return retVal.model;
290 }); 306 });
291 }; 307 };
OLDNEW
« no previous file with comments | « tools/deep_memory_profiler/visualizer/static/index.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698