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

Side by Side Diff: Source/devtools/front_end/TracingAgent.js

Issue 46663010: DevTools: Show GPU utilization bar on timeline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reverting the reverted container existance check. Created 7 years, 1 month 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 /* 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 22 matching lines...) Expand all
33 */ 33 */
34 WebInspector.TracingAgent = function() 34 WebInspector.TracingAgent = function()
35 { 35 {
36 this._active = false; 36 this._active = false;
37 InspectorBackend.registerTracingDispatcher(new WebInspector.TracingDispatche r(this)); 37 InspectorBackend.registerTracingDispatcher(new WebInspector.TracingDispatche r(this));
38 } 38 }
39 39
40 WebInspector.TracingAgent.prototype = { 40 WebInspector.TracingAgent.prototype = {
41 /** 41 /**
42 * @param {string} categoryPatterns 42 * @param {string} categoryPatterns
43 * @param {string} options
43 * @param {function(?string)=} callback 44 * @param {function(?string)=} callback
44 */ 45 */
45 start: function(categoryPatterns, callback) 46 start: function(categoryPatterns, options, callback)
46 { 47 {
47 TracingAgent.start(categoryPatterns, callback); 48 TracingAgent.start(categoryPatterns, options, callback);
48 this._active = true; 49 this._active = true;
49 this._events = []; 50 this._events = [];
50 }, 51 },
51 52
52 /** 53 /**
53 * @param {function()} callback 54 * @param {function()} callback
54 */ 55 */
55 stop: function(callback) 56 stop: function(callback)
56 { 57 {
57 if (!this._active) { 58 if (!this._active) {
58 callback(); 59 callback();
59 return; 60 return;
60 } 61 }
61 this._pendingStopCallback = callback; 62 this._pendingStopCallback = callback;
62 TracingAgent.end(); 63 TracingAgent.end();
63 }, 64 },
64 65
66 /**
67 * @return {!Array.<{cat: string, args: Object, ph: string, ts: number}>}
68 */
65 events: function() 69 events: function()
66 { 70 {
67 return this._events; 71 return this._events;
68 }, 72 },
69 73
70 _eventsCollected: function(events) 74 _eventsCollected: function(events)
71 { 75 {
72 Array.prototype.push.apply(this._events, events); 76 Array.prototype.push.apply(this._events, events);
73 }, 77 },
74 78
(...skipping 21 matching lines...) Expand all
96 dataCollected: function(data) 100 dataCollected: function(data)
97 { 101 {
98 this._tracingAgent._eventsCollected(data); 102 this._tracingAgent._eventsCollected(data);
99 }, 103 },
100 104
101 tracingComplete: function() 105 tracingComplete: function()
102 { 106 {
103 this._tracingAgent._tracingComplete(); 107 this._tracingAgent._tracingComplete();
104 } 108 }
105 } 109 }
110
111 /**
112 * @type {WebInspector.TracingAgent}
113 */
114 WebInspector.tracingAgent;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698