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

Unified Diff: chrome/browser/extensions/api/socket/udp_socket.cc

Issue 15039012: Add the ability to use AllowAddressReuse for UDP sockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/socket/udp_socket.cc
diff --git a/chrome/browser/extensions/api/socket/udp_socket.cc b/chrome/browser/extensions/api/socket/udp_socket.cc
index 3f6080d69ceb4b28f90fb40e22833fb6d147903a..20cda2eb56fec8fb9497ec3edce81a4ba754c813 100644
--- a/chrome/browser/extensions/api/socket/udp_socket.cc
+++ b/chrome/browser/extensions/api/socket/udp_socket.cc
@@ -243,6 +243,14 @@ int UDPSocket::JoinGroup(const std::string& address) {
return rv;
}
+int UDPSocket::AllowAddressReuse() {
+ if (socket_.is_connected()) {
+ return net::ERR_UNEXPECTED;
+ }
+ socket_.AllowAddressReuse();
+ return 0;
+}
+
int UDPSocket::LeaveGroup(const std::string& address) {
net::IPAddressNumber ip;
if (!net::ParseIPLiteralToNumber(address, &ip))
« no previous file with comments | « chrome/browser/extensions/api/socket/udp_socket.h ('k') | chrome/browser/extensions/extension_function_histogram_value.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698