WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
168549
Web Inspector: Use Maps in FrameResourceManager instead of objects
https://bugs.webkit.org/show_bug.cgi?id=168549
Summary
Web Inspector: Use Maps in FrameResourceManager instead of objects
Nikita Vasilyev
Reported
2017-02-17 20:22:25 PST
Also, instead of using `delete` operator use Map#delete.
Attachments
Patch
(12.04 KB, patch)
2017-02-17 20:42 PST
,
Nikita Vasilyev
joepeck
: review+
joepeck
: commit-queue-
Details
Formatted Diff
Diff
Patch
(12.00 KB, patch)
2017-02-17 22:22 PST
,
Nikita Vasilyev
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2017-02-17 20:22:45 PST
<
rdar://problem/30590110
>
Nikita Vasilyev
Comment 2
2017-02-17 20:42:06 PST
Created
attachment 302042
[details]
Patch
Joseph Pecoraro
Comment 3
2017-02-17 20:49:33 PST
Comment on
attachment 302042
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=302042&action=review
r=me
> Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js:72 > var frames = []; > - for (var key in this._frameIdentifierMap) > - frames.push(this._frameIdentifierMap[key]); > + for (let [key, value] of this._frameIdentifierMap) > + frames.push(value); > > return frames;
How about just [...map.values()]
> Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js:536 > + this._resourceRequestIdentifierMap = new Map; > + this._frameIdentifierMap = new Map;
These could be .clear(), but I think new Map is fine.
Nikita Vasilyev
Comment 4
2017-02-17 22:19:16 PST
(In reply to
comment #3
)
> Comment on
attachment 302042
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=302042&action=review
> > r=me > > > Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js:72 > > var frames = []; > > - for (var key in this._frameIdentifierMap) > > - frames.push(this._frameIdentifierMap[key]); > > + for (let [key, value] of this._frameIdentifierMap) > > + frames.push(value); > > > > return frames; > > How about just [...map.values()]
This's so much more concise! I forgot that `...` can be used with any iterator.
Nikita Vasilyev
Comment 5
2017-02-17 22:22:11 PST
Created
attachment 302046
[details]
Patch
WebKit Commit Bot
Comment 6
2017-02-17 22:59:24 PST
Comment on
attachment 302046
[details]
Patch Clearing flags on attachment: 302046 Committed
r212603
: <
http://trac.webkit.org/changeset/212603
>
WebKit Commit Bot
Comment 7
2017-02-17 22:59:27 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.
Top of Page
Format For Printing
XML
Clone This Bug