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

Side by Side Diff: ppapi/shared_impl/private/udp_socket_private_impl.cc

Issue 10735056: AllowBroadcast() is exposed to NaCl. (Closed) Base URL: http://git.chromium.org/chromium/src.git@udp_broadcast
Patch Set: Deleted callbacks. Created 8 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/shared_impl/private/udp_socket_private_impl.h" 5 #include "ppapi/shared_impl/private/udp_socket_private_impl.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 34
35 UDPSocketPrivateImpl::~UDPSocketPrivateImpl() { 35 UDPSocketPrivateImpl::~UDPSocketPrivateImpl() {
36 } 36 }
37 37
38 thunk::PPB_UDPSocket_Private_API* 38 thunk::PPB_UDPSocket_Private_API*
39 UDPSocketPrivateImpl::AsPPB_UDPSocket_Private_API() { 39 UDPSocketPrivateImpl::AsPPB_UDPSocket_Private_API() {
40 return this; 40 return this;
41 } 41 }
42 42
43 int32_t UDPSocketPrivateImpl::SetSocketFeature(PP_UDPSocketFeature_Private name,
44 PP_Var value) {
45 if (bound_ || closed_)
46 return PP_ERROR_FAILED;
47
48 // Send the request, no response needed.
49 SendSetSocketFeature(name, value);
brettw 2012/08/22 22:45:21 If you want to keep this function returning int32_
ygorshenin1 2012/08/23 09:48:40 Done.
50 return PP_OK;
51 }
52
43 int32_t UDPSocketPrivateImpl::Bind(const PP_NetAddress_Private* addr, 53 int32_t UDPSocketPrivateImpl::Bind(const PP_NetAddress_Private* addr,
44 scoped_refptr<TrackedCallback> callback) { 54 scoped_refptr<TrackedCallback> callback) {
45 if (!addr) 55 if (!addr)
46 return PP_ERROR_BADARGUMENT; 56 return PP_ERROR_BADARGUMENT;
47 if (bound_ || closed_) 57 if (bound_ || closed_)
48 return PP_ERROR_FAILED; 58 return PP_ERROR_FAILED;
49 if (TrackedCallback::IsPending(bind_callback_)) 59 if (TrackedCallback::IsPending(bind_callback_))
50 return PP_ERROR_INPROGRESS; 60 return PP_ERROR_INPROGRESS;
51 61
52 bind_callback_ = callback; 62 bind_callback_ = callback;
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 arraysize(bound_addr_.data) * sizeof(*bound_addr_.data)); 206 arraysize(bound_addr_.data) * sizeof(*bound_addr_.data));
197 } 207 }
198 208
199 void UDPSocketPrivateImpl::PostAbortIfNecessary( 209 void UDPSocketPrivateImpl::PostAbortIfNecessary(
200 scoped_refptr<TrackedCallback>* callback) { 210 scoped_refptr<TrackedCallback>* callback) {
201 if (callback->get()) 211 if (callback->get())
202 (*callback)->PostAbort(); 212 (*callback)->PostAbort();
203 } 213 }
204 214
205 } // namespace ppapi 215 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698