Skip to content

Commit 927727f

Browse files
author
Daniel Herzog
committed
Fixed some naming for consistency
1 parent 83c78e7 commit 927727f

File tree

3 files changed

+24
-27
lines changed

3 files changed

+24
-27
lines changed

src/network/network_details_templates.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ templates._details_content = function(entry, do_raw)
6363
return requests_responses;
6464
}
6565

66-
var responsecode = entry.last_responsecode;
66+
var responsecode = entry.current_responsecode;
6767
if (responsecode && responsecode in cls.ResourceUtil.http_status_codes)
6868
responsecode = responsecode + " " + cls.ResourceUtil.http_status_codes[responsecode];
6969

@@ -77,7 +77,7 @@ templates._details_content = function(entry, do_raw)
7777
[
7878
"span",
7979
entry.touched_network && responsecode ? String(responsecode) + " – " : "",
80-
"data-spec", "http#" + entry.last_responsecode
80+
"data-spec", "http#" + entry.current_responsecode
8181
],
8282
["span", entry.url]
8383
]

src/network/network_service.js

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -426,16 +426,16 @@ cls.RequestContextPrototype = function()
426426
return Math.min.apply(null, entries.map(function(e) { return e.starttime }));
427427
};
428428

429-
this._event_changes_req_id = function(event, last_entry)
429+
this._event_changes_req_id = function(event, current_entry)
430430
{
431431
/*
432-
Checks if the event's requestID is different from the one in last_entry.
432+
Checks if the event's requestID is different from the one in current_entry.
433433
That should never be the case, since the "urlload" event initiates
434-
a new entry and that doesn't have a requestID. Note that last_entry is
434+
a new entry and that doesn't have a requestID. Note that current_entry is
435435
the last entry we saw with the event's resourceID.
436436
*/
437437
return event.requestID &&
438-
(last_entry.last_requestID !== event.requestID);
438+
(current_entry._requestID !== event.requestID);
439439
};
440440

441441
this.update = function(eventname, event)
@@ -468,7 +468,7 @@ cls.RequestContextPrototype = function()
468468
else
469469
{
470470
var logger_entry = logger_entries.last;
471-
if (logger_entry && logger_entry.last_requestID)
471+
if (logger_entry && logger_entry._requestID)
472472
{
473473
/*
474474
The same resource id can be loaded several times, but then the request id changes.
@@ -482,7 +482,7 @@ cls.RequestContextPrototype = function()
482482
{
483483
opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE +
484484
" Unexpected change in requestID on " + eventname +
485-
": Change from " + logger_entry.last_requestID + " to " +
485+
": Change from " + logger_entry._requestID + " to " +
486486
event.requestID + ", URL: " + logger_entry.human_url);
487487
}
488488
}
@@ -496,7 +496,7 @@ cls.RequestContextPrototype = function()
496496
var window_context = this.get_window_context(event.windowID);
497497
window_context.entry_ids.push(id);
498498
}
499-
logger_entry.last_requestID = event.requestID;
499+
logger_entry._requestID = event.requestID;
500500
logger_entry.update(eventname, event);
501501
}
502502

@@ -577,20 +577,20 @@ cls.NetworkLoggerEntry = function(id, resource_id, document_id, context_starttim
577577
this.size = null;
578578
this.type = null;
579579
this.urltype = null;
580-
this.starttime = null;
581-
this.starttime_relative = null;
580+
this.starttime = 0;
581+
this.starttime_relative = 0;
582582
this.endtime = null;
583-
this.requests_responses = [];
584-
this.last_responsecode = null;
585-
this.last_method = null;
586583
this.is_unloaded = false;
587584
this.is_finished = false;
588585
this.events = [];
589586
this.event_sequence = [];
590-
this.called_get_body = false;
591-
this.current_response = null;
587+
this.requests_responses = [];
592588
this.current_request = null;
589+
this.current_response = null;
590+
this.current_responsecode = null;
591+
this.called_get_body = false;
593592
this.set_is_finished_on_responsefinished = false;
593+
this._requestID = 0;
594594
};
595595

596596
cls.NetworkLoggerEntryPrototype = function()
@@ -740,8 +740,6 @@ cls.NetworkLoggerEntryPrototype = function()
740740
this.starttime = eventdata.time;
741741
if (this.context_starttime)
742742
this.starttime_relative = this.starttime - this.context_starttime;
743-
else
744-
this.starttime_relative = 0;
745743

746744
var d = new Date(this.starttime);
747745
var h = String(d.getHours()).zfill(2);
@@ -807,7 +805,6 @@ cls.NetworkLoggerEntryPrototype = function()
807805

808806
this._update_event_request = function(event)
809807
{
810-
this.last_method = event.method;
811808
this.current_request = new cls.NetworkLoggerRequest(this);
812809
this.requests_responses.push(this.current_request);
813810
this.current_request._update_event_request(event);
@@ -839,7 +836,7 @@ cls.NetworkLoggerEntryPrototype = function()
839836
{
840837
// This means on the next request with event.toRequestID, we won't
841838
// make a new entry, but a new NetworkLoggerRequest on the same entry.
842-
this.last_requestID = event.toRequestID;
839+
this._requestID = event.toRequestID;
843840
};
844841

845842
this._update_event_response = function(event)
@@ -848,8 +845,8 @@ cls.NetworkLoggerEntryPrototype = function()
848845
{
849846
this.current_request.was_responded_to = true;
850847
}
851-
this.last_responsecode = event.responseCode;
852-
this.error_in_last_response = /^[45]/.test(this.last_responsecode);
848+
this.current_responsecode = event.responseCode;
849+
this.error_in_current_response = /^[45]/.test(this.current_responsecode);
853850
this.current_response = new cls.NetworkLoggerResponse(this);
854851
this.requests_responses.push(this.current_response);
855852
this.current_response._update_event_response(event);

src/network/network_templates.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ templates.viewmode_graphs = function(ctx, entries, selected, width)
185185

186186
templates.url_list_entry = function(selected, entry)
187187
{
188-
var error_in_last_response = entry.error_in_last_response;
188+
var error_in_current_response = entry.error_in_current_response;
189189
var not_requested = !entry.touched_network;
190190

191191
return ["li",
@@ -198,7 +198,7 @@ templates.url_list_entry = function(selected, entry)
198198
"handler", "select-network-request",
199199
"data-object-id", String(entry.id),
200200
"class", (selected === entry.id ? "selected" : "") +
201-
(error_in_last_response ? " " + ERROR_RESPONSE : "") +
201+
(error_in_current_response ? " " + ERROR_RESPONSE : "") +
202202
(not_requested ? " " + NOT_REQUESTED : "")
203203
];
204204
};
@@ -228,10 +228,10 @@ templates.url_tooltip = function(entry)
228228
context_string = ui_strings.S_HTTP_UNREFERENCED;
229229
context_type = UNREFERENCED;
230230
}
231-
else if (entry.error_in_last_response)
231+
else if (entry.error_in_current_response)
232232
{
233-
context_string = entry.last_responsecode +
234-
" (" + HTTP_STATUS_CODES[entry.last_responsecode] + ")";
233+
context_string = entry.current_responsecode +
234+
" (" + HTTP_STATUS_CODES[entry.current_responsecode] + ")";
235235
context_type = ERROR_RESPONSE;
236236
}
237237
else if (!entry.touched_network)

0 commit comments

Comments
 (0)