Closed
Bug 473065
Opened 16 years ago
Closed 14 years ago
use a more specific prefBranch (browser.tabs.) in the tabbrowser-tabs binding
Categories
(Firefox :: Tabbed Browser, defect)
Firefox
Tabbed Browser
Tracking
()
RESOLVED
FIXED
Firefox 4.0b2
People
(Reporter: zeniko, Assigned: mkohler)
References
()
Details
Attachments
(2 files, 1 obsolete file)
1.10 KB,
patch
|
dao
:
review-
|
Details | Diff | Splinter Review |
1.77 KB,
patch
|
dao
:
review+
|
Details | Diff | Splinter Review |
... and just one observer, in case further prefs are to be observed (such as the one added by bug 465673).
Bonus points for removing the unused mPrefs property and the _mPrefs field; and maybe also for using a "browser." prefBranch for the tabbrowser's own mPrefs.
Updated•15 years ago
|
Whiteboard: [good first bug]
Assignee | ||
Comment 1•15 years ago
|
||
Is this still wanted?
Assignee | ||
Comment 2•14 years ago
|
||
* removes unused mPrefs property
* the other changes are not necessary because we now use Services.prefs.*
Comment 3•14 years ago
|
||
Comment on attachment 456177 [details] [diff] [review]
Patch v1 (trivial)
Err, isn't this actually in the section for stuff that we kept only for add-on compatibility?
Updated•14 years ago
|
Attachment #456177 -
Flags: review?(dao) → review-
Updated•14 years ago
|
Whiteboard: [good first bug]
Assignee | ||
Comment 4•14 years ago
|
||
Attachment #456908 -
Flags: review?(dao)
Comment 5•14 years ago
|
||
Comment on attachment 456908 [details] [diff] [review]
just use one observer
I'm not sure this is actually a win, as it means that _prefObserver will be called for prefs it doesn't care about.
r- because you missed related code in the destructor.
Attachment #456908 -
Flags: review?(dao) → review-
Assignee | ||
Comment 6•14 years ago
|
||
(In reply to comment #5)
> I'm not sure this is actually a win, as it means that _prefObserver will be
> called for prefs it doesn't care about.
Adding the two other observers takes a few milliseconds, too.And the browser.tabs.* preferences don't get changed every few minutes, do they?
> r- because you missed related code in the destructor.
*facepalm*
Attachment #456908 -
Attachment is obsolete: true
Attachment #456914 -
Flags: review?(dao)
Comment 7•14 years ago
|
||
None of these prefs change very often (if at all), AFAIK, so I think memory footprint is a more important consideration than the number of cycles spent during a pref change. It's not a particularly big deal either way, though, especially since it's just three separate references to the same underlying observer (which is wrapped only once, IIRC).
Comment 8•14 years ago
|
||
Comment on attachment 456914 [details] [diff] [review]
just use one observer v2
># HG changeset patch
># User Michael Kohler <michaelkohler@live.com>
>Bug 473065 - use a more specific prefBranch (browser.tabs.) in the tabbrowser-tabs binding. r=dao
>
>diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml
>--- a/browser/base/content/tabbrowser.xml
>+++ b/browser/base/content/tabbrowser.xml
>@@ -2379,29 +2379,24 @@
> var tab = this.firstChild;
> tab.setAttribute("label",
> this.tabbrowser.mStringBundle.getString("tabs.emptyTabTitle"));
> tab.setAttribute("crop", "end");
> tab.setAttribute("validate", "never");
> tab.setAttribute("onerror", "this.removeAttribute('image');");
> this.adjustTabstrip();
>
>- Services.prefs.addObserver("browser.tabs.closeButtons", this._prefObserver, false);
>- Services.prefs.addObserver("browser.tabs.autoHide", this._prefObserver, false);
>- Services.prefs.addObserver("browser.tabs.closeWindowWithLastTab", this._prefObserver, false);
>-
>+ Services.prefs.addObserver("browser.tabs.", this._prefObserver, false);
> window.addEventListener("resize", this, false);
> ]]>
> </constructor>
>
> <destructor>
> <![CDATA[
>- Services.prefs.removeObserver("browser.tabs.closeButtons", this._prefObserver);
>- Services.prefs.removeObserver("browser.tabs.autoHide", this._prefObserver);
>- Services.prefs.removeObserver("browser.tabs.closeWindowWithLastTab", this._prefObserver);
>+ Services.prefs.removeObserver("browser.tabs.", this._prefObserver);
> ]]>
> </destructor>
>
> <field name="tabbrowser" readonly="true">
> document.getElementById(this.getAttribute("tabbrowser"));
> </field>
>
> <field name="tabbox" readonly="true">
Attachment #456914 -
Flags: review?(dao) → review+
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Comment 9•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.7b2
You need to log in
before you can comment on or make changes to this bug.
Description
•