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

Unified Diff: content/renderer/p2p/socket_client_impl.h

Issue 759923003: Detect situation when there is no missing send completion signal in P2PSocket implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/renderer/p2p/socket_client_impl.h
diff --git a/content/renderer/p2p/socket_client_impl.h b/content/renderer/p2p/socket_client_impl.h
index 4cda52ddb875d27fbd89ca38535be752e4f86859..3ce7be44dff5c3e38c433590e95c6823b3a1f168 100644
--- a/content/renderer/p2p/socket_client_impl.h
+++ b/content/renderer/p2p/socket_client_impl.h
@@ -44,10 +44,10 @@ class P2PSocketClientImpl : public P2PSocketClient {
const std::vector<char>& data) override;
// Send the |data| to the |address| using Differentiated Services Code Point
- // |dscp|.
- void SendWithDscp(const net::IPEndPoint& address,
- const std::vector<char>& data,
- const rtc::PacketOptions& options) override;
+ // |dscp|. Return value is the unique packet_id for this packet.
+ uint64 SendWithDscp(const net::IPEndPoint& address,
+ const std::vector<char>& data,
+ const rtc::PacketOptions& options) override;
// Setting socket options.
void SetOption(P2PSocketOption option, int value) override;
@@ -77,8 +77,7 @@ class P2PSocketClientImpl : public P2PSocketClient {
void OnSocketCreated(const net::IPEndPoint& local_address,
const net::IPEndPoint& remote_address);
void OnIncomingTcpConnection(const net::IPEndPoint& address);
- void OnSendComplete(int packet_id);
- void OnSendComplete();
+ void OnSendComplete(const P2PSendPacketMetrics& send_metrics);
void OnError();
void OnDataReceived(const net::IPEndPoint& address,
const std::vector<char>& data,
@@ -90,12 +89,19 @@ class P2PSocketClientImpl : public P2PSocketClient {
void DeliverOnIncomingTcpConnection(
const net::IPEndPoint& address,
scoped_refptr<P2PSocketClient> new_client);
- void DeliverOnSendComplete();
+ void DeliverOnSendComplete(const P2PSendPacketMetrics& send_metrics);
void DeliverOnError();
void DeliverOnDataReceived(const net::IPEndPoint& address,
const std::vector<char>& data,
const base::TimeTicks& timestamp);
+ // Helper function to be called by SendWithDscp to handle different threading
+ // condition.
+ void SendWithDscpAndPacketId(const net::IPEndPoint& address,
+ const std::vector<char>& data,
+ const rtc::PacketOptions& options,
+ uint64 packet_id);
+
// Scheduled on the IPC thread to finish initialization.
void DoInit(P2PSocketType type,
const net::IPEndPoint& local_address,

Powered by Google App Engine
This is Rietveld 408576698