зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 365053e73efa for build bustage on this CLOSED TREE.
This commit is contained in:
Родитель
ab43ff245b
Коммит
fb10bae2e6
|
@ -117,6 +117,7 @@
|
||||||
#include "nsWrapperCacheInlines.h"
|
#include "nsWrapperCacheInlines.h"
|
||||||
#include "xpcpublic.h"
|
#include "xpcpublic.h"
|
||||||
#include "nsIScriptError.h"
|
#include "nsIScriptError.h"
|
||||||
|
#include "nsLayoutStatics.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
|
|
||||||
#include "mozilla/CORSMode.h"
|
#include "mozilla/CORSMode.h"
|
||||||
|
|
|
@ -116,6 +116,7 @@
|
||||||
#include "nsCycleCollector.h"
|
#include "nsCycleCollector.h"
|
||||||
#include "xpcpublic.h"
|
#include "xpcpublic.h"
|
||||||
#include "nsIScriptError.h"
|
#include "nsIScriptError.h"
|
||||||
|
#include "nsLayoutStatics.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
|
|
||||||
#include "mozilla/CORSMode.h"
|
#include "mozilla/CORSMode.h"
|
||||||
|
@ -1040,19 +1041,21 @@ class ContentUnbinder : public nsRunnable
|
||||||
public:
|
public:
|
||||||
ContentUnbinder()
|
ContentUnbinder()
|
||||||
{
|
{
|
||||||
|
nsLayoutStatics::AddRef();
|
||||||
mLast = this;
|
mLast = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
~ContentUnbinder()
|
~ContentUnbinder()
|
||||||
{
|
{
|
||||||
Run();
|
Run();
|
||||||
|
nsLayoutStatics::Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnbindSubtree(nsIContent* aNode)
|
void UnbindSubtree(nsIContent* aNode)
|
||||||
{
|
{
|
||||||
if (aNode->NodeType() != nsIDOMNode::ELEMENT_NODE &&
|
if (aNode->NodeType() != nsIDOMNode::ELEMENT_NODE &&
|
||||||
aNode->NodeType() != nsIDOMNode::DOCUMENT_FRAGMENT_NODE) {
|
aNode->NodeType() != nsIDOMNode::DOCUMENT_FRAGMENT_NODE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
FragmentOrElement* container = static_cast<FragmentOrElement*>(aNode);
|
FragmentOrElement* container = static_cast<FragmentOrElement*>(aNode);
|
||||||
uint32_t childCount = container->mAttrsAndChildren.ChildCount();
|
uint32_t childCount = container->mAttrsAndChildren.ChildCount();
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "nsIPrompt.h"
|
#include "nsIPrompt.h"
|
||||||
#include "nsIStringBundle.h"
|
#include "nsIStringBundle.h"
|
||||||
#include "nsIConsoleService.h"
|
#include "nsIConsoleService.h"
|
||||||
|
#include "nsLayoutStatics.h"
|
||||||
#include "nsIDOMCloseEvent.h"
|
#include "nsIDOMCloseEvent.h"
|
||||||
#include "nsICryptoHash.h"
|
#include "nsICryptoHash.h"
|
||||||
#include "jsdbgapi.h"
|
#include "jsdbgapi.h"
|
||||||
|
@ -458,6 +459,7 @@ WebSocket::WebSocket()
|
||||||
mInnerWindowID(0)
|
mInnerWindowID(0)
|
||||||
{
|
{
|
||||||
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
|
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
|
||||||
|
nsLayoutStatics::AddRef();
|
||||||
|
|
||||||
SetIsDOMBinding();
|
SetIsDOMBinding();
|
||||||
}
|
}
|
||||||
|
@ -470,6 +472,7 @@ WebSocket::~WebSocket()
|
||||||
if (!mDisconnected) {
|
if (!mDisconnected) {
|
||||||
Disconnect();
|
Disconnect();
|
||||||
}
|
}
|
||||||
|
nsLayoutStatics::Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
JSObject*
|
JSObject*
|
||||||
|
|
|
@ -141,6 +141,7 @@
|
||||||
#include "nsIWordBreaker.h"
|
#include "nsIWordBreaker.h"
|
||||||
#include "nsIXPConnect.h"
|
#include "nsIXPConnect.h"
|
||||||
#include "nsJSUtils.h"
|
#include "nsJSUtils.h"
|
||||||
|
#include "nsLayoutStatics.h"
|
||||||
#include "nsLWBrkCIID.h"
|
#include "nsLWBrkCIID.h"
|
||||||
#include "nsMutationEvent.h"
|
#include "nsMutationEvent.h"
|
||||||
#include "nsNetCID.h"
|
#include "nsNetCID.h"
|
||||||
|
@ -5611,14 +5612,35 @@ nsContentUtils::WrapNative(JSContext *cx, JS::Handle<JSObject*> scope,
|
||||||
|
|
||||||
NS_ENSURE_TRUE(sXPConnect, NS_ERROR_UNEXPECTED);
|
NS_ENSURE_TRUE(sXPConnect, NS_ERROR_UNEXPECTED);
|
||||||
|
|
||||||
if (!NS_IsMainThread()) {
|
// Keep sXPConnect alive. If we're on the main
|
||||||
MOZ_CRASH();
|
// thread then this can be done simply and cheaply by adding a reference to
|
||||||
|
// nsLayoutStatics. If we're not on the main thread then we need to add a
|
||||||
|
// more expensive reference sXPConnect directly. We have to use manual
|
||||||
|
// AddRef and Release calls so don't early-exit from this function after we've
|
||||||
|
// added the reference!
|
||||||
|
bool isMainThread = NS_IsMainThread();
|
||||||
|
|
||||||
|
if (isMainThread) {
|
||||||
|
nsLayoutStatics::AddRef();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sXPConnect->AddRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
AutoPushJSContext context(cx);
|
{
|
||||||
rv = sXPConnect->WrapNativeToJSVal(context, scope, native, cache, aIID,
|
AutoPushJSContext context(cx);
|
||||||
aAllowWrapping, vp, aHolder);
|
rv = sXPConnect->WrapNativeToJSVal(context, scope, native, cache, aIID,
|
||||||
|
aAllowWrapping, vp, aHolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isMainThread) {
|
||||||
|
nsLayoutStatics::Release();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sXPConnect->Release();
|
||||||
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "nsCExternalHandlerService.h"
|
#include "nsCExternalHandlerService.h"
|
||||||
#include "nsIStreamConverterService.h"
|
#include "nsIStreamConverterService.h"
|
||||||
#include "nsCycleCollectionParticipant.h"
|
#include "nsCycleCollectionParticipant.h"
|
||||||
|
#include "nsLayoutStatics.h"
|
||||||
#include "nsIScriptObjectPrincipal.h"
|
#include "nsIScriptObjectPrincipal.h"
|
||||||
#include "nsHostObjectProtocolHandler.h"
|
#include "nsHostObjectProtocolHandler.h"
|
||||||
#include "mozilla/Base64.h"
|
#include "mozilla/Base64.h"
|
||||||
|
@ -104,6 +105,7 @@ nsDOMFileReader::nsDOMFileReader()
|
||||||
mDataLen(0), mDataFormat(FILE_AS_BINARY),
|
mDataLen(0), mDataFormat(FILE_AS_BINARY),
|
||||||
mResultArrayBuffer(nullptr)
|
mResultArrayBuffer(nullptr)
|
||||||
{
|
{
|
||||||
|
nsLayoutStatics::AddRef();
|
||||||
SetDOMStringToNull(mResult);
|
SetDOMStringToNull(mResult);
|
||||||
SetIsDOMBinding();
|
SetIsDOMBinding();
|
||||||
}
|
}
|
||||||
|
@ -113,6 +115,7 @@ nsDOMFileReader::~nsDOMFileReader()
|
||||||
FreeFileData();
|
FreeFileData();
|
||||||
mResultArrayBuffer = nullptr;
|
mResultArrayBuffer = nullptr;
|
||||||
NS_DROP_JS_OBJECTS(this, nsDOMFileReader);
|
NS_DROP_JS_OBJECTS(this, nsDOMFileReader);
|
||||||
|
nsLayoutStatics::Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,7 @@
|
||||||
#include "nsViewManager.h"
|
#include "nsViewManager.h"
|
||||||
#include "nsIWebNavigation.h"
|
#include "nsIWebNavigation.h"
|
||||||
#include "nsIWidget.h"
|
#include "nsIWidget.h"
|
||||||
|
#include "nsLayoutStatics.h"
|
||||||
#include "nsLayoutUtils.h"
|
#include "nsLayoutUtils.h"
|
||||||
#include "nsMutationEvent.h"
|
#include "nsMutationEvent.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include "nsIContentPolicy.h"
|
#include "nsIContentPolicy.h"
|
||||||
#include "nsContentPolicyUtils.h"
|
#include "nsContentPolicyUtils.h"
|
||||||
#include "nsError.h"
|
#include "nsError.h"
|
||||||
|
#include "nsLayoutStatics.h"
|
||||||
#include "nsCrossSiteListenerProxy.h"
|
#include "nsCrossSiteListenerProxy.h"
|
||||||
#include "nsIHTMLDocument.h"
|
#include "nsIHTMLDocument.h"
|
||||||
#include "nsIStorageStream.h"
|
#include "nsIStorageStream.h"
|
||||||
|
@ -301,6 +302,8 @@ nsXMLHttpRequest::nsXMLHttpRequest()
|
||||||
mResultArrayBuffer(nullptr),
|
mResultArrayBuffer(nullptr),
|
||||||
mXPCOMifier(nullptr)
|
mXPCOMifier(nullptr)
|
||||||
{
|
{
|
||||||
|
nsLayoutStatics::AddRef();
|
||||||
|
|
||||||
mAlreadySetHeaders.Init();
|
mAlreadySetHeaders.Init();
|
||||||
|
|
||||||
SetIsDOMBinding();
|
SetIsDOMBinding();
|
||||||
|
@ -324,6 +327,8 @@ nsXMLHttpRequest::~nsXMLHttpRequest()
|
||||||
mResultJSON = JSVAL_VOID;
|
mResultJSON = JSVAL_VOID;
|
||||||
mResultArrayBuffer = nullptr;
|
mResultArrayBuffer = nullptr;
|
||||||
NS_DROP_JS_OBJECTS(this, nsXMLHttpRequest);
|
NS_DROP_JS_OBJECTS(this, nsXMLHttpRequest);
|
||||||
|
|
||||||
|
nsLayoutStatics::Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "mozilla/dom/EventTarget.h"
|
#include "mozilla/dom/EventTarget.h"
|
||||||
#include "nsEventListenerManager.h"
|
#include "nsEventListenerManager.h"
|
||||||
#include "nsThreadUtils.h"
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#include "nsIScriptGlobalObject.h"
|
#include "nsIScriptGlobalObject.h"
|
||||||
#include "nsEventListenerManager.h"
|
#include "nsEventListenerManager.h"
|
||||||
#include "nsIScriptContext.h"
|
#include "nsIScriptContext.h"
|
||||||
#include "nsThreadUtils.h"
|
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
#include "mozilla/dom/EventTarget.h"
|
#include "mozilla/dom/EventTarget.h"
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "nsWrapperCache.h"
|
#include "nsWrapperCache.h"
|
||||||
#include "nsJSEnvironment.h"
|
#include "nsJSEnvironment.h"
|
||||||
#include "xpcpublic.h"
|
#include "xpcpublic.h"
|
||||||
|
#include "nsLayoutStatics.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
#include "ArchiveEvent.h"
|
#include "ArchiveEvent.h"
|
||||||
#include "ArchiveZipEvent.h"
|
#include "ArchiveZipEvent.h"
|
||||||
|
|
||||||
|
#include "nsLayoutStatics.h"
|
||||||
|
|
||||||
#include "nsIURI.h"
|
#include "nsIURI.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
|
|
||||||
|
@ -50,11 +52,13 @@ ArchiveReader::ArchiveReader(nsIDOMBlob* aBlob, nsPIDOMWindow* aWindow,
|
||||||
MOZ_ASSERT(aBlob);
|
MOZ_ASSERT(aBlob);
|
||||||
MOZ_ASSERT(aWindow);
|
MOZ_ASSERT(aWindow);
|
||||||
|
|
||||||
|
nsLayoutStatics::AddRef();
|
||||||
SetIsDOMBinding();
|
SetIsDOMBinding();
|
||||||
}
|
}
|
||||||
|
|
||||||
ArchiveReader::~ArchiveReader()
|
ArchiveReader::~ArchiveReader()
|
||||||
{
|
{
|
||||||
|
nsLayoutStatics::Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtual */ JSObject*
|
/* virtual */ JSObject*
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "mozilla/dom/ArchiveRequestBinding.h"
|
#include "mozilla/dom/ArchiveRequestBinding.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
#include "nsCxPusher.h"
|
#include "nsCxPusher.h"
|
||||||
|
#include "nsLayoutStatics.h"
|
||||||
#include "nsEventDispatcher.h"
|
#include "nsEventDispatcher.h"
|
||||||
|
|
||||||
USING_FILE_NAMESPACE
|
USING_FILE_NAMESPACE
|
||||||
|
@ -54,6 +55,7 @@ ArchiveRequest::ArchiveRequest(nsIDOMWindow* aWindow,
|
||||||
MOZ_ASSERT(aReader);
|
MOZ_ASSERT(aReader);
|
||||||
|
|
||||||
MOZ_COUNT_CTOR(ArchiveRequest);
|
MOZ_COUNT_CTOR(ArchiveRequest);
|
||||||
|
nsLayoutStatics::AddRef();
|
||||||
|
|
||||||
/* An event to make this request asynchronous: */
|
/* An event to make this request asynchronous: */
|
||||||
nsRefPtr<ArchiveRequestEvent> event = new ArchiveRequestEvent(this);
|
nsRefPtr<ArchiveRequestEvent> event = new ArchiveRequestEvent(this);
|
||||||
|
@ -63,6 +65,7 @@ ArchiveRequest::ArchiveRequest(nsIDOMWindow* aWindow,
|
||||||
ArchiveRequest::~ArchiveRequest()
|
ArchiveRequest::~ArchiveRequest()
|
||||||
{
|
{
|
||||||
MOZ_COUNT_DTOR(ArchiveRequest);
|
MOZ_COUNT_DTOR(ArchiveRequest);
|
||||||
|
nsLayoutStatics::Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#include "mozilla/dom/IDBIndexBinding.h"
|
#include "mozilla/dom/IDBIndexBinding.h"
|
||||||
#include "mozilla/dom/IDBObjectStoreBinding.h"
|
#include "mozilla/dom/IDBObjectStoreBinding.h"
|
||||||
#include "nsCycleCollectionParticipant.h"
|
#include "nsCycleCollectionParticipant.h"
|
||||||
#include "nsThreadUtils.h"
|
|
||||||
|
|
||||||
#include "mozilla/dom/indexedDB/IDBRequest.h"
|
#include "mozilla/dom/indexedDB/IDBRequest.h"
|
||||||
#include "mozilla/dom/indexedDB/IDBTransaction.h"
|
#include "mozilla/dom/indexedDB/IDBTransaction.h"
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#include "nsPIDOMWindow.h"
|
#include "nsPIDOMWindow.h"
|
||||||
#include "WorkerPrivate.h"
|
#include "WorkerPrivate.h"
|
||||||
#include "nsJSPrincipals.h"
|
#include "nsJSPrincipals.h"
|
||||||
#include "nsThreadUtils.h"
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include "mozilla/dom/PromiseResolver.h"
|
#include "mozilla/dom/PromiseResolver.h"
|
||||||
#include "mozilla/dom/PromiseBinding.h"
|
#include "mozilla/dom/PromiseBinding.h"
|
||||||
#include "mozilla/dom/Promise.h"
|
#include "mozilla/dom/Promise.h"
|
||||||
#include "nsThreadUtils.h"
|
|
||||||
#include "PromiseCallback.h"
|
#include "PromiseCallback.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
#include "mozilla/Services.h"
|
#include "mozilla/Services.h"
|
||||||
|
|
||||||
|
#include "nsLayoutStatics.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
#include "nsCxPusher.h"
|
#include "nsCxPusher.h"
|
||||||
#include "nsCCUncollectableMarker.h"
|
#include "nsCCUncollectableMarker.h"
|
||||||
|
|
|
@ -64,7 +64,6 @@
|
||||||
#include "nsCycleCollectionParticipant.h"
|
#include "nsCycleCollectionParticipant.h"
|
||||||
#include "nsCycleCollector.h"
|
#include "nsCycleCollector.h"
|
||||||
#include "nsDOMJSUtils.h"
|
#include "nsDOMJSUtils.h"
|
||||||
#include "nsThreadUtils.h"
|
|
||||||
#include "xpcpublic.h"
|
#include "xpcpublic.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче