WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
149760
Web Inspector: Cleanup DebuggerManager, reduce `delete` and use Maps instead of objects
https://bugs.webkit.org/show_bug.cgi?id=149760
Summary
Web Inspector: Cleanup DebuggerManager, reduce `delete` and use Maps instead ...
Matt Baker
Reported
2015-10-02 12:44:58 PDT
* SUMMARY Cleanup DebuggerManager, reduce `delete` and use Maps instead of objects.
Attachments
[Patch] Proposed Fix
(12.01 KB, patch)
2015-10-02 18:06 PDT
,
Matt Baker
no flags
Details
Formatted Diff
Diff
[Patch] For Landing
(12.17 KB, patch)
2015-10-02 18:40 PDT
,
Matt Baker
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2015-10-02 12:46:04 PDT
<
rdar://problem/22954630
>
Matt Baker
Comment 2
2015-10-02 18:06:24 PDT
Created
attachment 262371
[details]
[Patch] Proposed Fix
Matt Baker
Comment 3
2015-10-02 18:17:19 PDT
No instances of delete to remove (other than those used to remove hashmap object properties), just the switch to using Map.
Joseph Pecoraro
Comment 4
2015-10-02 18:22:31 PDT
Comment on
attachment 262371
[details]
[Patch] Proposed Fix View in context:
https://bugs.webkit.org/attachment.cgi?id=262371&action=review
r=me
> Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:280 > + if (this._breakpointURLMap.has(sourceCode.url)) { > + let urlBreakpoints = this._breakpointURLMap.get(sourceCode.url);
I tend to think we should reduce "has" && "get" to just a get. let urlBreakpoints = this._breakpointURLMap.get(sourceCode.url); if (urlBreakpoints) { ... }
> Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:286 > + if (sourceCode instanceof WebInspector.Script && this._breakpointScriptIdentifierMap.has(sourceCode.id)) { > + let scriptIdentifierBreakpoints = this._breakpointScriptIdentifierMap.get(sourceCode.id);
Same here, but it would involve more rewriting.
> Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:296 > - return this._breakpointIdMap[id]; > + return this._breakpointIdMap.get(id);
We probably should do `|| null` here too.
> Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:301 > + return this._scriptIdMap.get(id);
This should still have `|| null` to return `null` for missing values instead of `undefined`.
Matt Baker
Comment 5
2015-10-02 18:40:15 PDT
Created
attachment 262374
[details]
[Patch] For Landing
WebKit Commit Bot
Comment 6
2015-10-02 19:28:49 PDT
Comment on
attachment 262374
[details]
[Patch] For Landing Clearing flags on attachment: 262374 Committed
r190540
: <
http://trac.webkit.org/changeset/190540
>
WebKit Commit Bot
Comment 7
2015-10-02 19:28:54 PDT
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