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

Side by Side Diff: media/base/download_rate_monitor.cc

Issue 8472004: Remove a superfluous DCHECK() in DownloadRateMonitor::Start() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 "media/base/download_rate_monitor.h" 5 #include "media/base/download_rate_monitor.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 start_ = end_; 67 start_ = end_;
68 end_ = BufferingPoint(); 68 end_ = BufferingPoint();
69 } 69 }
70 70
71 DownloadRateMonitor::DownloadRateMonitor() { 71 DownloadRateMonitor::DownloadRateMonitor() {
72 Reset(); 72 Reset();
73 } 73 }
74 74
75 void DownloadRateMonitor::Start( 75 void DownloadRateMonitor::Start(
76 const base::Closure& canplaythrough_cb, int media_bitrate) { 76 const base::Closure& canplaythrough_cb, int media_bitrate) {
77 DCHECK(stopped_);
78 canplaythrough_cb_ = canplaythrough_cb; 77 canplaythrough_cb_ = canplaythrough_cb;
79 stopped_ = false; 78 stopped_ = false;
80 bitrate_ = media_bitrate; 79 bitrate_ = media_bitrate;
81 current_sample_.Reset(); 80 current_sample_.Reset();
82 buffered_bytes_ = 0; 81 buffered_bytes_ = 0;
83 82
84 NotifyCanPlayThroughIfNeeded(); 83 NotifyCanPlayThroughIfNeeded();
85 } 84 }
86 85
87 void DownloadRateMonitor::SetBufferedBytes( 86 void DownloadRateMonitor::SetBufferedBytes(
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 240 }
242 241
243 void DownloadRateMonitor::NotifyCanPlayThroughIfNeeded() { 242 void DownloadRateMonitor::NotifyCanPlayThroughIfNeeded() {
244 if (ShouldNotifyCanPlayThrough() && !canplaythrough_cb_.is_null()) { 243 if (ShouldNotifyCanPlayThrough() && !canplaythrough_cb_.is_null()) {
245 canplaythrough_cb_.Run(); 244 canplaythrough_cb_.Run();
246 has_notified_can_play_through_ = true; 245 has_notified_can_play_through_ = true;
247 } 246 }
248 } 247 }
249 248
250 } // namespace media 249 } // namespace media
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