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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/HAREntry.js

Issue 1798173003: [DevTools] Added serverIPaddress to HAR output (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Tests Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 { 42 {
43 this._request = request; 43 this._request = request;
44 } 44 }
45 45
46 WebInspector.HAREntry.prototype = { 46 WebInspector.HAREntry.prototype = {
47 /** 47 /**
48 * @return {!Object} 48 * @return {!Object}
49 */ 49 */
50 build: function() 50 build: function()
51 { 51 {
52 var ipAddress = this._request.remoteAddress();
pfeldman 2016/03/16 00:10:26 is this required field?
allada 2016/03/16 23:28:02 No, it is optional. From: https://dvcs.w3.org/hg/w
53 var portPositionInString = ipAddress.lastIndexOf(":");
54 if (portPositionInString) {
pfeldman 2016/03/16 00:10:26 drop {}
allada 2016/03/16 23:28:02 Done.
55 ipAddress = ipAddress.substr(0, portPositionInString);
56 }
57
52 var entry = { 58 var entry = {
53 startedDateTime: WebInspector.HARLog.pseudoWallTime(this._request, t his._request.startTime), 59 startedDateTime: WebInspector.HARLog.pseudoWallTime(this._request, t his._request.startTime),
54 time: this._request.timing ? WebInspector.HAREntry._toMilliseconds(t his._request.duration) : 0, 60 time: this._request.timing ? WebInspector.HAREntry._toMilliseconds(t his._request.duration) : 0,
55 request: this._buildRequest(), 61 request: this._buildRequest(),
56 response: this._buildResponse(), 62 response: this._buildResponse(),
57 cache: { }, // Not supported yet. 63 cache: { }, // Not supported yet.
58 timings: this._buildTimings() 64 timings: this._buildTimings(),
65 serverIPAddress: ipAddress
59 }; 66 };
60 67
61 if (this._request.connectionId !== "0") 68 if (this._request.connectionId !== "0")
62 entry.connection = this._request.connectionId; 69 entry.connection = this._request.connectionId;
63 var page = this._request.target().networkLog.pageLoadForRequest(this._re quest); 70 var page = this._request.target().networkLog.pageLoadForRequest(this._re quest);
64 if (page) 71 if (page)
65 entry.pageref = "page_" + page.id; 72 entry.pageref = "page_" + page.id;
66 return entry; 73 return entry;
67 }, 74 },
68 75
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 * @return {number} 368 * @return {number}
362 */ 369 */
363 _pageEventTime: function(page, time) 370 _pageEventTime: function(page, time)
364 { 371 {
365 var startTime = page.startTime; 372 var startTime = page.startTime;
366 if (time === -1 || startTime === -1) 373 if (time === -1 || startTime === -1)
367 return -1; 374 return -1;
368 return WebInspector.HAREntry._toMilliseconds(time - startTime); 375 return WebInspector.HAREntry._toMilliseconds(time - startTime);
369 } 376 }
370 } 377 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698