@@ -23,11 +23,9 @@ cls.ResourceManagerService = function(view, network_logger)
2323 "*" : ui_strings . S_HTTP_LABEL_FILTER_OTHER
2424 } ;
2525
26-
2726 this . _view = view ;
2827 this . _network_logger = network_logger ;
2928
30-
3129 this . _handle_list_documents = function ( status , msg )
3230 {
3331 this . _document_list = new cls . DocumentManager [ "1.0" ] . DocumentList ( msg ) . documentList ;
@@ -38,7 +36,6 @@ cls.ResourceManagerService = function(view, network_logger)
3836 d . url = new URI ( d . url ) ;
3937 } ) ;
4038
41-
4239 this . _update ( { type : "_handle_list_documents" } ) ;
4340 } ;
4441
@@ -57,21 +54,24 @@ cls.ResourceManagerService = function(view, network_logger)
5754
5855 if ( ! this . _document_resources [ document_id ] . contains ( r . uid ) )
5956 this . _document_resources [ document_id ] . push ( r . uid ) ;
60- }
57+ } ;
6158
6259 this . _update = function ( msg )
6360 {
6461 // bounce if _suppress_updates
65- if ( this . _suppress_updates )
62+ if ( this . _suppress_updates_url )
6663 {
6764 if ( msg && msg . type == "resource-update" )
6865 {
6966 // suppress the uid altogether if its URL matches the one we are requesting
70- var r = this . _network_logger . get_resources ( [ msg . id ] ) ;
71- if ( r && r [ 0 ] && r [ 0 ] . url == this . _suppress_updates_url )
67+ var r = this . _network_logger . get_resources ( [ msg . id ] ) [ 0 ] ;
68+ if ( r && r . url == this . _suppress_updates_url )
7269 this . _suppress_uids [ msg . id ] = true ;
70+
71+ // skip the update if it is about a suppressed uid
72+ if ( this . _suppress_uids [ msg . id ] )
73+ return ;
7374 }
74- return setTimeout ( this . _update_bound , THROTTLE_DELAY ) ;
7575 }
7676
7777 // build the context
@@ -124,7 +124,7 @@ cls.ResourceManagerService = function(view, network_logger)
124124 // set depth, pivotID and sameOrigin
125125 var p = a [ document_id_index [ d . parentDocumentID ] ] || { pivotID :d . windowID , depth :0 } ;
126126 var id = p . pivotID + "_" + d . documentID ;
127- d . depth = p . depth + 1 ;
127+ d . depth = p . depth + 1 ;
128128 d . pivotID = id ;
129129 d . sameOrigin = cls . ResourceUtil . sameOrigin ( p . url , d . url ) ;
130130
@@ -133,7 +133,7 @@ cls.ResourceManagerService = function(view, network_logger)
133133 if ( ! hash . hasOwnProperty ( id ) )
134134 {
135135 hash [ id ] = d . depth > 1 ;
136- ctx . groupOrder . forEach ( function ( g ) { hash [ id + "_" + g ] = true ; } ) ;
136+ ctx . groupOrder . forEach ( function ( g ) { hash [ id + "_" + g ] = true ; } ) ;
137137 }
138138 }
139139
@@ -194,7 +194,6 @@ cls.ResourceManagerService = function(view, network_logger)
194194
195195 this . _update_bound = this . _update . bind ( this ) ;
196196
197-
198197 this . _on_debug_context_selected_bound = function ( )
199198 {
200199 this . _reset ( ) ;
@@ -215,7 +214,7 @@ cls.ResourceManagerService = function(view, network_logger)
215214
216215 if ( event . shiftKey )
217216 {
218- pivotIDs . push . apply ( pivotIDs , Object . keys ( hash ) . filter ( function ( p ) {
217+ pivotIDs . push . apply ( pivotIDs , Object . keys ( hash ) . filter ( function ( p ) {
219218 return p . startswith ( pivotID + '_' ) ;
220219 } ) ) ;
221220 }
@@ -226,7 +225,6 @@ cls.ResourceManagerService = function(view, network_logger)
226225 }
227226 } . bind ( this ) ;
228227
229-
230228 this . _handle_resource_detail_bound = function ( event , target )
231229 {
232230 if ( ! this . _context )
@@ -278,7 +276,7 @@ cls.ResourceManagerService = function(view, network_logger)
278276
279277 this . highlight_resource ( uid ) ;
280278 cls . ResourceDetailView . instance . show_resource ( uid ) ;
281- }
279+ } ;
282280
283281 this . highlight_next_resource_bound = function ( )
284282 {
@@ -292,7 +290,7 @@ cls.ResourceManagerService = function(view, network_logger)
292290
293291 this . _resource_request_update_bound = function ( msg )
294292 {
295- this . _suppress_updates = ( msg . type == "resource-request-id" ) ;
293+ delete this . _suppress_updates_url ;
296294 } . bind ( this ) ;
297295
298296 this . _init = function ( )
@@ -312,7 +310,6 @@ cls.ResourceManagerService = function(view, network_logger)
312310 messages . add_listener ( 'debug-context-selected' , this . _on_debug_context_selected_bound ) ;
313311
314312 listener = this . _resource_request_update_bound ;
315- messages . add_listener ( 'resource-request-id' , listener ) ;
316313 messages . add_listener ( 'resource-request-resource' , listener ) ;
317314 messages . add_listener ( 'resource-request-fallback' , listener ) ;
318315
@@ -335,7 +332,6 @@ cls.ResourceManagerService = function(view, network_logger)
335332 this . _collapsed_hash = { } ;
336333 this . _document_resources = { } ;
337334
338- this . _suppress_updates = false ;
339335 this . _suppress_uids = { } ;
340336 this . _view . update ( ) ;
341337 } ;
@@ -367,10 +363,9 @@ cls.ResourceManagerService = function(view, network_logger)
367363
368364 this . request_resource_data = function ( url , callback , data , resourceInfo )
369365 {
370- this . _suppress_updates = true ;
371366 this . _suppress_updates_url = url ;
372367 new cls . ResourceRequest ( url , callback , data , resourceInfo ) ;
373- }
368+ } ;
374369
375370 this . _init ( ) ;
376371} ;
@@ -400,15 +395,15 @@ cls.ResourceRequest = function(url, callback, data, resourceInfo)
400395 this . _request_create_request ( ) ;
401396 else
402397 this . _fallback ( ) ;
403- }
398+ } ;
404399
405400 this . _fallback = function ( )
406401 {
407402 // broadcast that we fellback
408403 window . messages . post ( "resource-request-fallback" , { resource_id : this . resource_id } ) ;
409404
410405 window . open ( this . url ) ;
411- }
406+ } ;
412407
413408 this . _request_create_request = function ( )
414409 {
@@ -420,7 +415,7 @@ cls.ResourceRequest = function(url, callback, data, resourceInfo)
420415 }
421416 else
422417 this . _fallback ( ) ;
423- }
418+ } ;
424419
425420 this . _on_request_resource_id = function ( status , message )
426421 {
@@ -430,14 +425,11 @@ cls.ResourceRequest = function(url, callback, data, resourceInfo)
430425 var RESOURCE_ID = 0 ;
431426 this . resource_id = message [ RESOURCE_ID ] ;
432427
433- // broadcast that we are working on the resource this.resource_id
434- window . messages . post ( "resource-request-id" , { resource_id : this . resource_id } ) ;
435-
436428 this . _request_get_resource ( ) ;
437429 }
438430 else
439431 this . _fallback ( ) ;
440- }
432+ } ;
441433
442434 this . _request_get_resource = function ( )
443435 {
@@ -451,7 +443,7 @@ cls.ResourceRequest = function(url, callback, data, resourceInfo)
451443
452444 var tag = this . _tag_manager . set_callback ( this , this . _on_request_get_resource ) ;
453445 this . _resource_manager . requestGetResource ( tag , [ this . resource_id , [ transport_type , DECODE_TRUE , SIZE_LIMIT ] ] ) ;
454- }
446+ } ;
455447
456448 this . _on_request_get_resource = function ( status , message )
457449 {
@@ -484,9 +476,9 @@ cls.ResourceRequest = function(url, callback, data, resourceInfo)
484476 }
485477 else
486478 this . _fallback ( ) ;
487- }
479+ } ;
488480
489481 this . _init ( url , callback , data , resourceInfo ) ;
490- }
482+ } ;
491483
492484cls . ResourceRequest . prototype = new URIPrototype ( "url" ) ;
0 commit comments