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

Side by Side Diff: media/base/android/android_util.cc

Issue 2790783002: [Clank] Add JNI interface for media persistent license storage (Closed)
Patch Set: Fix lint Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "media/base/android/android_util.h"
6
7 #include <stddef.h>
8 #include <vector>
9
10 #include "base/android/jni_android.h"
11 #include "base/android/jni_array.h"
12
13 namespace media {
14
15 std::string JavaBytesToString(JNIEnv* env, jbyteArray j_byte_array) {
16 std::vector<uint8_t> byte_vector;
17 base::android::JavaByteArrayToByteVector(env, j_byte_array, &byte_vector);
18 return std::string(byte_vector.begin(), byte_vector.end());
19 }
20
21 JavaObjectPtr CreateJavaObjectPtr(jobject object) {
22 JavaObjectPtr j_object_ptr(new base::android::ScopedJavaGlobalRef<jobject>());
23 j_object_ptr->Reset(base::android::AttachCurrentThread(), object);
24 return j_object_ptr;
25 }
26
27 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/android_util.h ('k') | media/base/android/java/src/org/chromium/media/MediaDrmBridge.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698