Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Issue 3006933002: Allow PostTask() to take unique_ptr to classes derived of QueuedTask (Closed)

Created:
3 years, 3 months ago by eladalon
Modified:
3 years, 3 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

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-Commit-Position: refs/heads/master@{#19625} Committed: https://chromium.googlesource.com/external/webrtc/+/ffe2e141834d80e12a41251a5dfe4ad9581a1baa

Patch Set 1 #

Total comments: 4

Patch Set 2 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -1 line) Patch
M webrtc/rtc_base/task_queue.h View 1 2 chunks +7 lines, -1 line 0 comments Download

Messages

Total messages: 15 (6 generated)
eladalon
PTAL
3 years, 3 months ago (2017-08-31 08:59:53 UTC) #2
nisse-webrtc
lgtm Description nit: Replace "yields in" by "yields" or "results in".
3 years, 3 months ago (2017-08-31 09:28:53 UTC) #3
nisse-webrtc
https://codereview.webrtc.org/3006933002/diff/1/webrtc/rtc_base/task_queue.h File webrtc/rtc_base/task_queue.h (right): https://codereview.webrtc.org/3006933002/diff/1/webrtc/rtc_base/task_queue.h#newcode199 webrtc/rtc_base/task_queue.h:199: void PostTask(const Closure& closure) { One question: At some ...
3 years, 3 months ago (2017-08-31 09:40:39 UTC) #4
kwiberg-webrtc
https://codereview.webrtc.org/3006933002/diff/1/webrtc/rtc_base/task_queue.h File webrtc/rtc_base/task_queue.h (right): https://codereview.webrtc.org/3006933002/diff/1/webrtc/rtc_base/task_queue.h#newcode25 webrtc/rtc_base/task_queue.h:25: #include "webrtc/rtc_base/type_traits.h" You should #include <type_traits> instead. https://codereview.webrtc.org/3006933002/diff/1/webrtc/rtc_base/task_queue.h#newcode199 webrtc/rtc_base/task_queue.h:199: ...
3 years, 3 months ago (2017-08-31 10:45:33 UTC) #5
eladalon
https://codereview.webrtc.org/3006933002/diff/1/webrtc/rtc_base/task_queue.h File webrtc/rtc_base/task_queue.h (right): https://codereview.webrtc.org/3006933002/diff/1/webrtc/rtc_base/task_queue.h#newcode25 webrtc/rtc_base/task_queue.h:25: #include "webrtc/rtc_base/type_traits.h" On 2017/08/31 10:45:33, kwiberg-webrtc wrote: > You ...
3 years, 3 months ago (2017-08-31 10:51:04 UTC) #7
kwiberg-webrtc
lgtm Your call if you want to put in the work required to enable the ...
3 years, 3 months ago (2017-08-31 10:53:02 UTC) #8
nisse-webrtc
On 2017/08/31 10:45:33, kwiberg-webrtc wrote: > I don't know offhand how to test if a ...
3 years, 3 months ago (2017-08-31 11:00:07 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/3006933002/20001
3 years, 3 months ago (2017-08-31 11:02:15 UTC) #12
commit-bot: I haz the power
3 years, 3 months ago (2017-08-31 11:36:13 UTC) #15
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/external/webrtc/+/ffe2e141834d80e12a41251a5...

Powered by Google App Engine
This is Rietveld 408576698