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

Unified Diff: extensions/browser/api/sockets_udp/sockets_udp_api.cc

Issue 2378763003: Add ability to reuse address in chrome.sockets.udp
Patch Set: Respond to code reviews, clean up tests Created 4 years, 3 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
« no previous file with comments | « extensions/browser/api/socket/udp_socket.cc ('k') | extensions/common/api/sockets_udp.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/sockets_udp/sockets_udp_api.cc
diff --git a/extensions/browser/api/sockets_udp/sockets_udp_api.cc b/extensions/browser/api/sockets_udp/sockets_udp_api.cc
index 05ef6620e93f70a6d8c4b2f193f492f14d68a633..6f364daa3e231e8d698a1f7e39b29aaaa1bef8d9 100644
--- a/extensions/browser/api/sockets_udp/sockets_udp_api.cc
+++ b/extensions/browser/api/sockets_udp/sockets_udp_api.cc
@@ -56,6 +56,7 @@ sockets_udp::SocketInfo CreateSocketInfo(int socket_id,
socket_info.name.reset(new std::string(socket->name()));
}
socket_info.persistent = socket->persistent();
+ socket_info.address_reusable = socket->allow_address_reuse();
if (socket->buffer_size() > 0) {
socket_info.buffer_size.reset(new int(socket->buffer_size()));
}
@@ -80,6 +81,9 @@ void SetSocketProperties(ResumableUDPSocket* socket,
if (properties->persistent.get()) {
socket->set_persistent(*properties->persistent);
}
+ if (properties->allow_address_reuse.get()) {
+ socket->set_allow_address_reuse(*properties->allow_address_reuse);
+ }
if (properties->buffer_size.get()) {
socket->set_buffer_size(*properties->buffer_size);
}
« no previous file with comments | « extensions/browser/api/socket/udp_socket.cc ('k') | extensions/common/api/sockets_udp.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698