Bug 150860 - Web Inspector: Remove duplication among ScriptDebugServer subclasses
Summary: Web Inspector: Remove duplication among ScriptDebugServer subclasses
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
Keywords: InRadar
Depends on:
Reported: 2015-11-03 15:08 PST by Joseph Pecoraro
Modified: 2015-11-03 16:44 PST (History)
8 users (show)

See Also:

[PATCH] Proposed Fix (26.59 KB, patch)
2015-11-03 15:19 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-11-03 15:08:23 PST
Remove duplication among ScriptDebugServer subclasses.

ScriptDebugServer subclasses each have their own addListener/removeListener implementation because they do different work when the first debugger attaches or the last detaches. However, the base class needs that list of listeners to dispatch its events. This is unnecessarily confusing.

- Move addListener/removeListener and the list of listeners to the base class.
- Make the only virtual work "attachDebugger" / "detachDebugger" when the first listener is added or last removed
- Simplify related code that was duplicated as a result of the previous separation
Comment 1 Radar WebKit Bug Importer 2015-11-03 15:09:13 PST
Comment 2 Joseph Pecoraro 2015-11-03 15:19:29 PST
Created attachment 264736 [details]
[PATCH] Proposed Fix
Comment 3 WebKit Commit Bot 2015-11-03 16:44:51 PST
Comment on attachment 264736 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 264736

Committed r191997: <http://trac.webkit.org/changeset/191997>
Comment 4 WebKit Commit Bot 2015-11-03 16:44:54 PST
All reviewed patches have been landed.  Closing bug.