summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/dns/mock_mdns_socket_factory.h2
-rw-r--r--net/udp/datagram_server_socket.h3
-rw-r--r--net/udp/udp_server_socket.cc4
-rw-r--r--net/udp/udp_server_socket.h1
-rw-r--r--net/udp/udp_socket_libevent.cc4
-rw-r--r--net/udp/udp_socket_libevent.h3
-rw-r--r--net/udp/udp_socket_win.cc4
-rw-r--r--net/udp/udp_socket_win.h3
8 files changed, 24 insertions, 0 deletions
diff --git a/net/dns/mock_mdns_socket_factory.h b/net/dns/mock_mdns_socket_factory.h
index 7cc8fed..04bb837 100644
--- a/net/dns/mock_mdns_socket_factory.h
+++ b/net/dns/mock_mdns_socket_factory.h
@@ -54,6 +54,8 @@ class MockMDnsDatagramServerSocket : public DatagramServerSocket {
MOCK_METHOD1(SetDiffServCodePoint, int(DiffServCodePoint dscp));
+ MOCK_METHOD0(DetachFromThread, void());
+
void SetResponsePacket(std::string response_packet);
int HandleRecvNow(IOBuffer* buffer, int size, IPEndPoint* address,
diff --git a/net/udp/datagram_server_socket.h b/net/udp/datagram_server_socket.h
index ed5ab7a..a7191d1 100644
--- a/net/udp/datagram_server_socket.h
+++ b/net/udp/datagram_server_socket.h
@@ -103,6 +103,9 @@ class NET_EXPORT DatagramServerSocket : public DatagramSocket {
// Set the Differentiated Services Code Point. May do nothing on
// some platforms. Returns a network error code.
virtual int SetDiffServCodePoint(DiffServCodePoint dscp) = 0;
+
+ // Resets the thread to be used for thread-safety checks.
+ virtual void DetachFromThread() = 0;
};
} // namespace net
diff --git a/net/udp/udp_server_socket.cc b/net/udp/udp_server_socket.cc
index 99d741b..ad19655 100644
--- a/net/udp/udp_server_socket.cc
+++ b/net/udp/udp_server_socket.cc
@@ -93,4 +93,8 @@ int UDPServerSocket::SetDiffServCodePoint(DiffServCodePoint dscp) {
return socket_.SetDiffServCodePoint(dscp);
}
+void UDPServerSocket::DetachFromThread() {
+ socket_.DetachFromThread();
+}
+
} // namespace net
diff --git a/net/udp/udp_server_socket.h b/net/udp/udp_server_socket.h
index c593413..46e8b78 100644
--- a/net/udp/udp_server_socket.h
+++ b/net/udp/udp_server_socket.h
@@ -45,6 +45,7 @@ class NET_EXPORT UDPServerSocket : public DatagramServerSocket {
virtual int SetMulticastTimeToLive(int time_to_live) OVERRIDE;
virtual int SetMulticastLoopbackMode(bool loopback) OVERRIDE;
virtual int SetDiffServCodePoint(DiffServCodePoint dscp) OVERRIDE;
+ virtual void DetachFromThread() OVERRIDE;
private:
UDPSocket socket_;
diff --git a/net/udp/udp_socket_libevent.cc b/net/udp/udp_socket_libevent.cc
index a51567d..d3fbad4 100644
--- a/net/udp/udp_socket_libevent.cc
+++ b/net/udp/udp_socket_libevent.cc
@@ -767,4 +767,8 @@ int UDPSocketLibevent::SetDiffServCodePoint(DiffServCodePoint dscp) {
return OK;
}
+void UDPSocketLibevent::DetachFromThread() {
+ base::NonThreadSafe::DetachFromThread();
+}
+
} // namespace net
diff --git a/net/udp/udp_socket_libevent.h b/net/udp/udp_socket_libevent.h
index 2d1cefd..130dcaf 100644
--- a/net/udp/udp_socket_libevent.h
+++ b/net/udp/udp_socket_libevent.h
@@ -163,6 +163,9 @@ class NET_EXPORT UDPSocketLibevent : public base::NonThreadSafe {
// Return a network error code.
int SetDiffServCodePoint(DiffServCodePoint dscp);
+ // Resets the thread to be used for thread-safety checks.
+ void DetachFromThread();
+
private:
enum SocketOptions {
SOCKET_OPTION_REUSE_ADDRESS = 1 << 0,
diff --git a/net/udp/udp_socket_win.cc b/net/udp/udp_socket_win.cc
index cd4ec4a..f084037 100644
--- a/net/udp/udp_socket_win.cc
+++ b/net/udp/udp_socket_win.cc
@@ -810,4 +810,8 @@ int UDPSocketWin::SetDiffServCodePoint(DiffServCodePoint dscp) {
return ERR_NOT_IMPLEMENTED;
}
+void UDPSocketWin::DetachFromThread() {
+ base::NonThreadSafe::DetachFromThread();
+}
+
} // namespace net
diff --git a/net/udp/udp_socket_win.h b/net/udp/udp_socket_win.h
index 2f24877..28b7d4a 100644
--- a/net/udp/udp_socket_win.h
+++ b/net/udp/udp_socket_win.h
@@ -161,6 +161,9 @@ class NET_EXPORT UDPSocketWin : NON_EXPORTED_BASE(public base::NonThreadSafe) {
// do anything on some platforms.
int SetDiffServCodePoint(DiffServCodePoint dscp);
+ // Resets the thread to be used for thread-safety checks.
+ void DetachFromThread();
+
private:
enum SocketOptions {
SOCKET_OPTION_REUSE_ADDRESS = 1 << 0,