Frame subscriber bugfix + added only_damaged option

This commit is contained in:
Heilig Benedek 2016-06-21 02:15:39 +02:00
parent a35915ee9f
commit 3529f8a40a
4 changed files with 38 additions and 16 deletions

View file

@ -1195,11 +1195,18 @@ void WebContents::SendInputEvent(v8::Isolate* isolate,
}
void WebContents::BeginFrameSubscription(
const FrameSubscriber::FrameCaptureCallback& callback) {
mate::Arguments* args) {
FrameSubscriber::FrameCaptureCallback callback;
if (!args->GetNext(&callback))
return;
bool only_damaged = false;
args->GetNext(&only_damaged);
const auto view = web_contents()->GetRenderWidgetHostView();
if (view) {
std::unique_ptr<FrameSubscriber> frame_subscriber(new FrameSubscriber(
isolate(), view, callback));
isolate(), view, callback, only_damaged));
view->BeginFrameSubscription(std::move(frame_subscriber));
}
}