Add function to CancelableTaskTracker and convert BootTimeLoader (take 2)

This is the second try of: https://chromiumcodereview.appspot.com/11410073

Previous code has a potential race condition:

----------------------------------------------------------------
In old code when IsCanceledCallback is deleted. CancellationFlag is
deleted In task thread, and Untrack is called on client thread.

There's potential racy between:
1. CancellationFlag deletion. (task thread)
2. Untrack is called. (client thread)
3. TryCancel is called for the specific task. (client thread)

When the order is 1, 3, 2. There will be a CancellationFlag use after
delettion bug.
----------------------------------------------------------------

BUG=155883
TBR=brettw

Review URL: https://codereview.chromium.org/11414041

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168321 0039d316-1c4b-4281-b951-d872f2087c98
7 files changed