| Index: content/browser/renderer_host/pepper/pepper_udp_socket.h
|
| diff --git a/content/browser/renderer_host/pepper/pepper_udp_socket.h b/content/browser/renderer_host/pepper/pepper_udp_socket.h
|
| index 9f0cdb56b1f11728c3fa36e6b4dc4b7ce40c423e..a456170af6ac6fe8a85b5daf8db63216929cc725 100644
|
| --- a/content/browser/renderer_host/pepper/pepper_udp_socket.h
|
| +++ b/content/browser/renderer_host/pepper/pepper_udp_socket.h
|
| @@ -5,12 +5,15 @@
|
| #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_H_
|
| #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_H_
|
|
|
| +#include <queue>
|
| #include <string>
|
|
|
| #include "base/basictypes.h"
|
| +#include "base/memory/linked_ptr.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "net/base/completion_callback.h"
|
| +#include "net/base/io_buffer.h"
|
| #include "net/base/ip_endpoint.h"
|
| #include "ppapi/c/pp_stdint.h"
|
|
|
| @@ -18,7 +21,6 @@ class PepperMessageFilter;
|
| struct PP_NetAddress_Private;
|
|
|
| namespace net {
|
| -class IOBuffer;
|
| class UDPServerSocket;
|
| }
|
|
|
| @@ -42,6 +44,28 @@ class PepperUDPSocket {
|
| void SendBindACKError();
|
|
|
| private:
|
| + enum IOState {
|
| + IO_STATE_IDLE = 0,
|
| + IO_STATE_IN_PROCESS,
|
| + };
|
| +
|
| + struct IORequest {
|
| + IORequest(const scoped_refptr<net::IOBuffer>& buffer,
|
| + int buffer_size,
|
| + const linked_ptr<net::IPEndPoint>& end_point)
|
| + : buffer(buffer),
|
| + buffer_size(buffer_size),
|
| + end_point(end_point) {
|
| + }
|
| +
|
| + scoped_refptr<net::IOBuffer> buffer;
|
| + int buffer_size;
|
| + linked_ptr<net::IPEndPoint> end_point;
|
| + };
|
| +
|
| + void RecvFromInternal();
|
| + void SendToInternal();
|
| +
|
| void SendRecvFromACKError();
|
| void SendSendToACKError();
|
|
|
| @@ -58,10 +82,11 @@ class PepperUDPSocket {
|
|
|
| scoped_ptr<net::UDPServerSocket> socket_;
|
|
|
| - scoped_refptr<net::IOBuffer> recvfrom_buffer_;
|
| - scoped_refptr<net::IOBuffer> sendto_buffer_;
|
| + std::queue<IORequest> recvfrom_requests_;
|
| + std::queue<IORequest> sendto_requests_;
|
| + IOState recvfrom_state_;
|
| + IOState sendto_state_;
|
|
|
| - net::IPEndPoint recvfrom_address_;
|
| net::IPEndPoint bound_address_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(PepperUDPSocket);
|
|
|