Backed out changeset 438598073b9b (bug 1474540) for assertion failure at ScriptSettings.cpp:493 on Android. CLOSED TREE

This commit is contained in:
Csoregi Natalia
2018-07-24 11:34:09 +03:00
parent 8b8ad65845
commit c8dab51568
3 changed files with 1 additions and 7 deletions

View File

@@ -19,8 +19,6 @@
#include "nsINode.h" #include "nsINode.h"
#include "nsIPrincipal.h" #include "nsIPrincipal.h"
#include "js/Wrapper.h"
using namespace mozilla::dom; using namespace mozilla::dom;
namespace mozilla { namespace mozilla {
@@ -186,7 +184,6 @@ nsBrowserElement::Download(const nsAString& aUrl,
RefPtr<DOMRequest> req; RefPtr<DOMRequest> req;
nsCOMPtr<nsIXPConnectWrappedJS> wrappedObj = do_QueryInterface(mBrowserElementAPI); nsCOMPtr<nsIXPConnectWrappedJS> wrappedObj = do_QueryInterface(mBrowserElementAPI);
MOZ_ASSERT(wrappedObj, "Failed to get wrapped JS from XPCOM component."); MOZ_ASSERT(wrappedObj, "Failed to get wrapped JS from XPCOM component.");
MOZ_RELEASE_ASSERT(!js::IsWrapper(wrappedObj->GetJSObject()));
AutoJSAPI jsapi; AutoJSAPI jsapi;
if (!jsapi.Init(wrappedObj->GetJSObject())) { if (!jsapi.Init(wrappedObj->GetJSObject())) {
aRv.Throw(NS_ERROR_UNEXPECTED); aRv.Throw(NS_ERROR_UNEXPECTED);
@@ -406,7 +403,6 @@ nsBrowserElement::ExecuteScript(const nsAString& aScript,
RefPtr<DOMRequest> req; RefPtr<DOMRequest> req;
nsCOMPtr<nsIXPConnectWrappedJS> wrappedObj = do_QueryInterface(mBrowserElementAPI); nsCOMPtr<nsIXPConnectWrappedJS> wrappedObj = do_QueryInterface(mBrowserElementAPI);
MOZ_ASSERT(wrappedObj, "Failed to get wrapped JS from XPCOM component."); MOZ_ASSERT(wrappedObj, "Failed to get wrapped JS from XPCOM component.");
MOZ_RELEASE_ASSERT(!js::IsWrapper(wrappedObj->GetJSObject()));
AutoJSAPI jsapi; AutoJSAPI jsapi;
if (!jsapi.Init(wrappedObj->GetJSObject())) { if (!jsapi.Init(wrappedObj->GetJSObject())) {
aRv.Throw(NS_ERROR_UNEXPECTED); aRv.Throw(NS_ERROR_UNEXPECTED);

View File

@@ -490,7 +490,6 @@ AutoJSAPI::Init(nsIGlobalObject* aGlobalObject)
bool bool
AutoJSAPI::Init(JSObject* aObject) AutoJSAPI::Init(JSObject* aObject)
{ {
MOZ_ASSERT(!js::IsCrossCompartmentWrapper(aObject));
return Init(xpc::NativeGlobal(aObject)); return Init(xpc::NativeGlobal(aObject));
} }

View File

@@ -228,8 +228,7 @@ public:
MOZ_MUST_USE bool Init(nsIGlobalObject* aGlobalObject); MOZ_MUST_USE bool Init(nsIGlobalObject* aGlobalObject);
// This is a helper that grabs the native global associated with aObject and // This is a helper that grabs the native global associated with aObject and
// invokes the above Init() with that. aObject must not be a cross-compartment // invokes the above Init() with that.
// wrapper: CCWs are not associated with a single global.
MOZ_MUST_USE bool Init(JSObject* aObject); MOZ_MUST_USE bool Init(JSObject* aObject);
// Unsurprisingly, this uses aCx and enters the compartment of aGlobalObject. // Unsurprisingly, this uses aCx and enters the compartment of aGlobalObject.