| 1 | /* |
| 2 | * Copyright 2011 Closure Compiler Authors |
| 3 | * |
| 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 |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 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. |
| 15 | */ |
| 16 | |
| 17 | /** |
| 18 | * @fileoverview Definitions for W3C's Navigation Timing specification. |
| 19 | * |
| 20 | * Created from |
| 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 |
| 24 | * |
| 25 | * @externs |
| 26 | */ |
| 27 | |
| 28 | /** @constructor */ |
| 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; |
| 51 | |
| 52 | /** @constructor */ |
| 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; |
| 58 | |
| 59 | /** |
| 60 | * @constructor |
| 61 | * @extends {PerformanceEntry} |
| 62 | */ |
| 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; |
| 71 | /** @type {number} */ |
| 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; |
| 77 | |
| 78 | /** @constructor */ |
| 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; |
| 86 | |
| 87 | // Only available in WebKit, and only with the --enable-memory-info flag. |
| 88 | /** @constructor */ |
| 89 | function PerformanceMemory() {} |
| 90 | /** @type {number} */ PerformanceMemory.prototype.jsHeapSizeLimit; |
| 91 | /** @type {number} */ PerformanceMemory.prototype.totalJSHeapSize; |
| 92 | /** @type {number} */ PerformanceMemory.prototype.usedJSHeapSize; |
| 93 | |
| 94 | /** @constructor */ |
| 95 | function Performance() {} |
| 96 | /** @type {PerformanceTiming} */ Performance.prototype.timing; |
| 97 | /** @type {PerformanceNavigation} */ Performance.prototype.navigation; |
| 98 | |
| 99 | /** |
| 100 | * Clears the buffer used to store the current list of |
| 101 | * PerformanceResourceTiming resources. |
| 102 | * @return {undefined} |
| 103 | */ |
| 104 | Performance.prototype.clearResourceTimings = function() {}; |
| 105 | |
| 106 | /** |
| 107 | * Set the maximum number of PerformanceResourceTiming resources that may be |
| 108 | * stored in the buffer. |
| 109 | * @param {number} maxSize |
| 110 | */ |
| 111 | Performance.prototype.setResourceTimingBufferSize = function(maxSize) {}; |
| 112 | |
| 113 | /** |
| 114 | * @return {Array.<PerformanceEntry>} A copy of the PerformanceEntry list, |
| 115 | * in chronological order with respect to startTime. |
| 116 | * @nosideeffects |
| 117 | */ |
| 118 | Performance.prototype.getEntries = function() {}; |
| 119 | |
| 120 | /** |
| 121 | * @param {string} entryType Only return {@code PerformanceEntry}s with this |
| 122 | * entryType. |
| 123 | * @return {Array.<PerformanceEntry>} A copy of the PerformanceEntry list, |
| 124 | * in chronological order with respect to startTime. |
| 125 | * @nosideeffects |
| 126 | */ |
| 127 | Performance.prototype.getEntriesByType = function(entryType) {}; |
| 128 | |
| 129 | /** |
| 130 | * @param {string} name Only return {@code PerformanceEntry}s with this name. |
| 131 | * @param {string=} opt_entryType Only return {@code PerformanceEntry}s with |
| 132 | * this entryType. |
| 133 | * @return {Array.<PerformanceEntry>} PerformanceEntry list in chronological |
| 134 | * order with respect to startTime. |
| 135 | * @nosideeffects |
| 136 | */ |
| 137 | Performance.prototype.getEntriesByName = function(name, opt_entryType) {}; |
| 138 | |
| 139 | // Only available in WebKit, and only with the --enable-memory-info flag. |
| 140 | /** @type {PerformanceMemory} */ Performance.prototype.memory; |
| 141 | |
| 142 | /** |
| 143 | * @return {number} |
| 144 | * @nosideeffects |
| 145 | */ |
| 146 | Performance.prototype.now = function() {}; |
| 147 | |
| 148 | /** |
| 149 | * @return {number} |
| 150 | * @nosideeffects |
| 151 | */ |
| 152 | Performance.prototype.webkitNow = function() {}; |
| 153 | |
| 154 | /** @type {Performance} */ |
| 155 | Window.prototype.performance; |