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

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

Issue 7646016: Remove branch in WebMediaPlayerImpl that is never reached (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « no previous file | 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 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 case media::PIPELINE_ERROR_INVALID_STATE: 948 case media::PIPELINE_ERROR_INVALID_STATE:
949 // Decode error. 949 // Decode error.
950 SetNetworkState(WebMediaPlayer::DecodeError); 950 SetNetworkState(WebMediaPlayer::DecodeError);
951 break; 951 break;
952 } 952 }
953 953
954 // Repaint to trigger UI update. 954 // Repaint to trigger UI update.
955 Repaint(); 955 Repaint();
956 } 956 }
957 957
958 void WebMediaPlayerImpl::OnNetworkEvent(PipelineStatus status) { 958 void WebMediaPlayerImpl::OnNetworkEvent(PipelineStatus status) {
scherkus (not reviewing) 2011/08/16 18:07:00 hmm.. I wonder if this should trigger a repaint c
959 DCHECK(MessageLoop::current() == main_loop_); 959 DCHECK(MessageLoop::current() == main_loop_);
960 if (status == media::PIPELINE_OK) { 960 if (status == media::PIPELINE_OK) {
961 if (pipeline_->IsNetworkActive()) { 961 if (pipeline_->IsNetworkActive())
962 SetNetworkState(WebKit::WebMediaPlayer::Loading); 962 SetNetworkState(WebKit::WebMediaPlayer::Loading);
963 } else { 963 else
964 // If we are inactive because we just finished receiving all the data,
965 // do one final repaint to show final progress.
966 if (bytesLoaded() == totalBytes() &&
967 network_state_ != WebKit::WebMediaPlayer::Idle) {
968 Repaint();
969
970 SetNetworkState(WebKit::WebMediaPlayer::Loaded);
971 }
972
973 SetNetworkState(WebKit::WebMediaPlayer::Idle); 964 SetNetworkState(WebKit::WebMediaPlayer::Idle);
974 }
975 } 965 }
976 } 966 }
977 967
978 void WebMediaPlayerImpl::OnDemuxerOpened() { 968 void WebMediaPlayerImpl::OnDemuxerOpened() {
979 DCHECK(MessageLoop::current() == main_loop_); 969 DCHECK(MessageLoop::current() == main_loop_);
980 970
981 // TODO(acolwell): Uncomment once WebKit changes are checked in. 971 // TODO(acolwell): Uncomment once WebKit changes are checked in.
982 // https://bugs.webkit.org/show_bug.cgi?id=64731 972 // https://bugs.webkit.org/show_bug.cgi?id=64731
983 //GetClient()->sourceOpened(); 973 //GetClient()->sourceOpened();
984 } 974 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 } 1017 }
1028 } 1018 }
1029 1019
1030 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { 1020 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() {
1031 DCHECK(MessageLoop::current() == main_loop_); 1021 DCHECK(MessageLoop::current() == main_loop_);
1032 DCHECK(client_); 1022 DCHECK(client_);
1033 return client_; 1023 return client_;
1034 } 1024 }
1035 1025
1036 } // namespace webkit_glue 1026 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698