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

Unified Diff: Source/devtools/front_end/RequestHeadersView.js

Issue 142863003: Show IP address in DevTools. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed copy-paste + added field to detailed view Created 6 years, 11 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
« no previous file with comments | « Source/devtools/front_end/NetworkRequest.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/RequestHeadersView.js
diff --git a/Source/devtools/front_end/RequestHeadersView.js b/Source/devtools/front_end/RequestHeadersView.js
index cafef5d39101583250257580f8074c52bd5bc0ab..ff401c853a825b71177bf923d5388b57169824f7 100644
--- a/Source/devtools/front_end/RequestHeadersView.js
+++ b/Source/devtools/front_end/RequestHeadersView.js
@@ -48,6 +48,11 @@ WebInspector.RequestHeadersView = function(request)
this._headersTreeOutline = new TreeOutline(this._headersListElement);
this._headersTreeOutline.expandTreeElementsWhenArrowing = true;
+ this._remoteAddressTreeElement = new TreeElement("", null, false);
+ this._remoteAddressTreeElement.selectable = false;
+ this._remoteAddressTreeElement.hidden = true;
+ this._headersTreeOutline.appendChild(this._remoteAddressTreeElement);
+
this._urlTreeElement = new TreeElement("", null, false);
this._urlTreeElement.selectable = false;
this._headersTreeOutline.appendChild(this._urlTreeElement);
@@ -98,6 +103,7 @@ WebInspector.RequestHeadersView.prototype = {
wasShown: function()
{
+ this._request.addEventListener(WebInspector.NetworkRequest.Events.RemoteAddressChanged, this._refreshRemoteAddress, this);
this._request.addEventListener(WebInspector.NetworkRequest.Events.RequestHeadersChanged, this._refreshRequestHeaders, this);
this._request.addEventListener(WebInspector.NetworkRequest.Events.ResponseHeadersChanged, this._refreshResponseHeaders, this);
this._request.addEventListener(WebInspector.NetworkRequest.Events.FinishedLoading, this._refreshHTTPInformation, this);
@@ -107,10 +113,12 @@ WebInspector.RequestHeadersView.prototype = {
this._refreshRequestHeaders();
this._refreshResponseHeaders();
this._refreshHTTPInformation();
+ this._refreshRemoteAddress();
},
willHide: function()
{
+ this._request.removeEventListener(WebInspector.NetworkRequest.Events.RemoteAddressChanged, this._refreshRemoteAddress, this);
this._request.removeEventListener(WebInspector.NetworkRequest.Events.RequestHeadersChanged, this._refreshRequestHeaders, this);
this._request.removeEventListener(WebInspector.NetworkRequest.Events.ResponseHeadersChanged, this._refreshResponseHeaders, this);
this._request.removeEventListener(WebInspector.NetworkRequest.Events.FinishedLoading, this._refreshHTTPInformation, this);
@@ -448,6 +456,15 @@ WebInspector.RequestHeadersView.prototype = {
this._refreshHeadersTitle(title, headersTreeElement, count);
},
+ _refreshRemoteAddress: function()
+ {
+ var remoteAddress = this._request.remoteAddress();
+ var treeElement = this._remoteAddressTreeElement;
+ treeElement.hidden = !remoteAddress;
+ if (remoteAddress)
+ treeElement.title = this._formatHeader(WebInspector.UIString("Remote Address"), remoteAddress);
+ },
+
/**
* @param {?Event} event
*/
« no previous file with comments | « Source/devtools/front_end/NetworkRequest.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698