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

Side by Side Diff: chrome/browser/resources/gpu_internals/timeline_model.js

Issue 6677166: More about:gpu tracing improvements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 /** 6 /**
7 * @fileoverview TimelineModel is a parsed representation of the 7 * @fileoverview TimelineModel is a parsed representation of the
8 * TraceEvents obtained from base/trace_event in which the begin-end 8 * TraceEvents obtained from base/trace_event in which the begin-end
9 * tokens are converted into a hierarchy of processes, threads, 9 * tokens are converted into a hierarchy of processes, threads,
10 * subrows, and slices. 10 * subrows, and slices.
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 /** 103 /**
104 * Builds a model from an array of TraceEvent objects. 104 * Builds a model from an array of TraceEvent objects.
105 * @param {Array} events An array of TraceEvents created by 105 * @param {Array} events An array of TraceEvents created by
106 * TraceEvent.ToJSON(). 106 * TraceEvent.ToJSON().
107 * @constructor 107 * @constructor
108 */ 108 */
109 function TimelineModel(events) { 109 function TimelineModel(events) {
110 this.processes = {}; 110 this.processes = {};
111 111
112 this.importEvents(events); 112 if (events)
113 this.importEvents(events);
113 } 114 }
114 115
115 TimelineModel.prototype = { 116 TimelineModel.prototype = {
116 __proto__: cr.EventTarget.prototype, 117 __proto__: cr.EventTarget.prototype,
117 118
118 getProcess: function(pid) { 119 getProcess: function(pid) {
119 if (!this.processes[pid]) 120 if (!this.processes[pid])
120 this.processes[pid] = new TimelineProcess(pid); 121 this.processes[pid] = new TimelineProcess(pid);
121 return this.processes[pid]; 122 return this.processes[pid];
122 }, 123 },
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 244
244 }; 245 };
245 246
246 return { 247 return {
247 TimelineSlice: TimelineSlice, 248 TimelineSlice: TimelineSlice,
248 TimelineThread: TimelineThread, 249 TimelineThread: TimelineThread,
249 TimelineProcess: TimelineProcess, 250 TimelineProcess: TimelineProcess,
250 TimelineModel: TimelineModel 251 TimelineModel: TimelineModel
251 }; 252 };
252 }); 253 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/gpu_internals/timeline.js ('k') | chrome/browser/resources/gpu_internals/timeline_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698