Closed Bug 1271436 Opened 8 years ago Closed 8 years ago

some docshell cleanups

Categories

(Core :: DOM: Navigation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: tbsaunde, Unassigned)

Details

(Whiteboard: btpp-active)

Attachments

(4 files)

      No description provided.
Whiteboard: btpp-active
Comment on attachment 8750472 [details] [diff] [review]
use nsIDocShellTreeItem::GetWindow() more

do_GetInterface can be actually quite nice, as can be seen here, since it deals with null checks. But fine.
Attachment #8750472 - Flags: review?(bugs) → review+
Comment on attachment 8750473 [details] [diff] [review]
use nsIDocShellTreeItem::GetDocument() more

>+++ b/dom/base/nsFrameLoader.cpp
>@@ -3178,17 +3178,17 @@ nsFrameLoader::StartPersistence(uint64_t aOuterWindowID,
>   if (!aRecv) {
>     return NS_ERROR_INVALID_POINTER;
>   }
> 
>   if (mRemoteBrowser) {
>     return mRemoteBrowser->StartPersistence(aOuterWindowID, aRecv);
>   }
> 
>-  nsCOMPtr<nsIDocument> rootDoc = do_GetInterface(mDocShell);
>+  nsCOMPtr<nsIDocument> rootDoc = mDocShell->GetDocument();
You need to null check mDocShell here.
Attachment #8750473 - Flags: review?(bugs) → review+
Comment on attachment 8750474 [details] [diff] [review]
add nsIDocShell::GetCommandManager()


>+++ b/docshell/base/nsIDocShell.idl
...
>+
>+[noscript,nostdcall,notxpcom] nsICommandManager GetCommandManager();
Missing indentation.
Attachment #8750474 - Flags: review?(bugs) → review+
Comment on attachment 8750475 [details] [diff] [review]
use do_GetInterface() a little less

> SpeakerManager::Init(nsPIDOMWindowInner* aWindow)
> {
>   BindToOwner(aWindow);
> 
>-  nsCOMPtr<nsIDocShell> docshell = do_GetInterface(GetOwner());
>+  nsCOMPtr<nsIDocShell> docshell = GetOwner()->GetDocShell();
Ok, so this is fine because the only caller of Init happens to pass always non-null.
Attachment #8750475 - Flags: review?(bugs) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: