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

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

Issue 2430973004: Landing Recent QUIC changes until 10:38 AM, Oct 17, 2016 UTC-4 (Closed)
Patch Set: Improving flagsaver logging Created 4 years, 2 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/quic_test_client.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
index 898679dae4ceeffefd87b366858f25166dcac61f..3fecb06485addbbfd94fbf4079ec6ed8474ddf6e 100644
--- a/net/tools/quic/test_tools/server_thread.h
+++ b/net/tools/quic/test_tools/server_thread.h
@@ -8,6 +8,7 @@
#include <memory>
#include "base/macros.h"
+#include "base/synchronization/lock.h"
#include "base/threading/simple_thread.h"
#include "net/base/ip_endpoint.h"
#include "net/quic/core/quic_config.h"
@@ -32,6 +33,9 @@ class ServerThread : public base::SimpleThread {
// Runs the event loop. Will initialize if necessary.
void Run() override;
+ // Schedules the given action for execution in the event loop.
+ void Schedule(std::function<void()> action);
+
// Waits for the handshake to be confirmed for the first session created.
void WaitForCryptoHandshakeConfirmed();
@@ -57,6 +61,7 @@ class ServerThread : public base::SimpleThread {
private:
void MaybeNotifyOfHandshakeConfirmation();
+ void ExecuteScheduledActions();
base::WaitableEvent confirmed_; // Notified when the first handshake is
// confirmed.
@@ -72,6 +77,9 @@ class ServerThread : public base::SimpleThread {
bool initialized_;
+ base::Lock scheduled_actions_lock_;
+ std::deque<std::function<void()>> scheduled_actions_;
+
DISALLOW_COPY_AND_ASSIGN(ServerThread);
};
« no previous file with comments | « net/tools/quic/test_tools/quic_test_client.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