mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-06 06:22:33 +00:00
Remove silly warning in GetDocShell impls, and use the principal (which we
should always have) instead of the docshell for chrome vs content determination. Bug 51962, r+sr=jst
This commit is contained in:
parent
23e230a9ab
commit
594e733c16
@ -240,7 +240,6 @@ nsXBLDocGlobalObject::SetDocShell(nsIDocShell *aDocShell)
|
||||
nsIDocShell *
|
||||
nsXBLDocGlobalObject::GetDocShell()
|
||||
{
|
||||
NS_WARNING("waaah!");
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
|
@ -866,8 +866,6 @@ nsXULPDGlobalObject::SetDocShell(nsIDocShell *aDocShell)
|
||||
nsIDocShell *
|
||||
nsXULPDGlobalObject::GetDocShell()
|
||||
{
|
||||
NS_WARNING("waaah!");
|
||||
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
|
@ -231,20 +231,17 @@ NS_ScriptErrorReporter(JSContext *cx,
|
||||
if (errorObject != nsnull) {
|
||||
nsresult rv;
|
||||
|
||||
const char *category = nsnull;
|
||||
// Set category to XUL or content, if possible.
|
||||
if (docShell) {
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTI(do_QueryInterface(docShell, &rv));
|
||||
if (NS_SUCCEEDED(rv) && docShellTI) {
|
||||
PRInt32 docShellType;
|
||||
rv = docShellTI->GetItemType(&docShellType);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
category = docShellType == nsIDocShellTreeItem::typeChrome
|
||||
? "chrome javascript"
|
||||
: "content javascript";
|
||||
}
|
||||
}
|
||||
}
|
||||
// Set category to chrome or content
|
||||
nsCOMPtr<nsIScriptObjectPrincipal> scriptPrincipal =
|
||||
do_QueryInterface(globalObject);
|
||||
NS_ASSERTION(scriptPrincipal, "Global objects must implement "
|
||||
"nsIScriptObjectPrincipal");
|
||||
nsCOMPtr<nsIPrincipal> systemPrincipal;
|
||||
sSecurityManager->GetSystemPrincipal(getter_AddRefs(systemPrincipal));
|
||||
const char * category =
|
||||
scriptPrincipal->GetPrincipal() == systemPrincipal
|
||||
? "chrome javascript"
|
||||
: "content javascript";
|
||||
|
||||
if (report) {
|
||||
PRUint32 column = report->uctokenptr - report->uclinebuf;
|
||||
|
Loading…
x
Reference in New Issue
Block a user