Bug 865729 - Remove nsIJSContextStack from dom/foo. r=gabor

This commit is contained in:
Bobby Holley 2013-04-29 11:16:18 -07:00
parent 18707fd562
commit 8490fc8be1
18 changed files with 2 additions and 35 deletions

View File

@ -19,7 +19,6 @@
#include "nsIWebContentHandlerRegistrar.h"
#include "nsICookiePermission.h"
#include "nsIScriptSecurityManager.h"
#include "nsIJSContextStack.h"
#include "nsCharSeparatedTokenizer.h"
#include "nsContentUtils.h"
#include "nsUnicharUtils.h"
@ -76,8 +75,6 @@ DOMCI_DATA(Navigator, mozilla::dom::Navigator)
namespace mozilla {
namespace dom {
static const char sJSStackContractID[] = "@mozilla.org/js/xpc/ContextStack;1";
static bool sDoNotTrackEnabled = false;
static bool sVibratorEnabled = false;
static uint32_t sMaxVibrateMS = 0;
@ -892,11 +889,7 @@ Navigator::MozIsLocallyAvailable(const nsAString &aURI,
}
// Same origin check.
nsCOMPtr<nsIJSContextStack> stack = do_GetService(sJSStackContractID);
NS_ENSURE_TRUE(stack, NS_ERROR_FAILURE);
JSContext* cx = nullptr;
rv = stack->Peek(&cx);
JSContext *cx = nsContentUtils::GetCurrentJSContext();
NS_ENSURE_TRUE(cx, NS_ERROR_FAILURE);
rv = nsContentUtils::GetSecurityManager()->CheckSameOrigin(cx, uri);

View File

@ -26,7 +26,6 @@
#include "nsJSEnvironment.h"
#include "nsJSEventListener.h"
#include "nsGlobalWindow.h"
#include "nsIJSContextStack.h"
#include "nsISupportsPrimitives.h"
#include "nsDOMException.h"
#include "nsCRT.h"

View File

@ -429,7 +429,6 @@ nsGlobalWindow::DOMMinTimeoutValue() const {
// CIDs
static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID);
static const char sJSStackContractID[] = "@mozilla.org/js/xpc/ContextStack;1";
static const char sPopStatePrefStr[] = "browser.history.allowPopState";
#define NETWORK_UPLOAD_EVENT_NAME NS_LITERAL_STRING("moznetworkupload")

View File

@ -14,7 +14,6 @@
#include "nsDOMCID.h"
#include "nsIServiceManager.h"
#include "nsIXPConnect.h"
#include "nsIJSContextStack.h"
#include "nsIJSRuntimeService.h"
#include "nsCOMPtr.h"
#include "nsISupportsPrimitives.h"

View File

@ -25,7 +25,6 @@
#include "nsIDocument.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsIJSContextStack.h"
#include "nsXPIDLString.h"
#include "nsError.h"
#include "nsDOMClassInfoID.h"
@ -46,9 +45,6 @@ GetDocumentCharacterSetForURI(const nsAString& aHref, nsACString& aCharset)
nsresult rv;
nsCOMPtr<nsIJSContextStack> stack(do_GetService("@mozilla.org/js/xpc/ContextStack;1", &rv));
NS_ENSURE_SUCCESS(rv, rv);
JSContext *cx = nsContentUtils::GetCurrentJSContext();
if (cx) {
nsCOMPtr<nsIDOMWindow> window =

View File

@ -8,7 +8,6 @@
#include "nsStructuredCloneContainer.h"
#include "nsCOMPtr.h"
#include "nsIJSContextStack.h"
#include "nsIScriptContext.h"
#include "nsIVariant.h"
#include "nsIXPConnect.h"

View File

@ -6,8 +6,6 @@
#include "FileRequest.h"
#include "nsIJSContextStack.h"
#include "DOMFileRequest.h"
#include "nsContentUtils.h"
#include "nsEventDispatcher.h"

View File

@ -9,7 +9,6 @@
#include "nsIDOMFile.h"
#include "nsIDOMEvent.h"
#include "nsIIDBVersionChangeEvent.h"
#include "nsIJSContextStack.h"
#include "nsIXPConnect.h"
#include "mozilla/AppProcessChecker.h"
@ -394,8 +393,7 @@ IndexedDBDatabaseParent::HandleRequestEvent(nsIDOMEvent* aEvent,
nsIXPConnect* xpc = nsContentUtils::XPConnect();
MOZ_ASSERT(xpc);
JSContext* cx = nsContentUtils::ThreadJSContextStack()->GetSafeJSContext();
MOZ_ASSERT(cx);
SafeAutoJSContext cx;
nsCOMPtr<nsIXPConnectWrappedNative> wrapper;
rv = xpc->GetWrappedNativeOfJSObject(cx, JSVAL_TO_OBJECT(result),

View File

@ -49,7 +49,6 @@
#include "nsIDocShell.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIJSContextStack.h"
#include "nsIJSRuntimeService.h"
#include "nsISSLStatusProvider.h"
#include "nsIScriptContext.h"

View File

@ -27,8 +27,6 @@
#include "nsPluginsDir.h"
#include "nsPluginLogging.h"
#include "nsIJSContextStack.h"
#include "nsIDOMElement.h"
#include "nsPIDOMWindow.h"
#include "nsIDocument.h"

View File

@ -17,7 +17,6 @@
#include "nsVariant.h"
#include "nsIDOMBeforeUnloadEvent.h"
#include "nsGkAtoms.h"
#include "nsIJSContextStack.h"
#include "xpcpublic.h"
#include "nsJSEnvironment.h"
#include "nsDOMJSUtils.h"

View File

@ -8,10 +8,7 @@
#include "PCOMContentPermissionRequestChild.h"
#include "nsIPrincipal.h"
#include "nsIJSContextStack.h"
#include "nsIAlertsService.h"
#include "nsIContentPermissionPrompt.h"
#include "nsIObserver.h"

View File

@ -18,7 +18,6 @@
#include "nsIDOMLoadStatus.h"
#include "nsAutoPtr.h"
#include "nsContentUtils.h"
#include "nsIJSContextStack.h"
#include "nsEventDispatcher.h"
#include "nsIObserverService.h"
#include "nsIScriptGlobalObject.h"

View File

@ -17,7 +17,6 @@
#include "SystemWorkerManager.h"
#include "nsIJSContextStack.h"
#include "nsINetworkManager.h"
#include "nsIWifi.h"
#include "nsIWorkerHolder.h"

View File

@ -11,7 +11,6 @@
#include "mozilla/StaticPtr.h"
#include "nsCOMPtr.h"
#include "nsDebug.h"
#include "nsIJSContextStack.h"
#include "nsIObserver.h"
#include "nsIObserverService.h"
#include "nsISettingsService.h"

View File

@ -5,8 +5,6 @@
#include "DOMBindingBase.h"
#include "nsIJSContextStack.h"
#include "jsfriendapi.h"
#include "mozilla/dom/DOMJSClass.h"
#include "nsContentUtils.h"

View File

@ -14,7 +14,6 @@
#include "nsIObserverService.h"
#include "nsIPlatformCharset.h"
#include "nsIPrincipal.h"
#include "nsIJSContextStack.h"
#include "nsIScriptSecurityManager.h"
#include "nsISupportsPriority.h"
#include "nsITimer.h"

View File

@ -12,7 +12,6 @@
#include "nsIDOMFile.h"
#include "nsIDocument.h"
#include "nsIDocShell.h"
#include "nsIJSContextStack.h"
#include "nsIMemoryReporter.h"
#include "nsIPermissionManager.h"
#include "nsIScriptError.h"