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

Side by Side Diff: Source/devtools/front_end/timeline/TimelineUIUtilsImpl.js

Issue 344443007: Encapsulate implementation-specific timeline record handling in TimelineUIUtils (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
(Empty)
1 // Copyright 2014 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 /**
6 * @constructor
7 * @extends {WebInspector.TimelineUIUtils}
8 */
9 WebInspector.TimelineUIUtilsImpl = function()
10 {
11 WebInspector.TimelineUIUtils.call(this);
12 }
13
14 WebInspector.TimelineUIUtilsImpl.prototype = {
15 /**
16 * @param {!WebInspector.TimelineModel.Record} record
17 * @return {boolean}
18 */
19 isBeginFrame: function(record)
20 {
21 return record.type() === WebInspector.TimelineModel.RecordType.BeginFram e;
22 },
23 /**
24 * @param {!WebInspector.TimelineModel.Record} record
25 * @return {boolean}
26 */
27 isProgram: function(record)
28 {
29 return record.type() === WebInspector.TimelineModel.RecordType.Program;
30 },
31 /**
32 * @param {string} recordType
33 * @return {boolean}
34 */
35 isCoalescable: function(recordType)
36 {
37 return !!WebInspector.TimelineUIUtilsImpl._coalescableRecordTypes[record Type];
38 },
39
40 /**
41 * @param {!WebInspector.TimelineModel.Record} record
42 * @return {?Object}
43 */
44 countersForRecord: function(record)
45 {
46 return record.type() === WebInspector.TimelineModel.RecordType.UpdateCou nters ? record.data() : null;
47 },
48
49 /**
50 * @param {!WebInspector.TimelineModel.Record} record
51 * @return {?Object}
52 */
53 highlightQuadForRecord: function(record)
54 {
55 var recordTypes = WebInspector.TimelineModel.RecordType;
56 switch(record.type()) {
57 case recordTypes.Layout:
58 return record.data().root;
59 case recordTypes.Paint:
60 return record.data().clip;
61 default:
62 return null;
63 }
64 },
65
66 __proto__: WebInspector.TimelineUIUtils.prototype
67 }
68
69
70 WebInspector.TimelineUIUtilsImpl._coalescableRecordTypes = {};
71 WebInspector.TimelineUIUtilsImpl._coalescableRecordTypes[WebInspector.TimelineMo del.RecordType.Layout] = 1;
72 WebInspector.TimelineUIUtilsImpl._coalescableRecordTypes[WebInspector.TimelineMo del.RecordType.Paint] = 1;
73 WebInspector.TimelineUIUtilsImpl._coalescableRecordTypes[WebInspector.TimelineMo del.RecordType.Rasterize] = 1;
74 WebInspector.TimelineUIUtilsImpl._coalescableRecordTypes[WebInspector.TimelineMo del.RecordType.DecodeImage] = 1;
75 WebInspector.TimelineUIUtilsImpl._coalescableRecordTypes[WebInspector.TimelineMo del.RecordType.ResizeImage] = 1;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineUIUtils.js ('k') | Source/devtools/front_end/timeline/TimelineView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698