зеркало из 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
|
NS_IMETHODIMP
|
||||||
TCPSocket::FireDataArrayEvent(const nsAString& aType,
|
TCPSocket::FireDataArrayEvent(const nsAString& aType,
|
||||||
const InfallibleTArray<uint8_t>& buffer) {
|
const nsTArray<uint8_t>& buffer) {
|
||||||
AutoJSAPI api;
|
AutoJSAPI api;
|
||||||
if (NS_WARN_IF(!api.Init(GetOwnerGlobal()))) {
|
if (NS_WARN_IF(!api.Init(GetOwnerGlobal()))) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
|
@ -23,8 +23,7 @@ using mozilla::net::gNeckoChild;
|
||||||
|
|
||||||
namespace IPC {
|
namespace IPC {
|
||||||
|
|
||||||
bool DeserializeArrayBuffer(JSContext* cx,
|
bool DeserializeArrayBuffer(JSContext* cx, const nsTArray<uint8_t>& aBuffer,
|
||||||
const InfallibleTArray<uint8_t>& aBuffer,
|
|
||||||
JS::MutableHandle<JS::Value> aVal) {
|
JS::MutableHandle<JS::Value> aVal) {
|
||||||
mozilla::UniquePtr<uint8_t[], JS::FreePolicy> data(
|
mozilla::UniquePtr<uint8_t[], JS::FreePolicy> data(
|
||||||
js_pod_arena_malloc<uint8_t>(js::ArrayBufferContentsArena,
|
js_pod_arena_malloc<uint8_t>(js::ArrayBufferContentsArena,
|
||||||
|
@ -187,7 +186,7 @@ nsresult TCPSocketChild::SendSend(const ArrayBuffer& aData,
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
InfallibleTArray<uint8_t> arr;
|
nsTArray<uint8_t> arr;
|
||||||
arr.SwapElements(fallibleArr);
|
arr.SwapElements(fallibleArr);
|
||||||
SendData(arr, aTrackingNumber);
|
SendData(arr, aTrackingNumber);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
@ -16,8 +16,7 @@
|
||||||
class nsITCPSocketCallback;
|
class nsITCPSocketCallback;
|
||||||
|
|
||||||
namespace IPC {
|
namespace IPC {
|
||||||
bool DeserializeArrayBuffer(JSContext* cx,
|
bool DeserializeArrayBuffer(JSContext* cx, const nsTArray<uint8_t>& aBuffer,
|
||||||
const InfallibleTArray<uint8_t>& aBuffer,
|
|
||||||
JS::MutableHandle<JS::Value> aVal);
|
JS::MutableHandle<JS::Value> aVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace IPC {
|
||||||
|
|
||||||
// Defined in TCPSocketChild.cpp
|
// Defined in TCPSocketChild.cpp
|
||||||
extern bool DeserializeArrayBuffer(JSContext* aCx,
|
extern bool DeserializeArrayBuffer(JSContext* aCx,
|
||||||
const InfallibleTArray<uint8_t>& aBuffer,
|
const nsTArray<uint8_t>& aBuffer,
|
||||||
JS::MutableHandle<JS::Value> aVal);
|
JS::MutableHandle<JS::Value> aVal);
|
||||||
|
|
||||||
} // namespace IPC
|
} // namespace IPC
|
||||||
|
@ -208,7 +208,7 @@ mozilla::ipc::IPCResult TCPSocketParent::RecvData(
|
||||||
bool allowed;
|
bool allowed;
|
||||||
MOZ_ASSERT(aData.type() == SendableData::TArrayOfuint8_t,
|
MOZ_ASSERT(aData.type() == SendableData::TArrayOfuint8_t,
|
||||||
"Unsupported data type for filtering");
|
"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 =
|
nsresult nsrv =
|
||||||
mFilter->FilterPacket(&addr, data.Elements(), data.Length(),
|
mFilter->FilterPacket(&addr, data.Elements(), data.Length(),
|
||||||
nsISocketFilter::SF_OUTGOING, &allowed);
|
nsISocketFilter::SF_OUTGOING, &allowed);
|
||||||
|
@ -271,7 +271,7 @@ void TCPSocketParent::FireEvent(const nsAString& aType,
|
||||||
|
|
||||||
void TCPSocketParent::FireArrayBufferDataEvent(nsTArray<uint8_t>& aBuffer,
|
void TCPSocketParent::FireArrayBufferDataEvent(nsTArray<uint8_t>& aBuffer,
|
||||||
TCPReadyState aReadyState) {
|
TCPReadyState aReadyState) {
|
||||||
InfallibleTArray<uint8_t> arr;
|
nsTArray<uint8_t> arr;
|
||||||
arr.SwapElements(aBuffer);
|
arr.SwapElements(aBuffer);
|
||||||
|
|
||||||
if (mFilter) {
|
if (mFilter) {
|
||||||
|
|
|
@ -136,7 +136,7 @@ nsresult UDPSocketChild::SendDataInternal(const UDPSocketAddr& aAddr,
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
InfallibleTArray<uint8_t> array;
|
nsTArray<uint8_t> array;
|
||||||
array.SwapElements(fallibleArray);
|
array.SwapElements(fallibleArray);
|
||||||
|
|
||||||
SendOutgoingData(array, aAddr);
|
SendOutgoingData(array, aAddr);
|
||||||
|
@ -214,7 +214,7 @@ mozilla::ipc::IPCResult UDPSocketChild::RecvCallbackClosed() {
|
||||||
}
|
}
|
||||||
|
|
||||||
mozilla::ipc::IPCResult UDPSocketChild::RecvCallbackReceivedData(
|
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__,
|
UDPSOCKET_LOG(("%s: %s:%u length %zu", __FUNCTION__,
|
||||||
aAddressInfo.addr().get(), aAddressInfo.port(),
|
aAddressInfo.addr().get(), aAddressInfo.port(),
|
||||||
aData.Length()));
|
aData.Length()));
|
||||||
|
|
|
@ -88,7 +88,7 @@ class UDPSocketChild : public mozilla::net::PUDPSocketChild,
|
||||||
const UDPAddressInfo& aAddressInfo);
|
const UDPAddressInfo& aAddressInfo);
|
||||||
mozilla::ipc::IPCResult RecvCallbackClosed();
|
mozilla::ipc::IPCResult RecvCallbackClosed();
|
||||||
mozilla::ipc::IPCResult RecvCallbackReceivedData(
|
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,
|
mozilla::ipc::IPCResult RecvCallbackError(const nsCString& aMessage,
|
||||||
const nsCString& aFilename,
|
const nsCString& aFilename,
|
||||||
const uint32_t& aLineNumber);
|
const uint32_t& aLineNumber);
|
||||||
|
|
|
@ -340,7 +340,7 @@ mozilla::ipc::IPCResult UDPSocketParent::RecvOutgoingData(
|
||||||
}
|
}
|
||||||
|
|
||||||
bool allowed;
|
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(),
|
rv = mFilter->FilterPacket(&aAddr.get_NetAddr(), data.Elements(),
|
||||||
data.Length(), nsISocketFilter::SF_OUTGOING,
|
data.Length(), nsISocketFilter::SF_OUTGOING,
|
||||||
&allowed);
|
&allowed);
|
||||||
|
@ -366,7 +366,7 @@ mozilla::ipc::IPCResult UDPSocketParent::RecvOutgoingData(
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UDPSocketParent::Send(const InfallibleTArray<uint8_t>& aData,
|
void UDPSocketParent::Send(const nsTArray<uint8_t>& aData,
|
||||||
const UDPSocketAddr& aAddr) {
|
const UDPSocketAddr& aAddr) {
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
|
@ -527,7 +527,7 @@ UDPSocketParent::OnPacketReceived(nsIUDPSocket* aSocket,
|
||||||
FireInternalError(__LINE__);
|
FireInternalError(__LINE__);
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
InfallibleTArray<uint8_t> infallibleArray;
|
nsTArray<uint8_t> infallibleArray;
|
||||||
infallibleArray.SwapElements(fallibleArray);
|
infallibleArray.SwapElements(fallibleArray);
|
||||||
|
|
||||||
// compose callback
|
// compose callback
|
||||||
|
|
|
@ -58,7 +58,7 @@ class UDPSocketParent : public mozilla::net::PUDPSocketParent,
|
||||||
virtual ~UDPSocketParent();
|
virtual ~UDPSocketParent();
|
||||||
|
|
||||||
virtual void ActorDestroy(ActorDestroyReason why) override;
|
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);
|
void Send(const IPCStream& aStream, const UDPSocketAddr& aAddr);
|
||||||
nsresult BindInternal(const nsCString& aHost, const uint16_t& aPort,
|
nsresult BindInternal(const nsCString& aHost, const uint16_t& aPort,
|
||||||
const bool& aAddressReuse, const bool& aLoopback,
|
const bool& aAddressReuse, const bool& aLoopback,
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
%{C++
|
%{C++
|
||||||
#include "nsTArrayForwardDeclare.h"
|
#include "nsTArrayForwardDeclare.h"
|
||||||
%}
|
%}
|
||||||
[ref] native nsUint8TArrayRef(InfallibleTArray<uint8_t>);
|
[ref] native nsUint8TArrayRef(nsTArray<uint8_t>);
|
||||||
[ptr] native JSContextPtr(JSContext);
|
[ptr] native JSContextPtr(JSContext);
|
||||||
|
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче