Reimplement FrameSubscriber with mojo VideoCapture APIs

This commit is contained in:
Heilig Benedek 2018-04-18 02:45:15 +02:00 committed by Samuel Attard
parent 28f6e10e5a
commit 1de1ca906a
6 changed files with 99 additions and 104 deletions

View file

@ -1637,10 +1637,8 @@ void WebContents::SendInputEvent(v8::Isolate* isolate,
}
void WebContents::BeginFrameSubscription(mate::Arguments* args) {
bool only_dirty = false;
FrameSubscriber::FrameCaptureCallback callback;
args->GetNext(&only_dirty);
if (!args->GetNext(&callback)) {
args->ThrowError();
return;
@ -1648,16 +1646,12 @@ void WebContents::BeginFrameSubscription(mate::Arguments* args) {
auto* const view = web_contents()->GetRenderWidgetHostView();
if (view) {
std::unique_ptr<FrameSubscriber> frame_subscriber(
new FrameSubscriber(isolate(), view, callback, only_dirty));
view->BeginFrameSubscription(std::move(frame_subscriber));
frame_subscriber_.reset(new FrameSubscriber(isolate(), view, callback));
}
}
void WebContents::EndFrameSubscription() {
auto* const view = web_contents()->GetRenderWidgetHostView();
if (view)
view->EndFrameSubscription();
frame_subscriber_.reset();
}
void WebContents::StartDrag(const mate::Dictionary& item,