Remove nsContentUtils::GetPrefBranch()

RESOLVED FIXED in mozilla7

Status

()

Core
General
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: masayuki, Assigned: masayuki)

Tracking

Trunk
mozilla7
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Created attachment 535318 [details] [diff] [review]
Patch v1.0
Attachment #535318 - Flags: review?(roc)
(Assignee)

Updated

6 years ago
Blocks: 660121
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+
(Assignee)

Comment 2

6 years ago
(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.
(Assignee)

Comment 4

6 years ago
http://mxr.mozilla.org/mozilla-central/search?string=pref.*AddObserver&regexp=1&find=\.c&findi=\.c&filter=^[^\0]*%24&hitlimit=&tree=mozilla-central

Looks like they're helpful.
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.
(Assignee)

Comment 6

6 years ago
Okay, I'll add a new patch to this bug.
(Assignee)

Comment 7

6 years ago
Created attachment 535560 [details] [diff] [review]
Part.2 Implement (Add|Remove)Observers
Attachment #535560 - Flags: review?(roc)
(Assignee)

Comment 8

6 years ago
Created attachment 535561 [details] [diff] [review]
Part.3 Use (Add|Remove)Observers

For other callers which are using nsIPrefBranch2 directly, I'll replace them on another bug.
Attachment #535561 - Flags: review?(roc)
(Assignee)

Comment 9

6 years ago
Created attachment 535578 [details] [diff] [review]
Part.3 Use (Add|Remove)Observers
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+
... in another bug.
(Assignee)

Comment 13

6 years ago
http://hg.mozilla.org/mozilla-central/rev/fda7f2cc4a56
http://hg.mozilla.org/mozilla-central/rev/0a580dd5a56e
http://hg.mozilla.org/mozilla-central/rev/13314ef6e4d4
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
You need to log in before you can comment on or make changes to this bug.