Landing fix for bug 239202, patch by trev@gtchat.de. Making nsIScriptGlobalObjectOwner not scriptable. r+sr=jst@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@159342 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -43,7 +43,6 @@
|
||||
#include "nsIBaseWindow.idl"
|
||||
#include "nsIScrollable.idl"
|
||||
#include "nsITextScroll.idl"
|
||||
#include "nsIScriptGlobalObjectOwner.idl"
|
||||
|
||||
/*
|
||||
nsCHTMLDocShell implements:
|
||||
@@ -54,11 +53,10 @@ nsIDocShellTreeNode
|
||||
nsIBaseWindow
|
||||
nsIScrollable
|
||||
nsITextScroll
|
||||
nsIScriptGlobalObjectOwner
|
||||
*/
|
||||
|
||||
%{ C++
|
||||
// {F1EAC762-87E9-11d3-AF80-00A024FFC08C} -
|
||||
// {F1EAC762-87E9-11d3-AF80-00A024FFC08C} -
|
||||
#define NS_DOCSHELL_CID \
|
||||
{ 0xf1eac762, 0x87e9, 0x11d3, { 0xaf, 0x80, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c } }
|
||||
#define NS_DOCSHELL_CONTRACTID \
|
||||
|
||||
@@ -3835,45 +3835,16 @@ nsDocShell::ScrollByPages(PRInt32 numPages)
|
||||
// nsDocShell::nsIScriptGlobalObjectOwner
|
||||
//*****************************************************************************
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::GetScriptGlobalObject(nsIScriptGlobalObject ** aGlobal)
|
||||
nsIScriptGlobalObject*
|
||||
nsDocShell::GetScriptGlobalObject()
|
||||
{
|
||||
if (mIsBeingDestroyed) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aGlobal);
|
||||
NS_ENSURE_SUCCESS(EnsureScriptEnvironment(), NS_ERROR_FAILURE);
|
||||
NS_ENSURE_SUCCESS(EnsureScriptEnvironment(), nsnull);
|
||||
|
||||
*aGlobal = mScriptGlobal;
|
||||
NS_IF_ADDREF(*aGlobal);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::ReportScriptError(nsIScriptError * errorObject)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
if (errorObject == nsnull)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
// Get the console service, where we're going to register the error.
|
||||
nsCOMPtr<nsIConsoleService> consoleService
|
||||
(do_GetService("@mozilla.org/consoleservice;1"));
|
||||
|
||||
if (consoleService != nsnull) {
|
||||
rv = consoleService->LogMessage(errorObject);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
return NS_OK;
|
||||
}
|
||||
else {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
return mScriptGlobal;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
@@ -6957,9 +6928,9 @@ NS_IMETHODIMP nsDocShell::EnsureFind()
|
||||
// we promise that the nsIWebBrowserFind that we return has been set
|
||||
// up to point to the focussed, or content window, so we have to
|
||||
// set that up each time.
|
||||
nsCOMPtr<nsIScriptGlobalObject> scriptGO;
|
||||
rv = GetScriptGlobalObject(getter_AddRefs(scriptGO));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsIScriptGlobalObject* scriptGO = GetScriptGlobalObject();
|
||||
NS_ENSURE_TRUE(scriptGO, NS_ERROR_UNEXPECTED);
|
||||
|
||||
// default to our window
|
||||
nsCOMPtr<nsIDOMWindow> rootWindow = do_QueryInterface(scriptGO);
|
||||
|
||||
@@ -214,7 +214,6 @@ public:
|
||||
NS_DECL_NSITEXTSCROLL
|
||||
NS_DECL_NSIDOCCHARSET
|
||||
NS_DECL_NSIINTERFACEREQUESTOR
|
||||
NS_DECL_NSISCRIPTGLOBALOBJECTOWNER
|
||||
NS_DECL_NSIWEBPROGRESSLISTENER
|
||||
NS_DECL_NSIREFRESHURI
|
||||
NS_DECL_NSICONTENTVIEWERCONTAINER
|
||||
@@ -226,6 +225,8 @@ public:
|
||||
nsDocShellInfoLoadType ConvertLoadTypeToDocShellLoadInfo(PRUint32 aLoadType);
|
||||
PRUint32 ConvertDocShellLoadInfoToLoadType(nsDocShellInfoLoadType aDocShellLoadType);
|
||||
|
||||
// nsIScriptGlobalObjectOwner methods
|
||||
virtual nsIScriptGlobalObject* GetScriptGlobalObject();
|
||||
protected:
|
||||
// Object Management
|
||||
virtual ~nsDocShell();
|
||||
|
||||
Reference in New Issue
Block a user