mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 904826 - Remove some unneeded nsLayoutStatics calls. r=smaug,bholley,bz
This commit is contained in:
parent
bb164a9906
commit
d168e85a9e
@ -117,7 +117,6 @@
|
||||
#include "nsWrapperCacheInlines.h"
|
||||
#include "xpcpublic.h"
|
||||
#include "nsIScriptError.h"
|
||||
#include "nsLayoutStatics.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
#include "mozilla/CORSMode.h"
|
||||
|
@ -116,7 +116,6 @@
|
||||
#include "nsCycleCollector.h"
|
||||
#include "xpcpublic.h"
|
||||
#include "nsIScriptError.h"
|
||||
#include "nsLayoutStatics.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
#include "mozilla/CORSMode.h"
|
||||
@ -1041,21 +1040,19 @@ class ContentUnbinder : public nsRunnable
|
||||
public:
|
||||
ContentUnbinder()
|
||||
{
|
||||
nsLayoutStatics::AddRef();
|
||||
mLast = this;
|
||||
}
|
||||
|
||||
~ContentUnbinder()
|
||||
{
|
||||
Run();
|
||||
nsLayoutStatics::Release();
|
||||
}
|
||||
|
||||
void UnbindSubtree(nsIContent* aNode)
|
||||
{
|
||||
if (aNode->NodeType() != nsIDOMNode::ELEMENT_NODE &&
|
||||
aNode->NodeType() != nsIDOMNode::DOCUMENT_FRAGMENT_NODE) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
FragmentOrElement* container = static_cast<FragmentOrElement*>(aNode);
|
||||
uint32_t childCount = container->mAttrsAndChildren.ChildCount();
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "nsIPrompt.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsIConsoleService.h"
|
||||
#include "nsLayoutStatics.h"
|
||||
#include "nsIDOMCloseEvent.h"
|
||||
#include "nsICryptoHash.h"
|
||||
#include "jsdbgapi.h"
|
||||
@ -459,7 +458,6 @@ WebSocket::WebSocket()
|
||||
mInnerWindowID(0)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
|
||||
nsLayoutStatics::AddRef();
|
||||
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
@ -472,7 +470,6 @@ WebSocket::~WebSocket()
|
||||
if (!mDisconnected) {
|
||||
Disconnect();
|
||||
}
|
||||
nsLayoutStatics::Release();
|
||||
}
|
||||
|
||||
JSObject*
|
||||
|
@ -141,7 +141,6 @@
|
||||
#include "nsIWordBreaker.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsLayoutStatics.h"
|
||||
#include "nsLWBrkCIID.h"
|
||||
#include "nsMutationEvent.h"
|
||||
#include "nsNetCID.h"
|
||||
@ -5612,35 +5611,14 @@ nsContentUtils::WrapNative(JSContext *cx, JS::Handle<JSObject*> scope,
|
||||
|
||||
NS_ENSURE_TRUE(sXPConnect, NS_ERROR_UNEXPECTED);
|
||||
|
||||
// Keep sXPConnect alive. If we're on the main
|
||||
// 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();
|
||||
if (!NS_IsMainThread()) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
{
|
||||
AutoPushJSContext context(cx);
|
||||
rv = sXPConnect->WrapNativeToJSVal(context, scope, native, cache, aIID,
|
||||
aAllowWrapping, vp, aHolder);
|
||||
}
|
||||
|
||||
if (isMainThread) {
|
||||
nsLayoutStatics::Release();
|
||||
}
|
||||
else {
|
||||
sXPConnect->Release();
|
||||
}
|
||||
|
||||
AutoPushJSContext context(cx);
|
||||
rv = sXPConnect->WrapNativeToJSVal(context, scope, native, cache, aIID,
|
||||
aAllowWrapping, vp, aHolder);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "nsCExternalHandlerService.h"
|
||||
#include "nsIStreamConverterService.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsLayoutStatics.h"
|
||||
#include "nsIScriptObjectPrincipal.h"
|
||||
#include "nsHostObjectProtocolHandler.h"
|
||||
#include "mozilla/Base64.h"
|
||||
@ -105,7 +104,6 @@ nsDOMFileReader::nsDOMFileReader()
|
||||
mDataLen(0), mDataFormat(FILE_AS_BINARY),
|
||||
mResultArrayBuffer(nullptr)
|
||||
{
|
||||
nsLayoutStatics::AddRef();
|
||||
SetDOMStringToNull(mResult);
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
@ -115,7 +113,6 @@ nsDOMFileReader::~nsDOMFileReader()
|
||||
FreeFileData();
|
||||
mResultArrayBuffer = nullptr;
|
||||
NS_DROP_JS_OBJECTS(this, nsDOMFileReader);
|
||||
nsLayoutStatics::Release();
|
||||
}
|
||||
|
||||
|
||||
|
@ -76,7 +76,6 @@
|
||||
#include "nsViewManager.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsLayoutStatics.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsMutationEvent.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include "nsIContentPolicy.h"
|
||||
#include "nsContentPolicyUtils.h"
|
||||
#include "nsError.h"
|
||||
#include "nsLayoutStatics.h"
|
||||
#include "nsCrossSiteListenerProxy.h"
|
||||
#include "nsIHTMLDocument.h"
|
||||
#include "nsIStorageStream.h"
|
||||
@ -302,8 +301,6 @@ nsXMLHttpRequest::nsXMLHttpRequest()
|
||||
mResultArrayBuffer(nullptr),
|
||||
mXPCOMifier(nullptr)
|
||||
{
|
||||
nsLayoutStatics::AddRef();
|
||||
|
||||
mAlreadySetHeaders.Init();
|
||||
|
||||
SetIsDOMBinding();
|
||||
@ -327,8 +324,6 @@ nsXMLHttpRequest::~nsXMLHttpRequest()
|
||||
mResultJSON = JSVAL_VOID;
|
||||
mResultArrayBuffer = nullptr;
|
||||
NS_DROP_JS_OBJECTS(this, nsXMLHttpRequest);
|
||||
|
||||
nsLayoutStatics::Release();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "mozilla/dom/EventTarget.h"
|
||||
#include "nsEventListenerManager.h"
|
||||
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsEventListenerManager.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/EventTarget.h"
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "mozilla/Util.h"
|
||||
#include "nsCycleCollector.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "nsThreadUtils.h" // Hacky work around for some bindings needing NS_IsMainThread.
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "qsObjectHelper.h"
|
||||
#include "xpcpublic.h"
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "nsWrapperCache.h"
|
||||
#include "nsJSEnvironment.h"
|
||||
#include "xpcpublic.h"
|
||||
#include "nsLayoutStatics.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -9,8 +9,6 @@
|
||||
#include "ArchiveEvent.h"
|
||||
#include "ArchiveZipEvent.h"
|
||||
|
||||
#include "nsLayoutStatics.h"
|
||||
|
||||
#include "nsIURI.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
||||
@ -52,13 +50,11 @@ ArchiveReader::ArchiveReader(nsIDOMBlob* aBlob, nsPIDOMWindow* aWindow,
|
||||
MOZ_ASSERT(aBlob);
|
||||
MOZ_ASSERT(aWindow);
|
||||
|
||||
nsLayoutStatics::AddRef();
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
ArchiveReader::~ArchiveReader()
|
||||
{
|
||||
nsLayoutStatics::Release();
|
||||
}
|
||||
|
||||
/* virtual */ JSObject*
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "mozilla/dom/ArchiveRequestBinding.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsLayoutStatics.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
|
||||
USING_FILE_NAMESPACE
|
||||
@ -55,7 +54,6 @@ ArchiveRequest::ArchiveRequest(nsIDOMWindow* aWindow,
|
||||
MOZ_ASSERT(aReader);
|
||||
|
||||
MOZ_COUNT_CTOR(ArchiveRequest);
|
||||
nsLayoutStatics::AddRef();
|
||||
|
||||
/* An event to make this request asynchronous: */
|
||||
nsRefPtr<ArchiveRequestEvent> event = new ArchiveRequestEvent(this);
|
||||
@ -65,7 +63,6 @@ ArchiveRequest::ArchiveRequest(nsIDOMWindow* aWindow,
|
||||
ArchiveRequest::~ArchiveRequest()
|
||||
{
|
||||
MOZ_COUNT_DTOR(ArchiveRequest);
|
||||
nsLayoutStatics::Release();
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "mozilla/dom/IDBIndexBinding.h"
|
||||
#include "mozilla/dom/IDBObjectStoreBinding.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#include "mozilla/dom/indexedDB/IDBRequest.h"
|
||||
#include "mozilla/dom/indexedDB/IDBTransaction.h"
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "WorkerPrivate.h"
|
||||
#include "nsJSPrincipals.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "mozilla/dom/PromiseResolver.h"
|
||||
#include "mozilla/dom/PromiseBinding.h"
|
||||
#include "mozilla/dom/Promise.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "PromiseCallback.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/Services.h"
|
||||
|
||||
#include "nsLayoutStatics.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsCCUncollectableMarker.h"
|
||||
|
@ -64,6 +64,7 @@
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsCycleCollector.h"
|
||||
#include "nsDOMJSUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "xpcpublic.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
Loading…
Reference in New Issue
Block a user