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; | |
25 | 24 |
26 /** | 25 /** |
27 * Dictionary of all constants, used for saving log files. | 26 * Dictionary of all constants, used for saving log files. |
28 */ | 27 */ |
29 var Constants = null; | 28 var Constants = null; |
30 | 29 |
31 /** | 30 /** |
32 * Object to communicate between the renderer and the browser. | 31 * Object to communicate between the renderer and the browser. |
33 * @type {!BrowserBridge} | 32 * @type {!BrowserBridge} |
34 */ | 33 */ |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 addTab(ExportView); | 185 addTab(ExportView); |
187 addTab(ImportView); | 186 addTab(ImportView); |
188 addTab(ProxyView); | 187 addTab(ProxyView); |
189 addTab(EventsView); | 188 addTab(EventsView); |
190 addTab(WaterfallView); | 189 addTab(WaterfallView); |
191 addTab(TimelineView); | 190 addTab(TimelineView); |
192 addTab(DnsView); | 191 addTab(DnsView); |
193 addTab(SocketsView); | 192 addTab(SocketsView); |
194 addTab(SpdyView); | 193 addTab(SpdyView); |
195 addTab(QuicView); | 194 addTab(QuicView); |
196 addTab(SdchView); | |
197 addTab(HttpCacheView); | 195 addTab(HttpCacheView); |
198 addTab(ModulesView); | 196 addTab(ModulesView); |
199 addTab(TestView); | 197 addTab(TestView); |
200 addTab(CrosLogVisualizerView); | 198 addTab(CrosLogVisualizerView); |
201 addTab(HSTSView); | 199 addTab(HSTSView); |
202 addTab(LogsView); | 200 addTab(LogsView); |
203 addTab(BandwidthView); | 201 addTab(BandwidthView); |
204 addTab(PrerenderView); | 202 addTab(PrerenderView); |
205 addTab(CrosView); | 203 addTab(CrosView); |
206 | 204 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 EventSourceType = Constants.logSourceType; | 304 EventSourceType = Constants.logSourceType; |
307 EventSourceTypeNames = makeInverseMap(EventSourceType); | 305 EventSourceTypeNames = makeInverseMap(EventSourceType); |
308 LogLevelType = Constants.logLevelType; | 306 LogLevelType = Constants.logLevelType; |
309 ClientInfo = Constants.clientInfo; | 307 ClientInfo = Constants.clientInfo; |
310 LoadFlag = Constants.loadFlag; | 308 LoadFlag = Constants.loadFlag; |
311 NetError = Constants.netError; | 309 NetError = Constants.netError; |
312 QuicError = Constants.quicError; | 310 QuicError = Constants.quicError; |
313 QuicRstStreamError = Constants.quicRstStreamError; | 311 QuicRstStreamError = Constants.quicRstStreamError; |
314 AddressFamily = Constants.addressFamily; | 312 AddressFamily = Constants.addressFamily; |
315 LoadState = Constants.loadState; | 313 LoadState = Constants.loadState; |
316 SdchProblemCode = Constants.sdchProblemCode; | |
317 // certStatusFlag may not be present when loading old log Files | 314 // certStatusFlag may not be present when loading old log Files |
318 if (typeof(Constants.certStatusFlag) == 'object') | 315 if (typeof(Constants.certStatusFlag) == 'object') |
319 CertStatusFlag = Constants.certStatusFlag; | 316 CertStatusFlag = Constants.certStatusFlag; |
320 else | 317 else |
321 CertStatusFlag = {}; | 318 CertStatusFlag = {}; |
322 | 319 |
323 timeutil.setTimeTickOffset(Constants.timeTickOffset); | 320 timeutil.setTimeTickOffset(Constants.timeTickOffset); |
324 }; | 321 }; |
325 | 322 |
326 /** | 323 /** |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 * Returns a string representation of |family|. | 379 * Returns a string representation of |family|. |
383 * @param {number} family An AddressFamily | 380 * @param {number} family An AddressFamily |
384 * @return {string} A representation of the given family. | 381 * @return {string} A representation of the given family. |
385 */ | 382 */ |
386 function addressFamilyToString(family) { | 383 function addressFamilyToString(family) { |
387 var str = getKeyWithValue(AddressFamily, family); | 384 var str = getKeyWithValue(AddressFamily, family); |
388 // All the address family start with ADDRESS_FAMILY_*. | 385 // All the address family start with ADDRESS_FAMILY_*. |
389 // Strip that prefix since it is redundant and only clutters the output. | 386 // Strip that prefix since it is redundant and only clutters the output. |
390 return str.replace(/^ADDRESS_FAMILY_/, ''); | 387 return str.replace(/^ADDRESS_FAMILY_/, ''); |
391 } | 388 } |
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 |