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

Unified Diff: content/renderer/media/video_destination_handler.cc

Issue 14969013: Replace ASSERT with DCHECK per chromium style guide. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 7 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 | « no previous file | content/renderer/media/video_source_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/video_destination_handler.cc
===================================================================
--- content/renderer/media/video_destination_handler.cc (revision 199242)
+++ content/renderer/media/video_destination_handler.cc (working copy)
@@ -94,7 +94,10 @@
<< "Called when capturer is not started.";
return;
}
- ASSERT(image_data != NULL);
+ if (!image_data) {
+ LOG(ERROR) << "PpFrameWriter::PutFrame - Called with NULL image_data.";
+ return;
+ }
webkit::ppapi::ImageDataAutoMapper mapper(image_data);
if (!mapper.is_valid()) {
LOG(ERROR) << "PpFrameWriter::PutFrame - "
@@ -102,7 +105,11 @@
return;
}
const SkBitmap* bitmap = image_data->GetMappedBitmap();
- ASSERT(bitmap != NULL);
+ if (!bitmap) {
+ LOG(ERROR) << "PpFrameWriter::PutFrame - "
+ << "The image_data's mapped bitmap is NULL.";
+ return;
+ }
cricket::CapturedFrame frame;
frame.elapsed_time = 0;
@@ -115,7 +122,6 @@
frame.fourcc = cricket::FOURCC_BGRA;
} else {
LOG(ERROR) << "PpFrameWriter::PutFrame - Got RGBA which is not supported.";
- ASSERT(false);
return;
}
frame.data_size = bitmap->getSize();
@@ -135,7 +141,7 @@
PpFrameWriter* writer)
: track_(track),
writer_(writer) {
- ASSERT(writer_ != NULL);
+ DCHECK(writer_ != NULL);
}
virtual ~PpFrameWriterProxy() {}
@@ -159,7 +165,7 @@
FrameWriterInterface** frame_writer) {
if (!factory) {
factory = RenderThreadImpl::current()->GetMediaStreamDependencyFactory();
- ASSERT(factory != NULL);
+ DCHECK(factory != NULL);
}
WebKit::WebMediaStream stream;
if (registry) {
@@ -184,12 +190,11 @@
// Gets a handler to the native video track, which owns the |writer|.
MediaStreamExtraData* extra_data =
static_cast<MediaStreamExtraData*>(stream.extraData());
- DCHECK(extra_data);
webrtc::MediaStreamInterface* native_stream = extra_data->stream();
DCHECK(native_stream);
VideoTrackVector video_tracks = native_stream->GetVideoTracks();
// Currently one supports one video track per media stream.
- ASSERT(video_tracks.size() == 1);
+ DCHECK(video_tracks.size() == 1);
*frame_writer = new PpFrameWriterProxy(video_tracks[0].get(), writer);
return true;
« no previous file with comments | « no previous file | content/renderer/media/video_source_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698