@@ -11,7 +11,7 @@ cls.NetworkLogger = function()
1111 {
1212 // ids is an optional array of entry ids.
1313 var ctx = this . get_logger_context ( ) ;
14- var entries = ctx && ctx . get_entries ( true ) || [ ] ;
14+ var entries = ctx && ctx . get_entries ( ) || [ ] ;
1515 if ( ids )
1616 {
1717 var filter_bound = this . _filter_entries_by_list . bind ( this , ids ) ;
@@ -59,11 +59,6 @@ cls.NetworkLogger = function()
5959 this . post ( "context-removed" , { "context_type" : type } ) ;
6060 } ;
6161
62- this . remove_logger_request_context = function ( )
63- {
64- return this . _remove_request_context ( cls . NetworkLogger . CONTEXT_TYPE_LOGGER ) ;
65- } ;
66-
6762 this . remove_crafter_request_context = function ( )
6863 {
6964 return this . _remove_request_context ( cls . NetworkLogger . CONTEXT_TYPE_CRAFTER ) ;
@@ -430,6 +425,7 @@ cls.RequestContext = function(logger, is_main_context)
430425 is_blacklist : true
431426 } ;
432427 this . allocated_res_ids = [ ] ;
428+ this . _cleared_ids = [ ] ;
433429 this . is_paused = false ;
434430 this . is_waiting_for_create_request = false ;
435431 this . _logger_entries = [ ] ;
@@ -456,6 +452,9 @@ cls.RequestContextPrototype = function()
456452
457453 this . _filter_function = function ( item )
458454 {
455+ if ( this . _cleared_ids . contains ( item . id ) )
456+ return false ;
457+
459458 var success = false ;
460459 for ( var i = 0 , filter ; filter = this . _filters [ i ] ; i ++ )
461460 {
@@ -478,16 +477,13 @@ cls.RequestContextPrototype = function()
478477
479478 this . get_entries_filtered = function ( )
480479 {
481- return this . get_entries ( ) . filter ( this . _filter_function_bound ) ;
480+ var entries = this . is_paused ? this . _paused_entries : this . _logger_entries ;
481+ return entries . filter ( this . _filter_function_bound ) ;
482482 } ;
483483
484- this . get_entries = function ( dismiss_paused )
484+ this . get_entries = function ( )
485485 {
486- var entries = this . _logger_entries ;
487- if ( ! dismiss_paused && this . is_paused )
488- entries = this . _paused_entries ;
489-
490- return entries ;
486+ return this . _logger_entries ;
491487 } ;
492488
493489 this . get_entries_with_res_id = function ( res_id )
@@ -574,6 +570,8 @@ cls.RequestContextPrototype = function()
574570 event . windowID ,
575571 this . get_starttime ( ) ) ;
576572 this . _logger_entries . push ( logger_entry ) ;
573+ if ( this . after_clear )
574+ this . after_clear = false ;
577575 // Store the id in the list of entries in the window_context
578576 var window_context = event . windowID && this . get_window_context ( event . windowID , true ) ;
579577 if ( window_context )
@@ -583,6 +581,13 @@ cls.RequestContextPrototype = function()
583581 this . post_on_context_or_logger ( "resource-update" , { id : logger_entry . id , is_paused : this . is_paused } ) ;
584582 } ;
585583
584+ this . clear = function ( )
585+ {
586+ var helpers = window . helpers ;
587+ this . _cleared_ids . extend ( this . get_entries ( ) . map ( helpers . prop ( "id" ) ) ) ;
588+ this . after_clear = true ;
589+ } ;
590+
586591 this . post_on_context_or_logger = function ( name , body )
587592 {
588593 // Find out where to post the update message.
0 commit comments