| Index: webrtc/base/testclient.h
|
| diff --git a/webrtc/base/testclient.h b/webrtc/base/testclient.h
|
| index 74ef8cc3762c139a39177a028212121d07f98cc7..b4703828eb84a36ccec117254dc5489b7ae9ebc2 100644
|
| --- a/webrtc/base/testclient.h
|
| +++ b/webrtc/base/testclient.h
|
| @@ -11,6 +11,7 @@
|
| #ifndef WEBRTC_BASE_TESTCLIENT_H_
|
| #define WEBRTC_BASE_TESTCLIENT_H_
|
|
|
| +#include <memory>
|
| #include <vector>
|
| #include "webrtc/base/asyncudpsocket.h"
|
| #include "webrtc/base/constructormagic.h"
|
| @@ -42,7 +43,7 @@ class TestClient : public sigslot::has_slots<> {
|
|
|
| // Creates a client that will send and receive with the given socket and
|
| // will post itself messages with the given thread.
|
| - explicit TestClient(AsyncPacketSocket* socket);
|
| + explicit TestClient(std::unique_ptr<AsyncPacketSocket> socket);
|
| ~TestClient() override;
|
|
|
| SocketAddress address() const { return socket_->GetLocalAddress(); }
|
| @@ -62,10 +63,9 @@ class TestClient : public sigslot::has_slots<> {
|
| // Sends using the clients socket to the given destination.
|
| int SendTo(const char* buf, size_t size, const SocketAddress& dest);
|
|
|
| - // Returns the next packet received by the client or 0 if none is received
|
| - // within the specified timeout. The caller must delete the packet
|
| - // when done with it.
|
| - Packet* NextPacket(int timeout_ms);
|
| + // Returns the next packet received by the client or null if none is received
|
| + // within the specified timeout.
|
| + std::unique_ptr<Packet> NextPacket(int timeout_ms);
|
|
|
| // Checks that the next packet has the given contents. Returns the remote
|
| // address that the packet was sent from.
|
| @@ -95,8 +95,8 @@ class TestClient : public sigslot::has_slots<> {
|
| bool CheckTimestamp(int64_t packet_timestamp);
|
|
|
| CriticalSection crit_;
|
| - AsyncPacketSocket* socket_;
|
| - std::vector<Packet*>* packets_;
|
| + std::unique_ptr<AsyncPacketSocket> socket_;
|
| + std::vector<std::unique_ptr<Packet>> packets_;
|
| int ready_to_send_count_ = 0;
|
| int64_t prev_packet_timestamp_;
|
| RTC_DISALLOW_COPY_AND_ASSIGN(TestClient);
|
|
|