2 * Copyright 2011 The Closure Compiler Authors
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @fileoverview Definitions for W3C's Navigation Timing specification.
21 * @see http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html
22 * @see http://w3c-test.org/webperf/specs/ResourceTiming
23 * @see http://www.w3.org/TR/performance-timeline
29 function PerformanceTiming() {}
30 /** @type {number} */ PerformanceTiming.prototype.navigationStart;
31 /** @type {number} */ PerformanceTiming.prototype.unloadEventStart;
32 /** @type {number} */ PerformanceTiming.prototype.unloadEventEnd;
33 /** @type {number} */ PerformanceTiming.prototype.redirectStart;
34 /** @type {number} */ PerformanceTiming.prototype.redirectEnd;
35 /** @type {number} */ PerformanceTiming.prototype.fetchStart;
36 /** @type {number} */ PerformanceTiming.prototype.domainLookupStart;
37 /** @type {number} */ PerformanceTiming.prototype.domainLookupEnd;
38 /** @type {number} */ PerformanceTiming.prototype.connectStart;
39 /** @type {number} */ PerformanceTiming.prototype.connectEnd;
40 /** @type {number} */ PerformanceTiming.prototype.secureConnectionStart;
41 /** @type {number} */ PerformanceTiming.prototype.requestStart;
42 /** @type {number} */ PerformanceTiming.prototype.responseStart;
43 /** @type {number} */ PerformanceTiming.prototype.responseEnd;
44 /** @type {number} */ PerformanceTiming.prototype.domLoading;
45 /** @type {number} */ PerformanceTiming.prototype.domInteractive;
46 /** @type {number} */ PerformanceTiming.prototype.domContentLoadedEventStart;
47 /** @type {number} */ PerformanceTiming.prototype.domContentLoadedEventEnd;
48 /** @type {number} */ PerformanceTiming.prototype.domComplete;
49 /** @type {number} */ PerformanceTiming.prototype.loadEventStart;
50 /** @type {number} */ PerformanceTiming.prototype.loadEventEnd;
53 function PerformanceEntry() {}
54 /** @type {string} */ PerformanceEntry.prototype.name;
55 /** @type {string} */ PerformanceEntry.prototype.entryType;
56 /** @type {number} */ PerformanceEntry.prototype.startTime;
57 /** @type {number} */ PerformanceEntry.prototype.duration;
61 * @extends {PerformanceEntry}
63 function PerformanceResourceTiming() {}
64 /** @type {number} */ PerformanceResourceTiming.prototype.redirectStart;
65 /** @type {number} */ PerformanceResourceTiming.prototype.redirectEnd;
66 /** @type {number} */ PerformanceResourceTiming.prototype.fetchStart;
67 /** @type {number} */ PerformanceResourceTiming.prototype.domainLookupStart;
68 /** @type {number} */ PerformanceResourceTiming.prototype.domainLookupEnd;
69 /** @type {number} */ PerformanceResourceTiming.prototype.connectStart;
70 /** @type {number} */ PerformanceResourceTiming.prototype.connectEnd;
72 PerformanceResourceTiming.prototype.secureConnectionStart;
73 /** @type {number} */ PerformanceResourceTiming.prototype.requestStart;
74 /** @type {number} */ PerformanceResourceTiming.prototype.responseStart;
75 /** @type {number} */ PerformanceResourceTiming.prototype.responseEnd;
76 /** @type {string} */ PerformanceResourceTiming.prototype.initiatorType;
79 function PerformanceNavigation() {}
80 /** @type {number} */ PerformanceNavigation.prototype.TYPE_NAVIGATE = 0;
81 /** @type {number} */ PerformanceNavigation.prototype.TYPE_RELOAD = 1;
82 /** @type {number} */ PerformanceNavigation.prototype.TYPE_BACK_FORWARD = 2;
83 /** @type {number} */ PerformanceNavigation.prototype.TYPE_RESERVED = 255;
84 /** @type {number} */ PerformanceNavigation.prototype.type;
85 /** @type {number} */ PerformanceNavigation.prototype.redirectCount;
87 // Only available in WebKit, and only with the --enable-memory-info flag.
89 function PerformanceMemory() {}
90 /** @type {number} */ PerformanceMemory.prototype.jsHeapSizeLimit;
91 /** @type {number} */ PerformanceMemory.prototype.totalJSHeapSize;
92 /** @type {number} */ PerformanceMemory.prototype.usedJSHeapSize;
95 function Performance() {}
96 /** @type {PerformanceTiming} */ Performance.prototype.timing;
97 /** @type {PerformanceNavigation} */ Performance.prototype.navigation;
100 * Clears the buffer used to store the current list of
101 * PerformanceResourceTiming resources.
102 * @return {undefined}
104 Performance.prototype.clearResourceTimings = function() {};
107 * Clear out the buffer of performance timing events for webkit browsers.
108 * @return {undefined}
110 Performance.prototype.webkitClearResourceTimings = function() {};
113 * Set the maximum number of PerformanceResourceTiming resources that may be
114 * stored in the buffer.
115 * @param {number} maxSize
117 Performance.prototype.setResourceTimingBufferSize = function(maxSize) {};
120 * @return {Array.<PerformanceEntry>} A copy of the PerformanceEntry list,
121 * in chronological order with respect to startTime.
124 Performance.prototype.getEntries = function() {};
127 * @param {string} entryType Only return {@code PerformanceEntry}s with this
129 * @return {Array.<PerformanceEntry>} A copy of the PerformanceEntry list,
130 * in chronological order with respect to startTime.
133 Performance.prototype.getEntriesByType = function(entryType) {};
136 * @param {string} name Only return {@code PerformanceEntry}s with this name.
137 * @param {string=} opt_entryType Only return {@code PerformanceEntry}s with
139 * @return {Array.<PerformanceEntry>} PerformanceEntry list in chronological
140 * order with respect to startTime.
143 Performance.prototype.getEntriesByName = function(name, opt_entryType) {};
145 // Only available in WebKit, and only with the --enable-memory-info flag.
146 /** @type {PerformanceMemory} */ Performance.prototype.memory;
152 Performance.prototype.now = function() {};
158 Performance.prototype.webkitNow = function() {};
160 /** @type {Performance} */
161 Window.prototype.performance;