Closed Bug 659913 Opened 13 years ago Closed 13 years ago

Remove nsContentUtils::GetPrefBranch()

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla7

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(3 files, 1 obsolete file)

Attached patch Patch v1.0Splinter Review
      No description provided.
Attachment #535318 - Flags: review?(roc)
Comment on attachment 535318 [details] [diff] [review]
Patch v1.0

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

It would be nice if we looped over an array instead of writing out lots of calls to AddWeakObserver.
Attachment #535318 - Flags: review?(roc) → review+
(In reply to comment #1)
> Comment on attachment 535318 [details] [diff] [review] [review]
> Patch v1.0
> 
> Review of attachment 535318 [details] [diff] [review] [review]:
> -----------------------------------------------------------------
> 
> It would be nice if we looped over an array instead of writing out lots of
> calls to AddWeakObserver.

How about to make new methods like
AddWeakObservers(nsIObserver*, const char* aPrefs[], PRUint32 aCountOfPrefs); ?
We could, but I don't know if it would be worth it.
I guess so!

Instead of having a length argument, it might be simpler to just use NULL as the last string in the array as the terminator.
Okay, I'll add a new patch to this bug.
Attached patch Part.3 Use (Add|Remove)Observers (obsolete) — Splinter Review
For other callers which are using nsIPrefBranch2 directly, I'll replace them on another bug.
Attachment #535561 - Flags: review?(roc)
Attachment #535561 - Attachment is obsolete: true
Attachment #535561 - Flags: review?(roc)
Attachment #535578 - Flags: review?(roc)
Comment on attachment 535560 [details] [diff] [review]
Part.2 Implement (Add|Remove)Observers

Review of attachment 535560 [details] [diff] [review]:
-----------------------------------------------------------------
Attachment #535560 - Flags: review?(roc) → review+
Comment on attachment 535578 [details] [diff] [review]
Part.3 Use (Add|Remove)Observers

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

It looks like nothing unregisters the pref observers for IconLoad. We should do that, via some layout Shutdown method that unregisters and releases gIconLoad.
Attachment #535578 - Flags: review?(roc) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: