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

Unified Diff: media/capture/video/android/video_capture_device_factory_android.cc

Issue 2231923002: Make GetApplicationContext return a JavaRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also fix not-currently-compiled unit test Created 4 years, 4 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
Index: media/capture/video/android/video_capture_device_factory_android.cc
diff --git a/media/capture/video/android/video_capture_device_factory_android.cc b/media/capture/video/android/video_capture_device_factory_android.cc
index 3a65bda12e8b71c4b2c3f9573b7ba0a5b5feb5bb..84ff433373d950a9ba5daf306ba8689055d0d99e 100644
--- a/media/capture/video/android/video_capture_device_factory_android.cc
+++ b/media/capture/video/android/video_capture_device_factory_android.cc
@@ -8,12 +8,14 @@
#include "base/android/context_utils.h"
#include "base/android/jni_string.h"
+#include "base/android/scoped_java_ref.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "jni/VideoCaptureFactory_jni.h"
#include "media/capture/video/android/video_capture_device_android.h"
using base::android::AttachCurrentThread;
+using base::android::JavaRef;
using base::android::ScopedJavaLocalRef;
namespace media {
@@ -53,7 +55,7 @@ void VideoCaptureDeviceFactoryAndroid::GetDeviceDescriptors(
JNIEnv* env = AttachCurrentThread();
- const jobject context = base::android::GetApplicationContext();
+ const JavaRef<jobject>& context = base::android::GetApplicationContext();
const int num_cameras =
Java_VideoCaptureFactory_getNumberOfCameras(env, context);
DVLOG(1) << __FUNCTION__ << ": num_cameras=" << num_cameras;

Powered by Google App Engine
This is Rietveld 408576698