OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 if (manager_) | 114 if (manager_) |
115 manager_->AddServer(this); | 115 manager_->AddServer(this); |
116 } | 116 } |
117 | 117 |
118 FirewallSocketServer::~FirewallSocketServer() { | 118 FirewallSocketServer::~FirewallSocketServer() { |
119 if (manager_) | 119 if (manager_) |
120 manager_->RemoveServer(this); | 120 manager_->RemoveServer(this); |
121 | 121 |
122 if (server_ && should_delete_server_) { | 122 if (server_ && should_delete_server_) { |
123 delete server_; | 123 delete server_; |
124 server_ = NULL; | 124 server_ = nullptr; |
125 } | 125 } |
126 } | 126 } |
127 | 127 |
128 void FirewallSocketServer::AddRule(bool allow, FirewallProtocol p, | 128 void FirewallSocketServer::AddRule(bool allow, FirewallProtocol p, |
129 FirewallDirection d, | 129 FirewallDirection d, |
130 const SocketAddress& addr) { | 130 const SocketAddress& addr) { |
131 SocketAddress any; | 131 SocketAddress any; |
132 if (d == FD_IN || d == FD_ANY) { | 132 if (d == FD_IN || d == FD_ANY) { |
133 AddRule(allow, p, any, addr); | 133 AddRule(allow, p, any, addr); |
134 } | 134 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 void FirewallSocketServer::WakeUp() { | 203 void FirewallSocketServer::WakeUp() { |
204 return server_->WakeUp(); | 204 return server_->WakeUp(); |
205 } | 205 } |
206 | 206 |
207 AsyncSocket* FirewallSocketServer::WrapSocket(AsyncSocket* sock, int type) { | 207 AsyncSocket* FirewallSocketServer::WrapSocket(AsyncSocket* sock, int type) { |
208 if (!sock || | 208 if (!sock || |
209 (type == SOCK_STREAM && !tcp_sockets_enabled_) || | 209 (type == SOCK_STREAM && !tcp_sockets_enabled_) || |
210 (type == SOCK_DGRAM && !udp_sockets_enabled_)) { | 210 (type == SOCK_DGRAM && !udp_sockets_enabled_)) { |
211 LOG(LS_VERBOSE) << "FirewallSocketServer socket creation denied"; | 211 LOG(LS_VERBOSE) << "FirewallSocketServer socket creation denied"; |
212 delete sock; | 212 delete sock; |
213 return NULL; | 213 return nullptr; |
214 } | 214 } |
215 return new FirewallSocket(this, sock, type); | 215 return new FirewallSocket(this, sock, type); |
216 } | 216 } |
217 | 217 |
218 FirewallManager::FirewallManager() { | 218 FirewallManager::FirewallManager() { |
219 } | 219 } |
220 | 220 |
221 FirewallManager::~FirewallManager() { | 221 FirewallManager::~FirewallManager() { |
222 RTC_DCHECK(servers_.empty()); | 222 RTC_DCHECK(servers_.empty()); |
223 } | 223 } |
(...skipping 20 matching lines...) Expand all Loading... |
244 | 244 |
245 void FirewallManager::ClearRules() { | 245 void FirewallManager::ClearRules() { |
246 CritScope scope(&crit_); | 246 CritScope scope(&crit_); |
247 for (std::vector<FirewallSocketServer*>::const_iterator it = | 247 for (std::vector<FirewallSocketServer*>::const_iterator it = |
248 servers_.begin(); it != servers_.end(); ++it) { | 248 servers_.begin(); it != servers_.end(); ++it) { |
249 (*it)->ClearRules(); | 249 (*it)->ClearRules(); |
250 } | 250 } |
251 } | 251 } |
252 | 252 |
253 } // namespace rtc | 253 } // namespace rtc |
OLD | NEW |