New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 734227 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

DatabaseQuotaClient::DeleteOriginData is weird

Project Member Reported by jsb...@chromium.org, Jun 16 2017

Issue description

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

Status: WontFix (was: Untriaged)
Hrm, this is already handled via DidDeleteOriginData() in database_quota_client.cc so I guess the current code is fine. Just need to figure out how to Once-ify it properly.

Sign in to add a comment