The DatabaseQuotaClient::DeleteOriginData method wraps up with:
base::Callback<void(int)> delete_callback = base::Bind(
&DidDeleteOriginData,
base::RetainedRef(base::ThreadTaskRunnerHandle::Get()), callback);
PostTaskAndReplyWithResult(
db_tracker_thread_.get(),
FROM_HERE,
base::Bind(&DatabaseTracker::DeleteDataForOrigin,
db_tracker_,
storage::GetIdentifierFromOrigin(origin),
delete_callback),
delete_callback);
DatabaseTracker::DeleteDataForOrigin ignores the passed callback unless it returns net::ERR_IO_PENDING, in which case it will call it asynchronously via ScheduleDatabasesForDeletion
So far as I can tell, this means that the callback can be run twice - once by PostTaskAndReplyWithResult, and then again after the ScheduleDatabasesForDeletion work completes.
This is persnickety if we want to convert QuotaClient's callbacks to OnceCallbacks. It also just seems broken.
Comment 1 by jsb...@chromium.org
, Jun 16 2017