Closed Bug 1168916 Opened 9 years ago Closed 9 years ago

Redundant pref callback in nsXULPrototypeCache

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: jchen, Assigned: jchen)

Details

Attachments

(1 file)

We have two pref callbacks in nsXULPrototypeCache for the same pref. We can merge the two.
This patch removes the redundant pref callback, and merges it into the other existing one.
Attachment #8611308 - Flags: review?(Jan.Varga)
Hi Jan, can you review these or should I ask someone else? Thanks!
Flags: needinfo?(Jan.Varga)
Comment on attachment 8611308 [details] [diff] [review]
Get rid of redundant pref callback in nsXULPrototypeCache (v1)

Review of attachment 8611308 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, but please respond/address my comment below.

::: dom/xul/nsXULPrototypeCache.cpp
@@ +61,5 @@
>      // Flush the cache, regardless
>      nsXULPrototypeCache* cache = nsXULPrototypeCache::GetInstance();
> +    if (cache) {
> +        // AbortCaching() calls Flush() for us.
> +        cache->AbortCaching();

Hm, don't you want to check |wasEnabled| here like in the callback you're removing ?
If the cache was enabled then it makes sense to abort caching.
Not sure why we would need to call Flush() if the cache was just enabled.
Attachment #8611308 - Flags: review?(Jan.Varga) → review+
Flags: needinfo?(Jan.Varga)
https://hg.mozilla.org/mozilla-central/rev/cb9fe5f0fd6c
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: