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

Side by Side Diff: ppapi/proxy/tcp_socket_resource.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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/proxy/tcp_socket_resource.h" 5 #include "ppapi/proxy/tcp_socket_resource.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ppapi/proxy/ppapi_messages.h" 8 #include "ppapi/proxy/ppapi_messages.h"
9 #include "ppapi/shared_impl/ppb_tcp_socket_shared.h" 9 #include "ppapi/shared_impl/ppb_tcp_socket_shared.h"
10 #include "ppapi/thunk/enter.h" 10 #include "ppapi/thunk/enter.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 int32_t TCPSocketResource::Accept(PP_Resource* accepted_tcp_socket, 109 int32_t TCPSocketResource::Accept(PP_Resource* accepted_tcp_socket,
110 scoped_refptr<TrackedCallback> callback) { 110 scoped_refptr<TrackedCallback> callback) {
111 return AcceptImpl(accepted_tcp_socket, callback); 111 return AcceptImpl(accepted_tcp_socket, callback);
112 } 112 }
113 113
114 void TCPSocketResource::Close() { 114 void TCPSocketResource::Close() {
115 CloseImpl(); 115 CloseImpl();
116 } 116 }
117 117
118 int32_t TCPSocketResource::SetOption1_1(
119 PP_TCPSocket_Option name,
120 const PP_Var& value,
121 scoped_refptr<TrackedCallback> callback) {
122 return SetOptionImpl(name, value,
123 true, // Check connect() state.
124 callback);
125 }
126
118 int32_t TCPSocketResource::SetOption(PP_TCPSocket_Option name, 127 int32_t TCPSocketResource::SetOption(PP_TCPSocket_Option name,
119 const PP_Var& value, 128 const PP_Var& value,
120 scoped_refptr<TrackedCallback> callback) { 129 scoped_refptr<TrackedCallback> callback) {
121 return SetOptionImpl(name, value, callback); 130 return SetOptionImpl(name, value,
131 false, // Do not check connect() state.
132 callback);
122 } 133 }
123 134
124 PP_Resource TCPSocketResource::CreateAcceptedSocket( 135 PP_Resource TCPSocketResource::CreateAcceptedSocket(
125 int pending_host_id, 136 int pending_host_id,
126 const PP_NetAddress_Private& local_addr, 137 const PP_NetAddress_Private& local_addr,
127 const PP_NetAddress_Private& remote_addr) { 138 const PP_NetAddress_Private& remote_addr) {
128 return (new TCPSocketResource(connection(), pp_instance(), pending_host_id, 139 return (new TCPSocketResource(connection(), pp_instance(), pending_host_id,
129 local_addr, remote_addr))->GetReference(); 140 local_addr, remote_addr))->GetReference();
130 } 141 }
131 142
132 } // namespace proxy 143 } // namespace proxy
133 } // namespace ppapi 144 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698