Skip to content

Commit 0397227

Browse files
author
Daniel Herzog
committed
Stop looking at RequestID and only track resources by ResourceID as a tentative fix for DFL-3515: some resources don't have a URL property
1 parent cc6f476 commit 0397227

File tree

1 file changed

+1
-39
lines changed

1 file changed

+1
-39
lines changed

src/network/network_service.js

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -393,18 +393,6 @@ cls.RequestContextPrototype = function()
393393
return Math.min.apply(null, entries.map(function(e) { return e.starttime }));
394394
};
395395

396-
this._event_changes_req_id = function(event, current_entry)
397-
{
398-
/*
399-
Checks if the event's requestID is different from the one in current_entry.
400-
That should never be the case, since the "urlload" event initiates
401-
a new entry and that doesn't have a requestID. Note that current_entry is
402-
the last entry we saw with the event's resourceID.
403-
*/
404-
return event.requestID &&
405-
(current_entry.request_id !== event.requestID);
406-
};
407-
408396
this.update = function(eventname, event)
409397
{
410398
if (event.windowID)
@@ -424,26 +412,7 @@ cls.RequestContextPrototype = function()
424412
}
425413

426414
var logger_entry = logger_entries.last;
427-
if (logger_entry && logger_entry.request_id)
428-
{
429-
/*
430-
The same resource id can be loaded several times, but then the request id changes.
431-
It's not loaded multiple times in parallel though, so the following check would
432-
emit errors if that would happen. There is at least one NetworkLoggerEntry per
433-
resource ID, but several entries can refer to the same.
434-
Note: Retry events change the request id, but the Entry stays the same.
435-
*/
436-
var changed_request_id = this._event_changes_req_id(event, logger_entry);
437-
if (changed_request_id)
438-
{
439-
opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE +
440-
" Unexpected change in requestID on " + eventname +
441-
": Change from " + logger_entry.request_id + " to " +
442-
event.requestID + ", URL: " + logger_entry.human_url);
443-
}
444-
}
445-
446-
if (eventname == "urlload" || changed_request_id)
415+
if (eventname == "urlload")
447416
{
448417
var id = this._get_uid();
449418
logger_entry = new cls.NetworkLoggerEntry(id, event.resourceID, event.documentID, this.get_starttime());
@@ -452,7 +421,6 @@ cls.RequestContextPrototype = function()
452421
var window_context = this.get_window_context(event.windowID);
453422
window_context.entry_ids.push(id);
454423
}
455-
logger_entry.request_id = event.requestID;
456424
logger_entry.update(eventname, event);
457425

458426
if (!this.is_paused)
@@ -523,7 +491,6 @@ cls.RequestContext.prototype = new cls.RequestContextPrototype();
523491
cls.NetworkLoggerEntry = function(id, resource_id, document_id, context_starttime)
524492
{
525493
this.id = id;
526-
this.request_id = 0;
527494
this.resource_id = resource_id;
528495
this.document_id = document_id;
529496
this.context_starttime = context_starttime;
@@ -790,9 +757,6 @@ cls.NetworkLoggerEntryPrototype = function()
790757

791758
this._update_event_requestretry = function(event)
792759
{
793-
// This means on the next request with event.toRequestID, we won't
794-
// make a new entry, but a new NetworkLoggerRequest on the same entry.
795-
this.request_id = event.toRequestID;
796760
};
797761

798762
this._update_event_response = function(event)
@@ -1024,8 +988,6 @@ cls.NetworkLoggerRequest = function(entry)
1024988
this.was_responded_to = false;
1025989
// Set from template code, when first needed:
1026990
this.header_tokens = null;
1027-
// Belongs here, unused though:
1028-
this.request_id = entry.request_id;
1029991
};
1030992

1031993
cls.NetworkLoggerRequestPrototype = function()

0 commit comments

Comments
 (0)