Last Comment Bug 659913 - Remove nsContentUtils::GetPrefBranch()
: Remove nsContentUtils::GetPrefBranch()
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: General (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla7
Assigned To: Masayuki Nakano [:masayuki] (Mozilla Japan)
:
Mentors:
Depends on: 656826
Blocks: 660121
  Show dependency treegraph
 
Reported: 2011-05-26 06:12 PDT by Masayuki Nakano [:masayuki] (Mozilla Japan)
Modified: 2011-05-28 18:38 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1.0 (14.72 KB, patch)
2011-05-26 06:12 PDT, Masayuki Nakano [:masayuki] (Mozilla Japan)
roc: review+
Details | Diff | Splinter Review
Part.2 Implement (Add|Remove)Observers (2.81 KB, patch)
2011-05-26 23:16 PDT, Masayuki Nakano [:masayuki] (Mozilla Japan)
roc: review+
Details | Diff | Splinter Review
Part.3 Use (Add|Remove)Observers (8.09 KB, patch)
2011-05-26 23:18 PDT, Masayuki Nakano [:masayuki] (Mozilla Japan)
no flags Details | Diff | Splinter Review
Part.3 Use (Add|Remove)Observers (8.22 KB, patch)
2011-05-27 01:23 PDT, Masayuki Nakano [:masayuki] (Mozilla Japan)
roc: review+
Details | Diff | Splinter Review

Description Masayuki Nakano [:masayuki] (Mozilla Japan) 2011-05-26 06:12:00 PDT
Created attachment 535318 [details] [diff] [review]
Patch v1.0
Comment 1 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-05-26 17:12:37 PDT
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.
Comment 2 Masayuki Nakano [:masayuki] (Mozilla Japan) 2011-05-26 20:28:53 PDT
(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); ?
Comment 3 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-05-26 20:32:46 PDT
We could, but I don't know if it would be worth it.
Comment 5 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-05-26 20:40:37 PDT
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.
Comment 6 Masayuki Nakano [:masayuki] (Mozilla Japan) 2011-05-26 20:42:08 PDT
Okay, I'll add a new patch to this bug.
Comment 7 Masayuki Nakano [:masayuki] (Mozilla Japan) 2011-05-26 23:16:38 PDT
Created attachment 535560 [details] [diff] [review]
Part.2 Implement (Add|Remove)Observers
Comment 8 Masayuki Nakano [:masayuki] (Mozilla Japan) 2011-05-26 23:18:06 PDT
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.
Comment 9 Masayuki Nakano [:masayuki] (Mozilla Japan) 2011-05-27 01:23:17 PDT
Created attachment 535578 [details] [diff] [review]
Part.3 Use (Add|Remove)Observers
Comment 10 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-05-27 02:14:26 PDT
Comment on attachment 535560 [details] [diff] [review]
Part.2 Implement (Add|Remove)Observers

Review of attachment 535560 [details] [diff] [review]:
-----------------------------------------------------------------
Comment 11 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-05-27 02:21:09 PDT
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.
Comment 12 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-05-27 02:21:37 PDT
... in another bug.

Note You need to log in before you can comment on or make changes to this bug.