Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(819)

Unified Diff: remoting/test/fake_socket_factory.cc

Issue 1642793002: Add performance test for WebRTC protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@client_webrtc_support
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/test/cyclic_frame_generator.cc ('k') | remoting/test/protocol_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/test/fake_socket_factory.cc
diff --git a/remoting/test/fake_socket_factory.cc b/remoting/test/fake_socket_factory.cc
index 0e576cf9122fc9ed7c994e320ad300a41ff9107b..e7b314a8a87c6863520de38cabdcd4c0c7eb10e7 100644
--- a/remoting/test/fake_socket_factory.cc
+++ b/remoting/test/fake_socket_factory.cc
@@ -17,8 +17,10 @@
#include "base/rand_util.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
+#include "base/time/time.h"
#include "net/base/io_buffer.h"
#include "remoting/test/leaky_bucket.h"
+#include "third_party/libjingle/source/talk/media/base/rtputils.h"
#include "third_party/webrtc/base/asyncpacketsocket.h"
namespace remoting {
@@ -115,6 +117,10 @@ int FakeUdpSocket::SendTo(const void* data, size_t data_size,
const rtc::PacketOptions& options) {
scoped_refptr<net::IOBuffer> buffer = new net::IOBuffer(data_size);
memcpy(buffer->data(), data, data_size);
+ cricket::ApplyPacketOptions(
+ reinterpret_cast<uint8_t*>(buffer->data()), data_size,
+ options.packet_time_params,
+ (base::TimeTicks::Now() - base::TimeTicks()).InMilliseconds());
dispatcher_->DeliverPacket(local_address_, address, buffer, data_size);
return data_size;
}
« no previous file with comments | « remoting/test/cyclic_frame_generator.cc ('k') | remoting/test/protocol_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698