Bug 1444143 part 5. Remove nsIFrameLoader::GetOwnerIsMozBrowserFrame. r=mystor

MozReview-Commit-ID: 6IfTdTvDZtm
This commit is contained in:
Boris Zbarsky 2018-03-21 22:43:16 -04:00
Родитель 909a57edd7
Коммит 8ce517e191
5 изменённых файлов: 22 добавлений и 24 удалений

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

@ -151,8 +151,13 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(nsFrameLoader)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsFrameLoader)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsFrameLoader)
NS_INTERFACE_MAP_ENTRY(nsIFrameLoader)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsIFrameLoader)
if (aIID.Equals(NS_GET_IID(nsFrameLoader))) {
// We want to end up with a pointer that can then be reinterpret_cast
// from nsISupports* to nsFrameLoader* and end up with |this|.
foundInterface = reinterpret_cast<nsISupports*>(this);
} else
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIFrameLoader)
NS_INTERFACE_MAP_ENTRY(nsIWebBrowserPersistable)
NS_INTERFACE_MAP_END
@ -1932,14 +1937,6 @@ nsFrameLoader::OwnerIsMozBrowserFrame()
return browserFrame ? browserFrame->GetReallyIsBrowser() : false;
}
// The xpcom getter version
NS_IMETHODIMP
nsFrameLoader::GetOwnerIsMozBrowserFrame(bool* aResult)
{
*aResult = OwnerIsMozBrowserFrame();
return NS_OK;
}
bool
nsFrameLoader::OwnerIsIsolatedMozBrowserFrame()
{

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

@ -66,6 +66,13 @@ class RenderFrameParent;
typedef struct _GtkWidget GtkWidget;
#endif
// IID for nsFrameLoader, because some places want to QI to it.
#define NS_FRAMELOADER_IID \
{ 0x297fd0ea, 0x1b4a, 0x4c9a, \
{ 0xa4, 0x04, 0xe5, 0x8b, 0xe8, 0x95, 0x10, 0x50 } }
// If nsIFrameLoader stops being the first interface we implement, fix
// our impl of QI to nsFrameLoader.
class nsFrameLoader final : public nsIFrameLoader,
public nsIWebBrowserPersistable,
public nsStubMutationObserver,
@ -84,6 +91,8 @@ public:
bool aNetworkCreated,
int32_t aJSPluginID = nsFakePluginTag::NOT_JSPLUGIN);
NS_DECLARE_STATIC_IID_ACCESSOR(NS_FRAMELOADER_IID)
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsFrameLoader, nsIFrameLoader)
NS_DECL_NSIFRAMELOADER
@ -491,4 +500,6 @@ private:
bool mFreshProcess : 1;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsFrameLoader, NS_FRAMELOADER_IID)
#endif

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

@ -55,12 +55,6 @@ interface nsIFrameLoader : nsISupports
const unsigned long EVENT_MODE_DONT_FORWARD_TO_CHILD = 0x00000001;
attribute unsigned long eventMode;
/**
* Find out whether the owner content really is a mozbrowser. <xul:browser>
* is not considered to be a mozbrowser frame.
*/
readonly attribute boolean ownerIsMozBrowserFrame;
};
%{C++

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

@ -38,13 +38,10 @@ nsBrowserElement::IsBrowserElementOrThrow(ErrorResult& aRv)
void
nsBrowserElement::InitBrowserElementAPI()
{
bool isMozBrowser;
nsCOMPtr<nsIFrameLoader> frameLoader = GetFrameLoader();
RefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
NS_ENSURE_TRUE_VOID(frameLoader);
nsresult rv = frameLoader->GetOwnerIsMozBrowserFrame(&isMozBrowser);
NS_ENSURE_SUCCESS_VOID(rv);
if (!isMozBrowser) {
if (!frameLoader->OwnerIsMozBrowserFrame()) {
return;
}

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

@ -28,6 +28,7 @@
#include "nsComponentManagerUtils.h"
#include "nsCRT.h"
#include "nsTHashtable.h"
#include "nsQueryObject.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -718,7 +719,7 @@ ParticularProcessPriorityManager::NameWithComma()
void
ParticularProcessPriorityManager::OnRemoteBrowserFrameShown(nsISupports* aSubject)
{
nsCOMPtr<nsIFrameLoader> fl = do_QueryInterface(aSubject);
RefPtr<nsFrameLoader> fl = do_QueryObject(aSubject);
NS_ENSURE_TRUE_VOID(fl);
TabParent* tp = TabParent::GetFrom(fl);
@ -730,9 +731,7 @@ ParticularProcessPriorityManager::OnRemoteBrowserFrameShown(nsISupports* aSubjec
}
// Ignore notifications that aren't from a Browser
bool isMozBrowser;
fl->GetOwnerIsMozBrowserFrame(&isMozBrowser);
if (isMozBrowser) {
if (fl->OwnerIsMozBrowserFrame()) {
ResetPriority();
}