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

Side by Side Diff: webkit/media/webmediaplayer_ms.cc

Issue 15035013: Keep screen on when there is an active WebRTC session on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: code review: nits 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentVideoViewContextDelegate.java ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/media/webmediaplayer_ms.h" 5 #include "webkit/media/webmediaplayer_ms.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 135 }
136 136
137 void WebMediaPlayerMS::cancelLoad() { 137 void WebMediaPlayerMS::cancelLoad() {
138 DCHECK(thread_checker_.CalledOnValidThread()); 138 DCHECK(thread_checker_.CalledOnValidThread());
139 } 139 }
140 140
141 void WebMediaPlayerMS::play() { 141 void WebMediaPlayerMS::play() {
142 DVLOG(1) << "WebMediaPlayerMS::play"; 142 DVLOG(1) << "WebMediaPlayerMS::play";
143 DCHECK(thread_checker_.CalledOnValidThread()); 143 DCHECK(thread_checker_.CalledOnValidThread());
144 144
145 if (video_frame_provider_ && paused_) 145 if (paused_) {
146 video_frame_provider_->Play(); 146 if (video_frame_provider_)
147 video_frame_provider_->Play();
147 148
148 if (audio_renderer_ && paused_) 149 if (audio_renderer_)
149 audio_renderer_->Play(); 150 audio_renderer_->Play();
151
152 if (delegate_)
153 delegate_->DidPlay(this);
154 }
150 155
151 paused_ = false; 156 paused_ = false;
152 157
153 media_log_->AddEvent(media_log_->CreateEvent(media::MediaLogEvent::PLAY)); 158 media_log_->AddEvent(media_log_->CreateEvent(media::MediaLogEvent::PLAY));
154
155 if (delegate_)
156 delegate_->DidPlay(this);
157 } 159 }
158 160
159 void WebMediaPlayerMS::pause() { 161 void WebMediaPlayerMS::pause() {
160 DVLOG(1) << "WebMediaPlayerMS::pause"; 162 DVLOG(1) << "WebMediaPlayerMS::pause";
161 DCHECK(thread_checker_.CalledOnValidThread()); 163 DCHECK(thread_checker_.CalledOnValidThread());
162 164
163 if (video_frame_provider_) 165 if (video_frame_provider_)
164 video_frame_provider_->Pause(); 166 video_frame_provider_->Pause();
165 167
166 if (audio_renderer_ && !paused_) 168 if (!paused_) {
167 audio_renderer_->Pause(); 169 if (audio_renderer_)
170 audio_renderer_->Pause();
171
172 if (delegate_)
173 delegate_->DidPause(this);
174 }
168 175
169 paused_ = true; 176 paused_ = true;
170 177
171 media_log_->AddEvent(media_log_->CreateEvent(media::MediaLogEvent::PAUSE)); 178 media_log_->AddEvent(media_log_->CreateEvent(media::MediaLogEvent::PAUSE));
172
173 if (delegate_)
174 delegate_->DidPause(this);
175 } 179 }
176 180
177 bool WebMediaPlayerMS::supportsFullscreen() const { 181 bool WebMediaPlayerMS::supportsFullscreen() const {
178 DCHECK(thread_checker_.CalledOnValidThread()); 182 DCHECK(thread_checker_.CalledOnValidThread());
179 return true; 183 return true;
180 } 184 }
181 185
182 bool WebMediaPlayerMS::supportsSave() const { 186 bool WebMediaPlayerMS::supportsSave() const {
183 DCHECK(thread_checker_.CalledOnValidThread()); 187 DCHECK(thread_checker_.CalledOnValidThread());
184 return false; 188 return false;
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 GetClient()->readyStateChanged(); 467 GetClient()->readyStateChanged();
464 } 468 }
465 469
466 WebKit::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { 470 WebKit::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() {
467 DCHECK(thread_checker_.CalledOnValidThread()); 471 DCHECK(thread_checker_.CalledOnValidThread());
468 DCHECK(client_); 472 DCHECK(client_);
469 return client_; 473 return client_;
470 } 474 }
471 475
472 } // namespace webkit_media 476 } // namespace webkit_media
OLDNEW
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentVideoViewContextDelegate.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698