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

Side by Side Diff: content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.h

Issue 704133005: Pepper: Add support for multicast in PPB_UDPSocket API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: M43 Created 5 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_MESSAGE_FILTER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_MESSAGE_FILTER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_MESSAGE_FILTER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_MESSAGE_FILTER_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 static size_t GetNumInstances(); 54 static size_t GetNumInstances();
55 55
56 protected: 56 protected:
57 ~PepperUDPSocketMessageFilter() override; 57 ~PepperUDPSocketMessageFilter() override;
58 58
59 private: 59 private:
60 enum SocketOption { 60 enum SocketOption {
61 SOCKET_OPTION_ADDRESS_REUSE = 1 << 0, 61 SOCKET_OPTION_ADDRESS_REUSE = 1 << 0,
62 SOCKET_OPTION_BROADCAST = 1 << 1, 62 SOCKET_OPTION_BROADCAST = 1 << 1,
63 SOCKET_OPTION_RCVBUF_SIZE = 1 << 2, 63 SOCKET_OPTION_RCVBUF_SIZE = 1 << 2,
64 SOCKET_OPTION_SNDBUF_SIZE = 1 << 3 64 SOCKET_OPTION_SNDBUF_SIZE = 1 << 3,
65 SOCKET_OPTION_MULTICAST_LOOP = 1 << 4,
66 SOCKET_OPTION_MULTICAST_TTL = 1 << 5
65 }; 67 };
66 68
67 struct PendingSend { 69 struct PendingSend {
68 PendingSend(const net::IPAddressNumber& address, 70 PendingSend(const net::IPAddressNumber& address,
69 int port, 71 int port,
70 const scoped_refptr<net::IOBufferWithSize>& buffer, 72 const scoped_refptr<net::IOBufferWithSize>& buffer,
71 const ppapi::host::ReplyMessageContext& context); 73 const ppapi::host::ReplyMessageContext& context);
72 ~PendingSend(); 74 ~PendingSend();
73 75
74 net::IPAddressNumber address; 76 net::IPAddressNumber address;
(...skipping 13 matching lines...) Expand all
88 PP_UDPSocket_Option name, 90 PP_UDPSocket_Option name,
89 const ppapi::SocketOptionData& value); 91 const ppapi::SocketOptionData& value);
90 int32_t OnMsgBind(const ppapi::host::HostMessageContext* context, 92 int32_t OnMsgBind(const ppapi::host::HostMessageContext* context,
91 const PP_NetAddress_Private& addr); 93 const PP_NetAddress_Private& addr);
92 int32_t OnMsgSendTo(const ppapi::host::HostMessageContext* context, 94 int32_t OnMsgSendTo(const ppapi::host::HostMessageContext* context,
93 const std::string& data, 95 const std::string& data,
94 const PP_NetAddress_Private& addr); 96 const PP_NetAddress_Private& addr);
95 int32_t OnMsgClose(const ppapi::host::HostMessageContext* context); 97 int32_t OnMsgClose(const ppapi::host::HostMessageContext* context);
96 int32_t OnMsgRecvSlotAvailable( 98 int32_t OnMsgRecvSlotAvailable(
97 const ppapi::host::HostMessageContext* context); 99 const ppapi::host::HostMessageContext* context);
100 int32_t OnMsgJoinGroup(const ppapi::host::HostMessageContext* context,
101 const PP_NetAddress_Private& addr);
102 int32_t OnMsgLeaveGroup(const ppapi::host::HostMessageContext* context,
103 const PP_NetAddress_Private& addr);
98 104
99 void DoBind(const ppapi::host::ReplyMessageContext& context, 105 void DoBind(const ppapi::host::ReplyMessageContext& context,
100 const PP_NetAddress_Private& addr); 106 const PP_NetAddress_Private& addr);
101 void DoRecvFrom(); 107 void DoRecvFrom();
102 void DoSendTo(const ppapi::host::ReplyMessageContext& context, 108 void DoSendTo(const ppapi::host::ReplyMessageContext& context,
103 const std::string& data, 109 const std::string& data,
104 const PP_NetAddress_Private& addr); 110 const PP_NetAddress_Private& addr);
105 int StartPendingSend(); 111 int StartPendingSend();
106 void Close(); 112 void Close();
107 113
(...skipping 18 matching lines...) Expand all
126 int32_t result); 132 int32_t result);
127 133
128 // Bitwise-or of SocketOption flags. This stores the state about whether 134 // Bitwise-or of SocketOption flags. This stores the state about whether
129 // each option is set before Bind() is called. 135 // each option is set before Bind() is called.
130 int socket_options_; 136 int socket_options_;
131 137
132 // Locally cached value of buffer size. 138 // Locally cached value of buffer size.
133 int32_t rcvbuf_size_; 139 int32_t rcvbuf_size_;
134 int32_t sndbuf_size_; 140 int32_t sndbuf_size_;
135 141
142 // Multicast options
bbudge 2015/03/04 18:30:06 nit: // Multicast options, if socket hasn't been b
143 int multicast_ttl_;
144
136 scoped_ptr<net::UDPSocket> socket_; 145 scoped_ptr<net::UDPSocket> socket_;
137 bool closed_; 146 bool closed_;
138 147
139 scoped_refptr<net::IOBuffer> recvfrom_buffer_; 148 scoped_refptr<net::IOBuffer> recvfrom_buffer_;
140 149
141 std::queue<PendingSend> pending_sends_; 150 std::queue<PendingSend> pending_sends_;
142 151
143 net::IPEndPoint recvfrom_address_; 152 net::IPEndPoint recvfrom_address_;
144 153
145 size_t remaining_recv_slots_; 154 size_t remaining_recv_slots_;
146 155
147 bool external_plugin_; 156 bool external_plugin_;
148 bool private_api_; 157 bool private_api_;
149 158
150 int render_process_id_; 159 int render_process_id_;
151 int render_frame_id_; 160 int render_frame_id_;
152 161
153 DISALLOW_COPY_AND_ASSIGN(PepperUDPSocketMessageFilter); 162 DISALLOW_COPY_AND_ASSIGN(PepperUDPSocketMessageFilter);
154 }; 163 };
155 164
156 } // namespace content 165 } // namespace content
157 166
158 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_MESSAGE_FILTER _H_ 167 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_UDP_SOCKET_MESSAGE_FILTER _H_
OLDNEW
« no previous file with comments | « chrome/test/ppapi/ppapi_browsertest.cc ('k') | content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698