Last Comment Bug 667183 - Create a static nsGlobalWindow::Init method to do all one-shot initializations currently in nsGlobalWindow ctor
: Create a static nsGlobalWindow::Init method to do all one-shot initialization...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla9
Assigned To: Mounir Lamouri (:mounir)
:
: Andrew Overholt [:overholt]
Mentors:
Depends on: 684018
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-25 05:37 PDT by Mounir Lamouri (:mounir)
Modified: 2011-09-01 13:15 PDT (History)
5 users (show)
mounir: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (6.21 KB, patch)
2011-06-25 05:59 PDT, Mounir Lamouri (:mounir)
jst: review+
Details | Diff | Splinter Review
Patch v1.1 (4.70 KB, patch)
2011-08-30 15:38 PDT, Mounir Lamouri (:mounir)
no flags Details | Diff | Splinter Review

Description Mounir Lamouri (:mounir) 2011-06-25 05:37:50 PDT

    
Comment 1 Mounir Lamouri (:mounir) 2011-06-25 05:59:34 PDT
Created attachment 541925 [details] [diff] [review]
Patch v1
Comment 2 Mounir Lamouri (:mounir) 2011-06-27 08:41:55 PDT
I realize some things, especially related to Preferences might not work as expected. I don't know for ::Add*VarCache but ::GetCString() might always return the default value because user pref will not be read yet.
Comment 3 Johnny Stenback (:jst, jst@mozilla.com) 2011-06-27 16:57:38 PDT
Comment on attachment 541925 [details] [diff] [review]
Patch v1

r=jst, but please do make sure that the preference values do get read correctly this early in startup (or that the value gets updated once the value is available).
Comment 4 Boris Zbarsky [:bz] (still a bit busy) 2011-08-30 13:19:24 PDT
Once you land this, the null-check you added to the DOM memory reporter can get backed out, right?
Comment 5 Mounir Lamouri (:mounir) 2011-08-30 15:36:59 PDT
(In reply to Boris Zbarsky (:bz) from comment #4)
> Once you land this, the null-check you added to the DOM memory reporter can
> get backed out, right?

If there is no weird situations where about:memory is loaded after ::Shutdown(), yes.
Comment 6 Mounir Lamouri (:mounir) 2011-08-30 15:38:02 PDT
Created attachment 557022 [details] [diff] [review]
Patch v1.1

With all preferences check staying in the ctor.
Comment 7 Matt Brubeck (:mbrubeck) 2011-08-30 17:13:49 PDT
Backed out because of build failures on inbound.
https://hg.mozilla.org/integration/mozilla-inbound/rev/902d3de6f41d
Comment 8 :Ms2ger (⌚ UTC+1/+2) 2011-08-31 02:07:40 PDT
Comment on attachment 557022 [details] [diff] [review]
Patch v1.1

>+  // There are two reasons to have Init() failing: if we were not able to
>+  // alloc the memory or if the size we want to init is too high. None of them
>+  // should happen.
>+  NS_ASSERTION(sWindowsById->Init(), "Init() should not fail!");

Are you seriously only calling Init in debug builds?
Comment 9 Mounir Lamouri (:mounir) 2011-08-31 06:00:28 PDT
(In reply to Ms2ger from comment #8)
> Comment on attachment 557022 [details] [diff] [review]
> Patch v1.1
> 
> >+  // There are two reasons to have Init() failing: if we were not able to
> >+  // alloc the memory or if the size we want to init is too high. None of them
> >+  // should happen.
> >+  NS_ASSERTION(sWindowsById->Init(), "Init() should not fail!");
> 
> Are you seriously only calling Init in debug builds?

Oooouuuups :)
Fixed patch sent to try.
Comment 10 Mounir Lamouri (:mounir) 2011-08-31 07:59:13 PDT
Pushed:
http://hg.mozilla.org/mozilla-central/rev/bc0b3ab327fa
Comment 11 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-09-01 09:43:34 PDT
This broke DOMWINDOW printfs because you removed the --gRefCnt.

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