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

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

Issue 2843823002: Fix P2PSocketHostUdp to handle SetOptions() in error state (Closed)
Patch Set: dcheck Created 3 years, 8 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 | « no previous file | content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 039c619ccf45ebe68b58ffca31c0c5a50b419fd7..937365771bf8b1da2b4d51542d7c7aaff47a4b81 100644
--- a/content/browser/renderer_host/p2p/socket_host_tcp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_tcp.cc
@@ -484,7 +484,11 @@ void P2PSocketHostTcpBase::DidCompleteRead(int result) {
}
bool P2PSocketHostTcpBase::SetOption(P2PSocketOption option, int value) {
- DCHECK_EQ(STATE_OPEN, state_);
+ if (state_ != STATE_OPEN) {
+ DCHECK_EQ(state_, STATE_ERROR);
+ return false;
+ }
+
switch (option) {
case P2P_SOCKET_OPT_RCVBUF:
return socket_->SetReceiveBufferSize(value) == net::OK;
« no previous file with comments | « no previous file | content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698