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

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

Issue 9212047: Add GetBoundAddress to PPB_UDPSocket_Private (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fix build error after rebase 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) 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 #ifndef PPAPI_SHARED_IMPL_PRIVATE_UDP_SOCKET_PRIVATE_IMPL_H_ 5 #ifndef PPAPI_SHARED_IMPL_PRIVATE_UDP_SOCKET_PRIVATE_IMPL_H_
6 #define PPAPI_SHARED_IMPL_PRIVATE_UDP_SOCKET_PRIVATE_IMPL_H_ 6 #define PPAPI_SHARED_IMPL_PRIVATE_UDP_SOCKET_PRIVATE_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "ppapi/shared_impl/resource.h" 11 #include "ppapi/shared_impl/resource.h"
(...skipping 23 matching lines...) Expand all
35 // The maximum number of bytes that each PpapiHostMsg_PPBUDPSocket_SendTo 35 // The maximum number of bytes that each PpapiHostMsg_PPBUDPSocket_SendTo
36 // message is allowed to carry. 36 // message is allowed to carry.
37 static const int32_t kMaxWriteSize; 37 static const int32_t kMaxWriteSize;
38 38
39 // Resource overrides. 39 // Resource overrides.
40 virtual PPB_UDPSocket_Private_API* AsPPB_UDPSocket_Private_API() OVERRIDE; 40 virtual PPB_UDPSocket_Private_API* AsPPB_UDPSocket_Private_API() OVERRIDE;
41 41
42 // PPB_UDPSocket_Private_API implementation. 42 // PPB_UDPSocket_Private_API implementation.
43 virtual int32_t Bind(const PP_NetAddress_Private* addr, 43 virtual int32_t Bind(const PP_NetAddress_Private* addr,
44 PP_CompletionCallback callback) OVERRIDE; 44 PP_CompletionCallback callback) OVERRIDE;
45 virtual PP_Bool GetBoundAddress(PP_NetAddress_Private* addr) OVERRIDE;
45 virtual int32_t RecvFrom(char* buffer, 46 virtual int32_t RecvFrom(char* buffer,
46 int32_t num_bytes, 47 int32_t num_bytes,
47 PP_CompletionCallback callback) OVERRIDE; 48 PP_CompletionCallback callback) OVERRIDE;
48 virtual PP_Bool GetRecvFromAddress(PP_NetAddress_Private* addr) OVERRIDE; 49 virtual PP_Bool GetRecvFromAddress(PP_NetAddress_Private* addr) OVERRIDE;
49 virtual int32_t SendTo(const char* buffer, 50 virtual int32_t SendTo(const char* buffer,
50 int32_t num_bytes, 51 int32_t num_bytes,
51 const PP_NetAddress_Private* addr, 52 const PP_NetAddress_Private* addr,
52 PP_CompletionCallback callback) OVERRIDE; 53 PP_CompletionCallback callback) OVERRIDE;
53 virtual void Close() OVERRIDE; 54 virtual void Close() OVERRIDE;
54 55
55 // Notifications from the proxy. 56 // Notifications from the proxy.
56 void OnBindCompleted(bool succeeded); 57 void OnBindCompleted(bool succeeded,
58 const PP_NetAddress_Private& bound_addr);
57 void OnRecvFromCompleted(bool succeeded, 59 void OnRecvFromCompleted(bool succeeded,
58 const std::string& data, 60 const std::string& data,
59 const PP_NetAddress_Private& addr); 61 const PP_NetAddress_Private& addr);
60 void OnSendToCompleted(bool succeeded, int32_t bytes_written); 62 void OnSendToCompleted(bool succeeded, int32_t bytes_written);
61 63
62 // Send functions that need to be implemented differently for 64 // Send functions that need to be implemented differently for
63 // the proxied and non-proxied derived classes. 65 // the proxied and non-proxied derived classes.
64 virtual void SendBind(const PP_NetAddress_Private& addr) = 0; 66 virtual void SendBind(const PP_NetAddress_Private& addr) = 0;
65 virtual void SendRecvFrom(int32_t num_bytes) = 0; 67 virtual void SendRecvFrom(int32_t num_bytes) = 0;
66 virtual void SendSendTo(const std::string& buffer, 68 virtual void SendSendTo(const std::string& buffer,
(...skipping 10 matching lines...) Expand all
77 bool closed_; 79 bool closed_;
78 80
79 scoped_refptr<TrackedCallback> bind_callback_; 81 scoped_refptr<TrackedCallback> bind_callback_;
80 scoped_refptr<TrackedCallback> recvfrom_callback_; 82 scoped_refptr<TrackedCallback> recvfrom_callback_;
81 scoped_refptr<TrackedCallback> sendto_callback_; 83 scoped_refptr<TrackedCallback> sendto_callback_;
82 84
83 char* read_buffer_; 85 char* read_buffer_;
84 int32_t bytes_to_read_; 86 int32_t bytes_to_read_;
85 87
86 PP_NetAddress_Private recvfrom_addr_; 88 PP_NetAddress_Private recvfrom_addr_;
89 PP_NetAddress_Private bound_addr_;
87 90
88 DISALLOW_COPY_AND_ASSIGN(UDPSocketPrivateImpl); 91 DISALLOW_COPY_AND_ASSIGN(UDPSocketPrivateImpl);
89 }; 92 };
90 93
91 } // namespace ppapi 94 } // namespace ppapi
92 95
93 #endif // PPAPI_SHARED_IMPL_PRIVATE_UDP_SOCKET_PRIVATE_IMPL_H_ 96 #endif // PPAPI_SHARED_IMPL_PRIVATE_UDP_SOCKET_PRIVATE_IMPL_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_udp_socket_private_proxy.cc ('k') | ppapi/shared_impl/private/udp_socket_private_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698