diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/platform/p2p/ipc_socket_factory.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/platform/p2p/ipc_socket_factory.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/chromium/third_party/blink/renderer/platform/p2p/ipc_socket_factory.cc b/chromium/third_party/blink/renderer/platform/p2p/ipc_socket_factory.cc index 021d4e639a8..cc8c4238d4b 100644 --- a/chromium/third_party/blink/renderer/platform/p2p/ipc_socket_factory.cc +++ b/chromium/third_party/blink/renderer/platform/p2p/ipc_socket_factory.cc @@ -12,7 +12,6 @@ #include "base/compiler_specific.h" #include "base/logging.h" -#include "base/macros.h" #include "base/metrics/histogram_macros.h" #include "base/strings/stringprintf.h" #include "base/threading/thread_checker.h" @@ -77,6 +76,8 @@ class IpcPacketSocket : public rtc::AsyncPacketSocket, public blink::P2PSocketClientDelegate { public: IpcPacketSocket(); + IpcPacketSocket(const IpcPacketSocket&) = delete; + IpcPacketSocket& operator=(const IpcPacketSocket&) = delete; ~IpcPacketSocket() override; // Struct to track information when a packet is received by this socket for @@ -200,10 +201,8 @@ class IpcPacketSocket : public rtc::AsyncPacketSocket, size_t current_discard_bytes_sequence_; // Track the total number of packets and the number of packets discarded. - size_t packets_discarded_; - size_t total_packets_; - - DISALLOW_COPY_AND_ASSIGN(IpcPacketSocket); + int packets_discarded_; + int total_packets_; }; // Simple wrapper around P2PAsyncAddressResolver. The main purpose of this @@ -423,7 +422,8 @@ int IpcPacketSocket::SendTo(const void* data, send_bytes_available_ -= data_size; Vector<int8_t> data_vector; - data_vector.Append(reinterpret_cast<const int8_t*>(data), data_size); + data_vector.Append(reinterpret_cast<const int8_t*>(data), + base::checked_cast<wtf_size_t>(data_size)); uint64_t packet_id = client_->Send(address_chrome, data_vector, options); // Ensure packet_id is not 0. It can't be the case according to @@ -435,7 +435,7 @@ int IpcPacketSocket::SendTo(const void* data, TraceSendThrottlingState(); // Fake successful send. The caller ignores result anyway. - return data_size; + return base::checked_cast<int>(data_size); } int IpcPacketSocket::Close() { @@ -699,7 +699,7 @@ void AsyncAddressResolverImpl::Destroy(bool wait) { void AsyncAddressResolverImpl::OnAddressResolved( const Vector<net::IPAddress>& addresses) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - for (size_t i = 0; i < addresses.size(); ++i) { + for (wtf_size_t i = 0; i < addresses.size(); ++i) { rtc::SocketAddress socket_address; if (!jingle_glue::IPEndPointToSocketAddress( net::IPEndPoint(addresses[i], 0), &socket_address)) { |