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

Issue 874313 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Refactor RequestCoordinator::StopOfflining()

Project Member Reported by romax@chromium.org, Aug 15

Issue description

Currently the |final_callback| is referenced in both offliner->Cancel and later. A RepeatingCallback wrapper is used.
If later we want to change to use the OnceCallback, we might need to refactor so that it doesn't get moved twice if offliner->Cancel returns false.
 
more comments after committing the CL to CQ:
Line 349:
I think the code is fine, but think the explanation could be better... maybe something like this:

We want to call final_callback exactly once. When offliner->Cancel() returns false, the callback isn't called, so we call |callback| iff Cancel() returns false.

Line 361:
Run() has a r-value reference override, which presumably is a bit more efficient:
https://cs.chromium.org/chromium/src/base/callback.h?q=base/callback&sq=package:chromium&dr=C&l=132

so I would do std::move(callback).Run(...)


Labels: Hotlist-Fixit
Owner: romax@chromium.org
Status: Assigned (was: Untriaged)

Sign in to add a comment