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

Side by Side Diff: content/renderer/media/webmediaplayer_impl.cc

Issue 275303002: Non-const impls. for WebMediaPlayer::didLoadingProgress(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove mutable bools. Created 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/renderer/media/webmediaplayer_impl.h" 5 #include "content/renderer/media/webmediaplayer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 if (ready_state_ < WebMediaPlayer::ReadyStateHaveMetadata) 531 if (ready_state_ < WebMediaPlayer::ReadyStateHaveMetadata)
532 return 0.0; 532 return 0.0;
533 533
534 // We don't support seeking in streaming media. 534 // We don't support seeking in streaming media.
535 if (data_source_ && data_source_->IsStreaming()) 535 if (data_source_ && data_source_->IsStreaming())
536 return 0.0; 536 return 0.0;
537 return duration(); 537 return duration();
538 } 538 }
539 539
540 bool WebMediaPlayerImpl::didLoadingProgress() const { 540 bool WebMediaPlayerImpl::didLoadingProgress() const {
541 return const_cast<WebMediaPlayerImpl*>(this)->didLoadingProgress();
542 }
543
544 bool WebMediaPlayerImpl::didLoadingProgress() {
541 DCHECK(main_loop_->BelongsToCurrentThread()); 545 DCHECK(main_loop_->BelongsToCurrentThread());
542 bool pipeline_progress = pipeline_.DidLoadingProgress(); 546 bool pipeline_progress = pipeline_.DidLoadingProgress();
543 bool data_progress = buffered_data_source_host_.DidLoadingProgress(); 547 bool data_progress = buffered_data_source_host_.DidLoadingProgress();
544 return pipeline_progress || data_progress; 548 return pipeline_progress || data_progress;
545 } 549 }
546 550
547 void WebMediaPlayerImpl::paint(WebCanvas* canvas, 551 void WebMediaPlayerImpl::paint(WebCanvas* canvas,
548 const WebRect& rect, 552 const WebRect& rect,
549 unsigned char alpha) { 553 unsigned char alpha) {
550 DCHECK(main_loop_->BelongsToCurrentThread()); 554 DCHECK(main_loop_->BelongsToCurrentThread());
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 compositor_task_runner_->PostTask(FROM_HERE, 1382 compositor_task_runner_->PostTask(FROM_HERE,
1379 base::Bind(&GetCurrentFrameAndSignal, 1383 base::Bind(&GetCurrentFrameAndSignal,
1380 base::Unretained(compositor_), 1384 base::Unretained(compositor_),
1381 &video_frame, 1385 &video_frame,
1382 &event)); 1386 &event));
1383 event.Wait(); 1387 event.Wait();
1384 return video_frame; 1388 return video_frame;
1385 } 1389 }
1386 1390
1387 } // namespace content 1391 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webmediaplayer_impl.h ('k') | content/renderer/media/webmediaplayer_ms.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698