Bug 1494175 - Remove unimplemented nsIWebBrowserChrome methods. r=qdot

All implementations of these methods fail immediately. This patch removes them,
and replaces their call sites with failures. Code coverage indicates these
locations aren't hit by any of our tests.

--HG--
extra : rebase_source : 3c44ac20213af97865ad0316e65bfe49b9e5818c
This commit is contained in:
Nicholas Nethercote 2018-09-26 19:39:44 +10:00
Родитель f0ef711f2a
Коммит 578ac09f67
5 изменённых файлов: 12 добавлений и 66 удалений

Просмотреть файл

@ -402,7 +402,10 @@ nsDocShellTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem,
shellAsWin->GetSize(&width, &height);
return tabChild->RemoteSizeShellTo(aCX, aCY, width, height);
}
return webBrowserChrome->SizeBrowserTo(aCX, aCY);
// XXX: this is weird, but we used to call a method here
// (webBrowserChrome->SizeBrowserTo()) whose implementations all failed
// like this, so...
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_ENSURE_TRUE(aShellItem, NS_ERROR_FAILURE);
@ -430,12 +433,10 @@ nsDocShellTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem,
presShell->ResizeReflow(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE),
NS_ERROR_FAILURE);
nsRect shellArea = presContext->GetVisibleArea();
int32_t browserCX = presContext->AppUnitsToDevPixels(shellArea.Width());
int32_t browserCY = presContext->AppUnitsToDevPixels(shellArea.Height());
return webBrowserChrome->SizeBrowserTo(browserCX, browserCY);
// XXX: this is weird, but we used to call a method here
// (webBrowserChrome->SizeBrowserTo()) whose implementations all failed like
// this, so...
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
@ -495,7 +496,10 @@ nsDocShellTreeOwner::Destroy()
{
nsCOMPtr<nsIWebBrowserChrome> webBrowserChrome = GetWebBrowserChrome();
if (webBrowserChrome) {
return webBrowserChrome->DestroyBrowserWindow();
// XXX: this is weird, but we used to call a method here
// (webBrowserChrome->DestroyBrowserWindow()) whose implementations all
// failed like this, so...
return NS_ERROR_NOT_IMPLEMENTED;
}
return NS_ERROR_NULL_POINTER;

Просмотреть файл

@ -734,14 +734,6 @@ TabChild::SetChromeFlags(uint32_t aChromeFlags)
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
TabChild::DestroyBrowserWindow()
{
NS_WARNING("TabChild::DestroyBrowserWindow not supported in TabChild");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
TabChild::RemoteSizeShellTo(int32_t aWidth, int32_t aHeight,
int32_t aShellItemWidth, int32_t aShellItemHeight)
@ -798,14 +790,6 @@ TabChild::RemoteDropLinks(uint32_t aLinksCount,
return sent ? NS_OK : NS_ERROR_FAILURE;
}
NS_IMETHODIMP
TabChild::SizeBrowserTo(int32_t aWidth, int32_t aHeight)
{
NS_WARNING("TabChild::SizeBrowserTo not supported in TabChild");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
TabChild::ShowAsModal()
{

Просмотреть файл

@ -97,20 +97,6 @@ interface nsIWebBrowserChrome : nsISupports
*/
attribute unsigned long chromeFlags;
/**
* Asks the implementer to destroy the window associated with this
* WebBrowser object.
*/
void destroyBrowserWindow();
/**
* Tells the chrome to size itself such that the browser will be the
* specified size.
* @param aCX new width of the browser
* @param aCY new height of the browser
*/
void sizeBrowserTo(in long aCX, in long aCY);
/**
* Shows the window as a modal window.
*/

Просмотреть файл

@ -268,22 +268,6 @@ WebBrowserChrome2Stub::SetChromeFlags(uint32_t aChromeFlags)
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
WebBrowserChrome2Stub::DestroyBrowserWindow()
{
MOZ_ASSERT_UNREACHABLE("WebBrowserChrome2Stub::DestroyBrowserWindow is "
"not supported");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
WebBrowserChrome2Stub::SizeBrowserTo(int32_t aCX, int32_t aCY)
{
MOZ_ASSERT_UNREACHABLE("WebBrowserChrome2Stub::SizeBrowserTo is "
"not supported");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
WebBrowserChrome2Stub::ShowAsModal()
{

Просмотреть файл

@ -483,18 +483,6 @@ NS_IMETHODIMP nsContentTreeOwner::GetChromeFlags(uint32_t* aChromeFlags)
return mXULWindow->GetChromeFlags(aChromeFlags);
}
NS_IMETHODIMP nsContentTreeOwner::DestroyBrowserWindow()
{
NS_ERROR("Haven't Implemented this yet");
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsContentTreeOwner::SizeBrowserTo(int32_t aCX, int32_t aCY)
{
NS_ERROR("Haven't Implemented this yet");
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsContentTreeOwner::ShowAsModal()
{
NS_ENSURE_STATE(mXULWindow);