Use weak pointer instead of manual bookkeeping
This commit is contained in:
parent
ed1966ac76
commit
66bb6a8534
3 changed files with 16 additions and 62 deletions
|
@ -1072,11 +1072,9 @@ void WebContents::BeginFrameSubscription(
|
|||
const FrameSubscriber::FrameCaptureCallback& callback) {
|
||||
const auto view = web_contents()->GetRenderWidgetHostView();
|
||||
if (view) {
|
||||
FrameSubscriber* frame_subscriber = new FrameSubscriber(
|
||||
isolate(), view->GetVisibleViewportSize(), callback);
|
||||
scoped_ptr<FrameSubscriber::Subscriber> del_frame_subscriber(
|
||||
frame_subscriber->GetSubscriber());
|
||||
view->BeginFrameSubscription(del_frame_subscriber.Pass());
|
||||
scoped_ptr<FrameSubscriber> frame_subscriber(new FrameSubscriber(
|
||||
isolate(), view->GetVisibleViewportSize(), callback));
|
||||
view->BeginFrameSubscription(frame_subscriber.Pass());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue