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

Unified Diff: ppapi/proxy/tcp_socket_resource_base.cc

Issue 690903002: Remove timing limitation of SetOption invocation for PPAPI sockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fixed implementation. 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: ppapi/proxy/tcp_socket_resource_base.cc
diff --git a/ppapi/proxy/tcp_socket_resource_base.cc b/ppapi/proxy/tcp_socket_resource_base.cc
index 39c9fa311d68f75f8d40589f3bd8c54ebcd53aa1..fb4db5bee64a584dde7ec4697b7ead75d025d2be 100644
--- a/ppapi/proxy/tcp_socket_resource_base.cc
+++ b/ppapi/proxy/tcp_socket_resource_base.cc
@@ -318,11 +318,12 @@ void TCPSocketResourceBase::CloseImpl() {
int32_t TCPSocketResourceBase::SetOptionImpl(
PP_TCPSocket_Option name,
const PP_Var& value,
+ bool check_connect_state,
scoped_refptr<TrackedCallback> callback) {
SocketOptionData option_data;
switch (name) {
case PP_TCPSOCKET_OPTION_NO_DELAY: {
- if (!state_.IsConnected())
+ if (check_connect_state && !state_.IsConnected())
return PP_ERROR_FAILED;
if (value.type != PP_VARTYPE_BOOL)
@@ -332,7 +333,7 @@ int32_t TCPSocketResourceBase::SetOptionImpl(
}
case PP_TCPSOCKET_OPTION_SEND_BUFFER_SIZE:
case PP_TCPSOCKET_OPTION_RECV_BUFFER_SIZE: {
- if (!state_.IsConnected())
+ if (check_connect_state && !state_.IsConnected())
return PP_ERROR_FAILED;
if (value.type != PP_VARTYPE_INT32)

Powered by Google App Engine
This is Rietveld 408576698