Skip to content

Commit 1634e60

Browse files
author
p01
committed
Added _reset() method and missing _suppressed_resource_update
1 parent 72ee091 commit 1634e60

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

src/resource-manager/resource_service.js

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ cls.ResourceManagerService = function(view, network_logger)
1414

1515
this._view = view;
1616
this._network_logger = network_logger;
17-
this._context = null;
18-
this._documentList = [];
19-
this._documentURLHash = {};
20-
this._collapsedHash = {};
21-
this._documentResources = {};
17+
2218

2319
this._handle_listDocuments = function(status,msg)
2420
{
@@ -181,18 +177,12 @@ cls.ResourceManagerService = function(view, network_logger)
181177

182178
this._update_bound = this._update.bind(this);
183179

180+
184181
this._on_debug_context_selected_bound = function()
185182
{
186-
this._documentList = [];
187-
this._collapsedHash = {};
188-
this._documentResources = {};
189-
190-
delete this._context;
191-
delete this._selectedResourceID
192-
this._view.update();
183+
this._reset();
193184
}.bind(this);
194185

195-
196186
this._handle_expand_collapse_bound = function(event, target)
197187
{
198188
if (!this._context)
@@ -259,7 +249,6 @@ cls.ResourceManagerService = function(view, network_logger)
259249

260250
this._resource_request_update_bound = function(msg)
261251
{
262-
1;
263252
if (msg.type == 'resource-request-id')
264253
this._suppressed_resource_update[msg.resource_id] = true;
265254
else if (msg.type == 'resource-request-resource')
@@ -289,6 +278,21 @@ cls.ResourceManagerService = function(view, network_logger)
289278
this._network_logger.addListener("window-context-added", this._update_bound);
290279
this._network_logger.addListener("window-context-removed", this._update_bound);
291280

281+
this._reset();
282+
};
283+
284+
this._reset = function()
285+
{
286+
this._context = null;
287+
this._selectedResourceID = null;
288+
289+
this._documentList = [];
290+
this._documentURLHash = {};
291+
this._collapsedHash = {};
292+
this._documentResources = {};
293+
294+
this._suppressed_resource_update = {};
295+
this._view.update();
292296
};
293297

294298
this.get_resource_context = function()

0 commit comments

Comments
 (0)