Index: media/blink/multibuffer_data_source.cc |
diff --git a/media/blink/multibuffer_data_source.cc b/media/blink/multibuffer_data_source.cc |
index bfaec2069a11378c949f0b58cd6d7cf5be77eee4..36be3098753da924df02e4d479241697abf5a9f6 100644 |
--- a/media/blink/multibuffer_data_source.cc |
+++ b/media/blink/multibuffer_data_source.cc |
@@ -17,31 +17,31 @@ using blink::WebFrame; |
namespace { |
// Minimum preload buffer. |
-const int64 kMinBufferPreload = 2 << 20; // 2 Mb |
+const int64_t kMinBufferPreload = 2 << 20; // 2 Mb |
// Maxmimum preload buffer. |
-const int64 kMaxBufferPreload = 20 << 20; // 20 Mb |
+const int64_t kMaxBufferPreload = 20 << 20; // 20 Mb |
// Preload this much extra, then stop preloading until we fall below the |
// kTargetSecondsBufferedAhead. |
-const int64 kPreloadHighExtra = 1 << 20; // 1 Mb |
+const int64_t kPreloadHighExtra = 1 << 20; // 1 Mb |
// Total size of the pinned region in the cache. |
-const int64 kMaxBufferSize = 25 << 20; // 25 Mb |
+const int64_t kMaxBufferSize = 25 << 20; // 25 Mb |
// If bitrate is not known, use this. |
-const int64 kDefaultBitrate = 200 * 8 << 10; // 200 Kbps. |
+const int64_t kDefaultBitrate = 200 * 8 << 10; // 200 Kbps. |
// Maximum bitrate for buffer calculations. |
-const int64 kMaxBitrate = 20 * 8 << 20; // 20 Mbps. |
+const int64_t kMaxBitrate = 20 * 8 << 20; // 20 Mbps. |
// Maximum playback rate for buffer calculations. |
const double kMaxPlaybackRate = 25.0; |
// Preload this many seconds of data by default. |
-const int64 kTargetSecondsBufferedAhead = 10; |
+const int64_t kTargetSecondsBufferedAhead = 10; |
// Keep this many seconds of data for going back by default. |
-const int64 kTargetSecondsBufferedBehind = 2; |
+const int64_t kTargetSecondsBufferedBehind = 2; |
} // namespace |
@@ -54,9 +54,9 @@ T clamp(T value, T min, T max) { |
class MultibufferDataSource::ReadOperation { |
public: |
- ReadOperation(int64 position, |
+ ReadOperation(int64_t position, |
int size, |
- uint8* data, |
+ uint8_t* data, |
const DataSource::ReadCB& callback); |
~ReadOperation(); |
@@ -64,23 +64,23 @@ class MultibufferDataSource::ReadOperation { |
// afterwards. |
static void Run(scoped_ptr<ReadOperation> read_op, int result); |
- int64 position() { return position_; } |
+ int64_t position() { return position_; } |
int size() { return size_; } |
- uint8* data() { return data_; } |
+ uint8_t* data() { return data_; } |
private: |
- const int64 position_; |
+ const int64_t position_; |
const int size_; |
- uint8* data_; |
+ uint8_t* data_; |
DataSource::ReadCB callback_; |
DISALLOW_IMPLICIT_CONSTRUCTORS(ReadOperation); |
}; |
MultibufferDataSource::ReadOperation::ReadOperation( |
- int64 position, |
+ int64_t position, |
int size, |
- uint8* data, |
+ uint8_t* data, |
const DataSource::ReadCB& callback) |
: position_(position), size_(size), data_(data), callback_(callback) { |
DCHECK(!callback_.is_null()); |
@@ -148,8 +148,8 @@ bool MultibufferDataSource::assume_fully_buffered() { |
return !url_data_->url().SchemeIsHTTPOrHTTPS(); |
} |
-void MultibufferDataSource::CreateResourceLoader(int64 first_byte_position, |
- int64 last_byte_position) { |
+void MultibufferDataSource::CreateResourceLoader(int64_t first_byte_position, |
+ int64_t last_byte_position) { |
DCHECK(render_task_runner_->BelongsToCurrentThread()); |
reader_.reset(new MultiBufferReader( |
@@ -326,9 +326,9 @@ int64_t MultibufferDataSource::GetMemoryUsage() const { |
<< url_data_->multibuffer()->block_size_shift(); |
} |
-void MultibufferDataSource::Read(int64 position, |
+void MultibufferDataSource::Read(int64_t position, |
int size, |
- uint8* data, |
+ uint8_t* data, |
const DataSource::ReadCB& read_cb) { |
DVLOG(1) << "Read: " << position << " offset, " << size << " bytes"; |
// Reading is not allowed until after initialization. |
@@ -352,7 +352,7 @@ void MultibufferDataSource::Read(int64 position, |
base::Bind(&MultibufferDataSource::ReadTask, weak_factory_.GetWeakPtr())); |
} |
-bool MultibufferDataSource::GetSize(int64* size_out) { |
+bool MultibufferDataSource::GetSize(int64_t* size_out) { |
*size_out = url_data_->length(); |
return *size_out != kPositionNotSpecified; |
} |
@@ -484,7 +484,7 @@ void MultibufferDataSource::StartCallback() { |
UpdateLoadingState(true); |
} |
-void MultibufferDataSource::ProgressCallback(int64 begin, int64 end) { |
+void MultibufferDataSource::ProgressCallback(int64_t begin, int64_t end) { |
DVLOG(1) << __FUNCTION__ << "(" << begin << ", " << end << ")"; |
DCHECK(render_task_runner_->BelongsToCurrentThread()); |
@@ -540,7 +540,7 @@ void MultibufferDataSource::UpdateBufferSizes() { |
} |
// Use a default bit rate if unknown and clamp to prevent overflow. |
- int64 bitrate = clamp<int64>(bitrate_, 0, kMaxBitrate); |
+ int64_t bitrate = clamp<int64_t>(bitrate_, 0, kMaxBitrate); |
if (bitrate == 0) |
bitrate = kDefaultBitrate; |
@@ -551,13 +551,13 @@ void MultibufferDataSource::UpdateBufferSizes() { |
playback_rate = std::max(playback_rate, 1.0); |
playback_rate = std::min(playback_rate, kMaxPlaybackRate); |
- int64 bytes_per_second = (bitrate / 8.0) * playback_rate; |
+ int64_t bytes_per_second = (bitrate / 8.0) * playback_rate; |
- int64 preload = clamp(kTargetSecondsBufferedAhead * bytes_per_second, |
- kMinBufferPreload, kMaxBufferPreload); |
- int64 back_buffer = clamp(kTargetSecondsBufferedBehind * bytes_per_second, |
- kMinBufferPreload, kMaxBufferPreload); |
- int64 pin_forwards = kMaxBufferSize - back_buffer; |
+ int64_t preload = clamp(kTargetSecondsBufferedAhead * bytes_per_second, |
+ kMinBufferPreload, kMaxBufferPreload); |
+ int64_t back_buffer = clamp(kTargetSecondsBufferedBehind * bytes_per_second, |
+ kMinBufferPreload, kMaxBufferPreload); |
+ int64_t pin_forwards = kMaxBufferSize - back_buffer; |
DCHECK_LE(preload_ + kPreloadHighExtra, pin_forwards); |
reader_->SetMaxBuffer(back_buffer, pin_forwards); |