OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /** | 7 /** |
8 * @constructor | 8 * @constructor |
9 * @extends {WebInspector.Object} | 9 * @extends {WebInspector.Object} |
10 */ | 10 */ |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 DeleteObject: "D" | 58 DeleteObject: "D" |
59 }; | 59 }; |
60 | 60 |
61 WebInspector.TracingModel.MetadataEvent = { | 61 WebInspector.TracingModel.MetadataEvent = { |
62 ProcessSortIndex: "process_sort_index", | 62 ProcessSortIndex: "process_sort_index", |
63 ProcessName: "process_name", | 63 ProcessName: "process_name", |
64 ThreadSortIndex: "thread_sort_index", | 64 ThreadSortIndex: "thread_sort_index", |
65 ThreadName: "thread_name" | 65 ThreadName: "thread_name" |
66 } | 66 } |
67 | 67 |
68 WebInspector.TracingModel.DevToolsMetadataEventCategory = "disabled-by-default-d evtools.timeline"; | |
69 | |
70 WebInspector.TracingModel.DevToolsMetadataEvent = { | |
71 TracingStartedInPage: "TracingStartedInPage", | |
72 SetLayerTreeId: "SetLayerTreeId" | |
73 }; | |
74 | |
68 WebInspector.TracingModel.prototype = { | 75 WebInspector.TracingModel.prototype = { |
69 /** | 76 /** |
70 * @param {string} categoryPatterns | 77 * @param {string} categoryFilter |
78 */ | |
79 enable: function(categoryFilter) | |
80 { | |
81 TracingAgent.enable(categoryFilter); | |
82 }, | |
83 | |
84 /** | |
85 * @param {string} categoryFilter | |
71 * @param {string} options | 86 * @param {string} options |
72 * @param {function(?string)=} callback | 87 * @param {function(?string)=} callback |
73 */ | 88 */ |
74 start: function(categoryPatterns, options, callback) | 89 start: function(categoryFilter, options, callback) |
75 { | 90 { |
76 this.reset(); | 91 this.reset(); |
77 var bufferUsageReportingIntervalMs = 500; | 92 var bufferUsageReportingIntervalMs = 500; |
78 TracingAgent.start(categoryPatterns, options, bufferUsageReportingInterv alMs, callback); | 93 TracingAgent.start(categoryFilter, options, bufferUsageReportingInterval Ms, callback); |
79 this._active = true; | 94 this._active = true; |
95 this._sessionId = null; | |
80 }, | 96 }, |
81 | 97 |
82 /** | 98 /** |
83 * @param {function()} callback | 99 * @param {function()} callback |
84 */ | 100 */ |
85 stop: function(callback) | 101 stop: function(callback) |
86 { | 102 { |
87 if (!this._active) { | 103 if (!this._active) { |
88 callback(); | 104 callback(); |
89 return; | 105 return; |
90 } | 106 } |
91 this._pendingStopCallback = callback; | 107 this._pendingStopCallback = callback; |
92 TracingAgent.end(); | 108 TracingAgent.end(); |
93 }, | 109 }, |
94 | 110 |
95 /** | 111 /** |
112 * @return {?string} | |
113 */ | |
114 sessionId: function() | |
115 { | |
116 return this._sessionId; | |
117 }, | |
118 | |
119 /** | |
96 * @param {number} usage | 120 * @param {number} usage |
97 */ | 121 */ |
98 _bufferUsage: function(usage) | 122 _bufferUsage: function(usage) |
99 { | 123 { |
100 this.dispatchEventToListeners(WebInspector.TracingModel.Events.BufferUsa ge, usage); | 124 this.dispatchEventToListeners(WebInspector.TracingModel.Events.BufferUsa ge, usage); |
101 }, | 125 }, |
102 | 126 |
103 /** | 127 /** |
104 * @param {!Array.<!WebInspector.TracingModel.EventPayload>} events | 128 * @param {!Array.<!WebInspector.TracingModel.EventPayload>} events |
105 */ | 129 */ |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
426 * @constructor | 450 * @constructor |
427 * @implements {TracingAgent.Dispatcher} | 451 * @implements {TracingAgent.Dispatcher} |
428 * @param {!WebInspector.TracingModel} tracingModel | 452 * @param {!WebInspector.TracingModel} tracingModel |
429 */ | 453 */ |
430 WebInspector.TracingDispatcher = function(tracingModel) | 454 WebInspector.TracingDispatcher = function(tracingModel) |
431 { | 455 { |
432 this._tracingModel = tracingModel; | 456 this._tracingModel = tracingModel; |
433 } | 457 } |
434 | 458 |
435 WebInspector.TracingDispatcher.prototype = { | 459 WebInspector.TracingDispatcher.prototype = { |
460 pageTracingStarted: function(sessionId) | |
yurys
2014/04/24 14:08:09
Annotate please.
| |
461 { | |
462 this._tracingModel._sessionId = sessionId; | |
463 }, | |
464 | |
436 bufferUsage: function(usage) | 465 bufferUsage: function(usage) |
437 { | 466 { |
438 this._tracingModel._bufferUsage(usage); | 467 this._tracingModel._bufferUsage(usage); |
439 }, | 468 }, |
440 | 469 |
441 dataCollected: function(data) | 470 dataCollected: function(data) |
442 { | 471 { |
443 this._tracingModel._eventsCollected(data); | 472 this._tracingModel._eventsCollected(data); |
444 }, | 473 }, |
445 | 474 |
446 tracingComplete: function() | 475 tracingComplete: function() |
447 { | 476 { |
448 this._tracingModel._tracingComplete(); | 477 this._tracingModel._tracingComplete(); |
449 } | 478 } |
450 } | 479 } |
OLD | NEW |