Right now, part of our recursion protection is in nsFrameLoader::EnsureDocShell. This means that GetDocShell can throw for no really good reason (and if this happens during frame construction, the document the frame is in will suddenly have no presentation at best or crash at worst). I'm going to move all the recursion checking into a single method that's called from LoadFrame(). Throwing from that method is fine.
Created attachment 176616 [details] [diff] [review] Patch. This consolidates the recursion checking into a one function. Actual code changes were kept to a minimum. They are: 1) Return up front if it's not a content docshell, and use GetSameTypeParent throughout instead of checking type on everything in the parent chain by hand. 2) If parentURI is not an nsIURL, get the spec from parentURI, not aURI as the code did (this was clearly a bug in the existing code). 3) Switch some raw pointers to nsCOMPtr + swap(); the existing code was violating ownership rules...
Comment on attachment 176616 [details] [diff] [review] Patch. r+sr=jst
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8beta2
Note: this caused bug 303163.
Component: Layout: HTML Frames → Layout: Images
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.