Bug 24030 - Amalgamate suspendActiveDOMObjects/resumeActiveDOMObjects and documentWillBecomeInactive/documentDidBecomeActive?
Summary: Amalgamate suspendActiveDOMObjects/resumeActiveDOMObjects and documentWillBec...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-19 10:57 PST by Simon Fraser (smfr)
Modified: 2011-01-28 14:26 PST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2009-02-19 10:57:42 PST
suspendActiveDOMObjects/resumeActiveDOMObjects and documentWillBecomeInactive/documentDidBecomeActive do something very similar. Perhaps they should be one and the same?
Comment 1 Dmitry Titov 2011-01-28 14:23:49 PST
Indeed. Perhaps it makes sense to split ActiveDOMObject into 2 parts - the more generic interface like ScriptExecutionContextObserver (name?) that would receive stop/start/canSuspend/suspend/resume/contextDestroyed, and a PendingActivity object that would have hasPendingActivity (with counter) and optionally register with the list on SEC to keep their wrappers alive.

By splitting observer-like functionality from ActiveDOMObject, we would be able to have observers that don't have JS wrappers or a notion of pending activity.

Old ActiveDOMObjects would derive from both, while things like HTMLInputElement could only be an observer.

What do you think?
Comment 2 Jeremy Orlow 2011-01-28 14:26:49 PST
For the record, https://bugs.webkit.org/show_bug.cgi?id=53202 has some similar discussion....but yeah, I think that's probably the right basic concept.

We should probably also add a comment to ActiveDOMObject to make it more clear what it should be used for (and what an "active dom object" really means/implies).