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

Unified Diff: chrome/browser/invalidation/invalidation_service_factory_android.cc

Issue 1308363003: Revert of jni_generator: Make all object-returning natives return ScopedJavaLocalRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 5058f680ad98c84d0549c6875c936a762a3591a8..821d702a6e817ab6f0538be5ab9e6a45f296205c 100644
--- a/chrome/browser/invalidation/invalidation_service_factory_android.cc
+++ b/chrome/browser/invalidation/invalidation_service_factory_android.cc
@@ -16,39 +16,34 @@
namespace invalidation {
-ScopedJavaLocalRef<jobject> InvalidationServiceFactoryAndroid::GetForProfile(
- JNIEnv* env,
- jclass clazz,
- jobject j_profile) {
+jobject InvalidationServiceFactoryAndroid::GetForProfile(JNIEnv* env,
+ jclass clazz,
+ jobject j_profile) {
Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile);
invalidation::ProfileInvalidationProvider* provider =
ProfileInvalidationProviderFactory::GetForProfile(profile);
InvalidationServiceAndroid* service_android =
static_cast<InvalidationServiceAndroid*>(
provider->GetInvalidationService());
- return ScopedJavaLocalRef<jobject>(service_android->java_ref_);
+ return service_android->java_ref_.obj();
}
-ScopedJavaLocalRef<jobject> InvalidationServiceFactoryAndroid::GetForTest(
- JNIEnv* env,
- jclass clazz,
- jobject j_context) {
+jobject InvalidationServiceFactoryAndroid::GetForTest(JNIEnv* env,
+ jclass clazz,
+ jobject j_context) {
InvalidationServiceAndroid* service_android =
new InvalidationServiceAndroid(j_context);
- return ScopedJavaLocalRef<jobject>(service_android->java_ref_);
+ return service_android->java_ref_.obj();
}
-ScopedJavaLocalRef<jobject> GetForProfile(JNIEnv* env,
- jclass clazz,
- jobject j_profile) {
- return InvalidationServiceFactoryAndroid::GetForProfile(env, clazz,
- j_profile);
+jobject GetForProfile(JNIEnv* env, jclass clazz, jobject j_profile) {
+ return InvalidationServiceFactoryAndroid::GetForProfile(
+ env, clazz, j_profile);
}
-ScopedJavaLocalRef<jobject> GetForTest(JNIEnv* env,
- jclass clazz,
- jobject j_context) {
- return InvalidationServiceFactoryAndroid::GetForTest(env, clazz, j_context);
+jobject GetForTest(JNIEnv* env, jclass clazz, jobject j_context) {
+ return InvalidationServiceFactoryAndroid::GetForTest(
+ env, clazz, j_context);
}
bool InvalidationServiceFactoryAndroid::Register(JNIEnv* env) {
« no previous file with comments | « chrome/browser/invalidation/invalidation_service_factory_android.h ('k') | chrome/browser/profiles/profile_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698