Make canceling Timers fast.

base::Closure recently got an IsCancelled method. Taking advantage of
that the scheduler can short circuit a bunch of logic for cancelled
tasks and avoid running them and the rest of the task selection
machinery.

On the new TimerPerfTest benchmark this makes running 10000 cancelled
tasks aprox 50x - 60x faster (measured on Android and Linux).

Note this patch reverts many of the changes made in
https://codereview.chromium.org/2258713004 in favor of
WeakPtr based cancellation as favored by the base owners.

NOTE it's possible this might break
https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20ASAN

I was not able to reproduce the ASAN failure locally however
I suspect it's due to the Timer getting swept away which
should be fixed by the change in the latest patchset.

BUG=605718, 638542, 645876

Committed: https://crrev.com/e4e5868c5f32b015bf0d07a6eeace892d6a789a1
Review-Url: https://codereview.chromium.org/2319053004
Cr-Original-Commit-Position: refs/heads/master@{#417621}
Cr-Commit-Position: refs/heads/master@{#417931}
21 files changed