Remove MessageLoop::current()->RunUntilIdle() in net.
This CL replaces MessageLoop::current()->RunUntilIdle() with
RunLoop().RunUntilIdle() in net.
In files where this replacement is made, it adds this include:
#include "base/run_loop.h"
And removes this include if it is no longer required:
#include "base/message_loop/message_loop.h"
Why?
- The fact that there's a MessageLoop on the thread is an
unnecessary implementation detail. When browser threads
are migrated to base/task_scheduler, tasks will no longer
have access to a MessageLoop but they will be able to use
RunLoop.
- MessageLoop::RunUntilIdle() is deprecated.
Steps to generate this patch:
1. Run message_loop_cleanup_3.py (see code on the bug).
2. Run tools/sort-headers.py on modified files.
3. Run git cl format.
BUG=616447
[email protected]
Review-Url: https://codereview.chromium.org/2053133002
Cr-Commit-Position: refs/heads/master@{#399197}
diff --git a/net/quic/quic_network_transaction_unittest.cc b/net/quic/quic_network_transaction_unittest.cc
index 6c3fdfd..710584c4 100644
--- a/net/quic/quic_network_transaction_unittest.cc
+++ b/net/quic/quic_network_transaction_unittest.cc
@@ -274,16 +274,16 @@
void SetUp() override {
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
void TearDown() override {
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
// Empty the current queue.
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
PlatformTest::TearDown();
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
std::unique_ptr<QuicEncryptedPacket> ConstructClientConnectionClosePacket(
@@ -2162,7 +2162,7 @@
void SetUp() override {
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
HttpNetworkSession::Params params;
@@ -2201,10 +2201,10 @@
void TearDown() override {
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
// Empty the current queue.
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
PlatformTest::TearDown();
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
void SetAlternativeService(const std::string& origin) {