| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 g_browser.sourceTracker.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 DNS_TRANSACTION, use | 117 // If the parent of |this| is a HOST_RESOLVER_IMPL_JOB, use |
| 118 // '<DNS Server IP> [<DNS 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 = g_browser.sourceTracker.getSourceEntry(parentId); |
| 123 if (parent && | 123 if (parent && |
| 124 parent.getSourceType() == LogSourceType.DNS_TRANSACTION && | 124 parent.getSourceType() == |
| 125 LogSourceType.HOST_RESOLVER_IMPL_JOB && |
| 125 parent.getDescription().length > 0) { | 126 parent.getDescription().length > 0) { |
| 126 this.description_ += ' [' + parent.getDescription() + ']'; | 127 this.description_ += ' [' + parent.getDescription() + ']'; |
| 127 } | 128 } |
| 128 } | 129 } |
| 129 } | 130 } |
| 130 break; | 131 break; |
| 131 case LogSourceType.ASYNC_HOST_RESOLVER_REQUEST: | 132 case LogSourceType.ASYNC_HOST_RESOLVER_REQUEST: |
| 132 case LogSourceType.DNS_TRANSACTION: | 133 case LogSourceType.DNS_TRANSACTION: |
| 133 this.description_ = e.params.hostname; | 134 this.description_ = e.params.hostname; |
| 134 break; | 135 break; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 * 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 |
| 290 * of |parent|. | 291 * of |parent|. |
| 291 */ | 292 */ |
| 292 printAsText: function(parent) { | 293 printAsText: function(parent) { |
| 293 printLogEntriesAsText(this.entries_, parent); | 294 printLogEntriesAsText(this.entries_, parent); |
| 294 } | 295 } |
| 295 }; | 296 }; |
| 296 | 297 |
| 297 return SourceEntry; | 298 return SourceEntry; |
| 298 })(); | 299 })(); |
| OLD | NEW |