Commit 9737cd2b authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate off BrowserThread::DeleteSoon in /ios/web

Instead use base::DeleteSoon which enforces usage of TaskTraits.

This CL is a no-op as-is. It was recently discovered however that some
callers did BrowserThread::DeleteSoon() with pending tasks running on
different task queues (different traits  -- e.g.

TaskTraits to make this more obvious. Please review whether calls in
this CL can be migrated as-is or need additional traits to match
potentially pending tasks.

Split from https://chromium-review.googlesource.com/c/chromium/src/+/1894109
for cursory review.

This CL was uploaded by git cl split.

R=marq@chromium.org


TaskPriority: :BEST_EFFORT) which can result in out-of-order deletion...
BrowserThread: :DeleteSoon() is being migrated to base::DeleteSoon() w/
Bug: 1019767
Change-Id: Ib6832ed38491ccee5452b66cf2ba26f98d530cee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1895652
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Commit-Queue: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712093}
parent d8a95882
...@@ -89,8 +89,8 @@ BrowserState::~BrowserState() { ...@@ -89,8 +89,8 @@ BrowserState::~BrowserState() {
shared_url_loader_factory_->Detach(); shared_url_loader_factory_->Detach();
if (network_context_) { if (network_context_) {
web::WebThread::DeleteSoon(web::WebThread::IO, FROM_HERE, base::DeleteSoon(FROM_HERE, {web::WebThread::IO},
network_context_owner_.release()); network_context_owner_.release());
} }
// Delete the URLDataManagerIOSBackend instance on the IO thread if it has // Delete the URLDataManagerIOSBackend instance on the IO thread if it has
...@@ -99,8 +99,8 @@ BrowserState::~BrowserState() { ...@@ -99,8 +99,8 @@ BrowserState::~BrowserState() {
// BrowserState are still accessing it on the IO thread at this point, // BrowserState are still accessing it on the IO thread at this point,
// they're going to have a bad time anyway. // they're going to have a bad time anyway.
if (url_data_manager_ios_backend_) { if (url_data_manager_ios_backend_) {
bool posted = web::WebThread::DeleteSoon(web::WebThread::IO, FROM_HERE, bool posted = base::DeleteSoon(FROM_HERE, {web::WebThread::IO},
url_data_manager_ios_backend_); url_data_manager_ios_backend_);
if (!posted) if (!posted)
delete url_data_manager_ios_backend_; delete url_data_manager_ios_backend_;
} }
......
...@@ -61,8 +61,8 @@ TEST_F(NetworkContextOwnerTest, Basic) { ...@@ -61,8 +61,8 @@ TEST_F(NetworkContextOwnerTest, Basic) {
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
EXPECT_FALSE(saw_connection_error_); EXPECT_FALSE(saw_connection_error_);
web::WebThread::DeleteSoon(web::WebThread::IO, FROM_HERE, base::DeleteSoon(FROM_HERE, {web::WebThread::IO},
network_context_owner_.release()); network_context_owner_.release());
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
EXPECT_TRUE(saw_connection_error_); // other end gone EXPECT_TRUE(saw_connection_error_); // other end gone
} }
...@@ -89,8 +89,8 @@ TEST_F(NetworkContextOwnerTest, ShutdownHandling) { ...@@ -89,8 +89,8 @@ TEST_F(NetworkContextOwnerTest, ShutdownHandling) {
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
EXPECT_TRUE(saw_connection_error_); // other end gone post-shutdown. EXPECT_TRUE(saw_connection_error_); // other end gone post-shutdown.
web::WebThread::DeleteSoon(web::WebThread::IO, FROM_HERE, base::DeleteSoon(FROM_HERE, {web::WebThread::IO},
network_context_owner_.release()); network_context_owner_.release());
} }
} // namespace web } // namespace web
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment