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

Unified Diff: media/blink/multibuffer_data_source.cc

Issue 2671613003: Add checked_cast to size_t conversion in multibuffer_data_source.cc (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/multibuffer_data_source.cc
diff --git a/media/blink/multibuffer_data_source.cc b/media/blink/multibuffer_data_source.cc
index 3eb6e51459f132aa1e9713921ff55173e743f63b..91d61231eb86a3f643c1e0b048c8ba38b156a861 100644
--- a/media/blink/multibuffer_data_source.cc
+++ b/media/blink/multibuffer_data_source.cc
@@ -10,6 +10,7 @@
#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/macros.h"
+#include "base/numerics/safe_conversions.h"
#include "base/single_thread_task_runner.h"
#include "media/base/media_log.h"
#include "media/blink/buffered_data_source_host_impl.h"
@@ -335,7 +336,7 @@ void MultibufferDataSource::OnBufferingHaveEnough(bool always_cancel) {
int64_t MultibufferDataSource::GetMemoryUsage() const {
// TODO(hubbe): Make more accurate when url_data_ is shared.
- return url_data_->CachedSize()
+ return base::checked_cast<int64_t>(url_data_->CachedSize())
brucedawson 2017/02/02 22:22:52 Why do we need a checked cast for converting to a
jrummell 2017/02/03 01:35:40 My understanding is that on some systems size_t is
<< url_data_->multibuffer()->block_size_shift();
}
« 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