@@ -221,7 +221,7 @@ cls.NetworkLoggerService = function(view)
221221 this . _res_service . requestSetResponseMode ( cls . TagManager . IGNORE_RESPONSE , resparg ) ;
222222 } . bind ( this ) ;
223223
224- this . get_body = function ( itemid , update_callback )
224+ this . get_body = function ( itemid )
225225 {
226226 if ( ! this . _current_context )
227227 return ;
@@ -230,11 +230,11 @@ cls.NetworkLoggerService = function(view)
230230 entry . called_get_body = true ;
231231 var contentmode = cls . ResourceUtil . mime_to_content_mode ( entry . mime ) ;
232232 var typecode = { datauri : 3 , string : 1 } [ contentmode ] || 1 ;
233- var tag = window . tagManager . set_callback ( this , this . _handle_get_resource , [ update_callback , entry ] ) ;
233+ var tag = window . tagManager . set_callback ( this , this . _handle_get_resource , [ entry ] ) ;
234234 this . _res_service . requestGetResource ( tag , [ entry . resource_id , [ typecode , 1 ] ] ) ;
235235 } ;
236236
237- this . _handle_get_resource = function ( status , data , update_callback , entry )
237+ this . _handle_get_resource = function ( status , data , entry )
238238 {
239239 if ( ! this . _current_context )
240240 return ;
@@ -250,8 +250,8 @@ cls.NetworkLoggerService = function(view)
250250 this . _current_context . update ( "responsebody" , msg ) ;
251251 }
252252 // Update the view. This is only needed when the generic updating per event is paused.
253- if ( this . is_paused && update_callback )
254- update_callback ( ) ;
253+ if ( this . is_paused && window . views && window . views . network_logger )
254+ window . views . network_logger . update ( ) ;
255255
256256 } ;
257257
@@ -961,6 +961,22 @@ cls.NetworkLoggerEntryPrototype = function()
961961 this . events . push ( evt ) ;
962962 } ;
963963
964+ this . check_to_get_body = function ( service )
965+ {
966+ // Decide if body should be fetched, for when content-tracking is off or it's a cached request.
967+ if (
968+ this . is_finished &&
969+ ! this . called_get_body &&
970+ ( ! this . current_response || ! this . current_response . responsebody ) &&
971+ // When we have a response, but didn't see responsefinished, it means there's really no
972+ // responsebody. Don't attempt to fetch it.
973+ ( ! this . current_response || this . current_response . saw_responsefinished )
974+ )
975+ {
976+ service . get_body ( this . id ) ;
977+ }
978+ } ;
979+
964980 this . __defineGetter__ ( "duration" , function ( )
965981 {
966982 return ( this . events . length && this . endtime - this . starttime ) || 0 ;
0 commit comments