this._frames = [];
this._responseHeaderValues = {};
+
+ this._remoteAddress = "";
}
WebInspector.NetworkRequest.Events = {
FinishedLoading: "FinishedLoading",
TimingChanged: "TimingChanged",
+ RemoteAddressChanged: "RemoteAddressChanged",
RequestHeadersChanged: "RequestHeadersChanged",
ResponseHeadersChanged: "ResponseHeadersChanged",
}
},
/**
+ * @param {string} ip
+ * @param {number} port
+ */
+ setRemoteAddress: function(ip, port)
+ {
+ this._remoteAddress = ip + ":" + port;
+ this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.RemoteAddressChanged, this);
+ },
+
+ /**
+ * @return {string}
+ */
+ remoteAddress: function()
+ {
+ return this._remoteAddress;
+ },
+
+ /**
* @return {number}
*/
get startTime()
if (this._responseReceivedTime > x)
this._responseReceivedTime = x;
}
+ this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.TimingChanged, this);
},
/**
*/
get transferSize()
{
- if (typeof this._transferSize === "number")
- return this._transferSize;
- if (this.statusCode === 304) // Not modified
- return this.responseHeadersSize;
- if (this._cached)
- return 0;
- // If we did not receive actual transfer size from network
- // stack, we prefer using Content-Length over resourceSize as
- // resourceSize may differ from actual transfer size if platform's
- // network stack performed decoding (e.g. gzip decompression).
- // The Content-Length, though, is expected to come from raw
- // response headers and will reflect actual transfer length.
- // This won't work for chunked content encoding, so fall back to
- // resourceSize when we don't have Content-Length. This still won't
- // work for chunks with non-trivial encodings. We need a way to
- // get actual transfer size from the network stack.
- var bodySize = Number(this.responseHeaderValue("Content-Length") || this.resourceSize);
- return this.responseHeadersSize + bodySize;
+ return this._transferSize || 0;
},
/**
},
/**
+ * @param {number} x
+ */
+ setTransferSize: function(x)
+ {
+ this._transferSize = x;
+ },
+
+ /**
* @return {boolean}
*/
get finished()