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

Unified Diff: content/browser/renderer_host/p2p/socket_host_tcp.cc

Issue 159353002: This CL adds methods to manipulate RTP header extension, particularly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
Index: content/browser/renderer_host/p2p/socket_host_tcp.cc
diff --git a/content/browser/renderer_host/p2p/socket_host_tcp.cc b/content/browser/renderer_host/p2p/socket_host_tcp.cc
index 007472c07ee6ee44b0daed0049e7c0da4f365944..cf995bc307149198f212a7af1dc8fc2cc88de66f 100644
--- a/content/browser/renderer_host/p2p/socket_host_tcp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_tcp.cc
@@ -18,6 +18,7 @@
#include "net/socket/tcp_client_socket.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
+#include "third_party/libjingle/source/talk/base/asyncpacketsocket.h"
namespace {
@@ -454,6 +455,9 @@ void P2PSocketHostTcp::DoSend(const net::IPEndPoint& to,
*reinterpret_cast<uint16*>(buffer->data()) = base::HostToNet16(data.size());
memcpy(buffer->data() + kPacketHeaderSize, &data[0], data.size());
+ talk_base::PacketOptions options;
+ MaybeUpdateRtpSendTimeExtn(buffer->data(), buffer->BytesRemaining(), options);
+
WriteOrQueue(buffer);
}
@@ -519,6 +523,10 @@ void P2PSocketHostStunTcp::DoSend(const net::IPEndPoint& to,
new net::DrainableIOBuffer(new net::IOBuffer(size), size);
memcpy(buffer->data(), &data[0], data.size());
+ // Update HMAC before writing padding bytes at the end.
+ talk_base::PacketOptions options;
+ MaybeUpdateRtpSendTimeExtn(buffer->data(), data.size(), options);
+
if (pad_bytes) {
char padding[4] = {0};
DCHECK_LE(pad_bytes, 4);

Powered by Google App Engine
This is Rietveld 408576698