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

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

Issue 9391013: Make a global enum to differentiate impl & proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/message_loop.h" 14 #include "base/message_loop.h"
15 #include "ppapi/c/pp_completion_callback.h" 15 #include "ppapi/c/pp_completion_callback.h"
16 #include "ppapi/c/pp_errors.h" 16 #include "ppapi/c/pp_errors.h"
17 17
18 namespace ppapi { 18 namespace ppapi {
19 19
20 const int32_t UDPSocketPrivateImpl::kMaxReadSize = 1024 * 1024; 20 const int32_t UDPSocketPrivateImpl::kMaxReadSize = 1024 * 1024;
21 const int32_t UDPSocketPrivateImpl::kMaxWriteSize = 1024 * 1024; 21 const int32_t UDPSocketPrivateImpl::kMaxWriteSize = 1024 * 1024;
22 22
23 UDPSocketPrivateImpl::UDPSocketPrivateImpl(const HostResource& resource, 23 UDPSocketPrivateImpl::UDPSocketPrivateImpl(const HostResource& resource,
24 uint32 socket_id) 24 uint32 socket_id)
25 : Resource(resource) { 25 : Resource(OBJECT_IS_PROXY, resource) {
26 Init(socket_id); 26 Init(socket_id);
27 } 27 }
28 28
29 UDPSocketPrivateImpl::UDPSocketPrivateImpl(PP_Instance instance, 29 UDPSocketPrivateImpl::UDPSocketPrivateImpl(PP_Instance instance,
30 uint32 socket_id) 30 uint32 socket_id)
31 : Resource(instance) { 31 : Resource(OBJECT_IS_IMPL, instance) {
32 Init(socket_id); 32 Init(socket_id);
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 }
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 arraysize(recvfrom_addr_.data) * sizeof(*recvfrom_addr_.data)); 182 arraysize(recvfrom_addr_.data) * sizeof(*recvfrom_addr_.data));
183 } 183 }
184 184
185 void UDPSocketPrivateImpl::PostAbortIfNecessary( 185 void UDPSocketPrivateImpl::PostAbortIfNecessary(
186 scoped_refptr<TrackedCallback>* callback) { 186 scoped_refptr<TrackedCallback>* callback) {
187 if (callback->get()) 187 if (callback->get())
188 (*callback)->PostAbort(); 188 (*callback)->PostAbort();
189 } 189 }
190 190
191 } // namespace ppapi 191 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698