Bug 774633 - Remove dead mOpenerScriptPrincipal. r=jst

This value is initialized to null and never set, so we can get rid of it.
This commit is contained in:
Bobby Holley 2012-09-05 11:32:06 -07:00
Родитель e864c2fca6
Коммит b54ef01adf
4 изменённых файлов: 10 добавлений и 36 удалений

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

@ -6664,26 +6664,17 @@ nsDocShell::EnsureContentViewer()
NS_TIME_FUNCTION;
nsIPrincipal* principal = nullptr;
nsCOMPtr<nsIURI> baseURI;
nsCOMPtr<nsPIDOMWindow> piDOMWindow(do_QueryInterface(mScriptGlobal));
if (piDOMWindow) {
principal = piDOMWindow->GetOpenerScriptPrincipal();
}
if (!principal) {
principal = GetInheritedPrincipal(false);
nsCOMPtr<nsIDocShellTreeItem> parentItem;
GetSameTypeParent(getter_AddRefs(parentItem));
if (parentItem) {
nsCOMPtr<nsPIDOMWindow> domWin = do_GetInterface(GetAsSupports(this));
if (domWin) {
nsCOMPtr<nsIContent> parentContent =
do_QueryInterface(domWin->GetFrameElementInternal());
if (parentContent) {
baseURI = parentContent->GetBaseURI();
}
nsIPrincipal* principal = GetInheritedPrincipal(false);
nsCOMPtr<nsIDocShellTreeItem> parentItem;
GetSameTypeParent(getter_AddRefs(parentItem));
if (parentItem) {
nsCOMPtr<nsPIDOMWindow> domWin = do_GetInterface(GetAsSupports(this));
if (domWin) {
nsCOMPtr<nsIContent> parentContent =
do_QueryInterface(domWin->GetFrameElementInternal());
if (parentContent) {
baseURI = parentContent->GetBaseURI();
}
}
}

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

@ -1266,7 +1266,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGlobalWindow)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mInnerWindowHolder)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOuterWindow)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOpenerScriptPrincipal)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_MEMBER(mListenerManager,
nsEventListenerManager)
@ -1316,7 +1315,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGlobalWindow)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mOuterWindow)
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mOpenerScriptPrincipal)
if (tmp->mListenerManager) {
tmp->mListenerManager->Disconnect();
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mListenerManager)
@ -1517,7 +1515,6 @@ nsGlobalWindow::SetOpenerScriptPrincipal(nsIPrincipal* aPrincipal)
if (mDoc) {
if (!mDoc->IsInitialDocument()) {
// We have a document already, and it's not the original one. Bail out.
// Do NOT set mOpenerScriptPrincipal in this case, just to be safe.
return;
}
@ -1573,14 +1570,6 @@ nsGlobalWindow::SetInitialPrincipalToSubject()
SetOpenerScriptPrincipal(newWindowPrincipal);
}
nsIPrincipal*
nsGlobalWindow::GetOpenerScriptPrincipal()
{
FORWARD_TO_OUTER(GetOpenerScriptPrincipal, (), nullptr);
return mOpenerScriptPrincipal;
}
PopupControlState
PushPopupControlState(PopupControlState aState, bool aForce)
{

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

@ -344,7 +344,6 @@ public:
virtual NS_HIDDEN_(void) SetOpenerScriptPrincipal(nsIPrincipal* aPrincipal);
virtual NS_HIDDEN_(void) SetInitialPrincipalToSubject();
virtual NS_HIDDEN_(nsIPrincipal*) GetOpenerScriptPrincipal();
virtual NS_HIDDEN_(PopupControlState) PushPopupControlState(PopupControlState state, bool aForce) const;
virtual NS_HIDDEN_(void) PopPopupControlState(PopupControlState state) const;
@ -1015,8 +1014,6 @@ protected:
nsCOMPtr<nsIDOMStorage> mSessionStorage;
nsCOMPtr<nsIXPConnectJSObjectHolder> mInnerWindowHolder;
nsCOMPtr<nsIPrincipal> mOpenerScriptPrincipal; // strong; used to determine
// whether to clear scope
// These member variable are used only on inner windows.
nsRefPtr<nsEventListenerManager> mListenerManager;

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

@ -288,9 +288,6 @@ public:
virtual void SetOpenerScriptPrincipal(nsIPrincipal* aPrincipal) = 0;
virtual void SetInitialPrincipalToSubject() = 0;
// Ask this window who opened it.
virtual nsIPrincipal* GetOpenerScriptPrincipal() = 0;
virtual PopupControlState PushPopupControlState(PopupControlState aState,
bool aForce) const = 0;
virtual void PopPopupControlState(PopupControlState state) const = 0;