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

Unified Diff: content/renderer/media/webrtc/media_stream_remote_video_source.cc

Issue 1074963003: Clean up potentially leaky use of base::DeletePointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed another probleb Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/media/capture/web_contents_audio_input_stream_unittest.cc ('k') | dbus/object_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc/media_stream_remote_video_source.cc
diff --git a/content/renderer/media/webrtc/media_stream_remote_video_source.cc b/content/renderer/media/webrtc/media_stream_remote_video_source.cc
index a151647a7b100221f0f14eb18fbd930fabc43521..a42db405464b450f6e41a6552860d9544c28febb 100644
--- a/content/renderer/media/webrtc/media_stream_remote_video_source.cc
+++ b/content/renderer/media/webrtc/media_stream_remote_video_source.cc
@@ -88,13 +88,15 @@ void MediaStreamRemoteVideoSource::RemoteVideoSourceDelegate::RenderFrame(
// the data.
// TODO(magjed): Update media::VideoFrame to support const data so we don't
// need to const cast here.
+ scoped_ptr<cricket::VideoFrame> frame_copy(frame->Copy());
video_frame = media::VideoFrame::WrapExternalYuvData(
media::VideoFrame::YV12, size, gfx::Rect(size), size,
frame->GetYPitch(), frame->GetUPitch(), frame->GetVPitch(),
const_cast<uint8_t*>(frame->GetYPlane()),
const_cast<uint8_t*>(frame->GetUPlane()),
const_cast<uint8_t*>(frame->GetVPlane()), timestamp,
- base::Bind(&base::DeletePointer<cricket::VideoFrame>, frame->Copy()));
+ base::Bind(&base::DeletePointer<cricket::VideoFrame>,
+ base::Passed(&frame_copy)));
}
io_message_loop_->PostTask(
« no previous file with comments | « content/browser/media/capture/web_contents_audio_input_stream_unittest.cc ('k') | dbus/object_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698