Closed
Bug 906281
Opened 11 years ago
Closed 11 years ago
each nsEventStateManager should not register as a pref observer
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Core
DOM: UI Events & Focus Handling
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: dbaron, Assigned: masayuki)
References
Details
(Keywords: perf)
Attachments
(4 files)
7.43 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
4.46 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
17.86 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
12.96 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
Every nsEventStateManager object (one per document?) registers itself as a preference observer, and then unregisters on destruction. This unregistration uses a search through a linked list (something that we should perhaps also fix). This can add up to a noticeable amount of time when a lot of tabs are open; see the end of bug 906269 comment 0. However, the observer function that is called for *each* event state manager does only: * manipulation of global variables * manipulation of a variable that could easily be changed to a global (mClickHoldContextMenu) This should be converted into a single preference observer or set thereof rather than having one observer for every nsEventStateManager.
Comment 1•11 years ago
|
||
Yes. That pref handling is ancient, originally from http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/content/events/src/nsEventStateManager.cpp&rev=1.107 (early 2000)
Comment 2•11 years ago
|
||
FWIW I have a rough plan for fixing the prefs service in bug 901795. But yes to fixing this too...
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•11 years ago
|
||
Assignee | ||
Comment 4•11 years ago
|
||
Assignee | ||
Comment 5•11 years ago
|
||
Assignee | ||
Comment 6•11 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&usebuildbot=1&rev=5b65cd7ec8bb
Assignee | ||
Comment 7•11 years ago
|
||
Comment on attachment 792759 [details] [diff] [review] part.1 Make nsEventStateManager::mClickHoldContextMenu static variable I don't know why this is a member variable...
Attachment #792759 -
Flags: review?(bugs)
Assignee | ||
Comment 8•11 years ago
|
||
Comment on attachment 792760 [details] [diff] [review] part.2 Get rid of "nglayout.events.dispatchLeftClickOnly" due to not used Both this global variable and pref are not used now.
Attachment #792760 -
Flags: review?(bugs)
Assignee | ||
Comment 9•11 years ago
|
||
Comment on attachment 792761 [details] [diff] [review] part.3 Create nsEventStateManager::Prefs for capsuling the preferences management Let's capsule the pref values into a nested class, nsEventStateManager::Prefs. This helps next patch which makes access key code simpler.
Attachment #792761 -
Flags: review?(bugs)
Assignee | ||
Comment 10•11 years ago
|
||
Comment on attachment 792762 [details] [diff] [review] part.4 Use Preferences::AddIntVarCache() for accesskey prefs in nsEventStateManager::Prefs By this patch, only "dom.popup_allowed_events" uses the observer. I'm not sure why nsDOMEvent observes it directly. Additionally, I rename the variables and methods which store or return modifier mask value.
Attachment #792762 -
Flags: review?(bugs)
Updated•11 years ago
|
Attachment #792760 -
Flags: review?(bugs) → review+
Comment 11•11 years ago
|
||
Comment on attachment 792759 [details] [diff] [review] part.1 Make nsEventStateManager::mClickHoldContextMenu static variable Ok, this is useful with the part 3 patch...
Attachment #792759 -
Flags: review?(bugs) → review+
Comment 12•11 years ago
|
||
Comment on attachment 792761 [details] [diff] [review] part.3 Create nsEventStateManager::Prefs for capsuling the preferences management Could have an array of prefs for which callback is registered, and use that array also in Shutdown. But doesn't matter much since there are just few prefs.
Attachment #792761 -
Flags: review?(bugs) → review+
Updated•11 years ago
|
Attachment #792762 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 13•11 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #12) > Comment on attachment 792761 [details] [diff] [review] > part.3 Create nsEventStateManager::Prefs for capsuling the preferences > management > > Could have an array of prefs for which callback is registered, and use that > array also in Shutdown. But doesn't matter much since there are just few > prefs. I think that when we need to do it, we should add new methods to Preferences.h which takes pref names array.
Assignee | ||
Comment 14•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/493cd772def7 https://hg.mozilla.org/integration/mozilla-inbound/rev/eb09b18e4f14 https://hg.mozilla.org/integration/mozilla-inbound/rev/e4ae4a2c3d2f https://hg.mozilla.org/integration/mozilla-inbound/rev/38f6e57370ac
Comment 15•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/38f6e57370ac https://hg.mozilla.org/mozilla-central/rev/e4ae4a2c3d2f https://hg.mozilla.org/mozilla-central/rev/eb09b18e4f14 https://hg.mozilla.org/mozilla-central/rev/493cd772def7
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Comment hidden (spam) |
Updated•5 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•