OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 21 matching lines...) Expand all Loading... | |
32 * @constructor | 32 * @constructor |
33 * @extends {WebInspector.CountersGraph} | 33 * @extends {WebInspector.CountersGraph} |
34 * @implements {WebInspector.TimelineModeView} | 34 * @implements {WebInspector.TimelineModeView} |
35 * @param {!WebInspector.TimelineModeViewDelegate} delegate | 35 * @param {!WebInspector.TimelineModeViewDelegate} delegate |
36 * @param {!WebInspector.TimelineModel} model | 36 * @param {!WebInspector.TimelineModel} model |
37 */ | 37 */ |
38 WebInspector.MemoryCountersGraph = function(delegate, model) | 38 WebInspector.MemoryCountersGraph = function(delegate, model) |
39 { | 39 { |
40 WebInspector.CountersGraph.call(this, WebInspector.UIString("MEMORY"), deleg ate, model); | 40 WebInspector.CountersGraph.call(this, WebInspector.UIString("MEMORY"), deleg ate, model); |
41 this._countersByName = {}; | 41 this._countersByName = {}; |
42 this._countersByName["jsHeapSizeUsed"] = this.createCounter(WebInspector.UIS tring("Used JS Heap"), WebInspector.UIString("JS Heap Size: %d"), "hsl(220, 90%, 43%)"); | 42 this._countersByName["jsHeapSizeUsed"] = this.createCounter(WebInspector.UIS tring("JS Heap"), WebInspector.UIString("JS Heap: %s"), "hsl(220, 90%, 43%)", Nu mber.bytesToString); |
43 this._countersByName["documents"] = this.createCounter(WebInspector.UIString ("Documents"), WebInspector.UIString("Documents: %d"), "hsl(0, 90%, 43%)"); | 43 this._countersByName["documents"] = this.createCounter(WebInspector.UIString ("Documents"), WebInspector.UIString("Documents: %s"), "hsl(0, 90%, 43%)", undef ined); |
alph
2015/08/26 16:59:09
Once you make it optional, you can omit "undefined
| |
44 this._countersByName["nodes"] = this.createCounter(WebInspector.UIString("No des"), WebInspector.UIString("Nodes: %d"), "hsl(120, 90%, 43%)"); | 44 this._countersByName["nodes"] = this.createCounter(WebInspector.UIString("No des"), WebInspector.UIString("Nodes: %s"), "hsl(120, 90%, 43%)", undefined); |
45 this._countersByName["jsEventListeners"] = this.createCounter(WebInspector.U IString("Listeners"), WebInspector.UIString("Listeners: %d"), "hsl(38, 90%, 43%) "); | 45 this._countersByName["jsEventListeners"] = this.createCounter(WebInspector.U IString("Listeners"), WebInspector.UIString("Listeners: %s"), "hsl(38, 90%, 43%) ", undefined); |
46 if (Runtime.experiments.isEnabled("gpuTimeline")) { | 46 if (Runtime.experiments.isEnabled("gpuTimeline")) { |
47 this._gpuMemoryCounter = this.createCounter(WebInspector.UIString("GPU M emory"), WebInspector.UIString("GPU Memory [KB]: %d"), "hsl(300, 90%, 43%)"); | 47 this._gpuMemoryCounter = this.createCounter(WebInspector.UIString("GPU M emory"), WebInspector.UIString("GPU Memory [KB]: %s"), "hsl(300, 90%, 43%)", Num ber.bytesToString); |
48 this._countersByName["gpuMemoryUsedKB"] = this._gpuMemoryCounter; | 48 this._countersByName["gpuMemoryUsedKB"] = this._gpuMemoryCounter; |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
52 WebInspector.MemoryCountersGraph.prototype = { | 52 WebInspector.MemoryCountersGraph.prototype = { |
53 /** | 53 /** |
54 * @override | 54 * @override |
55 * @param {?RegExp} textFilter | 55 * @param {?RegExp} textFilter |
56 */ | 56 */ |
57 refreshRecords: function(textFilter) | 57 refreshRecords: function(textFilter) |
(...skipping 16 matching lines...) Expand all Loading... | |
74 | 74 |
75 var gpuMemoryLimitCounterName = "gpuMemoryLimitKB"; | 75 var gpuMemoryLimitCounterName = "gpuMemoryLimitKB"; |
76 if (this._gpuMemoryCounter && (gpuMemoryLimitCounterName in counters )) | 76 if (this._gpuMemoryCounter && (gpuMemoryLimitCounterName in counters )) |
77 this._gpuMemoryCounter.setLimit(counters[gpuMemoryLimitCounterNa me]); | 77 this._gpuMemoryCounter.setLimit(counters[gpuMemoryLimitCounterNa me]); |
78 } | 78 } |
79 this.scheduleRefresh(); | 79 this.scheduleRefresh(); |
80 }, | 80 }, |
81 | 81 |
82 __proto__: WebInspector.CountersGraph.prototype | 82 __proto__: WebInspector.CountersGraph.prototype |
83 } | 83 } |
OLD | NEW |