diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-18 22:53:05 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-18 22:53:05 +0000 |
commit | 54370ef679aee533c10cf16d504184f4d2825f36 (patch) | |
tree | eba544281e4c2e381152c57e9608c2288dff2d9e /remoting | |
parent | 43823995b45f01bbf8549cbf195a7aea7cb1227d (diff) | |
download | chromium_src-54370ef679aee533c10cf16d504184f4d2825f36.zip chromium_src-54370ef679aee533c10cf16d504184f4d2825f36.tar.gz chromium_src-54370ef679aee533c10cf16d504184f4d2825f36.tar.bz2 |
Clean up VideoFrame::CreateXXX and VideoFrame::AllocXXX methods.
No need to confuse people with potentially-NULL pointers due to out-of-memory conditions.
Review URL: http://codereview.chromium.org/7396007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92917 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/base/codec_test.cc | 8 | ||||
-rw-r--r-- | remoting/client/plugin/pepper_view.cc | 12 |
2 files changed, 9 insertions, 11 deletions
diff --git a/remoting/base/codec_test.cc b/remoting/base/codec_test.cc index 38593fb..d1b4978 100644 --- a/remoting/base/codec_test.cc +++ b/remoting/base/codec_test.cc @@ -121,10 +121,10 @@ class DecoderTester { DecoderTester(Decoder* decoder) : strict_(false), decoder_(decoder) { - media::VideoFrame::CreateFrame(media::VideoFrame::RGB32, - kWidth, kHeight, - base::TimeDelta(), - base::TimeDelta(), &frame_); + frame_ = media::VideoFrame::CreateFrame(media::VideoFrame::RGB32, + kWidth, kHeight, + base::TimeDelta(), + base::TimeDelta()); EXPECT_TRUE(frame_.get()); decoder_->Initialize(frame_); } diff --git a/remoting/client/plugin/pepper_view.cc b/remoting/client/plugin/pepper_view.cc index 714c1e0..bf5ae1c 100644 --- a/remoting/client/plugin/pepper_view.cc +++ b/remoting/client/plugin/pepper_view.cc @@ -430,13 +430,11 @@ void PepperView::AllocateFrame(media::VideoFrame::Format format, Task* done) { DCHECK(CurrentlyOnPluginThread()); - media::VideoFrame::CreateFrame(media::VideoFrame::RGB32, - width, height, - base::TimeDelta(), base::TimeDelta(), - frame_out); - if (*frame_out) { - (*frame_out)->AddRef(); - } + *frame_out = media::VideoFrame::CreateFrame(media::VideoFrame::RGB32, + width, height, + base::TimeDelta(), + base::TimeDelta()); + (*frame_out)->AddRef(); done->Run(); delete done; } |