Skip to content

Commit 68e3843

Browse files
author
p01
committed
Added pivot_id to the window_list
1 parent b6ab1a9 commit 68e3843

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/resource-manager/resource_service.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,21 @@ cls.ResourceInspector = function(network_logger)
105105

106106
ctx.document_resource_hash = {};
107107

108-
// mapping of the WindowIDs in the debugging context
109-
var window_id_index = {};
110-
ctx.window_list.forEach(function(w, i) { window_id_index[w.id] = i; });
111-
112-
var null_document_id = false;
113-
var document_id_index = {};
114108
var lead = function(str, char, len)
115109
{
116110
str = String(str);
117111
return new Array((len || 8) - str.length + 1).join(char || "-") + str;
118112
};
119113

114+
// mapping of the WindowIDs in the debugging context + pivot_id
115+
var window_id_index = {};
116+
ctx.window_list.forEach(function(w, i) {
117+
w.pivot_id = lead(w.id);
118+
window_id_index[w.id] = i;
119+
});
120+
121+
var null_document_id = false;
122+
var document_id_index = {};
120123
// filter the documents that belong in the window_id list,
121124
// set null_document_id flag,
122125
// augment the document objects,
@@ -136,7 +139,9 @@ cls.ResourceInspector = function(network_logger)
136139
document_id_index[d.documentID] = i;
137140

138141
// set depth, pivot_id and same_origin
139-
var p = a[document_id_index[d.parentDocumentID]] || {pivot_id: lead(d.windowID), depth: 0};;
142+
var p = a[document_id_index[d.parentDocumentID]];
143+
if (!p)
144+
p = {pivot_id: ctx.window_list[window_id_index[d.windowID]].pivot_id, depth: 0};
140145
var id = p.pivot_id + lead(d.documentID);
141146
d.depth = p.depth + 1;
142147
d.pivot_id = id;
@@ -246,7 +251,7 @@ cls.ResourceInspector = function(network_logger)
246251
if (event.shiftKey)
247252
{
248253
pivot_ids.push.apply(pivot_ids, Object.keys(hash).filter(function(p) {
249-
return p.startswith(pivot_id + "_");
254+
return p.startswith(pivot_id);
250255
}));
251256
}
252257

src/resource-manager/resource_templates.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ window.templates.resource_tree || (window.templates.resource_tree = new function
8282
if (!window_info)
8383
return;
8484

85-
var extras = this._expander_extras(context, String(w.id));
85+
var extras = this._expander_extras(context, w.pivot_id);
8686

8787
flat_list.push(
8888
["li",

0 commit comments

Comments
 (0)