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

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

Issue 1409123005: Add methods for telling V8 how much memory audio/video is using. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mock filter. Created 5 years, 2 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 (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 "media/base/decoder_buffer_queue.h" 5 #include "media/base/decoder_buffer_queue.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/numerics/safe_conversions.h" 8 #include "base/numerics/safe_conversions.h"
9 #include "media/base/decoder_buffer.h" 9 #include "media/base/decoder_buffer.h"
10 #include "media/base/timestamp_constants.h" 10 #include "media/base/timestamp_constants.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 return buffer; 68 return buffer;
69 } 69 }
70 70
71 void DecoderBufferQueue::Clear() { 71 void DecoderBufferQueue::Clear() {
72 queue_.clear(); 72 queue_.clear();
73 data_size_ = 0; 73 data_size_ = 0;
74 in_order_queue_.clear(); 74 in_order_queue_.clear();
75 earliest_valid_timestamp_ = kNoTimestamp(); 75 earliest_valid_timestamp_ = kNoTimestamp();
76 } 76 }
77 77
78 bool DecoderBufferQueue::IsEmpty() { 78 bool DecoderBufferQueue::IsEmpty() const {
79 return queue_.empty(); 79 return queue_.empty();
80 } 80 }
81 81
82 base::TimeDelta DecoderBufferQueue::Duration() { 82 base::TimeDelta DecoderBufferQueue::Duration() {
83 if (in_order_queue_.size() < 2) 83 if (in_order_queue_.size() < 2)
84 return base::TimeDelta(); 84 return base::TimeDelta();
85 85
86 base::TimeDelta start = in_order_queue_.front()->timestamp(); 86 base::TimeDelta start = in_order_queue_.front()->timestamp();
87 base::TimeDelta end = in_order_queue_.back()->timestamp(); 87 base::TimeDelta end = in_order_queue_.back()->timestamp();
88 return end - start; 88 return end - start;
89 } 89 }
90 90
91 } // namespace media 91 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698