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 var SourceEntry = (function() { | 5 var SourceEntry = (function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * A SourceEntry gathers all log entries with the same source. | 9 * A SourceEntry gathers all log entries with the same source. |
10 * | 10 * |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 break; | 101 break; |
102 case LogSourceType.HTTP_PIPELINED_CONNECTION: | 102 case LogSourceType.HTTP_PIPELINED_CONNECTION: |
103 if (e.params.host_and_port) | 103 if (e.params.host_and_port) |
104 this.description_ = e.params.host_and_port; | 104 this.description_ = e.params.host_and_port; |
105 break; | 105 break; |
106 case LogSourceType.SOCKET: | 106 case LogSourceType.SOCKET: |
107 // Use description of parent source, if any. | 107 // Use description of parent source, if any. |
108 if (e.params.source_dependency != undefined) { | 108 if (e.params.source_dependency != undefined) { |
109 var parentId = e.params.source_dependency.id; | 109 var parentId = e.params.source_dependency.id; |
110 this.description_ = | 110 this.description_ = |
111 g_browser.sourceTracker.getDescription(parentId); | 111 SourceTracker.getInstance().getDescription(parentId); |
112 } | 112 } |
113 break; | 113 break; |
114 case LogSourceType.UDP_SOCKET: | 114 case LogSourceType.UDP_SOCKET: |
115 if (e.params.address != undefined) { | 115 if (e.params.address != undefined) { |
116 this.description_ = e.params.address; | 116 this.description_ = e.params.address; |
117 // If the parent of |this| is a HOST_RESOLVER_IMPL_JOB, use | 117 // If the parent of |this| is a HOST_RESOLVER_IMPL_JOB, use |
118 // '<DNS Server IP> [<host we're resolving>]'. | 118 // '<DNS Server IP> [<host we're resolving>]'. |
119 if (this.entries_[0].type == LogEventType.SOCKET_ALIVE && | 119 if (this.entries_[0].type == LogEventType.SOCKET_ALIVE && |
120 this.entries_[0].params.source_dependency != undefined) { | 120 this.entries_[0].params.source_dependency != undefined) { |
121 var parentId = this.entries_[0].params.source_dependency.id; | 121 var parentId = this.entries_[0].params.source_dependency.id; |
122 var parent = g_browser.sourceTracker.getSourceEntry(parentId); | 122 var parent = SourceTracker.getInstance().getSourceEntry(parentId); |
123 if (parent && | 123 if (parent && |
124 parent.getSourceType() == | 124 parent.getSourceType() == |
125 LogSourceType.HOST_RESOLVER_IMPL_JOB && | 125 LogSourceType.HOST_RESOLVER_IMPL_JOB && |
126 parent.getDescription().length > 0) { | 126 parent.getDescription().length > 0) { |
127 this.description_ += ' [' + parent.getDescription() + ']'; | 127 this.description_ += ' [' + parent.getDescription() + ']'; |
128 } | 128 } |
129 } | 129 } |
130 } | 130 } |
131 break; | 131 break; |
132 case LogSourceType.ASYNC_HOST_RESOLVER_REQUEST: | 132 case LogSourceType.ASYNC_HOST_RESOLVER_REQUEST: |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 * Prints descriptive text about |entries_| to a new node added to the end | 290 * Prints descriptive text about |entries_| to a new node added to the end |
291 * of |parent|. | 291 * of |parent|. |
292 */ | 292 */ |
293 printAsText: function(parent) { | 293 printAsText: function(parent) { |
294 printLogEntriesAsText(this.entries_, parent); | 294 printLogEntriesAsText(this.entries_, parent); |
295 } | 295 } |
296 }; | 296 }; |
297 | 297 |
298 return SourceEntry; | 298 return SourceEntry; |
299 })(); | 299 })(); |
OLD | NEW |