From c5fb688d6a7030397a31b306a4f1a059c940d29d Mon Sep 17 00:00:00 2001 From: Barret Rennie Date: Wed, 10 Jul 2019 03:27:30 +0000 Subject: [PATCH] Bug 1289211 - Rename InfallibleTArray to nsTArray in dom/network/ r=Ehsan Differential Revision: https://phabricator.services.mozilla.com/D36947 --HG-- extra : moz-landing-system : lando --- dom/network/TCPSocket.cpp | 2 +- dom/network/TCPSocketChild.cpp | 5 ++--- dom/network/TCPSocketChild.h | 3 +-- dom/network/TCPSocketParent.cpp | 6 +++--- dom/network/UDPSocketChild.cpp | 4 ++-- dom/network/UDPSocketChild.h | 2 +- dom/network/UDPSocketParent.cpp | 6 +++--- dom/network/UDPSocketParent.h | 2 +- dom/network/interfaces/nsITCPSocketCallback.idl | 2 +- 9 files changed, 15 insertions(+), 17 deletions(-) diff --git a/dom/network/TCPSocket.cpp b/dom/network/TCPSocket.cpp index ba73f1a3a88e..11f44e46ce5f 100644 --- a/dom/network/TCPSocket.cpp +++ b/dom/network/TCPSocket.cpp @@ -481,7 +481,7 @@ TCPSocket::FireEvent(const nsAString& aType) { NS_IMETHODIMP TCPSocket::FireDataArrayEvent(const nsAString& aType, - const InfallibleTArray& buffer) { + const nsTArray& buffer) { AutoJSAPI api; if (NS_WARN_IF(!api.Init(GetOwnerGlobal()))) { return NS_ERROR_FAILURE; diff --git a/dom/network/TCPSocketChild.cpp b/dom/network/TCPSocketChild.cpp index ee78ce6d47e6..0c69deb16bc6 100644 --- a/dom/network/TCPSocketChild.cpp +++ b/dom/network/TCPSocketChild.cpp @@ -23,8 +23,7 @@ using mozilla::net::gNeckoChild; namespace IPC { -bool DeserializeArrayBuffer(JSContext* cx, - const InfallibleTArray& aBuffer, +bool DeserializeArrayBuffer(JSContext* cx, const nsTArray& aBuffer, JS::MutableHandle aVal) { mozilla::UniquePtr data( js_pod_arena_malloc(js::ArrayBufferContentsArena, @@ -187,7 +186,7 @@ nsresult TCPSocketChild::SendSend(const ArrayBuffer& aData, return NS_ERROR_OUT_OF_MEMORY; } - InfallibleTArray arr; + nsTArray arr; arr.SwapElements(fallibleArr); SendData(arr, aTrackingNumber); return NS_OK; diff --git a/dom/network/TCPSocketChild.h b/dom/network/TCPSocketChild.h index 5e8a046c70f3..0d2971076329 100644 --- a/dom/network/TCPSocketChild.h +++ b/dom/network/TCPSocketChild.h @@ -16,8 +16,7 @@ class nsITCPSocketCallback; namespace IPC { -bool DeserializeArrayBuffer(JSContext* cx, - const InfallibleTArray& aBuffer, +bool DeserializeArrayBuffer(JSContext* cx, const nsTArray& aBuffer, JS::MutableHandle aVal); } diff --git a/dom/network/TCPSocketParent.cpp b/dom/network/TCPSocketParent.cpp index 0222193c0c61..d41b630e7820 100644 --- a/dom/network/TCPSocketParent.cpp +++ b/dom/network/TCPSocketParent.cpp @@ -23,7 +23,7 @@ namespace IPC { // Defined in TCPSocketChild.cpp extern bool DeserializeArrayBuffer(JSContext* aCx, - const InfallibleTArray& aBuffer, + const nsTArray& aBuffer, JS::MutableHandle aVal); } // namespace IPC @@ -208,7 +208,7 @@ mozilla::ipc::IPCResult TCPSocketParent::RecvData( bool allowed; MOZ_ASSERT(aData.type() == SendableData::TArrayOfuint8_t, "Unsupported data type for filtering"); - const InfallibleTArray& data(aData.get_ArrayOfuint8_t()); + const nsTArray& data(aData.get_ArrayOfuint8_t()); nsresult nsrv = mFilter->FilterPacket(&addr, data.Elements(), data.Length(), nsISocketFilter::SF_OUTGOING, &allowed); @@ -271,7 +271,7 @@ void TCPSocketParent::FireEvent(const nsAString& aType, void TCPSocketParent::FireArrayBufferDataEvent(nsTArray& aBuffer, TCPReadyState aReadyState) { - InfallibleTArray arr; + nsTArray arr; arr.SwapElements(aBuffer); if (mFilter) { diff --git a/dom/network/UDPSocketChild.cpp b/dom/network/UDPSocketChild.cpp index 695fa61e29a0..88c60f661a1d 100644 --- a/dom/network/UDPSocketChild.cpp +++ b/dom/network/UDPSocketChild.cpp @@ -136,7 +136,7 @@ nsresult UDPSocketChild::SendDataInternal(const UDPSocketAddr& aAddr, return NS_ERROR_OUT_OF_MEMORY; } - InfallibleTArray array; + nsTArray array; array.SwapElements(fallibleArray); SendOutgoingData(array, aAddr); @@ -214,7 +214,7 @@ mozilla::ipc::IPCResult UDPSocketChild::RecvCallbackClosed() { } mozilla::ipc::IPCResult UDPSocketChild::RecvCallbackReceivedData( - const UDPAddressInfo& aAddressInfo, InfallibleTArray&& aData) { + const UDPAddressInfo& aAddressInfo, nsTArray&& aData) { UDPSOCKET_LOG(("%s: %s:%u length %zu", __FUNCTION__, aAddressInfo.addr().get(), aAddressInfo.port(), aData.Length())); diff --git a/dom/network/UDPSocketChild.h b/dom/network/UDPSocketChild.h index 4747bed5c6c2..226e75b86dfe 100644 --- a/dom/network/UDPSocketChild.h +++ b/dom/network/UDPSocketChild.h @@ -88,7 +88,7 @@ class UDPSocketChild : public mozilla::net::PUDPSocketChild, const UDPAddressInfo& aAddressInfo); mozilla::ipc::IPCResult RecvCallbackClosed(); mozilla::ipc::IPCResult RecvCallbackReceivedData( - const UDPAddressInfo& aAddressInfo, InfallibleTArray&& aData); + const UDPAddressInfo& aAddressInfo, nsTArray&& aData); mozilla::ipc::IPCResult RecvCallbackError(const nsCString& aMessage, const nsCString& aFilename, const uint32_t& aLineNumber); diff --git a/dom/network/UDPSocketParent.cpp b/dom/network/UDPSocketParent.cpp index 8c4e032f5263..43f2c85abbca 100644 --- a/dom/network/UDPSocketParent.cpp +++ b/dom/network/UDPSocketParent.cpp @@ -340,7 +340,7 @@ mozilla::ipc::IPCResult UDPSocketParent::RecvOutgoingData( } bool allowed; - const InfallibleTArray& data(aData.get_ArrayOfuint8_t()); + const nsTArray& data(aData.get_ArrayOfuint8_t()); rv = mFilter->FilterPacket(&aAddr.get_NetAddr(), data.Elements(), data.Length(), nsISocketFilter::SF_OUTGOING, &allowed); @@ -366,7 +366,7 @@ mozilla::ipc::IPCResult UDPSocketParent::RecvOutgoingData( return IPC_OK(); } -void UDPSocketParent::Send(const InfallibleTArray& aData, +void UDPSocketParent::Send(const nsTArray& aData, const UDPSocketAddr& aAddr) { nsresult rv; uint32_t count; @@ -527,7 +527,7 @@ UDPSocketParent::OnPacketReceived(nsIUDPSocket* aSocket, FireInternalError(__LINE__); return NS_ERROR_OUT_OF_MEMORY; } - InfallibleTArray infallibleArray; + nsTArray infallibleArray; infallibleArray.SwapElements(fallibleArray); // compose callback diff --git a/dom/network/UDPSocketParent.h b/dom/network/UDPSocketParent.h index 7427c0301a0d..7d0fd5922da6 100644 --- a/dom/network/UDPSocketParent.h +++ b/dom/network/UDPSocketParent.h @@ -58,7 +58,7 @@ class UDPSocketParent : public mozilla::net::PUDPSocketParent, virtual ~UDPSocketParent(); virtual void ActorDestroy(ActorDestroyReason why) override; - void Send(const InfallibleTArray& aData, const UDPSocketAddr& aAddr); + void Send(const nsTArray& aData, const UDPSocketAddr& aAddr); void Send(const IPCStream& aStream, const UDPSocketAddr& aAddr); nsresult BindInternal(const nsCString& aHost, const uint16_t& aPort, const bool& aAddressReuse, const bool& aLoopback, diff --git a/dom/network/interfaces/nsITCPSocketCallback.idl b/dom/network/interfaces/nsITCPSocketCallback.idl index 1c64b4c0fa1f..9c960a178168 100644 --- a/dom/network/interfaces/nsITCPSocketCallback.idl +++ b/dom/network/interfaces/nsITCPSocketCallback.idl @@ -14,7 +14,7 @@ %{C++ #include "nsTArrayForwardDeclare.h" %} -[ref] native nsUint8TArrayRef(InfallibleTArray); +[ref] native nsUint8TArrayRef(nsTArray); [ptr] native JSContextPtr(JSContext);