Closed Bug 593744 Opened 11 years ago Closed 10 years ago
Window .cpp should assert if m Layer Manager is null before Returning from ns Window::Get Layer Manager()
From an IRC discussion, following http://hg.mozilla.org/mozilla-central/rev/6d1ca8f869dd mLayerManager can be returned null in (currently unsupported) cases. I suggested we assert that it is not null on a return here, since I was also told it is expected not to be. (Before this cset we never returned null here). The assert will help prevent future mistakes that can happen much easier given the web of ifdefs inside this function.
Comment on attachment 550597 [details] [diff] [review] Added the requested assert I'm not a reviewer here, and it looks like the code has changed significantly since I filed this. I wasn't able to detangle it at first glance, but it does look like we still use |new| to create a LayerManager in this fallback (even though the fallback is no longer #ifdef'ed out in some cases). What I am not sure about is if this is an infallible alloc or not in this part of the code. The actual addition of the assert is technically correct, over to Joe for the concept on if this assert is actually useful here now.
Assignee: nobody → mmarcottulio
Status: NEW → ASSIGNED
Attachment #550597 - Flags: review?(joe) → review+
new is always infallible in Mozilla code; you have to use |new (fallible_t())| to get a fallible new.
Marco, I'm sorry we didn't catch this before now. Typically once you have review you would add checkin-needed so someone can get around to actually pushing this live. (I'm hoping the patch has not bitrotted since review)
Target Milestone: --- → mozilla10
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.