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

Unified Diff: media/base/android/media_codec_bridge.cc

Issue 141113003: Refactor base/safe_numerics.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 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 | « gpu/command_buffer/common/gles2_cmd_format.h ('k') | media/base/audio_bus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_codec_bridge.cc
===================================================================
--- media/base/android/media_codec_bridge.cc (revision 245415)
+++ media/base/android/media_codec_bridge.cc (working copy)
@@ -14,7 +14,7 @@
#include "base/basictypes.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
-#include "base/safe_numerics.h"
+#include "base/numerics/safe_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "jni/MediaCodecBridge_jni.h"
@@ -225,7 +225,7 @@
size_t data_size,
const base::TimeDelta& presentation_time) {
DVLOG(3) << __PRETTY_FUNCTION__ << index << ": " << data_size;
- if (data_size > base::checked_numeric_cast<size_t>(kint32max))
+ if (data_size > base::checked_cast<size_t>(kint32max))
return MEDIA_CODEC_ERROR;
if (data && !FillInputBuffer(index, data, data_size))
return MEDIA_CODEC_ERROR;
@@ -252,7 +252,7 @@
int subsamples_size,
const base::TimeDelta& presentation_time) {
DVLOG(3) << __PRETTY_FUNCTION__ << index << ": " << data_size;
- if (data_size > base::checked_numeric_cast<size_t>(kint32max))
+ if (data_size > base::checked_cast<size_t>(kint32max))
return MEDIA_CODEC_ERROR;
if (data && !FillInputBuffer(index, data, data_size))
return MEDIA_CODEC_ERROR;
@@ -349,9 +349,9 @@
Java_MediaCodecBridge_dequeueOutputBuffer(
env, j_media_codec_.obj(), timeout.InMicroseconds());
*index = Java_DequeueOutputResult_index(env, result.obj());
- *offset = base::checked_numeric_cast<size_t>(
+ *offset = base::checked_cast<size_t>(
Java_DequeueOutputResult_offset(env, result.obj()));
- *size = base::checked_numeric_cast<size_t>(
+ *size = base::checked_cast<size_t>(
Java_DequeueOutputResult_numBytes(env, result.obj()));
if (presentation_time) {
*presentation_time = base::TimeDelta::FromMicroseconds(
@@ -408,7 +408,7 @@
ScopedJavaLocalRef<jobject> j_buffer(Java_MediaCodecBridge_getInputBuffer(
env, j_media_codec_.obj(), input_buffer_index));
*data = static_cast<uint8*>(env->GetDirectBufferAddress(j_buffer.obj()));
- *capacity = base::checked_numeric_cast<size_t>(
+ *capacity = base::checked_cast<size_t>(
env->GetDirectBufferCapacity(j_buffer.obj()));
}
@@ -590,7 +590,7 @@
void AudioCodecBridge::PlayOutputBuffer(int index, size_t size) {
DCHECK_LE(0, index);
- int numBytes = base::checked_numeric_cast<int>(size);
+ int numBytes = base::checked_cast<int>(size);
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> buf =
Java_MediaCodecBridge_getOutputBuffer(env, media_codec(), index);
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_format.h ('k') | media/base/audio_bus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698