Closed Bug 455736 Opened 16 years ago Closed 16 years ago

Getting an app cache should not EnsureContentViewer()

Categories

(Core :: DOM: Navigation, defect, P2)

x86
macOS
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: dcamp)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file, 1 obsolete file)

We seem to EnsureContentViewer() when we get an app cache.  Since we try to get one in nsHttpChannel::OpenCacheEntry, this means that as soon as we create a docshell and start an HTTP load in it we immediately create an about:blank document in the docshell.  In many cases, that document is not needed, and will be thrown away immediately.  It certainly can't provide an app cache!

It would make a lot more sense to me to:

1)  Go ahead and get the root docshell no matter whether |this| has a content
    viewer.
2)  Don't use GetInterface (or any other method that does EnsureContentViewer)
    to get the document.  Probably the right way is to QI to nsIDocShell,
    GetContentViewer, and then GetDocument() from that if the viewer is
    non-null.

Looks like a regression from bug 442806, and I'm really sorry I didn't catch this earlier....
Flags: blocking1.9.1?
Attached patch fix (obsolete) — Splinter Review
Assignee: nobody → dcamp
Status: NEW → ASSIGNED
Attachment #339106 - Flags: superreview?(bzbarsky)
Attachment #339106 - Flags: review?(bzbarsky)
Attachment #339106 - Flags: superreview?(bzbarsky)
Attachment #339106 - Flags: superreview+
Attachment #339106 - Flags: review?(bzbarsky)
Attachment #339106 - Flags: review+
Comment on attachment 339106 [details] [diff] [review]
fix

]>+++ b/docshell/base/nsDocShell.cpp
>@@ -456,26 +456,35 @@ NS_IMETHODIMP nsDocShell::GetInterface(c
>         nsCOMPtr<nsIDOMDocument> domDoc = do_GetInterface(rootItem);

You want to drop the "= ..." part.

r+sr=bzbarsky with that.
Attachment #339106 - Attachment is obsolete: true
Landed as http://hg.mozilla.org/mozilla-central/rev/1a971f9406f8
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Landed before 1.9.1 branching.
Flags: blocking1.9.1? → blocking1.9.1+
Priority: -- → P2
adding fixed 1.9.1 per comment 6
Keywords: fixed1.9.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: