| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <memory> | 5 #include <memory> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 | 9 |
| 10 namespace media { | 10 namespace media { |
| 11 | 11 |
| 12 using JavaObjectPtr = | 12 using JavaObjectPtr = |
| 13 std::unique_ptr<base::android::ScopedJavaGlobalRef<jobject>>; | 13 std::unique_ptr<base::android::ScopedJavaGlobalRef<jobject>>; |
| 14 | 14 |
| 15 // Converts jbyteArray (byte[] in Java) into std::string. | 15 // Converts jbyteArray (byte[] in Java) into std::string. |
| 16 std::string JavaBytesToString(JNIEnv* env, jbyteArray j_byte_array); | 16 std::string JavaBytesToString(JNIEnv* env, jbyteArray j_byte_array); |
| 17 | 17 |
| 18 // Converts std::string to jbyteArray (byte[] in Java). |
| 19 base::android::ScopedJavaLocalRef<jbyteArray> StringToJavaBytes( |
| 20 JNIEnv* env, |
| 21 const std::string& str); |
| 22 |
| 18 // A helper method to create a JavaObjectPtr. | 23 // A helper method to create a JavaObjectPtr. |
| 19 JavaObjectPtr CreateJavaObjectPtr(jobject object); | 24 JavaObjectPtr CreateJavaObjectPtr(jobject object); |
| 20 | 25 |
| 21 } // namespace media | 26 } // namespace media |
| OLD | NEW |