Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: chrome/browser/resources/net_internals/source_entry.js

Issue 8200011: Add NetLog support to UDP sockets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: ??? Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/net_internals/source_entry.js
===================================================================
--- chrome/browser/resources/net_internals/source_entry.js (revision 106059)
+++ chrome/browser/resources/net_internals/source_entry.js (working copy)
@@ -99,14 +99,30 @@
this.description_ = e.params.host + ' (' + e.params.proxy + ')';
break;
case LogSourceType.SOCKET:
+ // Use description of parent source, if any.
if (e.params.source_dependency != undefined) {
- var connectJobId = e.params.source_dependency.id;
- var connectJob =
- g_browser.sourceTracker.getSourceEntry(connectJobId);
- if (connectJob)
- this.description_ = connectJob.getDescription();
+ var parentId = e.params.source_dependency.id;
+ this.description_ =
+ g_browser.sourceTracker.getDescription(parentId);
}
break;
+ case LogSourceType.UDP_SOCKET:
+ if (e.params.address != undefined) {
+ this.description_ = e.params.address;
+ // If the parent of |this| is a DNS_TRANSACTION, use
+ // '<DNS Server IP> [<DNS we're resolving>]'.
+ if (this.entries_[0].type == LogEventType.SOCKET_ALIVE &&
+ this.entries_[0].params.source_dependency != undefined) {
+ var parentId = this.entries_[0].params.source_dependency.id;
+ var parent = g_browser.sourceTracker.getSourceEntry(parentId);
+ if (parent &&
+ parent.getSourceType() == LogSourceType.DNS_TRANSACTION &&
+ parent.getDescription().length > 0) {
+ this.description_ += ' [' + parent.getDescription() + ']';
+ }
+ }
+ }
+ break;
case LogSourceType.ASYNC_HOST_RESOLVER_REQUEST:
case LogSourceType.DNS_TRANSACTION:
this.description_ = e.params.hostname;
@@ -137,8 +153,10 @@
return undefined;
if (this.entries_.length >= 2) {
if (this.entries_[0].type == LogEventType.REQUEST_ALIVE ||
- this.entries_[0].type == LogEventType.SOCKET_POOL_CONNECT_JOB)
+ this.entries_[0].type == LogEventType.SOCKET_POOL_CONNECT_JOB ||
+ this.entries_[1].type == LogEventType.UDP_CONNECT) {
return this.entries_[1];
+ }
}
return this.entries_[0];
},
« no previous file with comments | « chrome/browser/resources/net_internals/events_view.css ('k') | chrome/browser/resources/net_internals/source_tracker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698