summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorsatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-14 04:24:38 +0000
committersatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-14 04:24:38 +0000
commitf845ea593ebc1d9b22e485d0087099ea6167bc2e (patch)
tree7eb179fca7db553dbd59985f8c7a1205410260a8 /content
parent89c11c4f179fb80ff565f3da14308511f5077257 (diff)
downloadchromium_src-f845ea593ebc1d9b22e485d0087099ea6167bc2e.zip
chromium_src-f845ea593ebc1d9b22e485d0087099ea6167bc2e.tar.gz
chromium_src-f845ea593ebc1d9b22e485d0087099ea6167bc2e.tar.bz2
Fix build breaks when building content_unittests for android.
Since http://codereview.chromium.org/9358028/ various method signatures have changed in jni_android.h and since the android bot doesn't build code under content/ yet we didn't notice build breaks in these files. BUG=None TEST= Review URL: http://codereview.chromium.org/9392024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121847 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/renderer_host/java/java_bound_object.cc19
-rw-r--r--content/browser/renderer_host/java/java_method.cc22
-rw-r--r--content/browser/tab_contents/tab_contents_view_android.cc8
3 files changed, 20 insertions, 29 deletions
diff --git a/content/browser/renderer_host/java/java_bound_object.cc b/content/browser/renderer_host/java/java_bound_object.cc
index ced5106..ce13300 100644
--- a/content/browser/renderer_host/java/java_bound_object.cc
+++ b/content/browser/renderer_host/java/java_bound_object.cc
@@ -15,6 +15,7 @@
using base::StringPrintf;
using base::android::AttachCurrentThread;
using base::android::ConvertUTF8ToJavaString;
+using base::android::GetClass;
using base::android::GetMethodIDFromClassName;
using base::android::JavaRef;
using base::android::ScopedJavaGlobalRef;
@@ -167,8 +168,7 @@ NPVariant CallJNIMethod(jobject object, const JavaType& return_type,
VOID_TO_NPVARIANT(result);
break;
}
- std::string str =
- base::android::ConvertJavaStringToUTF8(env, java_string.obj());
+ std::string str = base::android::ConvertJavaStringToUTF8(java_string);
// Take a copy and pass ownership to the variant. We must allocate using
// NPN_MemAlloc, to match NPN_ReleaseVariant, which uses NPN_MemFree.
size_t length = str.length();
@@ -241,7 +241,8 @@ jvalue CoerceJavaScriptNumberToJavaValue(const NPVariant& variant,
ConvertUTF8ToJavaString(
AttachCurrentThread(),
is_double ? StringPrintf("%.6lg", NPVARIANT_TO_DOUBLE(variant)) :
- base::Int64ToString(NPVARIANT_TO_INT32(variant))) :
+ base::Int64ToString(NPVARIANT_TO_INT32(variant))).
+ Release() :
NULL;
break;
case JavaType::TypeBoolean:
@@ -281,7 +282,7 @@ jvalue CoerceJavaScriptBooleanToJavaValue(const NPVariant& variant,
case JavaType::TypeString:
result.l = coerce_to_string ?
ConvertUTF8ToJavaString(AttachCurrentThread(),
- boolean_value ? "true" : "false") :
+ boolean_value ? "true" : "false").Release() :
NULL;
break;
case JavaType::TypeByte:
@@ -320,7 +321,7 @@ jvalue CoerceJavaScriptStringToJavaValue(const NPVariant& variant,
result.l = ConvertUTF8ToJavaString(
AttachCurrentThread(),
base::StringPiece(NPVARIANT_TO_STRING(variant).UTF8Characters,
- NPVARIANT_TO_STRING(variant).UTF8Length));
+ NPVARIANT_TO_STRING(variant).UTF8Length)).Release();
break;
case JavaType::TypeObject:
// LIVECONNECT_COMPLIANCE: Existing behavior is to convert to NULL. Spec
@@ -383,7 +384,7 @@ jobject CreateJavaArray(const JavaType& type, jsize length) {
case JavaType::TypeDouble:
return env->NewDoubleArray(length);
case JavaType::TypeString: {
- ScopedJavaLocalRef<jclass> clazz(env, env->FindClass("java/lang/String"));
+ ScopedJavaLocalRef<jclass> clazz(GetClass(env, "java/lang/String"));
return env->NewObjectArray(length, clazz.obj(), NULL);
}
case JavaType::TypeVoid:
@@ -554,7 +555,8 @@ jvalue CoerceJavaScriptObjectToJavaValue(const NPVariant& variant,
// LIVECONNECT_COMPLIANCE: Existing behavior is to convert to
// "undefined". Spec requires calling toString() on the Java object.
result.l = coerce_to_string ?
- ConvertUTF8ToJavaString(AttachCurrentThread(), "undefined") :
+ ConvertUTF8ToJavaString(AttachCurrentThread(), "undefined").
+ Release() :
NULL;
break;
case JavaType::TypeByte:
@@ -607,7 +609,8 @@ jvalue CoerceJavaScriptNullOrUndefinedToJavaValue(const NPVariant& variant,
// LIVECONNECT_COMPLIANCE: Existing behavior is to convert undefined to
// "undefined". Spec requires converting undefined to NULL.
result.l = (coerce_to_string && variant.type == NPVariantType_Void) ?
- ConvertUTF8ToJavaString(AttachCurrentThread(), "undefined") :
+ ConvertUTF8ToJavaString(AttachCurrentThread(), "undefined").
+ Release() :
NULL;
break;
case JavaType::TypeByte:
diff --git a/content/browser/renderer_host/java/java_method.cc b/content/browser/renderer_host/java/java_method.cc
index ee65b87..01235e8 100644
--- a/content/browser/renderer_host/java/java_method.cc
+++ b/content/browser/renderer_host/java/java_method.cc
@@ -12,6 +12,7 @@
using base::android::AttachCurrentThread;
using base::android::ConvertJavaStringToUTF8;
+using base::android::GetClass;
using base::android::GetMethodID;
using base::android::GetMethodIDFromClassName;
using base::android::GetStaticMethodID;
@@ -42,9 +43,7 @@ struct ModifierClassTraits :
JNIEnv* env = AttachCurrentThread();
// Use placement new to initialize our instance in our preallocated space.
return new (instance) ScopedJavaGlobalRef<jclass>(
- ScopedJavaLocalRef<jclass>(
- env,
- static_cast<jclass>(env->FindClass(kJavaLangReflectModifier))));
+ GetClass(env, kJavaLangReflectModifier));
}
};
@@ -105,7 +104,7 @@ JavaMethod::JavaMethod(const base::android::JavaRef<jobject>& method)
kJavaLangReflectMethod,
kGetName,
kReturningJavaLangString))));
- name_ = ConvertJavaStringToUTF8(env, name.obj());
+ name_ = ConvertJavaStringToUTF8(name);
}
JavaMethod::~JavaMethod() {
@@ -186,7 +185,7 @@ void JavaMethod::EnsureTypesAndIDAreSetUp() const {
kJavaLangClass,
kGetName,
kReturningJavaLangString))));
- std::string name_utf8 = ConvertJavaStringToUTF8(env, name.obj());
+ std::string name_utf8 = ConvertJavaStringToUTF8(name);
signature += BinaryNameToJNIName(name_utf8, &parameter_types_[i]);
}
signature += ")";
@@ -204,7 +203,7 @@ void JavaMethod::EnsureTypesAndIDAreSetUp() const {
kJavaLangClass,
kGetName,
kReturningJavaLangString))));
- signature += BinaryNameToJNIName(ConvertJavaStringToUTF8(env, name.obj()),
+ signature += BinaryNameToJNIName(ConvertJavaStringToUTF8(name),
&return_type_);
// Determine whether the method is static.
@@ -215,8 +214,7 @@ void JavaMethod::EnsureTypesAndIDAreSetUp() const {
kReturningInteger));
bool is_static = env->CallStaticBooleanMethod(
g_java_lang_reflect_modifier_class.Get().obj(),
- GetStaticMethodID(env,
- g_java_lang_reflect_modifier_class.Get().obj(),
+ GetStaticMethodID(env, g_java_lang_reflect_modifier_class.Get(),
kIsStatic,
kIntegerReturningBoolean),
modifiers);
@@ -229,10 +227,8 @@ void JavaMethod::EnsureTypesAndIDAreSetUp() const {
kGetDeclaringClass,
kReturningJavaLangClass))));
id_ = is_static ?
- GetStaticMethodID(env, declaring_class.obj(), name_.c_str(),
- signature.c_str()) :
- GetMethodID(env, declaring_class.obj(), name_.c_str(),
- signature.c_str());
-
+ GetStaticMethodID(env, declaring_class, name_.c_str(),
+ signature.c_str()) :
+ GetMethodID(env, declaring_class, name_.c_str(), signature.c_str());
java_method_.Reset();
}
diff --git a/content/browser/tab_contents/tab_contents_view_android.cc b/content/browser/tab_contents/tab_contents_view_android.cc
index 3b1b1ff..30c9ea3 100644
--- a/content/browser/tab_contents/tab_contents_view_android.cc
+++ b/content/browser/tab_contents/tab_contents_view_android.cc
@@ -108,14 +108,6 @@ void TabContentsViewAndroid::RemoveOverlayView() {
NOTIMPLEMENTED();
}
-void TabContentsViewAndroid::ConfirmTouchEvent(bool handled) {
- NOTIMPLEMENTED();
-}
-
-void TabContentsViewAndroid::DidSetNeedTouchEvents(bool need_touch_events) {
- NOTIMPLEMENTED();
-}
-
void TabContentsViewAndroid::CreateNewWindow(
int route_id,
const ViewHostMsg_CreateWindow_Params& params) {