nsFrameLoader::GetDocShell should not throw if it can create the docshell

RESOLVED FIXED in mozilla1.8beta2

Status

()

RESOLVED FIXED
14 years ago
2 months ago

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Tracking

Trunk
mozilla1.8beta2
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

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

Comment 1

14 years ago
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...
Attachment #176616 - Flags: superreview?(jst)
Attachment #176616 - Flags: review?(jst)
Comment on attachment 176616 [details] [diff] [review]
Patch.

r+sr=jst
Attachment #176616 - Flags: superreview?(jst)
Attachment #176616 - Flags: superreview+
Attachment #176616 - Flags: review?(jst)
Attachment #176616 - Flags: review+
(Assignee)

Comment 3

14 years ago
Fixed
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8beta2
(Assignee)

Comment 4

13 years ago
Note: this caused bug 303163.
(Assignee)

Updated

13 years ago
Depends on: 303163

Updated

2 months ago
Product: Core → Core Graveyard
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.