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

Unified Diff: media/base/android/media_player_listener.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/base/android/media_player_listener.cc
diff --git a/media/base/android/media_player_listener.cc b/media/base/android/media_player_listener.cc
index 95dd0c53335881762c2471c77cea976571a3067f..37a854331b7c24539c98f63f788cfd32e3eabfcc 100644
--- a/media/base/android/media_player_listener.cc
+++ b/media/base/android/media_player_listener.cc
@@ -5,6 +5,7 @@
#include "media/base/android/media_player_listener.h"
#include "base/android/jni_android.h"
+#include "base/android/scoped_java_ref.h"
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
@@ -15,6 +16,7 @@
using base::android::AttachCurrentThread;
using base::android::CheckException;
using base::android::JavaParamRef;
+using base::android::JavaRef;
using base::android::ScopedJavaLocalRef;
namespace media {
@@ -31,9 +33,9 @@ MediaPlayerListener::MediaPlayerListener(
MediaPlayerListener::~MediaPlayerListener() {}
void MediaPlayerListener::CreateMediaPlayerListener(
- jobject context, jobject media_player) {
+ const JavaRef<jobject>& context,
+ const JavaRef<jobject>& media_player) {
JNIEnv* env = AttachCurrentThread();
- CHECK(env);
if (j_media_player_listener_.is_null()) {
j_media_player_listener_.Reset(Java_MediaPlayerListener_create(
env, reinterpret_cast<intptr_t>(this), context, media_player));

Powered by Google App Engine
This is Rietveld 408576698