Status

()

defect
RESOLVED FIXED
10 years ago
2 years ago

People

(Reporter: smaug, Assigned: Ms2ger)

Tracking

(Blocks 1 bug, {addon-compat, dev-doc-complete})

Trunk
mozilla10
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

I think we could merge nsIDocumentViewer and nsIContentViewer
together.
Most common case to use nsIDocumentViewer is to get nsIDocument from it, 
but nsIContentViewer has already attribute DOMDocument.
For performance reasons I'd add [noscript,notxpcom] nsIDocumentPtr getDocument();
to nsIContenViewer and remove NS_IMETHOD GetDocument(nsIDocument** aResult)
from nsIDocumentViewer.

After that removing the remaining methods GetPresShell(nsIPresShell** aResult)
GetPresContext(nsPresContext** aResult) should be easy.

(Noticed this all while profiling nsDocShell::GetChannelIsUnsafe)

Any objections? Suggestions?
Depends on: 540462
I'm all in favor of reducing the number of interfaces dealing with this stuff.  I think the theory was that we could have non-document viewers (e.g. for plug-ins or images PDFs or whatnot), but I think that's a silly theory.  We should just keep using synthetic documents.
Assignee: Olli.Pettay → nobody
Hardware: x86 → All
Assignee: nobody → Ms2ger
Posted patch Patch v1Splinter Review
Attachment #566602 - Flags: review?(Olli.Pettay)
I should probably rename NS_NewDocumentViewer as well, and I'll rev the iid.
Comment on attachment 566602 [details] [diff] [review]
Patch v1


>-NS_NewDocumentViewer(nsIDocumentViewer** aResult);
>+NS_NewDocumentViewer(nsIContentViewer** aResult);
Rename the method.


> MAKE_CTOR(CreateNameSpaceManager,         nsINameSpaceManager,         NS_GetNameSpaceManager)
>-MAKE_CTOR(CreateDocumentViewer,           nsIDocumentViewer,           NS_NewDocumentViewer)
>+MAKE_CTOR(CreateDocumentViewer,           nsIContentViewer,            NS_NewDocumentViewer)
CreateContentViewer   ... NS_NewContentViewer



>     if (mIsCreatingPrintPreview) {
>-      nsCOMPtr<nsIDocumentViewer> dv = do_QueryInterface(mDocViewerPrint);
>-      if (dv) {
>-        parentView = dv->FindContainerView();
>+      nsCOMPtr<nsIContentViewer> cv = do_QueryInterface(mDocViewerPrint);
>+      if (cv) {
>+        parentView = cv->FindContainerView();
>       }
Could you file a followup to rename mDocViewerPrint and nsIDocumentViewerPrint
(if I haven't filed that already)
Attachment #566602 - Flags: review?(Olli.Pettay) → review+
https://hg.mozilla.org/mozilla-central/rev/e915987a1cda
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
Keywords: dev-doc-needed
Keywords: addon-compat
The fix has been checked in by http://hg.mozilla.org/mozilla-central/rev/e915987a1cda

However nsIDocumentViewer.h is required by following files in comm-central.
/mailnews/base/src/nsMsgPrintEngine.cpp
/mailnews/base/src/nsMsgStatusFeedback.cpp
Status: RESOLVED → REOPENED
Depends on: 694749
Resolution: FIXED → ---
Target Milestone: mozilla10 → ---
Status: REOPENED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
This is mentioned on Firefox 10 for developers. In addition, I've added this new article:

https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIContentViewer

Neither nsIContentViewer nor nsIDocumentViewer had documentation previously.

That article is not complete but is a start. If anyone wants to fill out the rest, awesome. But for the purposes of this particular bug, it's done.
Blocks: 232583
Blocks: 769825
You need to log in before you can comment on or make changes to this bug.