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

Unified Diff: media/blink/buffered_data_source_host_impl.cc

Issue 1534273002: Switch to standard integer types in media/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: media/blink/buffered_data_source_host_impl.cc
diff --git a/media/blink/buffered_data_source_host_impl.cc b/media/blink/buffered_data_source_host_impl.cc
index 19d01be2b46135fbf575903f2653d3c6e47b95ae..d3ad3ded4dc5d6455cc365422e23ca69d63e9574 100644
--- a/media/blink/buffered_data_source_host_impl.cc
+++ b/media/blink/buffered_data_source_host_impl.cc
@@ -14,11 +14,12 @@ BufferedDataSourceHostImpl::BufferedDataSourceHostImpl()
BufferedDataSourceHostImpl::~BufferedDataSourceHostImpl() { }
-void BufferedDataSourceHostImpl::SetTotalBytes(int64 total_bytes) {
+void BufferedDataSourceHostImpl::SetTotalBytes(int64_t total_bytes) {
total_bytes_ = total_bytes;
}
-void BufferedDataSourceHostImpl::AddBufferedByteRange(int64 start, int64 end) {
+void BufferedDataSourceHostImpl::AddBufferedByteRange(int64_t start,
+ int64_t end) {
const auto i = buffered_byte_ranges_.find(start);
if (i.value() && i.interval_end() >= end) {
// No change
@@ -28,8 +29,9 @@ void BufferedDataSourceHostImpl::AddBufferedByteRange(int64 start, int64 end) {
did_loading_progress_ = true;
}
-static base::TimeDelta TimeForByteOffset(
- int64 byte_offset, int64 total_bytes, base::TimeDelta duration) {
+static base::TimeDelta TimeForByteOffset(int64_t byte_offset,
+ int64_t total_bytes,
+ base::TimeDelta duration) {
double position = static_cast<double>(byte_offset) / total_bytes;
// Snap to the beginning/end where the approximation can look especially bad.
if (position < 0.01)
@@ -37,7 +39,7 @@ static base::TimeDelta TimeForByteOffset(
if (position > 0.99)
return duration;
return base::TimeDelta::FromMilliseconds(
- static_cast<int64>(position * duration.InMilliseconds()));
+ static_cast<int64_t>(position * duration.InMilliseconds()));
}
void BufferedDataSourceHostImpl::AddBufferedTimeRanges(
@@ -48,8 +50,8 @@ void BufferedDataSourceHostImpl::AddBufferedTimeRanges(
if (total_bytes_ && !buffered_byte_ranges_.empty()) {
for (const auto i : buffered_byte_ranges_) {
if (i.second) {
- int64 start = i.first.begin;
- int64 end = i.first.end;
+ int64_t start = i.first.begin;
+ int64_t end = i.first.end;
buffered_time_ranges->Add(
TimeForByteOffset(start, total_bytes_, media_duration),
TimeForByteOffset(end, total_bytes_, media_duration));

Powered by Google App Engine
This is Rietveld 408576698