Index: ios/crnet/crnet_environment.mm |
diff --git a/ios/crnet/crnet_environment.mm b/ios/crnet/crnet_environment.mm |
index e61bead8dfa4c7155e0f5abcf188c3683b0f8bc9..42a54338c80a7936f4e00c478b6e6823b18b4634 100644 |
--- a/ios/crnet/crnet_environment.mm |
+++ b/ios/crnet/crnet_environment.mm |
@@ -23,6 +23,7 @@ |
#include "base/memory/ptr_util.h" |
#include "base/metrics/statistics_recorder.h" |
#include "base/path_service.h" |
+#include "base/single_thread_task_runner.h" |
#include "base/threading/worker_pool.h" |
#include "components/prefs/json_pref_store.h" |
#include "components/prefs/pref_filter.h" |
@@ -176,8 +177,7 @@ void CrNetEnvironment::StartNetLog(base::FilePath::StringType file_name, |
void CrNetEnvironment::StartNetLogInternal( |
base::FilePath::StringType file_name, bool log_bytes) { |
- DCHECK(base::MessageLoop::current() == |
- file_user_blocking_thread_->message_loop()); |
+ DCHECK(file_user_blocking_thread_->task_runner()->BelongsToCurrentThread()); |
DCHECK(file_name.length()); |
DCHECK(net_log_); |
@@ -210,8 +210,7 @@ void CrNetEnvironment::StopNetLog() { |
} |
void CrNetEnvironment::StopNetLogInternal() { |
- DCHECK(base::MessageLoop::current() == |
- file_user_blocking_thread_->message_loop()); |
+ DCHECK(file_user_blocking_thread_->task_runner()->BelongsToCurrentThread()); |
if (net_log_observer_) { |
net_log_observer_->StopObserving(nullptr); |
net_log_observer_.reset(); |
@@ -241,8 +240,7 @@ net::HttpNetworkSession* CrNetEnvironment::GetHttpNetworkSession( |
} |
void CrNetEnvironment::CloseAllSpdySessionsInternal() { |
- DCHECK(base::MessageLoop::current() == |
- network_io_thread_->message_loop()); |
+ DCHECK(network_io_thread_->task_runner()->BelongsToCurrentThread()); |
net::HttpNetworkSession* http_network_session = |
GetHttpNetworkSession(GetMainContextGetter()->GetURLRequestContext()); |
@@ -326,7 +324,7 @@ void CrNetEnvironment::SetHTTPProtocolHandlerRegistered(bool registered) { |
} |
void CrNetEnvironment::ConfigureSdchOnNetworkThread() { |
- DCHECK(base::MessageLoop::current() == network_io_thread_->message_loop()); |
+ DCHECK(network_io_thread_->task_runner()->BelongsToCurrentThread()); |
net::URLRequestContext* context = |
main_context_getter_->GetURLRequestContext(); |
@@ -351,7 +349,7 @@ void CrNetEnvironment::ConfigureSdchOnNetworkThread() { |
} |
void CrNetEnvironment::InitializeOnNetworkThread() { |
- DCHECK(base::MessageLoop::current() == network_io_thread_->message_loop()); |
+ DCHECK(network_io_thread_->task_runner()->BelongsToCurrentThread()); |
ConfigureSdchOnNetworkThread(); |