Commit 973d6c53 authored by Mark Brand's avatar Mark Brand Committed by Commit Bot

Add DCHECKs to BlobTaskProxy to validate the intended sequencing restrictions.

The calls to BelongsToCurrentThread appear to be no-ops at the moment, and
assume that they were intended to be DCHECKS, so a quick CL to fix.

Change-Id: I33a6c8e05312b528d5a4e89fd18a0cff6281cd28
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762238
Commit-Queue: Xing Liu <xingliu@chromium.org>
Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720592}
parent c69ed863
......@@ -36,11 +36,12 @@ BlobTaskProxy::BlobTaskProxy(
}
BlobTaskProxy::~BlobTaskProxy() {
io_task_runner_->BelongsToCurrentThread();
CHECK(io_task_runner_->BelongsToCurrentThread());
}
void BlobTaskProxy::InitializeOnIO(BlobContextGetter blob_context_getter) {
io_task_runner_->BelongsToCurrentThread();
DCHECK(io_task_runner_->BelongsToCurrentThread());
blob_storage_context_ = blob_context_getter.Run();
}
......@@ -56,7 +57,7 @@ void BlobTaskProxy::SaveAsBlob(std::unique_ptr<std::string> data,
void BlobTaskProxy::SaveAsBlobOnIO(std::unique_ptr<std::string> data,
BlobDataHandleCallback callback) {
io_task_runner_->BelongsToCurrentThread();
DCHECK(io_task_runner_->BelongsToCurrentThread());
// Build blob data. This has to do a copy into blob's internal storage.
std::string blob_uuid = base::GenerateGUID();
......@@ -73,7 +74,7 @@ void BlobTaskProxy::SaveAsBlobOnIO(std::unique_ptr<std::string> data,
void BlobTaskProxy::BlobSavedOnIO(BlobDataHandleCallback callback,
storage::BlobStatus status) {
io_task_runner_->BelongsToCurrentThread();
DCHECK(io_task_runner_->BelongsToCurrentThread());
// Relay BlobDataHandle and |status| back to main thread.
auto cb =
......
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