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

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

Issue 1906423005: Replace scoped_ptr with std::unique_ptr in //media/base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-media-base: android Created 4 years, 8 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 | « media/base/android/provision_fetcher.h ('k') | media/base/android/sdk_media_codec_bridge_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/sdk_media_codec_bridge.cc
diff --git a/media/base/android/sdk_media_codec_bridge.cc b/media/base/android/sdk_media_codec_bridge.cc
index 226a90a6cbf8c2a6262ca11096ed24b562d8e82f..b3802888e8ba63307c5a6d34862272d8f63e1c29 100644
--- a/media/base/android/sdk_media_codec_bridge.cc
+++ b/media/base/android/sdk_media_codec_bridge.cc
@@ -6,6 +6,7 @@
#include <algorithm>
#include <limits>
+#include <memory>
#include <utility>
#include "base/android/build_info.h"
@@ -42,7 +43,7 @@ enum {
};
static ScopedJavaLocalRef<jintArray>
-ToJavaIntArray(JNIEnv* env, scoped_ptr<jint[]> native_array, int size) {
+ToJavaIntArray(JNIEnv* env, std::unique_ptr<jint[]> native_array, int size) {
ScopedJavaLocalRef<jintArray> j_array(env, env->NewIntArray(size));
env->SetIntArrayRegion(j_array.obj(), 0, size, native_array.get());
return j_array;
@@ -186,8 +187,8 @@ MediaCodecStatus SdkMediaCodecBridge::QueueSecureInputBuffer(
// one subsample here just to be on the safe side.
int new_subsamples_size = subsamples_size == 0 ? 1 : subsamples_size;
- scoped_ptr<jint[]> native_clear_array(new jint[new_subsamples_size]);
- scoped_ptr<jint[]> native_cypher_array(new jint[new_subsamples_size]);
+ std::unique_ptr<jint[]> native_clear_array(new jint[new_subsamples_size]);
+ std::unique_ptr<jint[]> native_cypher_array(new jint[new_subsamples_size]);
if (subsamples_size == 0) {
DCHECK(!subsamples);
@@ -348,7 +349,7 @@ AudioCodecBridge* AudioCodecBridge::Create(const AudioCodec& codec) {
if (mime.empty())
return nullptr;
- scoped_ptr<AudioCodecBridge> bridge(new AudioCodecBridge(mime));
+ std::unique_ptr<AudioCodecBridge> bridge(new AudioCodecBridge(mime));
if (!bridge->media_codec())
return nullptr;
@@ -611,7 +612,7 @@ VideoCodecBridge* VideoCodecBridge::CreateDecoder(
if (mime.empty())
return nullptr;
- scoped_ptr<VideoCodecBridge> bridge(
+ std::unique_ptr<VideoCodecBridge> bridge(
new VideoCodecBridge(mime, is_secure, MEDIA_CODEC_DECODER));
if (!bridge->media_codec())
return nullptr;
@@ -645,7 +646,7 @@ VideoCodecBridge* VideoCodecBridge::CreateEncoder(const VideoCodec& codec,
if (mime.empty())
return nullptr;
- scoped_ptr<VideoCodecBridge> bridge(
+ std::unique_ptr<VideoCodecBridge> bridge(
new VideoCodecBridge(mime, false, MEDIA_CODEC_ENCODER));
if (!bridge->media_codec())
return nullptr;
« no previous file with comments | « media/base/android/provision_fetcher.h ('k') | media/base/android/sdk_media_codec_bridge_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698