Commit b1e7e50a authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

Deprecate content::BrowserThread::PostAfterStartupTask

BEST_EFFORT tasks will not run until after startup and only if there is no
critical work pending.

This patch should not change the current behaviour. Please double check
whether the task being posted via BrowserThread::PostAfterStartupTask
really cares about being run after startup or just wants to run after
any critical work was completed. If you are fine with it just running
after critical work has completed LGTM and keep on with your life. If
that is not the case let me know and please explain your reasoning in a
comment.

More details:
https://docs.google.com/document/d/1P8PV1qX2cOR2WRFD6v9CjygJkE_mftCtJ7BoqQHCKZI

This CL was uploaded by git cl split.

R=pwnall@chromium.org

Bug: 887407
Change-Id: I9206c2ed05b021f5357b6644dcf8cdf0c10b3267
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1631284Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Auto-Submit: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#663860}
parent f6a8aff4
...@@ -122,7 +122,7 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor( ...@@ -122,7 +122,7 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor(
{base::MayBlock(), base::TaskPriority::BEST_EFFORT, {base::MayBlock(), base::TaskPriority::BEST_EFFORT,
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN});
// Removes our old blob directories if they exist. // Removes our old blob directories if they exist.
BrowserThread::PostAfterStartupTask( BrowserThread::PostBestEffortTask(
FROM_HERE, file_task_runner, FROM_HERE, file_task_runner,
base::BindOnce(&RemoveOldBlobStorageDirectories, base::BindOnce(&RemoveOldBlobStorageDirectories,
std::move(blob_storage_parent), blob_storage_dir)); std::move(blob_storage_parent), blob_storage_dir));
...@@ -149,9 +149,8 @@ void ChromeBlobStorageContext::InitializeOnIOThread( ...@@ -149,9 +149,8 @@ void ChromeBlobStorageContext::InitializeOnIOThread(
std::move(file_task_runner))); std::move(file_task_runner)));
// Signal the BlobMemoryController when it's appropriate to calculate its // Signal the BlobMemoryController when it's appropriate to calculate its
// storage limits. // storage limits.
BrowserThread::PostAfterStartupTask( base::PostTaskWithTraits(
FROM_HERE, FROM_HERE, {content::BrowserThread::IO, base::TaskPriority::BEST_EFFORT},
base::CreateSingleThreadTaskRunnerWithTraits({BrowserThread::IO}),
base::BindOnce(&storage::BlobMemoryController::CalculateBlobStorageLimits, base::BindOnce(&storage::BlobMemoryController::CalculateBlobStorageLimits,
context_->mutable_memory_controller()->GetWeakPtr())); context_->mutable_memory_controller()->GetWeakPtr()));
} }
......
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