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

Unified Diff: net/test/embedded_test_server/embedded_test_server.cc

Issue 418043002: Add test for showing confirmation dialog for unsecure signin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybot errors fixed Created 6 years, 4 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 | « net/test/embedded_test_server/embedded_test_server.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/embedded_test_server/embedded_test_server.cc
diff --git a/net/test/embedded_test_server/embedded_test_server.cc b/net/test/embedded_test_server/embedded_test_server.cc
index 75b46e22166e6fb8aaaccddaf74e46dd863f3072..0fb73602534b3c5cdcc3562c41f7152b570c6c9d 100644
--- a/net/test/embedded_test_server/embedded_test_server.cc
+++ b/net/test/embedded_test_server/embedded_test_server.cc
@@ -92,9 +92,28 @@ HttpListenSocket::HttpListenSocket(const SocketDescriptor socket_descriptor,
void HttpListenSocket::Listen() {
DCHECK(thread_checker_.CalledOnValidThread());
+#if !defined(OS_POSIX)
+ // This method may be called after the IO thread is changed, thus we need to
+ // call |WatchSocket| again to make sure it listens on the current IO thread.
+ // Only needed for non POSIX platforms, since on POSIX platforms
+ // StreamListenSocket::Listen already calls WatchSocket inside the function.
+ WatchSocket(WAITING_ACCEPT);
+#endif
TCPListenSocket::Listen();
}
+void HttpListenSocket::ListenOnIOThread() {
xiyuan 2014/08/12 18:35:54 This looks the same as HttpListenSocket::Listen. I
guohui 2014/08/12 19:01:16 Sorry this patch is broken =( the #if block shoul
+ DCHECK(thread_checker_.CalledOnValidThread());
+#if !defined(OS_POSIX)
+ // This method may be called after the IO thread is changed, thus we need to
+ // call |WatchSocket| again to make sure it listens on the current IO thread.
+ // Only needed for non POSIX platforms, since on POSIX platforms
+ // StreamListenSocket::Listen already calls WatchSocket inside the function.
+ WatchSocket(WAITING_ACCEPT);
+#endif
+ Listen();
+}
+
HttpListenSocket::~HttpListenSocket() {
DCHECK(thread_checker_.CalledOnValidThread());
}
@@ -198,7 +217,7 @@ void EmbeddedTestServer::InitializeOnIOThread() {
void EmbeddedTestServer::ListenOnIOThread() {
DCHECK(io_thread_->message_loop_proxy()->BelongsToCurrentThread());
DCHECK(Started());
- listen_socket_->Listen();
+ listen_socket_->ListenOnIOThread();
}
void EmbeddedTestServer::ShutdownOnIOThread() {
« no previous file with comments | « net/test/embedded_test_server/embedded_test_server.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698