Bug 164268 - Web Inspector: Fix double remove of ResourceCollection if type changes
Summary: Web Inspector: Fix double remove of ResourceCollection if type changes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-11-01 00:48 PDT by Devin Rousso
Modified: 2016-11-01 12:07 PDT (History)
9 users (show)

See Also:


Attachments
Patch (2.16 KB, patch)
2016-11-01 00:51 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-yosemite (976.02 KB, application/zip)
2016-11-01 01:51 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews105 for mac-yosemite-wk2 (1.03 MB, application/zip)
2016-11-01 01:55 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews117 for mac-yosemite (1.76 MB, application/zip)
2016-11-01 02:13 PDT, Build Bot
no flags Details
Patch (3.37 KB, patch)
2016-11-01 10:27 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2016-11-01 00:48:18 PDT
If a ResourceCollection is created without a type, and a Resource object is added to it, a sub-collection (also a ResourceCollection) is created for that specific type and stored in a Map.  If the type on that Resource changes, the `WebInspector.Resource.Event.TypeDidChange` event listeners for both the "parent" collection and the sub-collection will be fired, and both attempt to remove the resource from the sub-collection of that type:
 - The "parent" tries to add it to the sub-collection of the new type (creating one if it does not exist) and remove it from the sub-collection of the old type
 - The sub-collection of the old type tries to remove it from itself since it has a specified type, and changing types means that it no longer matches
Comment 1 Radar WebKit Bug Importer 2016-11-01 00:48:33 PDT
<rdar://problem/29040483>
Comment 2 Devin Rousso 2016-11-01 00:51:54 PDT
Created attachment 293536 [details]
Patch
Comment 3 Build Bot 2016-11-01 01:51:16 PDT
Comment on attachment 293536 [details]
Patch

Attachment 293536 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/2425667

New failing tests:
inspector/unit-tests/resource-collection.html
Comment 4 Build Bot 2016-11-01 01:51:19 PDT
Created attachment 293538 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 5 Build Bot 2016-11-01 01:55:08 PDT
Comment on attachment 293536 [details]
Patch

Attachment 293536 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/2425671

New failing tests:
inspector/unit-tests/resource-collection.html
Comment 6 Build Bot 2016-11-01 01:55:11 PDT
Created attachment 293540 [details]
Archive of layout-test-results from ews105 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 7 Build Bot 2016-11-01 02:12:59 PDT
Comment on attachment 293536 [details]
Patch

Attachment 293536 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/2425692

New failing tests:
inspector/unit-tests/resource-collection.html
Comment 8 Build Bot 2016-11-01 02:13:02 PDT
Created attachment 293541 [details]
Archive of layout-test-results from ews117 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 9 Matt Baker 2016-11-01 09:31:35 PDT
Comment on attachment 293536 [details]
Patch

r- because of resource-collection.html failure. Maybe test expectations need updating?
Comment 10 Devin Rousso 2016-11-01 10:27:02 PDT
Created attachment 293557 [details]
Patch
Comment 11 Joseph Pecoraro 2016-11-01 11:10:46 PDT
Comment on attachment 293557 [details]
Patch

r=me
Comment 12 WebKit Commit Bot 2016-11-01 12:07:44 PDT
Comment on attachment 293557 [details]
Patch

Clearing flags on attachment: 293557

Committed r208234: <http://trac.webkit.org/changeset/208234>
Comment 13 WebKit Commit Bot 2016-11-01 12:07:50 PDT
All reviewed patches have been landed.  Closing bug.