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

Unified Diff: content/browser/renderer_host/p2p/socket_host.h

Issue 264793017: Implements RTP header dumping. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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.h
diff --git a/content/browser/renderer_host/p2p/socket_host.h b/content/browser/renderer_host/p2p/socket_host.h
index a4c82f3ecf79de557a9466361bb24276189362d5..45348fcb072305beb3053a0b8d789564bcbdcfa4 100644
--- a/content/browser/renderer_host/p2p/socket_host.h
+++ b/content/browser/renderer_host/p2p/socket_host.h
@@ -7,6 +7,7 @@
#include "content/common/content_export.h"
#include "content/common/p2p_socket_type.h"
+#include "content/public/browser/render_process_host.h"
#include "net/base/ip_endpoint.h"
#include "net/udp/datagram_socket.h"
@@ -37,7 +38,8 @@ CONTENT_EXPORT bool ApplyPacketOptions(char* data, int length,
// Helper method which finds RTP ofset and length if the packet is encapsulated
// in a TURN Channel Message or TURN Send Indication message.
-CONTENT_EXPORT bool GetRtpPacketStartPositionAndLength(char* data, int length,
+CONTENT_EXPORT bool GetRtpPacketStartPositionAndLength(const char* data,
+ int length,
int* rtp_start_pos,
int* rtp_packet_length);
// Helper method which updates absoulute send time extension if present.
@@ -53,7 +55,8 @@ class CONTENT_EXPORT P2PSocketHost {
static const int kStunHeaderSize = 20;
// Creates P2PSocketHost of the specific type.
static P2PSocketHost* Create(IPC::Sender* message_sender,
- int id, P2PSocketType type,
+ int socket_id,
+ P2PSocketType type,
net::URLRequestContextGetter* url_context,
P2PMessageThrottler* throttler);
@@ -74,6 +77,11 @@ class CONTENT_EXPORT P2PSocketHost {
virtual bool SetOption(P2PSocketOption option, int value) = 0;
+ void StartRtpDump(
+ RtpDumpType type,
+ const RenderProcessHost::WebRtcRtpPacketCallback& packet_callback);
+ void StopRtpDump(RtpDumpType type);
+
protected:
friend class P2PSocketHostTcpTestBase;
@@ -111,7 +119,7 @@ class CONTENT_EXPORT P2PSocketHost {
STATE_ERROR,
};
- P2PSocketHost(IPC::Sender* message_sender, int id);
+ P2PSocketHost(IPC::Sender* message_sender, int socket_id);
// Verifies that the packet |data| has a valid STUN header. In case
// of success stores type of the message in |type|.
@@ -119,9 +127,15 @@ class CONTENT_EXPORT P2PSocketHost {
StunMessageType* type);
static bool IsRequestOrResponse(StunMessageType type);
+ // Calls RenderProcessHostImpl::OnRtpPacket to record the RTP header.
+ void DumpRtpPacket(const char* packet, size_t length, bool incoming);
+
IPC::Sender* message_sender_;
int id_;
State state_;
+ bool dump_incoming_rtp_packet_;
+ bool dump_outgoing_rtp_packet_;
+ RenderProcessHost::WebRtcRtpPacketCallback packet_dump_callback_;
DISALLOW_COPY_AND_ASSIGN(P2PSocketHost);
};

Powered by Google App Engine
This is Rietveld 408576698