Index: webrtc/p2p/base/fakepackettransport.h |
diff --git a/webrtc/p2p/base/fakepackettransport.h b/webrtc/p2p/base/fakepackettransport.h |
index 16af9a42aec5a5241e38b223cbd8dba7982e277a..82d39c23646712bc4a6ccf88ff8a19221923fe5f 100644 |
--- a/webrtc/p2p/base/fakepackettransport.h |
+++ b/webrtc/p2p/base/fakepackettransport.h |
@@ -86,6 +86,8 @@ class FakePacketTransport : public PacketTransportInternal { |
bool GetOption(Socket::Option opt, int* value) override { return true; } |
int GetError() override { return 0; } |
+ const CopyOnWriteBuffer* last_sent_packet() { return &last_sent_packet_; } |
+ |
private: |
void set_writable(bool writable) { |
if (writable_ == writable) { |
@@ -107,12 +109,14 @@ class FakePacketTransport : public PacketTransportInternal { |
} |
void SendPacketInternal(const CopyOnWriteBuffer& packet) { |
+ last_sent_packet_ = packet; |
if (dest_) { |
dest_->SignalReadPacket(dest_, packet.data<char>(), packet.size(), |
CreatePacketTime(0), 0); |
} |
} |
+ CopyOnWriteBuffer last_sent_packet_; |
AsyncInvoker invoker_; |
std::string debug_name_; |
FakePacketTransport* dest_ = nullptr; |