Bug 49088

Summary: Web Inspector: _bindResourceURL in ResourceManager.js may not add resource to map
Product: WebKit Reporter: Jenn Braithwaite <jennb>
Component: Web Inspector (Deprecated)Assignee: Jenn Braithwaite <jennb>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, pfeldman, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
patch
pfeldman: review+, pfeldman: commit-queue-
updated patch none

Jenn Braithwaite
Reported 2010-11-05 13:14:45 PDT
In ResourceManager.js: _bindResourceURL: function(resource) { var resourceForURL = this._resourcesByURL[resource.url]; if (!resourceForURL) this._resourcesByURL[resource.url] = resource; else if (resourceForURL instanceof Array) resourceForURL.push(resource); else this._resourcesByURL[resource.url] = [resourceForURL]; <==== }, The last else clause converts a single element into an array, but it seems to have forgotten to put the resource into the newly formed array.
Attachments
patch (1.43 KB, patch)
2010-11-05 13:19 PDT, Jenn Braithwaite
pfeldman: review+
pfeldman: commit-queue-
updated patch (1.25 KB, patch)
2010-11-08 09:56 PST, Jenn Braithwaite
no flags
Jenn Braithwaite
Comment 1 2010-11-05 13:19:14 PDT
Pavel Feldman
Comment 2 2010-11-05 23:54:46 PDT
Comment on attachment 73105 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=73105&action=review Thanks for fixing this! Fyi: there is a webkit.com/new-inspector-bug that has nice template for inspector bugs. > WebCore/ChangeLog:5 > + _bindResourceURL in ResourceManager.js may not add resource to map You should use Web Inspector: prefix > WebCore/inspector/front-end/ResourceManager.js:405 > + var resourceForURLArray = [resourceForURL]; Nit: I would simply do this._resourcesByURL[resource.url] = [resourceForURL, resource];
Jenn Braithwaite
Comment 3 2010-11-08 09:56:20 PST
Created attachment 73246 [details] updated patch I like your JS better. My JS-newbie-ness is showing...
WebKit Commit Bot
Comment 4 2010-11-08 20:48:14 PST
Comment on attachment 73246 [details] updated patch Clearing flags on attachment: 73246 Committed r71603: <http://trac.webkit.org/changeset/71603>
WebKit Commit Bot
Comment 5 2010-11-08 20:48:19 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.