зеркало из https://github.com/mozilla/gecko-dev.git
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
This commit is contained in:
Родитель
bb885448d8
Коммит
c5fb688d6a
|
@ -481,7 +481,7 @@ TCPSocket::FireEvent(const nsAString& aType) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
TCPSocket::FireDataArrayEvent(const nsAString& aType,
|
||||
const InfallibleTArray<uint8_t>& buffer) {
|
||||
const nsTArray<uint8_t>& buffer) {
|
||||
AutoJSAPI api;
|
||||
if (NS_WARN_IF(!api.Init(GetOwnerGlobal()))) {
|
||||
return NS_ERROR_FAILURE;
|
||||
|
|
|
@ -23,8 +23,7 @@ using mozilla::net::gNeckoChild;
|
|||
|
||||
namespace IPC {
|
||||
|
||||
bool DeserializeArrayBuffer(JSContext* cx,
|
||||
const InfallibleTArray<uint8_t>& aBuffer,
|
||||
bool DeserializeArrayBuffer(JSContext* cx, const nsTArray<uint8_t>& aBuffer,
|
||||
JS::MutableHandle<JS::Value> aVal) {
|
||||
mozilla::UniquePtr<uint8_t[], JS::FreePolicy> data(
|
||||
js_pod_arena_malloc<uint8_t>(js::ArrayBufferContentsArena,
|
||||
|
@ -187,7 +186,7 @@ nsresult TCPSocketChild::SendSend(const ArrayBuffer& aData,
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
InfallibleTArray<uint8_t> arr;
|
||||
nsTArray<uint8_t> arr;
|
||||
arr.SwapElements(fallibleArr);
|
||||
SendData(arr, aTrackingNumber);
|
||||
return NS_OK;
|
||||
|
|
|
@ -16,8 +16,7 @@
|
|||
class nsITCPSocketCallback;
|
||||
|
||||
namespace IPC {
|
||||
bool DeserializeArrayBuffer(JSContext* cx,
|
||||
const InfallibleTArray<uint8_t>& aBuffer,
|
||||
bool DeserializeArrayBuffer(JSContext* cx, const nsTArray<uint8_t>& aBuffer,
|
||||
JS::MutableHandle<JS::Value> aVal);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace IPC {
|
|||
|
||||
// Defined in TCPSocketChild.cpp
|
||||
extern bool DeserializeArrayBuffer(JSContext* aCx,
|
||||
const InfallibleTArray<uint8_t>& aBuffer,
|
||||
const nsTArray<uint8_t>& aBuffer,
|
||||
JS::MutableHandle<JS::Value> 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<uint8_t>& data(aData.get_ArrayOfuint8_t());
|
||||
const nsTArray<uint8_t>& 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<uint8_t>& aBuffer,
|
||||
TCPReadyState aReadyState) {
|
||||
InfallibleTArray<uint8_t> arr;
|
||||
nsTArray<uint8_t> arr;
|
||||
arr.SwapElements(aBuffer);
|
||||
|
||||
if (mFilter) {
|
||||
|
|
|
@ -136,7 +136,7 @@ nsresult UDPSocketChild::SendDataInternal(const UDPSocketAddr& aAddr,
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
InfallibleTArray<uint8_t> array;
|
||||
nsTArray<uint8_t> 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<uint8_t>&& aData) {
|
||||
const UDPAddressInfo& aAddressInfo, nsTArray<uint8_t>&& aData) {
|
||||
UDPSOCKET_LOG(("%s: %s:%u length %zu", __FUNCTION__,
|
||||
aAddressInfo.addr().get(), aAddressInfo.port(),
|
||||
aData.Length()));
|
||||
|
|
|
@ -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<uint8_t>&& aData);
|
||||
const UDPAddressInfo& aAddressInfo, nsTArray<uint8_t>&& aData);
|
||||
mozilla::ipc::IPCResult RecvCallbackError(const nsCString& aMessage,
|
||||
const nsCString& aFilename,
|
||||
const uint32_t& aLineNumber);
|
||||
|
|
|
@ -340,7 +340,7 @@ mozilla::ipc::IPCResult UDPSocketParent::RecvOutgoingData(
|
|||
}
|
||||
|
||||
bool allowed;
|
||||
const InfallibleTArray<uint8_t>& data(aData.get_ArrayOfuint8_t());
|
||||
const nsTArray<uint8_t>& 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<uint8_t>& aData,
|
||||
void UDPSocketParent::Send(const nsTArray<uint8_t>& 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<uint8_t> infallibleArray;
|
||||
nsTArray<uint8_t> infallibleArray;
|
||||
infallibleArray.SwapElements(fallibleArray);
|
||||
|
||||
// compose callback
|
||||
|
|
|
@ -58,7 +58,7 @@ class UDPSocketParent : public mozilla::net::PUDPSocketParent,
|
|||
virtual ~UDPSocketParent();
|
||||
|
||||
virtual void ActorDestroy(ActorDestroyReason why) override;
|
||||
void Send(const InfallibleTArray<uint8_t>& aData, const UDPSocketAddr& aAddr);
|
||||
void Send(const nsTArray<uint8_t>& 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,
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
%{C++
|
||||
#include "nsTArrayForwardDeclare.h"
|
||||
%}
|
||||
[ref] native nsUint8TArrayRef(InfallibleTArray<uint8_t>);
|
||||
[ref] native nsUint8TArrayRef(nsTArray<uint8_t>);
|
||||
[ptr] native JSContextPtr(JSContext);
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче