DescriptionVideoCaptureHost/VideoCaptureControllerEventHandler cleanup
1. VideoCaptureControllerID is a struct inside VCCEventHandler, just
to wrap an int. It also defines operator< and operator== to enable
using it in std::map. This is not needed, so I replaced it with a
typedef int VideoCaptureControllerID;
And s/const VideoCaptureControllerID&/VideoCaptureControllerID/
This enabled VideoCaptureControllerEventHandler to become a
pure interface. Removed video_capture_controller_event_handler.cc.
2. VideoCaptureHost lives 100% in IO Thread, except ctor in UI thread.
There's this idiom on IPC message sending where there's two
methods OnBla() -> PostTask to DoBla() on IO -> Send msg.
But all methods are living on IO and Send is asynchronous anyway,
so those DoBla() dealing with Send() are folded into OnBla()
methods -- trhose remain they mean basically a sophisticated
DeleteLater().
3. A few methods use base::TimeTicks as param, when they can
use const base::TimeTicks&, replaced them (one less copy in the
critical capture path).
BUG=440843
Committed: https://crrev.com/abc12f001172a3df76199a07bc6972587a4f9775
Cr-Commit-Position: refs/heads/master@{#320933}
Patch Set 1 #Patch Set 2 : Removed VCHost self PostTask()ing. Range-based loops in VCController. #Patch Set 3 : s/base::TimeTicks/const base::TimeTicks&/, reinstalling OnEnded()/OnError->Do.. allowing for Delete… #
Total comments: 2
Patch Set 4 : Remove unneeded BindToCurrentLoop() #Messages
Total messages: 10 (4 generated)
|