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

Unified Diff: net/tools/quic/test_tools/server_thread.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/tools/quic/test_tools/run_all_unittests.cc ('k') | net/tools/quic/test_tools/server_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/test_tools/server_thread.h
diff --git a/net/tools/quic/test_tools/server_thread.h b/net/tools/quic/test_tools/server_thread.h
deleted file mode 100644
index 774ff67700eae1b828b4111687df3bfef6942ac2..0000000000000000000000000000000000000000
--- a/net/tools/quic/test_tools/server_thread.h
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef NET_TOOLS_QUIC_SERVER_THREAD_H_
-#define NET_TOOLS_QUIC_SERVER_THREAD_H_
-
-#include "base/threading/simple_thread.h"
-#include "net/base/ip_endpoint.h"
-#include "net/quic/quic_config.h"
-#include "net/tools/quic/quic_server.h"
-
-namespace net {
-namespace tools {
-namespace test {
-
-// Simple wrapper class to run server in a thread.
-class ServerThread : public base::SimpleThread {
- public:
- ServerThread(QuicServer* server,
- IPEndPoint address,
- bool strike_register_no_startup_period);
-
- ~ServerThread() override;
-
- // Prepares the server, but does not start accepting connections. Useful for
- // injecting mocks.
- void Initialize();
-
- // Runs the event loop. Will initialize if necessary.
- void Run() override;
-
- // Waits for the handshake to be confirmed for the first session created.
- void WaitForCryptoHandshakeConfirmed();
-
- // Pauses execution of the server until Resume() is called. May only be
- // called once.
- void Pause();
-
- // Resumes execution of the server after Pause() has been called. May only
- // be called once.
- void Resume();
-
- // Stops the server from executing and shuts it down, destroying all
- // server objects.
- void Quit();
-
- // Returns the underlying server. Care must be taken to avoid data races
- // when accessing the server. It is always safe to access the server
- // after calling Pause() and before calling Resume().
- QuicServer* server() { return server_.get(); }
-
- // Returns the port that the server is listening on.
- int GetPort();
-
- private:
- void MaybeNotifyOfHandshakeConfirmation();
-
- base::WaitableEvent confirmed_; // Notified when the first handshake is
- // confirmed.
- base::WaitableEvent pause_; // Notified when the server should pause.
- base::WaitableEvent paused_; // Notitied when the server has paused
- base::WaitableEvent resume_; // Notified when the server should resume.
- base::WaitableEvent quit_; // Notified when the server should quit.
-
- scoped_ptr<QuicServer> server_;
- IPEndPoint address_;
- base::Lock port_lock_;
- int port_;
-
- bool initialized_;
-
- DISALLOW_COPY_AND_ASSIGN(ServerThread);
-};
-
-} // namespace test
-} // namespace tools
-} // namespace net
-
-#endif // NET_TOOLS_QUIC_SERVER_THREAD_H_
« no previous file with comments | « net/tools/quic/test_tools/run_all_unittests.cc ('k') | net/tools/quic/test_tools/server_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698