Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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(); | |
| 53 var portPositionInString = ipAddress.lastIndexOf(":"); | |
| 54 if (portPositionInString) | |
|
alph
2016/03/21 23:09:55
!== -1
| |
| 55 ipAddress = ipAddress.substr(0, portPositionInString); | |
| 56 | |
| 52 var entry = { | 57 var entry = { |
| 53 startedDateTime: WebInspector.HARLog.pseudoWallTime(this._request, t his._request.startTime), | 58 startedDateTime: WebInspector.HARLog.pseudoWallTime(this._request, t his._request.startTime), |
| 54 time: this._request.timing ? WebInspector.HAREntry._toMilliseconds(t his._request.duration) : 0, | 59 time: this._request.timing ? WebInspector.HAREntry._toMilliseconds(t his._request.duration) : 0, |
| 55 request: this._buildRequest(), | 60 request: this._buildRequest(), |
| 56 response: this._buildResponse(), | 61 response: this._buildResponse(), |
| 57 cache: { }, // Not supported yet. | 62 cache: { }, // Not supported yet. |
| 58 timings: this._buildTimings() | 63 timings: this._buildTimings(), |
| 64 serverIPAddress: ipAddress | |
| 59 }; | 65 }; |
| 60 | 66 |
| 61 if (this._request.connectionId !== "0") | 67 if (this._request.connectionId !== "0") |
| 62 entry.connection = this._request.connectionId; | 68 entry.connection = this._request.connectionId; |
| 63 var page = this._request.target().networkLog.pageLoadForRequest(this._re quest); | 69 var page = this._request.target().networkLog.pageLoadForRequest(this._re quest); |
| 64 if (page) | 70 if (page) |
| 65 entry.pageref = "page_" + page.id; | 71 entry.pageref = "page_" + page.id; |
| 66 return entry; | 72 return entry; |
| 67 }, | 73 }, |
| 68 | 74 |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 361 * @return {number} | 367 * @return {number} |
| 362 */ | 368 */ |
| 363 _pageEventTime: function(page, time) | 369 _pageEventTime: function(page, time) |
| 364 { | 370 { |
| 365 var startTime = page.startTime; | 371 var startTime = page.startTime; |
| 366 if (time === -1 || startTime === -1) | 372 if (time === -1 || startTime === -1) |
| 367 return -1; | 373 return -1; |
| 368 return WebInspector.HAREntry._toMilliseconds(time - startTime); | 374 return WebInspector.HAREntry._toMilliseconds(time - startTime); |
| 369 } | 375 } |
| 370 } | 376 } |
| OLD | NEW |