Allow PostTask() to take unique_ptr to classes derived of QueuedTask

Problem fixed by this CL: Let DerivedQueuedTask be a custom derivation of QueuedTask. Calling PostTask() with a std::unique_ptr<DerivedQueuedTask> does not work, because overload resolution sees PostTask(const Closure& closure) as a better match. The workaround of explicitly converting to std::unique_ptr<QueuedTask> before calling PostTask() results in less readable code.

Solution: Use std::enable_if to limit the template, thereby making the compiler use the right version of PostTask().

BUG=webrtc:8188

Review-Url: https://codereview.webrtc.org/3006933002
Cr-Original-Commit-Position: refs/heads/master@{#19625}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: ffe2e141834d80e12a41251a5dfe4ad9581a1baa
1 file changed