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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 this.description_ = | 110 this.description_ = |
111 SourceTracker.getInstance().getDescription(parentId); | 111 SourceTracker.getInstance().getDescription(parentId); |
112 } | 112 } |
113 break; | 113 break; |
114 case EventSourceType.UDP_SOCKET: | 114 case EventSourceType.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 == EventType.SOCKET_ALIVE && | 119 if (this.entries_[0].type == EventType.SOCKET_ALIVE && |
| 120 this.entries_[0].params && |
120 this.entries_[0].params.source_dependency != undefined) { | 121 this.entries_[0].params.source_dependency != undefined) { |
121 var parentId = this.entries_[0].params.source_dependency.id; | 122 var parentId = this.entries_[0].params.source_dependency.id; |
122 var parent = SourceTracker.getInstance().getSourceEntry(parentId); | 123 var parent = SourceTracker.getInstance().getSourceEntry(parentId); |
123 if (parent && | 124 if (parent && |
124 parent.getSourceType() == | 125 parent.getSourceType() == |
125 EventSourceType.HOST_RESOLVER_IMPL_JOB && | 126 EventSourceType.HOST_RESOLVER_IMPL_JOB && |
126 parent.getDescription().length > 0) { | 127 parent.getDescription().length > 0) { |
127 this.description_ += ' [' + parent.getDescription() + ']'; | 128 this.description_ += ' [' + parent.getDescription() + ']'; |
128 } | 129 } |
129 } | 130 } |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 printAsText: function(parent) { | 313 printAsText: function(parent) { |
313 // The date will be undefined if not viewing a loaded log file. | 314 // The date will be undefined if not viewing a loaded log file. |
314 printLogEntriesAsText(this.entries_, parent, | 315 printLogEntriesAsText(this.entries_, parent, |
315 SourceTracker.getInstance().getPrivacyStripping(), | 316 SourceTracker.getInstance().getPrivacyStripping(), |
316 Constants.clientInfo.numericDate); | 317 Constants.clientInfo.numericDate); |
317 } | 318 } |
318 }; | 319 }; |
319 | 320 |
320 return SourceEntry; | 321 return SourceEntry; |
321 })(); | 322 })(); |
OLD | NEW |