Skip to content

Commit 27b0dc6

Browse files
author
Daniel Herzog
committed
Fixed a todo from the review.
1 parent ab84aca commit 27b0dc6

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/network/network_service.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ cls.NetworkLoggerService = function()
236236
// Returns a ResourceInfo based on the most recent Entry with that resource_id.
237237
var entry = this._current_context &&
238238
this._current_context.get_entries_with_res_id(resource_id).last;
239-
// todo: probably make a getter for current_response that gets _current_response.
240-
if (entry && entry._current_response && entry._current_response.responsebody)
239+
if (entry && entry.current_response && entry.current_response.responsebody)
241240
{
242241
return new cls.ResourceInfo(entry);
243242
}
@@ -1009,9 +1008,17 @@ cls.NetworkLoggerEntryPrototype = function()
10091008

10101009
this.__defineGetter__("touched_network", function()
10111010
{
1012-
return Boolean(this._current_request);
1011+
return Boolean(this._current_request);
10131012
});
10141013
this.__defineSetter__("touched_network", function(){});
1014+
1015+
this.__defineGetter__("current_response", function()
1016+
{
1017+
// In 99% of the cases, _current_response is used. It's only
1018+
// exposed for getting the ResourceInfo from the service directly.
1019+
return this.current_response;
1020+
});
1021+
this.__defineSetter__("current_response", function(){});
10151022
};
10161023

10171024
cls.NetworkLoggerEntryPrototype.prototype = new URIPrototype("url");
@@ -1152,7 +1159,6 @@ cls.NetworkLoggerResponse.prototype = new cls.NetworkLoggerResponsePrototype();
11521159
cls.ResourceInfo = function(entry)
11531160
{
11541161
this.url = entry.url;
1155-
// todo: probably make a getter for current_response that gets _current_response.
1156-
this.responseheaders = entry._current_response.response_headers;
1157-
this.responsebody = entry._current_response.responsebody;
1162+
this.responseheaders = entry.current_response.response_headers;
1163+
this.responsebody = entry.current_response.responsebody;
11581164
};

0 commit comments

Comments
 (0)