Commit 3ba629a1 authored by Sky Malice's avatar Sky Malice Committed by Chromium LUCI CQ

Clean up unnecessary ProfileKey JNI params.

Change-Id: If36b7a0da82d041742c4f454381a20817a3d0a51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2607572Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: Sky Malice <skym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840395}
parent fc21ea4c
......@@ -19,8 +19,7 @@ public class ProfileKey {
private ProfileKey(long nativeProfileKeyAndroid) {
mNativeProfileKeyAndroid = nativeProfileKeyAndroid;
mIsOffTheRecord =
ProfileKeyJni.get().isOffTheRecord(mNativeProfileKeyAndroid, ProfileKey.this);
mIsOffTheRecord = ProfileKeyJni.get().isOffTheRecord(mNativeProfileKeyAndroid);
}
/**
......@@ -32,12 +31,11 @@ public class ProfileKey {
public static ProfileKey getLastUsedRegularProfileKey() {
// TODO(mheikal): Assert at least reduced mode is started when https://crbug.com/973241 is
// fixed.
return (ProfileKey) ProfileKeyJni.get().getLastUsedRegularProfileKey();
return ProfileKeyJni.get().getLastUsedRegularProfileKey();
}
public ProfileKey getOriginalKey() {
return (ProfileKey) ProfileKeyJni.get().getOriginalKey(
mNativeProfileKeyAndroid, ProfileKey.this);
return ProfileKeyJni.get().getOriginalKey(mNativeProfileKeyAndroid);
}
public boolean isOffTheRecord() {
......@@ -61,8 +59,8 @@ public class ProfileKey {
@NativeMethods
interface Natives {
Object getLastUsedRegularProfileKey();
Object getOriginalKey(long nativeProfileKeyAndroid, ProfileKey caller);
boolean isOffTheRecord(long nativeProfileKeyAndroid, ProfileKey caller);
ProfileKey getLastUsedRegularProfileKey();
ProfileKey getOriginalKey(long nativeProfileKeyAndroid);
boolean isOffTheRecord(long nativeProfileKeyAndroid);
}
}
......@@ -42,6 +42,11 @@ ProfileKey* ProfileKeyAndroid::FromProfileKeyAndroid(
}
// static
ScopedJavaLocalRef<jobject> JNI_ProfileKey_GetLastUsedRegularProfileKey(
JNIEnv* env) {
return ProfileKeyAndroid::GetLastUsedRegularProfileKey(env);
}
ScopedJavaLocalRef<jobject> ProfileKeyAndroid::GetLastUsedRegularProfileKey(
JNIEnv* env) {
ProfileKey* key = ::android::GetLastUsedRegularProfileKey();
......@@ -59,26 +64,17 @@ ScopedJavaLocalRef<jobject> ProfileKeyAndroid::GetLastUsedRegularProfileKey(
return ScopedJavaLocalRef<jobject>(profile_key_android->obj_);
}
ScopedJavaLocalRef<jobject> ProfileKeyAndroid::GetOriginalKey(
JNIEnv* env,
const JavaParamRef<jobject>& obj) {
ScopedJavaLocalRef<jobject> ProfileKeyAndroid::GetOriginalKey(JNIEnv* env) {
ProfileKeyAndroid* original_key =
key_->GetOriginalKey()->GetProfileKeyAndroid();
DCHECK(original_key);
return original_key->GetJavaObject();
}
jboolean ProfileKeyAndroid::IsOffTheRecord(JNIEnv* env,
const JavaParamRef<jobject>& obj) {
jboolean ProfileKeyAndroid::IsOffTheRecord(JNIEnv* env) {
return key_->IsOffTheRecord();
}
// static
ScopedJavaLocalRef<jobject> JNI_ProfileKey_GetLastUsedRegularProfileKey(
JNIEnv* env) {
return ProfileKeyAndroid::GetLastUsedRegularProfileKey(env);
}
ScopedJavaLocalRef<jobject> ProfileKeyAndroid::GetJavaObject() {
return ScopedJavaLocalRef<jobject>(obj_);
}
......@@ -26,13 +26,10 @@ class ProfileKeyAndroid {
GetLastUsedRegularProfileKey(JNIEnv* env);
// Return the original profile key.
base::android::ScopedJavaLocalRef<jobject> GetOriginalKey(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
base::android::ScopedJavaLocalRef<jobject> GetOriginalKey(JNIEnv* env);
// Whether this profile is off the record.
jboolean IsOffTheRecord(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
jboolean IsOffTheRecord(JNIEnv* env);
base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment