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

Side by Side Diff: ppapi/shared_impl/private/tcp_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/tcp_socket_private_impl.h" 5 #include "ppapi/shared_impl/private/tcp_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 TCPSocketPrivateImpl::kMaxReadSize = 1024 * 1024; 20 const int32_t TCPSocketPrivateImpl::kMaxReadSize = 1024 * 1024;
21 const int32_t TCPSocketPrivateImpl::kMaxWriteSize = 1024 * 1024; 21 const int32_t TCPSocketPrivateImpl::kMaxWriteSize = 1024 * 1024;
22 22
23 TCPSocketPrivateImpl::TCPSocketPrivateImpl(PP_Instance instance, 23 TCPSocketPrivateImpl::TCPSocketPrivateImpl(PP_Instance instance,
24 uint32 socket_id) 24 uint32 socket_id)
25 : Resource(instance) { 25 : Resource(OBJECT_IS_IMPL, instance) {
26 Init(socket_id); 26 Init(socket_id);
27 } 27 }
28 28
29 TCPSocketPrivateImpl::TCPSocketPrivateImpl(const HostResource& resource, 29 TCPSocketPrivateImpl::TCPSocketPrivateImpl(const HostResource& resource,
30 uint32 socket_id) 30 uint32 socket_id)
31 : Resource(resource) { 31 : Resource(OBJECT_IS_PROXY, resource) {
32 Init(socket_id); 32 Init(socket_id);
33 } 33 }
34 34
35 TCPSocketPrivateImpl::~TCPSocketPrivateImpl() { 35 TCPSocketPrivateImpl::~TCPSocketPrivateImpl() {
36 } 36 }
37 37
38 thunk::PPB_TCPSocket_Private_API* 38 thunk::PPB_TCPSocket_Private_API*
39 TCPSocketPrivateImpl::AsPPB_TCPSocket_Private_API() { 39 TCPSocketPrivateImpl::AsPPB_TCPSocket_Private_API() {
40 return this; 40 return this;
41 } 41 }
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 return connection_state_ == CONNECTED || connection_state_ == SSL_CONNECTED; 269 return connection_state_ == CONNECTED || connection_state_ == SSL_CONNECTED;
270 } 270 }
271 271
272 void TCPSocketPrivateImpl::PostAbortIfNecessary( 272 void TCPSocketPrivateImpl::PostAbortIfNecessary(
273 scoped_refptr<TrackedCallback>* callback) { 273 scoped_refptr<TrackedCallback>* callback) {
274 if (callback->get()) 274 if (callback->get())
275 (*callback)->PostAbort(); 275 (*callback)->PostAbort();
276 } 276 }
277 277
278 } // namespace ppapi 278 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698