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

Side by Side Diff: webkit/glue/webmediaplayer_impl.cc

Issue 7538027: Make ChunkDemuxer error handling more consistent and robust. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove MessageLoop usage. Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/glue/webmediaplayer_impl.h" 5 #include "webkit/glue/webmediaplayer_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 DCHECK(MessageLoop::current() == main_loop_); 834 DCHECK(MessageLoop::current() == main_loop_);
835 return proxy_->DemuxerAppend(data, length); 835 return proxy_->DemuxerAppend(data, length);
836 } 836 }
837 837
838 void WebMediaPlayerImpl::sourceEndOfStream( 838 void WebMediaPlayerImpl::sourceEndOfStream(
839 WebKit::WebMediaPlayer::EndOfStreamStatus status) { 839 WebKit::WebMediaPlayer::EndOfStreamStatus status) {
840 DCHECK(MessageLoop::current() == main_loop_); 840 DCHECK(MessageLoop::current() == main_loop_);
841 media::PipelineStatus pipeline_status = media::PIPELINE_OK; 841 media::PipelineStatus pipeline_status = media::PIPELINE_OK;
842 842
843 switch(status) { 843 switch(status) {
844 case WebKit::WebMediaPlayer::EosNoError:
845 break;
844 case WebKit::WebMediaPlayer::EosNetworkError: 846 case WebKit::WebMediaPlayer::EosNetworkError:
845 pipeline_status = media::PIPELINE_ERROR_NETWORK; 847 pipeline_status = media::PIPELINE_ERROR_NETWORK;
846 break; 848 break;
847 case WebKit::WebMediaPlayer::EosDecodeError: 849 case WebKit::WebMediaPlayer::EosDecodeError:
848 pipeline_status = media::PIPELINE_ERROR_DECODE; 850 pipeline_status = media::PIPELINE_ERROR_DECODE;
849 break; 851 break;
850 default: 852 default:
851 NOTIMPLEMENTED(); 853 NOTIMPLEMENTED();
852 } 854 }
853 855
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 } 920 }
919 } 921 }
920 922
921 void WebMediaPlayerImpl::OnPipelineError(PipelineStatus error) { 923 void WebMediaPlayerImpl::OnPipelineError(PipelineStatus error) {
922 DCHECK(MessageLoop::current() == main_loop_); 924 DCHECK(MessageLoop::current() == main_loop_);
923 switch (error) { 925 switch (error) {
924 case media::PIPELINE_OK: 926 case media::PIPELINE_OK:
925 LOG(DFATAL) << "PIPELINE_OK isn't an error!"; 927 LOG(DFATAL) << "PIPELINE_OK isn't an error!";
926 break; 928 break;
927 929
930 case media::PIPELINE_ERROR_NETWORK:
931 SetNetworkState(WebMediaPlayer::NetworkError);
932 break;
933
928 case media::PIPELINE_ERROR_INITIALIZATION_FAILED: 934 case media::PIPELINE_ERROR_INITIALIZATION_FAILED:
929 case media::PIPELINE_ERROR_REQUIRED_FILTER_MISSING: 935 case media::PIPELINE_ERROR_REQUIRED_FILTER_MISSING:
930 case media::PIPELINE_ERROR_COULD_NOT_RENDER: 936 case media::PIPELINE_ERROR_COULD_NOT_RENDER:
931 case media::PIPELINE_ERROR_URL_NOT_FOUND: 937 case media::PIPELINE_ERROR_URL_NOT_FOUND:
932 case media::PIPELINE_ERROR_NETWORK:
933 case media::PIPELINE_ERROR_READ: 938 case media::PIPELINE_ERROR_READ:
934 case media::DEMUXER_ERROR_COULD_NOT_OPEN: 939 case media::DEMUXER_ERROR_COULD_NOT_OPEN:
935 case media::DEMUXER_ERROR_COULD_NOT_PARSE: 940 case media::DEMUXER_ERROR_COULD_NOT_PARSE:
936 case media::DEMUXER_ERROR_NO_SUPPORTED_STREAMS: 941 case media::DEMUXER_ERROR_NO_SUPPORTED_STREAMS:
937 case media::DEMUXER_ERROR_COULD_NOT_CREATE_THREAD: 942 case media::DEMUXER_ERROR_COULD_NOT_CREATE_THREAD:
938 case media::DATASOURCE_ERROR_URL_NOT_SUPPORTED: 943 case media::DATASOURCE_ERROR_URL_NOT_SUPPORTED:
939 // Format error. 944 // Format error.
940 SetNetworkState(WebMediaPlayer::FormatError); 945 SetNetworkState(WebMediaPlayer::FormatError);
941 break; 946 break;
942 947
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 } 1032 }
1028 } 1033 }
1029 1034
1030 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { 1035 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() {
1031 DCHECK(MessageLoop::current() == main_loop_); 1036 DCHECK(MessageLoop::current() == main_loop_);
1032 DCHECK(client_); 1037 DCHECK(client_);
1033 return client_; 1038 return client_;
1034 } 1039 }
1035 1040
1036 } // namespace webkit_glue 1041 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698