| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Dictionary of constants (Initialized soon after loading by data from browser, | 6 * Dictionary of constants (Initialized soon after loading by data from browser, |
| 7 * updated on load log). The *Types dictionaries map strings to numeric IDs, | 7 * updated on load log). The *Types dictionaries map strings to numeric IDs, |
| 8 * while the *TypeNames are the other way around. | 8 * while the *TypeNames are the other way around. |
| 9 */ | 9 */ |
| 10 var EventType = null; | 10 var EventType = null; |
| 11 var EventTypeNames = null; | 11 var EventTypeNames = null; |
| 12 var EventPhase = null; | 12 var EventPhase = null; |
| 13 var EventSourceType = null; | 13 var EventSourceType = null; |
| 14 var EventSourceTypeNames = null; | 14 var EventSourceTypeNames = null; |
| 15 var LogLevelType = null; | 15 var LogLevelType = null; |
| 16 var ClientInfo = null; | 16 var ClientInfo = null; |
| 17 var NetError = null; | 17 var NetError = null; |
| 18 var QuicError = null; | 18 var QuicError = null; |
| 19 var QuicRstStreamError = null; | 19 var QuicRstStreamError = null; |
| 20 var LoadFlag = null; | 20 var LoadFlag = null; |
| 21 var CertStatusFlag = null; | 21 var CertStatusFlag = null; |
| 22 var LoadState = null; | 22 var LoadState = null; |
| 23 var AddressFamily = null; | 23 var AddressFamily = null; |
| 24 var SdchProblemCode = null; |
| 24 | 25 |
| 25 /** | 26 /** |
| 26 * Dictionary of all constants, used for saving log files. | 27 * Dictionary of all constants, used for saving log files. |
| 27 */ | 28 */ |
| 28 var Constants = null; | 29 var Constants = null; |
| 29 | 30 |
| 30 /** | 31 /** |
| 31 * Object to communicate between the renderer and the browser. | 32 * Object to communicate between the renderer and the browser. |
| 32 * @type {!BrowserBridge} | 33 * @type {!BrowserBridge} |
| 33 */ | 34 */ |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 addTab(ExportView); | 186 addTab(ExportView); |
| 186 addTab(ImportView); | 187 addTab(ImportView); |
| 187 addTab(ProxyView); | 188 addTab(ProxyView); |
| 188 addTab(EventsView); | 189 addTab(EventsView); |
| 189 addTab(WaterfallView); | 190 addTab(WaterfallView); |
| 190 addTab(TimelineView); | 191 addTab(TimelineView); |
| 191 addTab(DnsView); | 192 addTab(DnsView); |
| 192 addTab(SocketsView); | 193 addTab(SocketsView); |
| 193 addTab(SpdyView); | 194 addTab(SpdyView); |
| 194 addTab(QuicView); | 195 addTab(QuicView); |
| 196 addTab(SdchView); |
| 195 addTab(HttpCacheView); | 197 addTab(HttpCacheView); |
| 196 addTab(ModulesView); | 198 addTab(ModulesView); |
| 197 addTab(TestView); | 199 addTab(TestView); |
| 198 addTab(CrosLogVisualizerView); | 200 addTab(CrosLogVisualizerView); |
| 199 addTab(HSTSView); | 201 addTab(HSTSView); |
| 200 addTab(LogsView); | 202 addTab(LogsView); |
| 201 addTab(BandwidthView); | 203 addTab(BandwidthView); |
| 202 addTab(PrerenderView); | 204 addTab(PrerenderView); |
| 203 addTab(CrosView); | 205 addTab(CrosView); |
| 204 | 206 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 EventSourceType = Constants.logSourceType; | 306 EventSourceType = Constants.logSourceType; |
| 305 EventSourceTypeNames = makeInverseMap(EventSourceType); | 307 EventSourceTypeNames = makeInverseMap(EventSourceType); |
| 306 LogLevelType = Constants.logLevelType; | 308 LogLevelType = Constants.logLevelType; |
| 307 ClientInfo = Constants.clientInfo; | 309 ClientInfo = Constants.clientInfo; |
| 308 LoadFlag = Constants.loadFlag; | 310 LoadFlag = Constants.loadFlag; |
| 309 NetError = Constants.netError; | 311 NetError = Constants.netError; |
| 310 QuicError = Constants.quicError; | 312 QuicError = Constants.quicError; |
| 311 QuicRstStreamError = Constants.quicRstStreamError; | 313 QuicRstStreamError = Constants.quicRstStreamError; |
| 312 AddressFamily = Constants.addressFamily; | 314 AddressFamily = Constants.addressFamily; |
| 313 LoadState = Constants.loadState; | 315 LoadState = Constants.loadState; |
| 316 SdchProblemCode = Constants.sdchProblemCode; |
| 314 // certStatusFlag may not be present when loading old log Files | 317 // certStatusFlag may not be present when loading old log Files |
| 315 if (typeof(Constants.certStatusFlag) == 'object') | 318 if (typeof(Constants.certStatusFlag) == 'object') |
| 316 CertStatusFlag = Constants.certStatusFlag; | 319 CertStatusFlag = Constants.certStatusFlag; |
| 317 else | 320 else |
| 318 CertStatusFlag = {}; | 321 CertStatusFlag = {}; |
| 319 | 322 |
| 320 timeutil.setTimeTickOffset(Constants.timeTickOffset); | 323 timeutil.setTimeTickOffset(Constants.timeTickOffset); |
| 321 }; | 324 }; |
| 322 | 325 |
| 323 /** | 326 /** |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 * Returns a string representation of |family|. | 382 * Returns a string representation of |family|. |
| 380 * @param {number} family An AddressFamily | 383 * @param {number} family An AddressFamily |
| 381 * @return {string} A representation of the given family. | 384 * @return {string} A representation of the given family. |
| 382 */ | 385 */ |
| 383 function addressFamilyToString(family) { | 386 function addressFamilyToString(family) { |
| 384 var str = getKeyWithValue(AddressFamily, family); | 387 var str = getKeyWithValue(AddressFamily, family); |
| 385 // All the address family start with ADDRESS_FAMILY_*. | 388 // All the address family start with ADDRESS_FAMILY_*. |
| 386 // Strip that prefix since it is redundant and only clutters the output. | 389 // Strip that prefix since it is redundant and only clutters the output. |
| 387 return str.replace(/^ADDRESS_FAMILY_/, ''); | 390 return str.replace(/^ADDRESS_FAMILY_/, ''); |
| 388 } | 391 } |
| 392 |
| 393 /** |
| 394 * Returns the name for sdchProblemCode. |
| 395 * |
| 396 * Example: sdchProblemCodeToString(5) should return |
| 397 * "DECODE_BODY_ERROR". |
| 398 * @param {number} sdchProblemCode The SDCH problem code. |
| 399 * @return {string} The name of the given problem code. |
| 400 */ |
| 401 function sdchProblemCodeToString(sdchProblemCode) { |
| 402 return getKeyWithValue(SdchProblemCode, sdchProblemCode); |
| 403 } |
| OLD | NEW |