mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
Bug 1647133 - P1. Use nsISerialEventTarget where it's actually that. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D80419
This commit is contained in:
parent
b894acb874
commit
d7b9a044db
@ -140,7 +140,8 @@ void FileSystemTaskChildBase::Start() {
|
||||
}
|
||||
|
||||
if (NS_IsMainThread()) {
|
||||
nsIEventTarget* target = mGlobalObject->EventTargetFor(TaskCategory::Other);
|
||||
nsISerialEventTarget* target =
|
||||
mGlobalObject->EventTargetFor(TaskCategory::Other);
|
||||
MOZ_ASSERT(target);
|
||||
|
||||
actor->SetEventTargetForActor(this, target);
|
||||
|
@ -265,7 +265,7 @@ Result<RefPtr<IDBFactory>, nsresult> IDBFactory::CreateInternal(
|
||||
auto factory = MakeRefPtr<IDBFactory>(IDBFactoryGuard{});
|
||||
factory->mPrincipalInfo = std::move(aPrincipalInfo);
|
||||
factory->mGlobal = aGlobal;
|
||||
factory->mEventTarget = GetCurrentThreadEventTarget();
|
||||
factory->mEventTarget = GetCurrentThreadSerialEventTarget();
|
||||
factory->mInnerWindowID = aInnerWindowID;
|
||||
|
||||
return factory;
|
||||
|
@ -19,8 +19,8 @@
|
||||
#include "nsWrapperCache.h"
|
||||
|
||||
class nsIGlobalObject;
|
||||
class nsIEventTarget;
|
||||
class nsIPrincipal;
|
||||
class nsISerialEventTarget;
|
||||
class nsPIDOMWindowInner;
|
||||
|
||||
namespace mozilla {
|
||||
@ -69,8 +69,8 @@ class IDBFactory final : public nsISupports, public nsWrapperCache {
|
||||
indexedDB::BackgroundFactoryChild* mBackgroundActor;
|
||||
|
||||
// It is either set to a DocGroup-specific EventTarget if created by
|
||||
// CreateForWindow() or set to GetCurrentThreadEventTarget() otherwise.
|
||||
nsCOMPtr<nsIEventTarget> mEventTarget;
|
||||
// CreateForWindow() or set to GetCurrentSerialEventTarget() otherwise.
|
||||
nsCOMPtr<nsISerialEventTarget> mEventTarget;
|
||||
|
||||
uint64_t mInnerWindowID;
|
||||
uint32_t mActiveTransactionCount;
|
||||
@ -99,7 +99,7 @@ class IDBFactory final : public nsISupports, public nsWrapperCache {
|
||||
|
||||
void AssertIsOnOwningThread() const { NS_ASSERT_OWNINGTHREAD(IDBFactory); }
|
||||
|
||||
nsIEventTarget* EventTarget() const {
|
||||
nsISerialEventTarget* EventTarget() const {
|
||||
AssertIsOnOwningThread();
|
||||
MOZ_RELEASE_ASSERT(mEventTarget);
|
||||
return mEventTarget;
|
||||
|
@ -59,7 +59,7 @@ nsresult TCPServerSocket::Init() {
|
||||
}
|
||||
|
||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
||||
nsCOMPtr<nsIEventTarget> target;
|
||||
nsCOMPtr<nsISerialEventTarget> target;
|
||||
if (nsCOMPtr<nsIGlobalObject> global = GetOwnerGlobal()) {
|
||||
target = global->EventTargetFor(TaskCategory::Other);
|
||||
}
|
||||
|
@ -39,11 +39,9 @@ NS_IMETHODIMP_(MozExternalRefCountType) TCPServerSocketChild::Release(void) {
|
||||
return refcnt;
|
||||
}
|
||||
|
||||
TCPServerSocketChild::TCPServerSocketChild(TCPServerSocket* aServerSocket,
|
||||
uint16_t aLocalPort,
|
||||
uint16_t aBacklog,
|
||||
bool aUseArrayBuffers,
|
||||
nsIEventTarget* aIPCEventTarget) {
|
||||
TCPServerSocketChild::TCPServerSocketChild(
|
||||
TCPServerSocket* aServerSocket, uint16_t aLocalPort, uint16_t aBacklog,
|
||||
bool aUseArrayBuffers, nsISerialEventTarget* aIPCEventTarget) {
|
||||
mServerSocket = aServerSocket;
|
||||
if (aIPCEventTarget) {
|
||||
gNeckoChild->SetEventTargetForActor(this, aIPCEventTarget);
|
||||
|
@ -48,7 +48,7 @@ class TCPServerSocketChild : public mozilla::net::PTCPServerSocketChild,
|
||||
|
||||
TCPServerSocketChild(TCPServerSocket* aServerSocket, uint16_t aLocalPort,
|
||||
uint16_t aBacklog, bool aUseArrayBuffers,
|
||||
nsIEventTarget* aIPCEventTarget);
|
||||
nsISerialEventTarget* aIPCEventTarget);
|
||||
~TCPServerSocketChild();
|
||||
|
||||
void Close();
|
||||
|
@ -177,7 +177,7 @@ nsresult TCPSocket::CreateStream() {
|
||||
do_QueryInterface(mSocketInputStream);
|
||||
NS_ENSURE_TRUE(asyncStream, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
nsCOMPtr<nsIEventTarget> mainTarget = GetMainThreadEventTarget();
|
||||
nsCOMPtr<nsISerialEventTarget> mainTarget = GetMainThreadSerialEventTarget();
|
||||
rv = asyncStream->AsyncWait(this, nsIAsyncInputStream::WAIT_CLOSURE_ONLY, 0,
|
||||
mainTarget);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -206,7 +206,7 @@ nsresult TCPSocket::InitWithUnconnectedTransport(
|
||||
|
||||
MOZ_ASSERT(XRE_GetProcessType() != GeckoProcessType_Content);
|
||||
|
||||
nsCOMPtr<nsIEventTarget> mainTarget = GetMainThreadEventTarget();
|
||||
nsCOMPtr<nsISerialEventTarget> mainTarget = GetMainThreadSerialEventTarget();
|
||||
mTransport->SetEventSink(this, mainTarget);
|
||||
|
||||
nsresult rv = CreateStream();
|
||||
@ -227,7 +227,7 @@ nsresult TCPSocket::Init() {
|
||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
||||
mReadyState = TCPReadyState::Connecting;
|
||||
|
||||
nsCOMPtr<nsIEventTarget> target;
|
||||
nsCOMPtr<nsISerialEventTarget> target;
|
||||
if (nsCOMPtr<nsIGlobalObject> global = GetOwnerGlobal()) {
|
||||
target = global->EventTargetFor(TaskCategory::Other);
|
||||
}
|
||||
@ -358,7 +358,7 @@ nsresult TCPSocket::EnsureCopying() {
|
||||
nsCOMPtr<nsISocketTransportService> sts =
|
||||
do_GetService("@mozilla.org/network/socket-transport-service;1");
|
||||
|
||||
nsCOMPtr<nsIEventTarget> target = do_QueryInterface(sts);
|
||||
nsCOMPtr<nsISerialEventTarget> target = do_QueryInterface(sts);
|
||||
rv = copier->Init(stream, mSocketOutputStream, target,
|
||||
true, /* source buffered */
|
||||
false, /* sink buffered */
|
||||
|
@ -83,7 +83,7 @@ NS_IMETHODIMP_(MozExternalRefCountType) TCPSocketChild::Release(void) {
|
||||
}
|
||||
|
||||
TCPSocketChild::TCPSocketChild(const nsAString& aHost, const uint16_t& aPort,
|
||||
nsIEventTarget* aTarget)
|
||||
nsISerialEventTarget* aTarget)
|
||||
: mHost(aHost), mPort(aPort), mIPCEventTarget(aTarget) {}
|
||||
|
||||
void TCPSocketChild::SendOpen(nsITCPSocketCallback* aSocket, bool aUseSSL,
|
||||
|
@ -47,7 +47,7 @@ class TCPSocketChild : public mozilla::net::PTCPSocketChild,
|
||||
NS_IMETHOD_(MozExternalRefCountType) Release() override;
|
||||
|
||||
TCPSocketChild(const nsAString& aHost, const uint16_t& aPort,
|
||||
nsIEventTarget* aTarget);
|
||||
nsISerialEventTarget* aTarget);
|
||||
~TCPSocketChild();
|
||||
|
||||
void SendOpen(nsITCPSocketCallback* aSocket, bool aUseSSL,
|
||||
@ -70,7 +70,7 @@ class TCPSocketChild : public mozilla::net::PTCPSocketChild,
|
||||
private:
|
||||
nsString mHost;
|
||||
uint16_t mPort;
|
||||
nsCOMPtr<nsIEventTarget> mIPCEventTarget;
|
||||
nsCOMPtr<nsISerialEventTarget> mIPCEventTarget;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
@ -479,7 +479,7 @@ nsresult UDPSocket::InitRemote(const nsAString& aLocalAddress,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIEventTarget> target;
|
||||
nsCOMPtr<nsISerialEventTarget> target;
|
||||
if (nsCOMPtr<nsIGlobalObject> global = GetOwnerGlobal()) {
|
||||
target = global->EventTargetFor(TaskCategory::Other);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ nsresult UDPSocketChild::Bind(nsIUDPSocketInternal* aSocket,
|
||||
uint16_t aPort, bool aAddressReuse,
|
||||
bool aLoopback, uint32_t recvBufferSize,
|
||||
uint32_t sendBufferSize,
|
||||
nsIEventTarget* aMainThreadEventTarget) {
|
||||
nsISerialEventTarget* aMainThreadEventTarget) {
|
||||
UDPSOCKET_LOG(
|
||||
("%s: %s:%u", __FUNCTION__, PromiseFlatCString(aHost).get(), aPort));
|
||||
|
||||
|
@ -60,7 +60,7 @@ class UDPSocketChild : public mozilla::net::PUDPSocketChild,
|
||||
const nsACString& aHost, uint16_t aPort, bool aAddressReuse,
|
||||
bool aLoopback, uint32_t recvBufferSize,
|
||||
uint32_t sendBufferSize,
|
||||
nsIEventTarget* aMainThreadEventTarget);
|
||||
nsISerialEventTarget* aMainThreadEventTarget);
|
||||
|
||||
// Tell the chrome process to connect the UDP socket to a given remote host
|
||||
// and port
|
||||
|
@ -2146,7 +2146,7 @@ nsresult PluginModuleParent::NPP_NewInternal(
|
||||
owner->GetDOMElement(getter_AddRefs(elt));
|
||||
if (elt) {
|
||||
RefPtr<dom::Document> doc = elt->OwnerDoc();
|
||||
nsCOMPtr<nsIEventTarget> eventTarget =
|
||||
nsCOMPtr<nsISerialEventTarget> eventTarget =
|
||||
doc->EventTargetFor(TaskCategory::Other);
|
||||
SetEventTargetForActor(parentInstance, eventTarget);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user