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

Unified Diff: chrome/browser/invalidation/invalidation_service_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: chrome/browser/invalidation/invalidation_service_factory_android.cc
diff --git a/chrome/browser/invalidation/invalidation_service_factory_android.cc b/chrome/browser/invalidation/invalidation_service_factory_android.cc
index 1b86424a16e128fd8706c98cae7a443cef869d63..e46f85ad6d5a52cf59656039349f7c01bbb41b50 100644
--- a/chrome/browser/invalidation/invalidation_service_factory_android.cc
+++ b/chrome/browser/invalidation/invalidation_service_factory_android.cc
@@ -13,15 +13,14 @@
#include "jni/InvalidationServiceFactory_jni.h"
using base::android::JavaParamRef;
+using base::android::JavaRef;
using base::android::ScopedJavaLocalRef;
namespace invalidation {
ScopedJavaLocalRef<jobject> InvalidationServiceFactoryAndroid::GetForProfile(
- JNIEnv* env,
- jclass clazz,
- jobject j_profile) {
- Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile);
+ const JavaRef<jobject>& j_profile) {
+ Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile.obj());
invalidation::ProfileInvalidationProvider* provider =
ProfileInvalidationProviderFactory::GetForProfile(profile);
InvalidationServiceAndroid* service_android =
@@ -31,9 +30,7 @@ ScopedJavaLocalRef<jobject> InvalidationServiceFactoryAndroid::GetForProfile(
}
ScopedJavaLocalRef<jobject> InvalidationServiceFactoryAndroid::GetForTest(
- JNIEnv* env,
- jclass clazz,
- jobject j_context) {
+ const JavaRef<jobject>& j_context) {
InvalidationServiceAndroid* service_android =
new InvalidationServiceAndroid(j_context);
return ScopedJavaLocalRef<jobject>(service_android->java_ref_);
@@ -43,14 +40,13 @@ ScopedJavaLocalRef<jobject> GetForProfile(
JNIEnv* env,
const JavaParamRef<jclass>& clazz,
const JavaParamRef<jobject>& j_profile) {
- return InvalidationServiceFactoryAndroid::GetForProfile(env, clazz,
- j_profile);
+ return InvalidationServiceFactoryAndroid::GetForProfile(j_profile);
}
ScopedJavaLocalRef<jobject> GetForTest(JNIEnv* env,
const JavaParamRef<jclass>& clazz,
const JavaParamRef<jobject>& j_context) {
- return InvalidationServiceFactoryAndroid::GetForTest(env, clazz, j_context);
+ return InvalidationServiceFactoryAndroid::GetForTest(j_context);
}
bool InvalidationServiceFactoryAndroid::Register(JNIEnv* env) {

Powered by Google App Engine
This is Rietveld 408576698