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

Issue 2936213003: Test using a global, replacable TaskQueueImpl factory.

Created:
3 years, 6 months ago by perkj_webrtc
Modified:
3 years, 3 months ago
CC:
webrtc-reviews_webrtc.org, yujie_mao (webrtc), kwiberg-webrtc, tterriberry_mozilla.com, qiang.lu, niklas.enbom, peah-webrtc, danilchap
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Test using a global, replacable TaskQueueImpl factory. BUG=none

Patch Set 1 #

Patch Set 2 : Added global factory. #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+304 lines, -76 lines) Patch
M webrtc/rtc_base/BUILD.gn View 1 1 chunk +3 lines, -0 lines 0 comments Download
M webrtc/rtc_base/task_queue.h View 1 3 chunks +7 lines, -37 lines 0 comments Download
A webrtc/rtc_base/task_queue_impl.h View 1 1 chunk +34 lines, -0 lines 0 comments Download
A webrtc/rtc_base/task_queue_impl_factory.h View 1 1 chunk +56 lines, -0 lines 4 comments Download
A webrtc/rtc_base/task_queue_impl_factory.cc View 1 1 chunk +39 lines, -0 lines 4 comments Download
M webrtc/rtc_base/task_queue_libevent.cc View 1 14 chunks +165 lines, -39 lines 0 comments Download

Messages

Total messages: 18 (13 generated)
perkj_webrtc
I created a TQ PIMPL out of the linux implementation for discussion. The implementation is ...
3 years, 6 months ago (2017-06-14 15:51:55 UTC) #4
perkj_webrtc
New discussions and new cls.... Latest approach still only touch the linux/android implementation at the ...
3 years, 4 months ago (2017-08-18 10:17:54 UTC) #10
perkj_webrtc
3 years, 4 months ago (2017-08-18 10:28:19 UTC) #12
nisse-webrtc
I find it acceptable. Even though it would be preferable to 1. Use a single ...
3 years, 4 months ago (2017-08-18 11:45:45 UTC) #15
kwiberg-webrtc
3 years, 4 months ago (2017-08-21 09:21:55 UTC) #17
https://codereview.webrtc.org/2936213003/diff/20001/webrtc/rtc_base/task_queu...
File webrtc/rtc_base/task_queue_impl_factory.cc (right):

https://codereview.webrtc.org/2936213003/diff/20001/webrtc/rtc_base/task_queu...
webrtc/rtc_base/task_queue_impl_factory.cc:22: void
TaskQueueImplFactory::Set(TaskQueueImplFactory* factory) {
Is it really a good idea for Set() to not take ownership of the factory? It
would seem safer for Set() to take a unique_ptr, and then explicitly leak the
factory by storing it in the static raw pointer on line 16. (And document that
this is what Set() does!)

Another alternative would be to let the factory be a function pointer instead of
an interface. That way, there is no per-instance state, and storing it in a raw
pointer becomes unproblematic. It doesn't look like you really need any state...

https://codereview.webrtc.org/2936213003/diff/20001/webrtc/rtc_base/task_queu...
webrtc/rtc_base/task_queue_impl_factory.cc:26: return;
If the contract is that you're only allowed to call this once, you should
CHECK() that.

https://codereview.webrtc.org/2936213003/diff/20001/webrtc/rtc_base/task_queu...
webrtc/rtc_base/task_queue_impl_factory.cc:31: if (taskqueue_factory)
Don't read this variable without taking the lock.

https://codereview.webrtc.org/2936213003/diff/20001/webrtc/rtc_base/task_queu...
File webrtc/rtc_base/task_queue_impl_factory.h (right):

https://codereview.webrtc.org/2936213003/diff/20001/webrtc/rtc_base/task_queu...
webrtc/rtc_base/task_queue_impl_factory.h:38: class TaskQueueLibEventFactory :
public TaskQueueImplFactory {
Does this class definition need to be here, in a header? It's usually possible
to put interface implementations in a .cc file together with the definition of
the function that instantiates them.

https://codereview.webrtc.org/2936213003/diff/20001/webrtc/rtc_base/task_queu...
webrtc/rtc_base/task_queue_impl_factory.h:41: ~TaskQueueLibEventFactory()
override = default;
Do you need these two?

https://codereview.webrtc.org/2936213003/diff/20001/webrtc/rtc_base/task_queu...
webrtc/rtc_base/task_queue_impl_factory.h:44: TaskQueueLibEventFactory&
operator=(const TaskQueueLibEventFactory&) = delete;
I don't think you need these two. Copying or moving isn't useful, but not
harmful either.

Powered by Google App Engine
This is Rietveld 408576698