mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Remove RTC_DISALLOW_COPY_AND_ASSIGN from rtc_base/
Bug: webrtc:13555, webrtc:13082 Change-Id: I406b7f04497562866ea3329e97c5adc96e927b6f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/245680 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Artem Titov <titovartem@webrtc.org> Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com> Cr-Commit-Position: refs/heads/main@{#35691}
This commit is contained in:
parent
ca15fcd37e
commit
14af7622a7
43 changed files with 203 additions and 151 deletions
|
@ -18,7 +18,6 @@
|
|||
#include "absl/base/attributes.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "rtc_base/async_invoker_inl.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/event.h"
|
||||
#include "rtc_base/ref_counted_object.h"
|
||||
#include "rtc_base/third_party/sigslot/sigslot.h"
|
||||
|
@ -94,6 +93,9 @@ class DEPRECATED_AsyncInvoker : public MessageHandlerAutoCleanup {
|
|||
DEPRECATED_AsyncInvoker();
|
||||
~DEPRECATED_AsyncInvoker() override;
|
||||
|
||||
DEPRECATED_AsyncInvoker(const DEPRECATED_AsyncInvoker&) = delete;
|
||||
DEPRECATED_AsyncInvoker& operator=(const DEPRECATED_AsyncInvoker&) = delete;
|
||||
|
||||
// Call `functor` asynchronously on `thread`, with no callback upon
|
||||
// completion. Returns immediately.
|
||||
template <class ReturnT, class FunctorT>
|
||||
|
@ -159,8 +161,6 @@ class DEPRECATED_AsyncInvoker : public MessageHandlerAutoCleanup {
|
|||
std::atomic<bool> destroying_;
|
||||
|
||||
friend class AsyncClosure;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(DEPRECATED_AsyncInvoker);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/dscp.h"
|
||||
#include "rtc_base/network/sent_packet.h"
|
||||
#include "rtc_base/socket.h"
|
||||
|
@ -69,6 +68,9 @@ class RTC_EXPORT AsyncPacketSocket : public sigslot::has_slots<> {
|
|||
AsyncPacketSocket();
|
||||
~AsyncPacketSocket() override;
|
||||
|
||||
AsyncPacketSocket(const AsyncPacketSocket&) = delete;
|
||||
AsyncPacketSocket& operator=(const AsyncPacketSocket&) = delete;
|
||||
|
||||
// Returns current local address. Address may be set to null if the
|
||||
// socket is not bound yet (GetState() returns STATE_BINDING).
|
||||
virtual SocketAddress GetLocalAddress() const = 0;
|
||||
|
@ -127,9 +129,6 @@ class RTC_EXPORT AsyncPacketSocket : public sigslot::has_slots<> {
|
|||
// Emitted for client TCP sockets when state is changed from
|
||||
// CONNECTED to CLOSED.
|
||||
sigslot::signal2<AsyncPacketSocket*, int> SignalClose;
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(AsyncPacketSocket);
|
||||
};
|
||||
|
||||
// Listen socket, producing an AsyncPacketSocket when a peer connects.
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
#include "rtc_base/async_packet_socket.h"
|
||||
#include "rtc_base/buffer.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/socket.h"
|
||||
#include "rtc_base/socket_address.h"
|
||||
|
||||
|
@ -31,6 +30,9 @@ class AsyncTCPSocketBase : public AsyncPacketSocket {
|
|||
AsyncTCPSocketBase(Socket* socket, size_t max_packet_size);
|
||||
~AsyncTCPSocketBase() override;
|
||||
|
||||
AsyncTCPSocketBase(const AsyncTCPSocketBase&) = delete;
|
||||
AsyncTCPSocketBase& operator=(const AsyncTCPSocketBase&) = delete;
|
||||
|
||||
// Pure virtual methods to send and recv data.
|
||||
int Send(const void* pv,
|
||||
size_t cb,
|
||||
|
@ -78,8 +80,6 @@ class AsyncTCPSocketBase : public AsyncPacketSocket {
|
|||
Buffer outbuf_;
|
||||
size_t max_insize_;
|
||||
size_t max_outsize_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(AsyncTCPSocketBase);
|
||||
};
|
||||
|
||||
class AsyncTCPSocket : public AsyncTCPSocketBase {
|
||||
|
@ -93,13 +93,13 @@ class AsyncTCPSocket : public AsyncTCPSocketBase {
|
|||
explicit AsyncTCPSocket(Socket* socket);
|
||||
~AsyncTCPSocket() override {}
|
||||
|
||||
AsyncTCPSocket(const AsyncTCPSocket&) = delete;
|
||||
AsyncTCPSocket& operator=(const AsyncTCPSocket&) = delete;
|
||||
|
||||
int Send(const void* pv,
|
||||
size_t cb,
|
||||
const rtc::PacketOptions& options) override;
|
||||
void ProcessInput(char* data, size_t* len) override;
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(AsyncTCPSocket);
|
||||
};
|
||||
|
||||
class AsyncTcpListenSocket : public AsyncListenSocket {
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
#include <stddef.h> // For size_t.
|
||||
#include <stdint.h> // For integer types.
|
||||
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
|
||||
namespace rtc {
|
||||
|
||||
// A BitBuffer API for write operations. Supports symmetric write APIs to the
|
||||
|
@ -27,6 +25,9 @@ class BitBufferWriter {
|
|||
// Constructs a bit buffer for the writable buffer of `bytes`.
|
||||
BitBufferWriter(uint8_t* bytes, size_t byte_count);
|
||||
|
||||
BitBufferWriter(const BitBufferWriter&) = delete;
|
||||
BitBufferWriter& operator=(const BitBufferWriter&) = delete;
|
||||
|
||||
// Gets the current offset, in bytes/bits, from the start of the buffer. The
|
||||
// bit offset is the offset into the current byte, in the range [0,7].
|
||||
void GetCurrentOffset(size_t* out_byte_offset, size_t* out_bit_offset);
|
||||
|
@ -80,8 +81,6 @@ class BitBufferWriter {
|
|||
size_t byte_offset_;
|
||||
// The current offset, in bits, into the current byte.
|
||||
size_t bit_offset_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(BitBufferWriter);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include <string>
|
||||
|
||||
#include "rtc_base/buffer.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/ssl_certificate.h"
|
||||
#include "rtc_base/ssl_identity.h"
|
||||
|
||||
|
@ -43,6 +42,9 @@ class BoringSSLCertificate final : public SSLCertificate {
|
|||
|
||||
~BoringSSLCertificate() override;
|
||||
|
||||
BoringSSLCertificate(const BoringSSLCertificate&) = delete;
|
||||
BoringSSLCertificate& operator=(const BoringSSLCertificate&) = delete;
|
||||
|
||||
std::unique_ptr<SSLCertificate> Clone() const override;
|
||||
|
||||
CRYPTO_BUFFER* cert_buffer() const { return cert_buffer_.get(); }
|
||||
|
@ -72,7 +74,6 @@ class BoringSSLCertificate final : public SSLCertificate {
|
|||
private:
|
||||
// A handle to the DER encoded certificate data.
|
||||
bssl::UniquePtr<CRYPTO_BUFFER> cert_buffer_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(BoringSSLCertificate);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <string>
|
||||
|
||||
#include "rtc_base/boringssl_certificate.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/openssl_key_pair.h"
|
||||
#include "rtc_base/ssl_certificate.h"
|
||||
#include "rtc_base/ssl_identity.h"
|
||||
|
@ -44,6 +43,9 @@ class BoringSSLIdentity final : public SSLIdentity {
|
|||
const std::string& certificate_chain);
|
||||
~BoringSSLIdentity() override;
|
||||
|
||||
BoringSSLIdentity(const BoringSSLIdentity&) = delete;
|
||||
BoringSSLIdentity& operator=(const BoringSSLIdentity&) = delete;
|
||||
|
||||
const BoringSSLCertificate& certificate() const override;
|
||||
const SSLCertChain& cert_chain() const override;
|
||||
|
||||
|
@ -67,8 +69,6 @@ class BoringSSLIdentity final : public SSLIdentity {
|
|||
|
||||
std::unique_ptr<OpenSSLKeyPair> key_pair_;
|
||||
std::unique_ptr<SSLCertChain> cert_chain_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(BoringSSLIdentity);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
#include "api/sequence_checker.h"
|
||||
#include "rtc_base/buffer.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/system/no_unique_address.h"
|
||||
#include "rtc_base/thread_annotations.h"
|
||||
|
||||
|
@ -30,6 +29,9 @@ class BufferQueue final {
|
|||
BufferQueue(size_t capacity, size_t default_size);
|
||||
~BufferQueue();
|
||||
|
||||
BufferQueue(const BufferQueue&) = delete;
|
||||
BufferQueue& operator=(const BufferQueue&) = delete;
|
||||
|
||||
// Return number of queued buffers.
|
||||
size_t size() const;
|
||||
|
||||
|
@ -61,8 +63,6 @@ class BufferQueue final {
|
|||
const size_t default_size_;
|
||||
std::deque<Buffer*> queue_ RTC_GUARDED_BY(sequence_checker_);
|
||||
std::vector<Buffer*> free_list_ RTC_GUARDED_BY(sequence_checker_);
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(BufferQueue);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
#include "rtc_base/buffer.h"
|
||||
#include "rtc_base/byte_order.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
|
||||
// Reads/Writes from/to buffer using network byte order (big endian)
|
||||
namespace rtc {
|
||||
|
@ -29,6 +28,9 @@ class ByteBufferWriterT {
|
|||
ByteBufferWriterT() { Construct(nullptr, kDefaultCapacity); }
|
||||
ByteBufferWriterT(const char* bytes, size_t len) { Construct(bytes, len); }
|
||||
|
||||
ByteBufferWriterT(const ByteBufferWriterT&) = delete;
|
||||
ByteBufferWriterT& operator=(const ByteBufferWriterT&) = delete;
|
||||
|
||||
const char* Data() const { return buffer_.data(); }
|
||||
size_t Length() const { return buffer_.size(); }
|
||||
size_t Capacity() const { return buffer_.capacity(); }
|
||||
|
@ -104,7 +106,6 @@ class ByteBufferWriterT {
|
|||
|
||||
// There are sensible ways to define these, but they aren't needed in our code
|
||||
// base.
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(ByteBufferWriterT);
|
||||
};
|
||||
|
||||
class ByteBufferWriter : public ByteBufferWriterT<BufferT<char>> {
|
||||
|
@ -112,8 +113,8 @@ class ByteBufferWriter : public ByteBufferWriterT<BufferT<char>> {
|
|||
ByteBufferWriter();
|
||||
ByteBufferWriter(const char* bytes, size_t len);
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(ByteBufferWriter);
|
||||
ByteBufferWriter(const ByteBufferWriter&) = delete;
|
||||
ByteBufferWriter& operator=(const ByteBufferWriter&) = delete;
|
||||
};
|
||||
|
||||
// The ByteBufferReader references the passed data, i.e. the pointer must be
|
||||
|
@ -129,6 +130,9 @@ class ByteBufferReader {
|
|||
|
||||
explicit ByteBufferReader(const ByteBufferWriter& buf);
|
||||
|
||||
ByteBufferReader(const ByteBufferReader&) = delete;
|
||||
ByteBufferReader& operator=(const ByteBufferReader&) = delete;
|
||||
|
||||
// Returns start of unprocessed data.
|
||||
const char* Data() const { return bytes_ + start_; }
|
||||
// Returns number of unprocessed bytes.
|
||||
|
@ -161,9 +165,6 @@ class ByteBufferReader {
|
|||
size_t size_;
|
||||
size_t start_;
|
||||
size_t end_;
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(ByteBufferReader);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#ifndef RTC_BASE_DEPRECATED_RECURSIVE_CRITICAL_SECTION_H_
|
||||
#define RTC_BASE_DEPRECATED_RECURSIVE_CRITICAL_SECTION_H_
|
||||
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/platform_thread_types.h"
|
||||
#include "rtc_base/thread_annotations.h"
|
||||
|
||||
|
@ -94,9 +93,11 @@ class RTC_SCOPED_LOCKABLE CritScope {
|
|||
RTC_EXCLUSIVE_LOCK_FUNCTION(cs);
|
||||
~CritScope() RTC_UNLOCK_FUNCTION();
|
||||
|
||||
CritScope(const CritScope&) = delete;
|
||||
CritScope& operator=(const CritScope&) = delete;
|
||||
|
||||
private:
|
||||
const RecursiveCriticalSection* const cs_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(CritScope);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/system/file_wrapper.h"
|
||||
|
||||
namespace rtc {
|
||||
|
@ -37,6 +36,9 @@ class FileRotatingStream {
|
|||
|
||||
virtual ~FileRotatingStream();
|
||||
|
||||
FileRotatingStream(const FileRotatingStream&) = delete;
|
||||
FileRotatingStream& operator=(const FileRotatingStream&) = delete;
|
||||
|
||||
bool IsOpen() const;
|
||||
|
||||
bool Write(const void* data, size_t data_len);
|
||||
|
@ -100,8 +102,6 @@ class FileRotatingStream {
|
|||
// buffering the file size read from disk might not be accurate.
|
||||
size_t current_bytes_written_;
|
||||
bool disable_buffering_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(FileRotatingStream);
|
||||
};
|
||||
|
||||
// CallSessionFileRotatingStream is meant to be used in situations where we will
|
||||
|
@ -130,6 +130,10 @@ class CallSessionFileRotatingStream : public FileRotatingStream {
|
|||
size_t max_total_log_size);
|
||||
~CallSessionFileRotatingStream() override {}
|
||||
|
||||
CallSessionFileRotatingStream(const CallSessionFileRotatingStream&) = delete;
|
||||
CallSessionFileRotatingStream& operator=(
|
||||
const CallSessionFileRotatingStream&) = delete;
|
||||
|
||||
protected:
|
||||
void OnRotation() override;
|
||||
|
||||
|
@ -140,8 +144,6 @@ class CallSessionFileRotatingStream : public FileRotatingStream {
|
|||
|
||||
const size_t max_total_log_size_;
|
||||
size_t num_rotations_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(CallSessionFileRotatingStream);
|
||||
};
|
||||
|
||||
// This is a convenience class, to read all files produced by a
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/file_rotating_stream.h"
|
||||
#include "rtc_base/logging.h"
|
||||
|
||||
|
@ -34,6 +33,9 @@ class FileRotatingLogSink : public LogSink {
|
|||
size_t num_log_files);
|
||||
~FileRotatingLogSink() override;
|
||||
|
||||
FileRotatingLogSink(const FileRotatingLogSink&) = delete;
|
||||
FileRotatingLogSink& operator=(const FileRotatingLogSink&) = delete;
|
||||
|
||||
// Writes the message to the current file. It will spill over to the next
|
||||
// file if needed.
|
||||
void OnLogMessage(const std::string& message) override;
|
||||
|
@ -52,8 +54,6 @@ class FileRotatingLogSink : public LogSink {
|
|||
|
||||
private:
|
||||
std::unique_ptr<FileRotatingStream> stream_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(FileRotatingLogSink);
|
||||
};
|
||||
|
||||
// Log sink that uses a CallSessionFileRotatingStream to write to disk.
|
||||
|
@ -64,8 +64,10 @@ class CallSessionFileRotatingLogSink : public FileRotatingLogSink {
|
|||
size_t max_total_log_size);
|
||||
~CallSessionFileRotatingLogSink() override;
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(CallSessionFileRotatingLogSink);
|
||||
CallSessionFileRotatingLogSink(const CallSessionFileRotatingLogSink&) =
|
||||
delete;
|
||||
CallSessionFileRotatingLogSink& operator=(
|
||||
const CallSessionFileRotatingLogSink&) = delete;
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
#include "absl/base/attributes.h"
|
||||
#include "absl/meta/type_traits.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "rtc_base/system/inline.h"
|
||||
|
||||
|
@ -443,6 +442,9 @@ class LogMessage {
|
|||
const std::string& tag);
|
||||
~LogMessage();
|
||||
|
||||
LogMessage(const LogMessage&) = delete;
|
||||
LogMessage& operator=(const LogMessage&) = delete;
|
||||
|
||||
void AddTag(const char* tag);
|
||||
rtc::StringBuilder& stream();
|
||||
// Returns the time at which this function was called for the first time.
|
||||
|
@ -602,8 +604,6 @@ class LogMessage {
|
|||
|
||||
// The stringbuilder that buffers the formatted message before output
|
||||
rtc::StringBuilder print_stream_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(LogMessage);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -29,6 +29,10 @@ class FifoBuffer final : public StreamInterface {
|
|||
// Creates a FIFO buffer with the specified capacity and owner
|
||||
FifoBuffer(size_t length, Thread* owner);
|
||||
~FifoBuffer() override;
|
||||
|
||||
FifoBuffer(const FifoBuffer&) = delete;
|
||||
FifoBuffer& operator=(const FifoBuffer&) = delete;
|
||||
|
||||
// Gets the amount of data currently readable from the buffer.
|
||||
bool GetBuffered(size_t* data_len) const;
|
||||
|
||||
|
@ -110,7 +114,6 @@ class FifoBuffer final : public StreamInterface {
|
|||
Thread* const owner_;
|
||||
// object lock
|
||||
mutable webrtc::Mutex mutex_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(FifoBuffer);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <utility>
|
||||
|
||||
#include "api/function_view.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace rtc {
|
||||
|
@ -37,11 +36,12 @@ class RTC_EXPORT MessageHandlerAutoCleanup : public MessageHandler {
|
|||
public:
|
||||
~MessageHandlerAutoCleanup() override;
|
||||
|
||||
MessageHandlerAutoCleanup(const MessageHandlerAutoCleanup&) = delete;
|
||||
MessageHandlerAutoCleanup& operator=(const MessageHandlerAutoCleanup&) =
|
||||
delete;
|
||||
|
||||
protected:
|
||||
MessageHandlerAutoCleanup();
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(MessageHandlerAutoCleanup);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include <set>
|
||||
|
||||
#include "rtc_base/async_udp_socket.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/nat_types.h"
|
||||
#include "rtc_base/proxy_server.h"
|
||||
#include "rtc_base/socket_address_pair.h"
|
||||
|
@ -69,6 +68,9 @@ class NATServer : public sigslot::has_slots<> {
|
|||
const SocketAddress& external_ip);
|
||||
~NATServer() override;
|
||||
|
||||
NATServer(const NATServer&) = delete;
|
||||
NATServer& operator=(const NATServer&) = delete;
|
||||
|
||||
SocketAddress internal_udp_address() const {
|
||||
return udp_server_socket_->GetLocalAddress();
|
||||
}
|
||||
|
@ -122,7 +124,6 @@ class NATServer : public sigslot::has_slots<> {
|
|||
ProxyServer* tcp_proxy_server_;
|
||||
InternalMap* int_map_;
|
||||
ExternalMap* ext_map_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(NATServer);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include <memory>
|
||||
#include <set>
|
||||
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/nat_server.h"
|
||||
#include "rtc_base/nat_types.h"
|
||||
#include "rtc_base/socket.h"
|
||||
|
@ -50,6 +49,9 @@ class NATSocketFactory : public SocketFactory, public NATInternalSocketFactory {
|
|||
const SocketAddress& nat_udp_addr,
|
||||
const SocketAddress& nat_tcp_addr);
|
||||
|
||||
NATSocketFactory(const NATSocketFactory&) = delete;
|
||||
NATSocketFactory& operator=(const NATSocketFactory&) = delete;
|
||||
|
||||
// SocketFactory implementation
|
||||
Socket* CreateSocket(int family, int type) override;
|
||||
|
||||
|
@ -63,7 +65,6 @@ class NATSocketFactory : public SocketFactory, public NATInternalSocketFactory {
|
|||
SocketFactory* factory_;
|
||||
SocketAddress nat_udp_addr_;
|
||||
SocketAddress nat_tcp_addr_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(NATSocketFactory);
|
||||
};
|
||||
|
||||
// Creates sockets that will send traffic through a NAT depending on what
|
||||
|
@ -135,6 +136,9 @@ class NATSocketServer : public SocketServer, public NATInternalSocketFactory {
|
|||
|
||||
explicit NATSocketServer(SocketServer* ss);
|
||||
|
||||
NATSocketServer(const NATSocketServer&) = delete;
|
||||
NATSocketServer& operator=(const NATSocketServer&) = delete;
|
||||
|
||||
SocketServer* socketserver() { return server_; }
|
||||
Thread* queue() { return msg_queue_; }
|
||||
|
||||
|
@ -161,7 +165,6 @@ class NATSocketServer : public SocketServer, public NATInternalSocketFactory {
|
|||
SocketServer* server_;
|
||||
Thread* msg_queue_;
|
||||
TranslatorMap nats_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(NATSocketServer);
|
||||
};
|
||||
|
||||
// Free-standing NAT helper functions.
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
#include "absl/types/optional.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
|
||||
namespace rtc {
|
||||
|
||||
|
@ -34,6 +33,10 @@ template <class T>
|
|||
class MovingMaxCounter {
|
||||
public:
|
||||
explicit MovingMaxCounter(int64_t window_length_ms);
|
||||
|
||||
MovingMaxCounter(const MovingMaxCounter&) = delete;
|
||||
MovingMaxCounter& operator=(const MovingMaxCounter&) = delete;
|
||||
|
||||
// Advances the current time, and adds a new sample. The new current time must
|
||||
// be at least as large as the old current time.
|
||||
void Add(const T& sample, int64_t current_time_ms);
|
||||
|
@ -57,7 +60,6 @@ class MovingMaxCounter {
|
|||
#if RTC_DCHECK_IS_ON
|
||||
int64_t last_call_time_ms_ = std::numeric_limits<int64_t>::min();
|
||||
#endif
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(MovingMaxCounter);
|
||||
};
|
||||
|
||||
template <class T>
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include <list>
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/numerics/percentile_filter.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -30,6 +29,9 @@ class MovingMedianFilter {
|
|||
// used to take median. `window_size` must be positive.
|
||||
explicit MovingMedianFilter(size_t window_size);
|
||||
|
||||
MovingMedianFilter(const MovingMedianFilter&) = delete;
|
||||
MovingMedianFilter& operator=(const MovingMedianFilter&) = delete;
|
||||
|
||||
// Insert a new sample.
|
||||
void Insert(const T& value);
|
||||
|
||||
|
@ -47,8 +49,6 @@ class MovingMedianFilter {
|
|||
std::list<T> samples_;
|
||||
size_t samples_stored_;
|
||||
const size_t window_size_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(MovingMedianFilter);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <random>
|
||||
|
||||
#include "absl/algorithm/container.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "test/gtest.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -30,11 +29,11 @@ class PercentileFilterTest : public ::testing::TestWithParam<float> {
|
|||
srand(42);
|
||||
}
|
||||
|
||||
PercentileFilterTest(const PercentileFilterTest&) = delete;
|
||||
PercentileFilterTest& operator=(const PercentileFilterTest&) = delete;
|
||||
|
||||
protected:
|
||||
PercentileFilter<int64_t> filter_;
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(PercentileFilterTest);
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(PercentileFilterTests,
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include <string>
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/ssl_identity.h"
|
||||
|
||||
namespace rtc {
|
||||
|
@ -39,6 +38,9 @@ class OpenSSLKeyPair final {
|
|||
|
||||
~OpenSSLKeyPair();
|
||||
|
||||
OpenSSLKeyPair(const OpenSSLKeyPair&) = delete;
|
||||
OpenSSLKeyPair& operator=(const OpenSSLKeyPair&) = delete;
|
||||
|
||||
std::unique_ptr<OpenSSLKeyPair> Clone();
|
||||
|
||||
EVP_PKEY* pkey() const { return pkey_; }
|
||||
|
@ -51,8 +53,6 @@ class OpenSSLKeyPair final {
|
|||
void AddReference();
|
||||
|
||||
EVP_PKEY* pkey_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLKeyPair);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/ssl_stream_adapter.h"
|
||||
|
||||
#ifndef OPENSSL_IS_BORINGSSL
|
||||
|
@ -36,6 +35,10 @@ class OpenSSLSessionCache final {
|
|||
OpenSSLSessionCache(SSLMode ssl_mode, SSL_CTX* ssl_ctx);
|
||||
// Frees the cached SSL_SESSIONS and then frees the SSL_CTX.
|
||||
~OpenSSLSessionCache();
|
||||
|
||||
OpenSSLSessionCache(const OpenSSLSessionCache&) = delete;
|
||||
OpenSSLSessionCache& operator=(const OpenSSLSessionCache&) = delete;
|
||||
|
||||
// Looks up a session by hostname. The returned SSL_SESSION is not up_refed.
|
||||
SSL_SESSION* LookupSession(const std::string& hostname) const;
|
||||
// Adds a session to the cache, and up_refs it. Any existing session with the
|
||||
|
@ -60,7 +63,6 @@ class OpenSSLSessionCache final {
|
|||
// TODO(juberti): Add LRU eviction to keep the cache from growing forever.
|
||||
std::map<std::string, SSL_SESSION*> sessions_;
|
||||
// The cache should never be copied or assigned directly.
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLSessionCache);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "api/scoped_refptr.h"
|
||||
#include "api/sequence_checker.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/ref_count.h"
|
||||
#include "rtc_base/ref_counted_object.h"
|
||||
#include "rtc_base/system/no_unique_address.h"
|
||||
|
@ -119,6 +118,9 @@ class OperationsChain final : public RefCountedNonVirtual<OperationsChain> {
|
|||
static scoped_refptr<OperationsChain> Create();
|
||||
~OperationsChain();
|
||||
|
||||
OperationsChain(const OperationsChain&) = delete;
|
||||
OperationsChain& operator=(const OperationsChain&) = delete;
|
||||
|
||||
void SetOnChainEmptyCallback(std::function<void()> on_chain_empty_callback);
|
||||
bool IsEmpty() const;
|
||||
|
||||
|
@ -169,6 +171,9 @@ class OperationsChain final : public RefCountedNonVirtual<OperationsChain> {
|
|||
explicit CallbackHandle(scoped_refptr<OperationsChain> operations_chain);
|
||||
~CallbackHandle();
|
||||
|
||||
CallbackHandle(const CallbackHandle&) = delete;
|
||||
CallbackHandle& operator=(const CallbackHandle&) = delete;
|
||||
|
||||
void OnOperationComplete();
|
||||
|
||||
private:
|
||||
|
@ -176,8 +181,6 @@ class OperationsChain final : public RefCountedNonVirtual<OperationsChain> {
|
|||
#if RTC_DCHECK_IS_ON
|
||||
bool has_run_ = false;
|
||||
#endif // RTC_DCHECK_IS_ON
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(CallbackHandle);
|
||||
};
|
||||
|
||||
OperationsChain();
|
||||
|
@ -193,8 +196,6 @@ class OperationsChain final : public RefCountedNonVirtual<OperationsChain> {
|
|||
chained_operations_ RTC_GUARDED_BY(sequence_checker_);
|
||||
absl::optional<std::function<void()>> on_chain_empty_callback_
|
||||
RTC_GUARDED_BY(sequence_checker_);
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(OperationsChain);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -219,6 +219,9 @@ class SignalOnDestruction final {
|
|||
}
|
||||
}
|
||||
|
||||
SignalOnDestruction(const SignalOnDestruction&) = delete;
|
||||
SignalOnDestruction& operator=(const SignalOnDestruction&) = delete;
|
||||
|
||||
// Move operators.
|
||||
SignalOnDestruction(SignalOnDestruction&& other)
|
||||
: SignalOnDestruction(other.destructor_called_) {
|
||||
|
@ -232,8 +235,6 @@ class SignalOnDestruction final {
|
|||
|
||||
private:
|
||||
bool* destructor_called_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(SignalOnDestruction);
|
||||
};
|
||||
|
||||
TEST(OperationsChainTest, SynchronousOperation) {
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/memory/fifo_buffer.h"
|
||||
#include "rtc_base/server_socket_adapters.h"
|
||||
#include "rtc_base/socket.h"
|
||||
|
@ -36,6 +35,10 @@ class ProxyBinding : public sigslot::has_slots<> {
|
|||
public:
|
||||
ProxyBinding(AsyncProxyServerSocket* in_socket, Socket* out_socket);
|
||||
~ProxyBinding() override;
|
||||
|
||||
ProxyBinding(const ProxyBinding&) = delete;
|
||||
ProxyBinding& operator=(const ProxyBinding&) = delete;
|
||||
|
||||
sigslot::signal1<ProxyBinding*> SignalDestroyed;
|
||||
|
||||
private:
|
||||
|
@ -59,7 +62,6 @@ class ProxyBinding : public sigslot::has_slots<> {
|
|||
bool connected_;
|
||||
FifoBuffer out_buffer_;
|
||||
FifoBuffer in_buffer_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(ProxyBinding);
|
||||
};
|
||||
|
||||
class ProxyServer : public sigslot::has_slots<> {
|
||||
|
@ -70,6 +72,9 @@ class ProxyServer : public sigslot::has_slots<> {
|
|||
const SocketAddress& ext_ip);
|
||||
~ProxyServer() override;
|
||||
|
||||
ProxyServer(const ProxyServer&) = delete;
|
||||
ProxyServer& operator=(const ProxyServer&) = delete;
|
||||
|
||||
// Returns the address to which the proxy server is bound
|
||||
SocketAddress GetServerAddress();
|
||||
|
||||
|
@ -82,7 +87,6 @@ class ProxyServer : public sigslot::has_slots<> {
|
|||
SocketAddress ext_ip_;
|
||||
std::unique_ptr<Socket> server_socket_;
|
||||
std::vector<std::unique_ptr<ProxyBinding>> bindings_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(ProxyServer);
|
||||
};
|
||||
|
||||
// SocksProxyServer is a simple extension of ProxyServer to implement SOCKS.
|
||||
|
@ -94,9 +98,11 @@ class SocksProxyServer : public ProxyServer {
|
|||
const SocketAddress& ext_ip)
|
||||
: ProxyServer(int_factory, int_addr, ext_factory, ext_ip) {}
|
||||
|
||||
SocksProxyServer(const SocksProxyServer&) = delete;
|
||||
SocksProxyServer& operator=(const SocksProxyServer&) = delete;
|
||||
|
||||
protected:
|
||||
AsyncProxyServerSocket* WrapSocket(Socket* socket) override;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(SocksProxyServer);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <utility>
|
||||
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/ref_count.h"
|
||||
#include "rtc_base/ref_counter.h"
|
||||
|
||||
|
@ -42,6 +41,9 @@ class RefCountedObject : public T {
|
|||
public:
|
||||
RefCountedObject() {}
|
||||
|
||||
RefCountedObject(const RefCountedObject&) = delete;
|
||||
RefCountedObject& operator=(const RefCountedObject&) = delete;
|
||||
|
||||
template <class P0>
|
||||
explicit RefCountedObject(P0&& p0) : T(std::forward<P0>(p0)) {}
|
||||
|
||||
|
@ -73,8 +75,6 @@ class RefCountedObject : public T {
|
|||
~RefCountedObject() override {}
|
||||
|
||||
mutable webrtc::webrtc_impl::RefCounter ref_count_{0};
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(RefCountedObject);
|
||||
};
|
||||
|
||||
template <class T>
|
||||
|
|
|
@ -27,8 +27,8 @@ class A {
|
|||
public:
|
||||
A() {}
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(A);
|
||||
A(const A&) = delete;
|
||||
A& operator=(const A&) = delete;
|
||||
};
|
||||
|
||||
class RefClass : public RefCountInterface {
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/numerics/running_statistics.h"
|
||||
|
||||
namespace rtc {
|
||||
|
@ -35,6 +34,9 @@ class RollingAccumulator {
|
|||
}
|
||||
~RollingAccumulator() {}
|
||||
|
||||
RollingAccumulator(const RollingAccumulator&) = delete;
|
||||
RollingAccumulator& operator=(const RollingAccumulator&) = delete;
|
||||
|
||||
size_t max_count() const { return samples_.size(); }
|
||||
|
||||
size_t count() const { return static_cast<size_t>(stats_.Size()); }
|
||||
|
@ -136,8 +138,6 @@ class RollingAccumulator {
|
|||
mutable T min_;
|
||||
mutable bool min_stale_;
|
||||
std::vector<T> samples_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(RollingAccumulator);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -31,9 +31,11 @@ class AsyncSSLServerSocket : public BufferedReadAdapter {
|
|||
public:
|
||||
explicit AsyncSSLServerSocket(Socket* socket);
|
||||
|
||||
AsyncSSLServerSocket(const AsyncSSLServerSocket&) = delete;
|
||||
AsyncSSLServerSocket& operator=(const AsyncSSLServerSocket&) = delete;
|
||||
|
||||
protected:
|
||||
void ProcessInput(char* data, size_t* len) override;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(AsyncSSLServerSocket);
|
||||
};
|
||||
|
||||
// Implements a proxy server socket for the SOCKS protocol.
|
||||
|
@ -41,6 +43,10 @@ class AsyncSocksProxyServerSocket : public AsyncProxyServerSocket {
|
|||
public:
|
||||
explicit AsyncSocksProxyServerSocket(Socket* socket);
|
||||
|
||||
AsyncSocksProxyServerSocket(const AsyncSocksProxyServerSocket&) = delete;
|
||||
AsyncSocksProxyServerSocket& operator=(const AsyncSocksProxyServerSocket&) =
|
||||
delete;
|
||||
|
||||
private:
|
||||
void ProcessInput(char* data, size_t* len) override;
|
||||
void DirectSend(const ByteBufferWriter& buf);
|
||||
|
@ -64,7 +70,6 @@ class AsyncSocksProxyServerSocket : public AsyncProxyServerSocket {
|
|||
SS_ERROR
|
||||
};
|
||||
State state_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(AsyncSocksProxyServerSocket);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
// EXPECT_EQ("hello", capture);
|
||||
// /* See unit-tests for more examples */
|
||||
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/third_party/sigslot/sigslot.h"
|
||||
|
||||
namespace rtc {
|
||||
|
@ -50,13 +49,14 @@ class SigslotTester0 : public sigslot::has_slots<> {
|
|||
signal->connect(this, &SigslotTester0::OnSignalCallback);
|
||||
}
|
||||
|
||||
SigslotTester0(const SigslotTester0&) = delete;
|
||||
SigslotTester0& operator=(const SigslotTester0&) = delete;
|
||||
|
||||
int callback_count() const { return callback_count_; }
|
||||
|
||||
private:
|
||||
void OnSignalCallback() { callback_count_++; }
|
||||
int callback_count_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester0);
|
||||
};
|
||||
|
||||
// Versions below are for testing signals that pass arguments. For all the
|
||||
|
@ -74,6 +74,9 @@ class SigslotTester1 : public sigslot::has_slots<> {
|
|||
signal->connect(this, &SigslotTester1::OnSignalCallback);
|
||||
}
|
||||
|
||||
SigslotTester1(const SigslotTester1&) = delete;
|
||||
SigslotTester1& operator=(const SigslotTester1&) = delete;
|
||||
|
||||
int callback_count() const { return callback_count_; }
|
||||
|
||||
private:
|
||||
|
@ -84,8 +87,6 @@ class SigslotTester1 : public sigslot::has_slots<> {
|
|||
|
||||
int callback_count_;
|
||||
C1* capture1_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester1);
|
||||
};
|
||||
|
||||
template <class A1, class A2, class C1, class C2>
|
||||
|
@ -96,6 +97,9 @@ class SigslotTester2 : public sigslot::has_slots<> {
|
|||
signal->connect(this, &SigslotTester2::OnSignalCallback);
|
||||
}
|
||||
|
||||
SigslotTester2(const SigslotTester2&) = delete;
|
||||
SigslotTester2& operator=(const SigslotTester2&) = delete;
|
||||
|
||||
int callback_count() const { return callback_count_; }
|
||||
|
||||
private:
|
||||
|
@ -108,8 +112,6 @@ class SigslotTester2 : public sigslot::has_slots<> {
|
|||
int callback_count_;
|
||||
C1* capture1_;
|
||||
C2* capture2_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester2);
|
||||
};
|
||||
|
||||
template <class A1, class A2, class A3, class C1, class C2, class C3>
|
||||
|
@ -126,6 +128,9 @@ class SigslotTester3 : public sigslot::has_slots<> {
|
|||
signal->connect(this, &SigslotTester3::OnSignalCallback);
|
||||
}
|
||||
|
||||
SigslotTester3(const SigslotTester3&) = delete;
|
||||
SigslotTester3& operator=(const SigslotTester3&) = delete;
|
||||
|
||||
int callback_count() const { return callback_count_; }
|
||||
|
||||
private:
|
||||
|
@ -140,8 +145,6 @@ class SigslotTester3 : public sigslot::has_slots<> {
|
|||
C1* capture1_;
|
||||
C2* capture2_;
|
||||
C3* capture3_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester3);
|
||||
};
|
||||
|
||||
template <class A1,
|
||||
|
@ -167,6 +170,9 @@ class SigslotTester4 : public sigslot::has_slots<> {
|
|||
signal->connect(this, &SigslotTester4::OnSignalCallback);
|
||||
}
|
||||
|
||||
SigslotTester4(const SigslotTester4&) = delete;
|
||||
SigslotTester4& operator=(const SigslotTester4&) = delete;
|
||||
|
||||
int callback_count() const { return callback_count_; }
|
||||
|
||||
private:
|
||||
|
@ -183,8 +189,6 @@ class SigslotTester4 : public sigslot::has_slots<> {
|
|||
C2* capture2_;
|
||||
C3* capture3_;
|
||||
C4* capture4_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester4);
|
||||
};
|
||||
|
||||
template <class A1,
|
||||
|
@ -214,6 +218,9 @@ class SigslotTester5 : public sigslot::has_slots<> {
|
|||
signal->connect(this, &SigslotTester5::OnSignalCallback);
|
||||
}
|
||||
|
||||
SigslotTester5(const SigslotTester5&) = delete;
|
||||
SigslotTester5& operator=(const SigslotTester5&) = delete;
|
||||
|
||||
int callback_count() const { return callback_count_; }
|
||||
|
||||
private:
|
||||
|
@ -232,8 +239,6 @@ class SigslotTester5 : public sigslot::has_slots<> {
|
|||
C3* capture3_;
|
||||
C4* capture4_;
|
||||
C5* capture5_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester5);
|
||||
};
|
||||
} // namespace rtc
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "rtc_base/win32.h"
|
||||
#endif
|
||||
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/socket_address.h"
|
||||
#include "rtc_base/third_party/sigslot/sigslot.h"
|
||||
|
||||
|
@ -83,6 +82,9 @@ class Socket {
|
|||
public:
|
||||
virtual ~Socket() {}
|
||||
|
||||
Socket(const Socket&) = delete;
|
||||
Socket& operator=(const Socket&) = delete;
|
||||
|
||||
// Returns the address to which the socket is bound. If the socket is not
|
||||
// bound, then the any-address is returned.
|
||||
virtual SocketAddress GetLocalAddress() const = 0;
|
||||
|
@ -138,9 +140,6 @@ class Socket {
|
|||
|
||||
protected:
|
||||
Socket() {}
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(Socket);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
#include "api/array_view.h"
|
||||
#include "rtc_base/async_socket.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/crypt_string.h"
|
||||
|
||||
namespace rtc {
|
||||
|
@ -34,6 +33,9 @@ class BufferedReadAdapter : public AsyncSocketAdapter {
|
|||
BufferedReadAdapter(Socket* socket, size_t buffer_size);
|
||||
~BufferedReadAdapter() override;
|
||||
|
||||
BufferedReadAdapter(const BufferedReadAdapter&) = delete;
|
||||
BufferedReadAdapter& operator=(const BufferedReadAdapter&) = delete;
|
||||
|
||||
int Send(const void* pv, size_t cb) override;
|
||||
int Recv(void* pv, size_t cb, int64_t* timestamp) override;
|
||||
|
||||
|
@ -51,7 +53,6 @@ class BufferedReadAdapter : public AsyncSocketAdapter {
|
|||
char* buffer_;
|
||||
size_t buffer_size_, data_len_;
|
||||
bool buffering_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(BufferedReadAdapter);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -65,12 +66,14 @@ class AsyncSSLSocket : public BufferedReadAdapter {
|
|||
|
||||
explicit AsyncSSLSocket(Socket* socket);
|
||||
|
||||
AsyncSSLSocket(const AsyncSSLSocket&) = delete;
|
||||
AsyncSSLSocket& operator=(const AsyncSSLSocket&) = delete;
|
||||
|
||||
int Connect(const SocketAddress& addr) override;
|
||||
|
||||
protected:
|
||||
void OnConnectEvent(Socket* socket) override;
|
||||
void ProcessInput(char* data, size_t* len) override;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(AsyncSSLSocket);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -85,6 +88,9 @@ class AsyncHttpsProxySocket : public BufferedReadAdapter {
|
|||
const CryptString& password);
|
||||
~AsyncHttpsProxySocket() override;
|
||||
|
||||
AsyncHttpsProxySocket(const AsyncHttpsProxySocket&) = delete;
|
||||
AsyncHttpsProxySocket& operator=(const AsyncHttpsProxySocket&) = delete;
|
||||
|
||||
// If connect is forced, the adapter will always issue an HTTP CONNECT to the
|
||||
// target address. Otherwise, it will connect only if the destination port
|
||||
// is not port 80.
|
||||
|
@ -128,7 +134,6 @@ class AsyncHttpsProxySocket : public BufferedReadAdapter {
|
|||
} state_;
|
||||
HttpAuthContext* context_;
|
||||
std::string unknown_mechanisms_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(AsyncHttpsProxySocket);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -142,6 +147,9 @@ class AsyncSocksProxySocket : public BufferedReadAdapter {
|
|||
const CryptString& password);
|
||||
~AsyncSocksProxySocket() override;
|
||||
|
||||
AsyncSocksProxySocket(const AsyncSocksProxySocket&) = delete;
|
||||
AsyncSocksProxySocket& operator=(const AsyncSocksProxySocket&) = delete;
|
||||
|
||||
int Connect(const SocketAddress& addr) override;
|
||||
SocketAddress GetRemoteAddress() const override;
|
||||
int Close() override;
|
||||
|
@ -162,7 +170,6 @@ class AsyncSocksProxySocket : public BufferedReadAdapter {
|
|||
SocketAddress proxy_, dest_;
|
||||
std::string user_;
|
||||
CryptString pass_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(AsyncSocksProxySocket);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/socket.h"
|
||||
#include "rtc_base/stream.h"
|
||||
#include "rtc_base/third_party/sigslot/sigslot.h"
|
||||
|
@ -27,6 +26,9 @@ class SocketStream : public StreamInterface, public sigslot::has_slots<> {
|
|||
explicit SocketStream(Socket* socket);
|
||||
~SocketStream() override;
|
||||
|
||||
SocketStream(const SocketStream&) = delete;
|
||||
SocketStream& operator=(const SocketStream&) = delete;
|
||||
|
||||
void Attach(Socket* socket);
|
||||
Socket* Detach();
|
||||
|
||||
|
@ -53,8 +55,6 @@ class SocketStream : public StreamInterface, public sigslot::has_slots<> {
|
|||
void OnCloseEvent(Socket* socket, int err);
|
||||
|
||||
Socket* socket_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(SocketStream);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "rtc_base/buffer.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace rtc {
|
||||
|
@ -101,6 +101,9 @@ class RTC_EXPORT SSLCertChain final {
|
|||
|
||||
~SSLCertChain();
|
||||
|
||||
SSLCertChain(const SSLCertChain&) = delete;
|
||||
SSLCertChain& operator=(const SSLCertChain&) = delete;
|
||||
|
||||
// Vector access methods.
|
||||
size_t GetSize() const { return certs_.size(); }
|
||||
|
||||
|
@ -118,8 +121,6 @@ class RTC_EXPORT SSLCertChain final {
|
|||
|
||||
private:
|
||||
std::vector<std::unique_ptr<SSLCertificate>> certs_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(SSLCertChain);
|
||||
};
|
||||
|
||||
// SSLCertificateVerifier provides a simple interface to allow third parties to
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <memory>
|
||||
|
||||
#include "rtc_base/buffer.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/message_handler.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
#include "rtc_base/third_party/sigslot/sigslot.h"
|
||||
|
@ -52,6 +51,9 @@ class RTC_EXPORT StreamInterface {
|
|||
public:
|
||||
virtual ~StreamInterface() {}
|
||||
|
||||
StreamInterface(const StreamInterface&) = delete;
|
||||
StreamInterface& operator=(const StreamInterface&) = delete;
|
||||
|
||||
virtual StreamState GetState() const = 0;
|
||||
|
||||
// Read attempts to fill buffer of size buffer_len. Write attempts to send
|
||||
|
@ -110,9 +112,6 @@ class RTC_EXPORT StreamInterface {
|
|||
|
||||
protected:
|
||||
StreamInterface();
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(StreamInterface);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "api/task_queue/queued_task.h"
|
||||
#include "api/task_queue/task_queue_base.h"
|
||||
#include "api/task_queue/task_queue_factory.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
#include "rtc_base/task_utils/to_queued_task.h"
|
||||
#include "rtc_base/thread_annotations.h"
|
||||
|
@ -83,6 +82,9 @@ class RTC_LOCKABLE RTC_EXPORT TaskQueue {
|
|||
webrtc::TaskQueueDeleter> task_queue);
|
||||
~TaskQueue();
|
||||
|
||||
TaskQueue(const TaskQueue&) = delete;
|
||||
TaskQueue& operator=(const TaskQueue&) = delete;
|
||||
|
||||
// Used for DCHECKing the current queue.
|
||||
bool IsCurrent() const;
|
||||
|
||||
|
@ -125,8 +127,6 @@ class RTC_LOCKABLE RTC_EXPORT TaskQueue {
|
|||
|
||||
private:
|
||||
webrtc::TaskQueueBase* const impl_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(TaskQueue);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "rtc_base/async_udp_socket.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/fake_clock.h"
|
||||
#include "rtc_base/synchronization/mutex.h"
|
||||
|
||||
|
@ -53,6 +52,9 @@ class TestClient : public sigslot::has_slots<> {
|
|||
ThreadProcessingFakeClock* fake_clock);
|
||||
~TestClient() override;
|
||||
|
||||
TestClient(const TestClient&) = delete;
|
||||
TestClient& operator=(const TestClient&) = delete;
|
||||
|
||||
SocketAddress address() const { return socket_->GetLocalAddress(); }
|
||||
SocketAddress remote_address() const { return socket_->GetRemoteAddress(); }
|
||||
|
||||
|
@ -110,7 +112,6 @@ class TestClient : public sigslot::has_slots<> {
|
|||
std::vector<std::unique_ptr<Packet>> packets_;
|
||||
int ready_to_send_count_ = 0;
|
||||
int64_t prev_packet_timestamp_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(TestClient);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "absl/algorithm/container.h"
|
||||
#include "rtc_base/async_packet_socket.h"
|
||||
#include "rtc_base/async_tcp_socket.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/socket.h"
|
||||
#include "rtc_base/socket_address.h"
|
||||
#include "rtc_base/third_party/sigslot/sigslot.h"
|
||||
|
@ -35,6 +34,9 @@ class TestEchoServer : public sigslot::has_slots<> {
|
|||
TestEchoServer(Thread* thread, const SocketAddress& addr);
|
||||
~TestEchoServer() override;
|
||||
|
||||
TestEchoServer(const TestEchoServer&) = delete;
|
||||
TestEchoServer& operator=(const TestEchoServer&) = delete;
|
||||
|
||||
SocketAddress address() const { return server_socket_->GetLocalAddress(); }
|
||||
|
||||
private:
|
||||
|
@ -64,7 +66,6 @@ class TestEchoServer : public sigslot::has_slots<> {
|
|||
typedef std::list<AsyncTCPSocket*> ClientList;
|
||||
std::unique_ptr<Socket> server_socket_;
|
||||
ClientList client_sockets_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(TestEchoServer);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -75,6 +75,9 @@ class MessageHandlerWithTask final : public MessageHandler {
|
|||
public:
|
||||
MessageHandlerWithTask() {}
|
||||
|
||||
MessageHandlerWithTask(const MessageHandlerWithTask&) = delete;
|
||||
MessageHandlerWithTask& operator=(const MessageHandlerWithTask&) = delete;
|
||||
|
||||
void OnMessage(Message* msg) override {
|
||||
static_cast<rtc_thread_internal::MessageLikeTask*>(msg->pdata)->Run();
|
||||
delete msg->pdata;
|
||||
|
@ -82,8 +85,6 @@ class MessageHandlerWithTask final : public MessageHandler {
|
|||
|
||||
private:
|
||||
~MessageHandlerWithTask() override {}
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(MessageHandlerWithTask);
|
||||
};
|
||||
|
||||
class RTC_SCOPED_LOCKABLE MarkProcessingCritScope {
|
||||
|
@ -100,11 +101,12 @@ class RTC_SCOPED_LOCKABLE MarkProcessingCritScope {
|
|||
cs_->Leave();
|
||||
}
|
||||
|
||||
MarkProcessingCritScope(const MarkProcessingCritScope&) = delete;
|
||||
MarkProcessingCritScope& operator=(const MarkProcessingCritScope&) = delete;
|
||||
|
||||
private:
|
||||
const RecursiveCriticalSection* const cs_;
|
||||
size_t* processing_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(MarkProcessingCritScope);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "api/task_queue/queued_task.h"
|
||||
#include "api/task_queue/task_queue_base.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/deprecated/recursive_critical_section.h"
|
||||
#include "rtc_base/location.h"
|
||||
#include "rtc_base/message_handler.h"
|
||||
|
@ -89,14 +88,15 @@ class MessageWithFunctor final : public MessageLikeTask {
|
|||
explicit MessageWithFunctor(FunctorT&& functor)
|
||||
: functor_(std::forward<FunctorT>(functor)) {}
|
||||
|
||||
MessageWithFunctor(const MessageWithFunctor&) = delete;
|
||||
MessageWithFunctor& operator=(const MessageWithFunctor&) = delete;
|
||||
|
||||
void Run() override { functor_(); }
|
||||
|
||||
private:
|
||||
~MessageWithFunctor() override {}
|
||||
|
||||
typename std::remove_reference<FunctorT>::type functor_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(MessageWithFunctor);
|
||||
};
|
||||
|
||||
} // namespace rtc_thread_internal
|
||||
|
@ -152,6 +152,9 @@ class RTC_EXPORT ThreadManager {
|
|||
ThreadManager();
|
||||
~ThreadManager();
|
||||
|
||||
ThreadManager(const ThreadManager&) = delete;
|
||||
ThreadManager& operator=(const ThreadManager&) = delete;
|
||||
|
||||
void SetCurrentThreadInternal(Thread* thread);
|
||||
void AddInternal(Thread* message_queue);
|
||||
void RemoveInternal(Thread* message_queue);
|
||||
|
@ -186,8 +189,6 @@ class RTC_EXPORT ThreadManager {
|
|||
|
||||
// The thread to potentially autowrap.
|
||||
const PlatformThreadRef main_thread_ref_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(ThreadManager);
|
||||
};
|
||||
|
||||
// WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread().
|
||||
|
@ -221,6 +222,9 @@ class RTC_LOCKABLE RTC_EXPORT Thread : public webrtc::TaskQueueBase {
|
|||
// calling Clear on the object from a different thread.
|
||||
~Thread() override;
|
||||
|
||||
Thread(const Thread&) = delete;
|
||||
Thread& operator=(const Thread&) = delete;
|
||||
|
||||
static std::unique_ptr<Thread> CreateWithSocketServer();
|
||||
static std::unique_ptr<Thread> Create();
|
||||
static Thread* Current();
|
||||
|
@ -685,8 +689,6 @@ class RTC_LOCKABLE RTC_EXPORT Thread : public webrtc::TaskQueueBase {
|
|||
friend class ThreadManager;
|
||||
|
||||
int dispatch_warning_ms_ RTC_GUARDED_BY(this) = kSlowDispatchLoggingThreshold;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(Thread);
|
||||
};
|
||||
|
||||
// AutoThread automatically installs itself at construction
|
||||
|
@ -700,8 +702,8 @@ class AutoThread : public Thread {
|
|||
AutoThread();
|
||||
~AutoThread() override;
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(AutoThread);
|
||||
AutoThread(const AutoThread&) = delete;
|
||||
AutoThread& operator=(const AutoThread&) = delete;
|
||||
};
|
||||
|
||||
// AutoSocketServerThread automatically installs itself at
|
||||
|
@ -714,10 +716,11 @@ class AutoSocketServerThread : public Thread {
|
|||
explicit AutoSocketServerThread(SocketServer* ss);
|
||||
~AutoSocketServerThread() override;
|
||||
|
||||
AutoSocketServerThread(const AutoSocketServerThread&) = delete;
|
||||
AutoSocketServerThread& operator=(const AutoSocketServerThread&) = delete;
|
||||
|
||||
private:
|
||||
rtc::Thread* old_thread_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(AutoSocketServerThread);
|
||||
};
|
||||
} // namespace rtc
|
||||
|
||||
|
|
|
@ -204,6 +204,10 @@ struct FunctorD {
|
|||
public:
|
||||
explicit FunctorD(AtomicBool* flag) : flag_(flag) {}
|
||||
FunctorD(FunctorD&&) = default;
|
||||
|
||||
FunctorD(const FunctorD&) = delete;
|
||||
FunctorD& operator=(const FunctorD&) = delete;
|
||||
|
||||
FunctorD& operator=(FunctorD&&) = default;
|
||||
void operator()() {
|
||||
if (flag_)
|
||||
|
@ -212,7 +216,6 @@ struct FunctorD {
|
|||
|
||||
private:
|
||||
AtomicBool* flag_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(FunctorD);
|
||||
};
|
||||
|
||||
// See: https://code.google.com/p/webrtc/issues/detail?id=2409
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace rtc {
|
||||
|
@ -35,6 +34,9 @@ class RTC_EXPORT TimestampAligner {
|
|||
TimestampAligner();
|
||||
~TimestampAligner();
|
||||
|
||||
TimestampAligner(const TimestampAligner&) = delete;
|
||||
TimestampAligner& operator=(const TimestampAligner&) = delete;
|
||||
|
||||
public:
|
||||
// Translates timestamps of a capture system to the same timescale as is used
|
||||
// by rtc::TimeMicros(). `capturer_time_us` is assumed to be accurate, but
|
||||
|
@ -77,7 +79,6 @@ class RTC_EXPORT TimestampAligner {
|
|||
// Offset between `prev_translated_time_us_` and the corresponding capturer
|
||||
// time.
|
||||
int64_t prev_time_offset_us_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(TimestampAligner);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/event.h"
|
||||
#include "rtc_base/fake_clock.h"
|
||||
#include "rtc_base/message_handler.h"
|
||||
|
@ -163,6 +162,9 @@ class VirtualSocketServer : public SocketServer {
|
|||
explicit VirtualSocketServer(ThreadProcessingFakeClock* fake_clock);
|
||||
~VirtualSocketServer() override;
|
||||
|
||||
VirtualSocketServer(const VirtualSocketServer&) = delete;
|
||||
VirtualSocketServer& operator=(const VirtualSocketServer&) = delete;
|
||||
|
||||
// The default source address specifies which local address to use when a
|
||||
// socket is bound to the 'any' address, e.g. 0.0.0.0. (If not set, the 'any'
|
||||
// address is used as the source address on outgoing virtual packets, exposed
|
||||
|
@ -419,7 +421,6 @@ class VirtualSocketServer : public SocketServer {
|
|||
size_t max_udp_payload_ RTC_GUARDED_BY(mutex_) = 65507;
|
||||
|
||||
bool sending_blocked_ RTC_GUARDED_BY(mutex_) = false;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(VirtualSocketServer);
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <random>
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/null_socket_server.h"
|
||||
#include "rtc_base/thread.h"
|
||||
#include "test/gtest.h"
|
||||
|
|
Loading…
Reference in a new issue