@@ -964,6 +964,11 @@ cls.NetworkLoggerEntryPrototype = function()
964964 return Boolean ( this . _current_response && this . _current_response . responsebody ) ;
965965 } ) ;
966966
967+ this . __defineGetter__ ( "current_response_saw_responsefinished" , function ( )
968+ {
969+ return Boolean ( this . _current_response && this . _current_response . saw_responsefinished ) ;
970+ } ) ;
971+
967972 this . __defineGetter__ ( "duration" , function ( )
968973 {
969974 return ( this . events . length && this . endtime - this . starttime ) || 0 ;
@@ -981,6 +986,8 @@ cls.NetworkLoggerEntryPrototype = function()
981986 return Boolean ( this . _current_request ) ;
982987 } ) ;
983988
989+ // todo: add empty setters.
990+
984991} ;
985992
986993cls . NetworkLoggerEntryPrototype . prototype = new URIPrototype ( "url" ) ;
@@ -1051,6 +1058,7 @@ cls.NetworkLoggerResponse = function(entry)
10511058 this . responsebody = null ;
10521059 this . header_tokens = null ; // This is set from template code, when it's first needed
10531060 this . is_response = true ; // Simpler for recognizing than dealing with comparing the constructor
1061+ this . saw_responsefinished = false ;
10541062
10551063 // The following are duplicated from the entry to have them available directly on the response
10561064 this . logger_entry_type = entry . type ;
@@ -1078,15 +1086,22 @@ cls.NetworkLoggerResponsePrototype = function()
10781086
10791087 this . _update_event_responsefinished = function ( event )
10801088 {
1089+ this . saw_responsefinished = true ;
10811090 if ( event . data && event . data . content )
10821091 {
1092+ // event.data is of type ResourceData here.
1093+ // todo: this does not set body_unavailable = true when there is no mimeType. does that make sense?
10831094 this . responsebody = event . data ;
10841095 }
10851096 } ;
10861097
10871098 this . _update_event_responsebody = function ( event )
10881099 {
1100+ // "The used mime type. This may be different from the mime type advertised in the HTTP headers."
1101+ // Todo: So this can mean that there was no response, this is better represented through "!saw_responsefinished" though,
1102+ // or that it was somehow invalid? Not so sure.
10891103 if ( ! event . mimeType ) { this . body_unavailable = true ; }
1104+ // event is of type ResourceData here.
10901105 this . responsebody = event ;
10911106 // todo: check how to distinguish body_unavailable and empty body.
10921107 } ;
@@ -1096,7 +1111,7 @@ cls.NetworkLoggerResponsePrototype = function()
10961111 this . is_unloaded = true ;
10971112 } ;
10981113
1099- // The following sync changes on Entry.
1114+ // The following are to reflect changes that happened on Entry.
11001115 this . _update_event_urlfinished = function ( event )
11011116 {
11021117 this . logger_entry_is_finished = true ;
0 commit comments