The default bug view has changed. See this FAQ.

Create a static nsGlobalWindow::Init method to do all one-shot initializations currently in nsGlobalWindow ctor

RESOLVED FIXED in mozilla9

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: mounir, Assigned: mounir)

Tracking

Trunk
mozilla9
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Comment hidden (empty)
(Assignee)

Updated

6 years ago
Summary: Create a static nsGlobolWindow::Init method to do all one-shot initializations currently ins nsGlobalWindow ctor → Create a static nsGlobolWindow::Init method to do all one-shot initializations currently in nsGlobalWindow ctor
(Assignee)

Comment 1

6 years ago
Created attachment 541925 [details] [diff] [review]
Patch v1
Assignee: nobody → mounir.lamouri
Status: NEW → ASSIGNED
Attachment #541925 - Flags: review?(jst)
(Assignee)

Updated

6 years ago
Whiteboard: [needs review]
(Assignee)

Updated

6 years ago
Flags: in-testsuite-
(Assignee)

Comment 2

6 years ago
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 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).
Attachment #541925 - Flags: review?(jst) → review+
Summary: Create a static nsGlobolWindow::Init method to do all one-shot initializations currently in nsGlobalWindow ctor → Create a static nsGlobalWindow::Init method to do all one-shot initializations currently in nsGlobalWindow ctor
Once you land this, the null-check you added to the DOM memory reporter can get backed out, right?
(Assignee)

Comment 5

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

Comment 6

6 years ago
Created attachment 557022 [details] [diff] [review]
Patch v1.1

With all preferences check staying in the ctor.
Attachment #541925 - Attachment is obsolete: true
(Assignee)

Updated

6 years ago
Whiteboard: [needs review] → [inbound]
Backed out because of build failures on inbound.
https://hg.mozilla.org/integration/mozilla-inbound/rev/902d3de6f41d
Whiteboard: [inbound]
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?
(Assignee)

Comment 9

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

Comment 10

6 years ago
Pushed:
http://hg.mozilla.org/mozilla-central/rev/bc0b3ab327fa
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla9
This broke DOMWINDOW printfs because you removed the --gRefCnt.
Depends on: 684018
You need to log in before you can comment on or make changes to this bug.