Commit 948f3666 authored by torne's avatar torne Committed by Commit bot
Browse files

Remove now-unnecessary .obj() in Java method calls.

Java methods can now be passed JavaRef parameters directly; remove calls
to .obj() that were being used to convert JavaRef to bare jobject, in
preparation for requiring JavaRef to be used.

This CL only fixes cases that can be fixed by removing the precise
string ".obj()" from a function call and does not introduce any other
changes (though it was run through git cl format to rewrap lines
afterward). This is to enable rubberstamp reviews.

There are a much smaller number of nontrivial changes required to
completely eliminate use of bare jobject as Java method parameters,
which will come in followup CLs for proper review.

BUG=506850
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2237943002
Cr-Commit-Position: refs/heads/master@{#412237}
parent c88c2032
......@@ -135,9 +135,7 @@ AndroidStreamReaderURLRequestJobDelegateImpl::OpenInputStream(JNIEnv* env,
ConvertUTF8ToJavaString(env, url.spec());
ScopedJavaLocalRef<jobject> stream =
android_webview::Java_AndroidProtocolHandler_open(
env,
GetResourceContext(env).obj(),
jurl.obj());
env, GetResourceContext(env), jurl);
if (stream.is_null()) {
DLOG(ERROR) << "Unable to open input stream for Android URL";
......@@ -171,9 +169,7 @@ bool AndroidStreamReaderURLRequestJobDelegateImpl::GetMimeType(
InputStreamImpl::FromInputStream(stream);
ScopedJavaLocalRef<jstring> returned_type =
android_webview::Java_AndroidProtocolHandler_getMimeType(
env,
GetResourceContext(env).obj(),
stream_impl->jobj(), url.obj());
env, GetResourceContext(env), stream_impl->jobj(), url);
if (returned_type.is_null())
return false;
......
......@@ -134,8 +134,7 @@ void AwAutofillClient::ShowAutofillPopupImpl(
ScopedJavaLocalRef<jstring> label =
ConvertUTF16ToJavaString(env, suggestions[i].label);
Java_AwAutofillClient_addToAutofillSuggestionArray(
env, data_array.obj(), i, name.obj(), label.obj(),
suggestions[i].frontend_id);
env, data_array, i, name, label, suggestions[i].frontend_id);
}
ui::ViewAndroid* view_android = web_contents_->GetNativeView();
if (!view_android)
......@@ -150,11 +149,7 @@ void AwAutofillClient::ShowAutofillPopupImpl(
return;
view_android->SetAnchorRect(view, element_bounds);
Java_AwAutofillClient_showAutofillPopup(env,
obj.obj(),
view.obj(),
is_rtl,
data_array.obj());
Java_AwAutofillClient_showAutofillPopup(env, obj, view, is_rtl, data_array);
}
void AwAutofillClient::UpdateAutofillPopupDataListValues(
......@@ -171,7 +166,7 @@ void AwAutofillClient::HideAutofillPopup() {
if (obj.is_null())
return;
delegate_.reset();
Java_AwAutofillClient_hideAutofillPopup(env, obj.obj());
Java_AwAutofillClient_hideAutofillPopup(env, obj);
}
bool AwAutofillClient::IsAutocompleteEnabled() {
......
......@@ -279,7 +279,7 @@ void AwContents::SetAwAutofillClient(jobject client) {
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null())
return;
Java_AwContents_setAwAutofillClient(env, obj.obj(), client);
Java_AwContents_setAwAutofillClient(env, obj, client);
}
AwContents::~AwContents() {
......@@ -377,9 +377,8 @@ jint GetNativeInstanceCount(JNIEnv* env, const JavaParamRef<jclass>&) {
namespace {
void DocumentHasImagesCallback(const ScopedJavaGlobalRef<jobject>& message,
bool has_images) {
Java_AwContents_onDocumentHasImagesResponse(AttachCurrentThread(),
has_images,
message.obj());
Java_AwContents_onDocumentHasImagesResponse(AttachCurrentThread(), has_images,
message);
}
} // namespace
......@@ -400,9 +399,8 @@ void GenerateMHTMLCallback(ScopedJavaGlobalRef<jobject>* callback,
JNIEnv* env = AttachCurrentThread();
// Android files are UTF8, so the path conversion below is safe.
Java_AwContents_generateMHTMLCallback(
env,
ConvertUTF8ToJavaString(env, path.AsUTF8Unsafe()).obj(),
size, callback->obj());
env, ConvertUTF8ToJavaString(env, path.AsUTF8Unsafe()), size,
callback->obj());
}
} // namespace
......@@ -441,8 +439,7 @@ bool AwContents::OnReceivedHttpAuthRequest(const JavaRef<jobject>& handler,
ScopedJavaLocalRef<jstring> jrealm = ConvertUTF8ToJavaString(env, realm);
devtools_instrumentation::ScopedEmbedderCallbackTask embedder_callback(
"onReceivedHttpAuthRequest");
Java_AwContents_onReceivedHttpAuthRequest(env, obj.obj(), handler.obj(),
jhost.obj(), jrealm.obj());
Java_AwContents_onReceivedHttpAuthRequest(env, obj, handler, jhost, jrealm);
return true;
}
......@@ -486,9 +483,7 @@ void ShowGeolocationPromptHelperTask(const JavaObjectWeakGlobalRef& java_ref,
ConvertUTF8ToJavaString(env, origin.spec()));
devtools_instrumentation::ScopedEmbedderCallbackTask embedder_callback(
"onGeolocationPermissionsShowPrompt");
Java_AwContents_onGeolocationPermissionsShowPrompt(env,
j_ref.obj(),
j_origin.obj());
Java_AwContents_onGeolocationPermissionsShowPrompt(env, j_ref, j_origin);
}
}
......@@ -562,7 +557,7 @@ void AwContents::HideGeolocationPrompt(const GURL& origin) {
if (j_ref.obj()) {
devtools_instrumentation::ScopedEmbedderCallbackTask embedder_callback(
"onGeolocationPermissionsHidePrompt");
Java_AwContents_onGeolocationPermissionsHidePrompt(env, j_ref.obj());
Java_AwContents_onGeolocationPermissionsHidePrompt(env, j_ref);
}
if (!pending_geolocation_prompts_.empty()) {
ShowGeolocationPromptHelper(java_ref_,
......@@ -585,7 +580,7 @@ void AwContents::OnPermissionRequest(
return;
}
Java_AwContents_onPermissionRequest(env, j_ref.obj(), j_request.obj());
Java_AwContents_onPermissionRequest(env, j_ref, j_request);
}
void AwContents::OnPermissionRequestCanceled(AwPermissionRequest* request) {
......@@ -595,8 +590,7 @@ void AwContents::OnPermissionRequestCanceled(AwPermissionRequest* request) {
if (j_request.is_null() || j_ref.is_null())
return;
Java_AwContents_onPermissionRequestCanceled(
env, j_ref.obj(), j_request.obj());
Java_AwContents_onPermissionRequestCanceled(env, j_ref, j_request);
}
void AwContents::PreauthorizePermission(JNIEnv* env,
......@@ -629,7 +623,7 @@ void AwContents::RequestGeolocationPermission(
if (obj.is_null())
return;
if (Java_AwContents_useLegacyGeolocationPermissionAPI(env, obj.obj())) {
if (Java_AwContents_useLegacyGeolocationPermissionAPI(env, obj)) {
ShowGeolocationPrompt(origin, callback);
return;
}
......@@ -644,7 +638,7 @@ void AwContents::CancelGeolocationPermissionRequests(const GURL& origin) {
if (obj.is_null())
return;
if (Java_AwContents_useLegacyGeolocationPermissionAPI(env, obj.obj())) {
if (Java_AwContents_useLegacyGeolocationPermissionAPI(env, obj)) {
HideGeolocationPrompt(origin);
return;
}
......@@ -712,8 +706,8 @@ void AwContents::OnFindResultReceived(int active_ordinal,
if (obj.is_null())
return;
Java_AwContents_onFindResultReceived(
env, obj.obj(), active_ordinal, match_count, finished);
Java_AwContents_onFindResultReceived(env, obj, active_ordinal, match_count,
finished);
}
bool AwContents::ShouldDownloadFavicon(const GURL& icon_url) {
......@@ -736,8 +730,7 @@ void AwContents::OnReceivedIcon(const GURL& icon_url, const SkBitmap& bitmap) {
entry->GetFavicon().image = gfx::Image::CreateFrom1xBitmap(bitmap);
}
Java_AwContents_onReceivedIcon(
env, obj.obj(), gfx::ConvertToJavaBitmap(&bitmap).obj());
Java_AwContents_onReceivedIcon(env, obj, gfx::ConvertToJavaBitmap(&bitmap));
}
void AwContents::OnReceivedTouchIconUrl(const std::string& url,
......@@ -749,7 +742,7 @@ void AwContents::OnReceivedTouchIconUrl(const std::string& url,
return;
Java_AwContents_onReceivedTouchIconUrl(
env, obj.obj(), ConvertUTF8ToJavaString(env, url).obj(), precomposed);
env, obj, ConvertUTF8ToJavaString(env, url), precomposed);
}
void AwContents::PostInvalidate() {
......@@ -757,7 +750,7 @@ void AwContents::PostInvalidate() {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (!obj.is_null())
Java_AwContents_postInvalidateOnAnimation(env, obj.obj());
Java_AwContents_postInvalidateOnAnimation(env, obj);
}
void AwContents::OnNewPicture() {
......@@ -767,7 +760,7 @@ void AwContents::OnNewPicture() {
if (!obj.is_null()) {
devtools_instrumentation::ScopedEmbedderCallbackTask embedder_callback(
"onNewPicture");
Java_AwContents_onNewPicture(env, obj.obj());
Java_AwContents_onNewPicture(env, obj);
}
}
......@@ -831,13 +824,8 @@ void AwContents::UpdateLastHitTestData(JNIEnv* env,
if (data.img_src.is_valid())
img_src = ConvertUTF8ToJavaString(env, data.img_src.spec());
Java_AwContents_updateHitTestData(env,
obj,
data.type,
extra_data_for_type.obj(),
href.obj(),
anchor_text.obj(),
img_src.obj());
Java_AwContents_updateHitTestData(env, obj, data.type, extra_data_for_type,
href, anchor_text, img_src);
}
void AwContents::OnSizeChanged(JNIEnv* env,
......@@ -1031,9 +1019,7 @@ gfx::Point AwContents::GetLocationOnScreen() {
return gfx::Point();
std::vector<int> location;
base::android::JavaIntArrayToIntVector(
env,
Java_AwContents_getLocationOnScreen(env, obj.obj()).obj(),
&location);
env, Java_AwContents_getLocationOnScreen(env, obj).obj(), &location);
return gfx::Point(location[0], location[1]);
}
......@@ -1043,8 +1029,7 @@ void AwContents::ScrollContainerViewTo(const gfx::Vector2d& new_value) {
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null())
return;
Java_AwContents_scrollContainerViewTo(
env, obj.obj(), new_value.x(), new_value.y());
Java_AwContents_scrollContainerViewTo(env, obj, new_value.x(), new_value.y());
}
void AwContents::UpdateScrollState(const gfx::Vector2d& max_scroll_offset,
......@@ -1057,15 +1042,10 @@ void AwContents::UpdateScrollState(const gfx::Vector2d& max_scroll_offset,
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null())
return;
Java_AwContents_updateScrollState(env,
obj.obj(),
max_scroll_offset.x(),
max_scroll_offset.y(),
contents_size_dip.width(),
contents_size_dip.height(),
page_scale_factor,
min_page_scale_factor,
max_page_scale_factor);
Java_AwContents_updateScrollState(
env, obj, max_scroll_offset.x(), max_scroll_offset.y(),
contents_size_dip.width(), contents_size_dip.height(), page_scale_factor,
min_page_scale_factor, max_page_scale_factor);
}
void AwContents::DidOverscroll(const gfx::Vector2d& overscroll_delta,
......@@ -1075,7 +1055,7 @@ void AwContents::DidOverscroll(const gfx::Vector2d& overscroll_delta,
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null())
return;
Java_AwContents_didOverscroll(env, obj.obj(), overscroll_delta.x(),
Java_AwContents_didOverscroll(env, obj, overscroll_delta.x(),
overscroll_delta.y(), overscroll_velocity.x(),
overscroll_velocity.y());
}
......@@ -1118,8 +1098,8 @@ void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) {
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null())
return;
Java_AwContents_onWebLayoutPageScaleFactorChanged(env, obj.obj(),
page_scale_factor);
Java_AwContents_onWebLayoutPageScaleFactorChanged(env, obj,
page_scale_factor);
}
void AwContents::OnWebLayoutContentsSizeChanged(
......@@ -1130,7 +1110,7 @@ void AwContents::OnWebLayoutContentsSizeChanged(
if (obj.is_null())
return;
Java_AwContents_onWebLayoutContentsSizeChanged(
env, obj.obj(), contents_size.width(), contents_size.height());
env, obj, contents_size.width(), contents_size.height());
}
jlong AwContents::CapturePicture(JNIEnv* env,
......@@ -1158,8 +1138,8 @@ void InvokeVisualStateCallback(const JavaObjectWeakGlobalRef& java_ref,
ScopedJavaLocalRef<jobject> obj = java_ref.get(env);
if (obj.is_null())
return;
Java_AwContents_invokeVisualStateCallback(
env, obj.obj(), callback->obj(), request_id);
Java_AwContents_invokeVisualStateCallback(env, obj, callback->obj(),
request_id);
}
} // namespace
......
......@@ -65,8 +65,7 @@ AwContentsClientBridge::~AwContentsClientBridge() {
if (!obj.is_null()) {
// Clear the weak reference from the java peer to the native object since
// it is possible that java object lifetime can exceed the AwContens.
Java_AwContentsClientBridge_setNativeContentsClientBridge(env, obj.obj(),
0);
Java_AwContentsClientBridge_setNativeContentsClientBridge(env, obj, 0);
}
for (IDMap<content::ClientCertificateDelegate>::iterator iter(
......@@ -101,7 +100,7 @@ void AwContentsClientBridge::AllowCertificateError(
int request_id = pending_cert_error_callbacks_.Add(
new CertErrorCallback(callback));
*cancel_request = !Java_AwContentsClientBridge_allowCertificateError(
env, obj.obj(), cert_error, jcert.obj(), jurl.obj(), request_id);
env, obj, cert_error, jcert, jurl, request_id);
// if the request is cancelled, then cancel the stored callback
if (*cancel_request) {
pending_cert_error_callbacks_.Remove(request_id);
......@@ -183,12 +182,7 @@ void AwContentsClientBridge::SelectClientCertificate(
env, cert_request_info->host_and_port.host());
Java_AwContentsClientBridge_selectClientCertificate(
env,
obj.obj(),
request_id,
key_types_ref.obj(),
principals_ref.obj(),
host_name_ref.obj(),
env, obj, request_id, key_types_ref, principals_ref, host_name_ref,
cert_request_info->host_and_port.port());
// Release the guard.
......@@ -291,26 +285,22 @@ void AwContentsClientBridge::RunJavaScriptDialog(
switch (message_type) {
case content::JAVASCRIPT_MESSAGE_TYPE_ALERT: {
devtools_instrumentation::ScopedEmbedderCallbackTask("onJsAlert");
Java_AwContentsClientBridge_handleJsAlert(
env, obj.obj(), jurl.obj(), jmessage.obj(), callback_id);
Java_AwContentsClientBridge_handleJsAlert(env, obj, jurl, jmessage,
callback_id);
break;
}
case content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM: {
devtools_instrumentation::ScopedEmbedderCallbackTask("onJsConfirm");
Java_AwContentsClientBridge_handleJsConfirm(
env, obj.obj(), jurl.obj(), jmessage.obj(), callback_id);
Java_AwContentsClientBridge_handleJsConfirm(env, obj, jurl, jmessage,
callback_id);
break;
}
case content::JAVASCRIPT_MESSAGE_TYPE_PROMPT: {
ScopedJavaLocalRef<jstring> jdefault_value(
ConvertUTF16ToJavaString(env, default_prompt_text));
devtools_instrumentation::ScopedEmbedderCallbackTask("onJsPrompt");
Java_AwContentsClientBridge_handleJsPrompt(env,
obj.obj(),
jurl.obj(),
jmessage.obj(),
jdefault_value.obj(),
callback_id);
Java_AwContentsClientBridge_handleJsPrompt(env, obj, jurl, jmessage,
jdefault_value, callback_id);
break;
}
default:
......@@ -341,8 +331,8 @@ void AwContentsClientBridge::RunBeforeUnloadDialog(
ConvertUTF16ToJavaString(env, message_text));
devtools_instrumentation::ScopedEmbedderCallbackTask("onJsBeforeUnload");
Java_AwContentsClientBridge_handleJsBeforeUnload(
env, obj.obj(), jurl.obj(), jmessage.obj(), callback_id);
Java_AwContentsClientBridge_handleJsBeforeUnload(env, obj, jurl, jmessage,
callback_id);
}
bool AwContentsClientBridge::ShouldOverrideUrlLoading(const base::string16& url,
......@@ -357,7 +347,7 @@ bool AwContentsClientBridge::ShouldOverrideUrlLoading(const base::string16& url,
devtools_instrumentation::ScopedEmbedderCallbackTask(
"shouldOverrideUrlLoading");
return Java_AwContentsClientBridge_shouldOverrideUrlLoading(
env, obj.obj(), jurl.obj(), has_user_gesture, is_redirect, is_main_frame);
env, obj, jurl, has_user_gesture, is_redirect, is_main_frame);
}
void AwContentsClientBridge::ConfirmJsResult(JNIEnv* env,
......
......@@ -111,7 +111,7 @@ void AwContentsClientBridgeTest::TestCertType(SSLClientCertType type,
base::RunLoop().RunUntilIdle();
EXPECT_EQ(0, cert_selected_callbacks_);
ScopedJavaLocalRef<jobjectArray> key_types =
Java_MockAwContentsClientBridge_getKeyTypes(env_, jbridge_.obj());
Java_MockAwContentsClientBridge_getKeyTypes(env_, jbridge_);
std::vector<std::string> vec;
base::android::AppendJavaStringArrayToStringVector(env_,
key_types.obj(),
......@@ -131,8 +131,8 @@ TEST_F(AwContentsClientBridgeTest,
base::WrapUnique(new TestClientCertificateDelegate(this)));
bridge_->ProvideClientCertificateResponse(
env_, jbridge_,
Java_MockAwContentsClientBridge_getRequestId(env_, jbridge_.obj()),
Java_MockAwContentsClientBridge_createTestCertChain(env_, jbridge_.obj()),
Java_MockAwContentsClientBridge_getRequestId(env_, jbridge_),
Java_MockAwContentsClientBridge_createTestCertChain(env_, jbridge_),
nullptr);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(nullptr, selected_cert_);
......@@ -148,8 +148,7 @@ TEST_F(AwContentsClientBridgeTest,
bridge_->SelectClientCertificate(
cert_request_info_.get(),
base::WrapUnique(new TestClientCertificateDelegate(this)));
int requestId =
Java_MockAwContentsClientBridge_getRequestId(env_, jbridge_.obj());
int requestId = Java_MockAwContentsClientBridge_getRequestId(env_, jbridge_);
bridge_->ProvideClientCertificateResponse(env_, jbridge_, requestId, nullptr,
nullptr);
base::RunLoop().RunUntilIdle();
......
......@@ -307,8 +307,7 @@ AwContentsIoThreadClientImpl::GetCacheMode() const {
JNIEnv* env = AttachCurrentThread();
return static_cast<AwContentsIoThreadClient::CacheMode>(
Java_AwContentsIoThreadClient_getCacheMode(
env, java_object_.obj()));
Java_AwContentsIoThreadClient_getCacheMode(env, java_object_));
}
......@@ -356,8 +355,8 @@ void AwContentsIoThreadClientImpl::ShouldInterceptRequestAsync(
JNIEnv* env = AttachCurrentThread();
if (bg_thread_client_object_.is_null() && !java_object_.is_null()) {
bg_thread_client_object_.Reset(
Java_AwContentsIoThreadClient_getBackgroundThreadClient(
env, java_object_.obj()));
Java_AwContentsIoThreadClient_getBackgroundThreadClient(env,
java_object_));
}
if (!bg_thread_client_object_.is_null()) {
get_response = base::Bind(
......@@ -374,8 +373,8 @@ bool AwContentsIoThreadClientImpl::ShouldBlockContentUrls() const {
return false;
JNIEnv* env = AttachCurrentThread();
return Java_AwContentsIoThreadClient_shouldBlockContentUrls(
env, java_object_.obj());
return Java_AwContentsIoThreadClient_shouldBlockContentUrls(env,
java_object_);
}
bool AwContentsIoThreadClientImpl::ShouldBlockFileUrls() const {
......@@ -384,8 +383,7 @@ bool AwContentsIoThreadClientImpl::ShouldBlockFileUrls() const {
return false;
JNIEnv* env = AttachCurrentThread();
return Java_AwContentsIoThreadClient_shouldBlockFileUrls(
env, java_object_.obj());
return Java_AwContentsIoThreadClient_shouldBlockFileUrls(env, java_object_);
}
bool AwContentsIoThreadClientImpl::ShouldAcceptThirdPartyCookies() const {
......@@ -395,7 +393,7 @@ bool AwContentsIoThreadClientImpl::ShouldAcceptThirdPartyCookies() const {
JNIEnv* env = AttachCurrentThread();
return Java_AwContentsIoThreadClient_shouldAcceptThirdPartyCookies(
env, java_object_.obj());
env, java_object_);
}
bool AwContentsIoThreadClientImpl::ShouldBlockNetworkLoads() const {
......@@ -404,8 +402,8 @@ bool AwContentsIoThreadClientImpl::ShouldBlockNetworkLoads() const {
return false;
JNIEnv* env = AttachCurrentThread();
return Java_AwContentsIoThreadClient_shouldBlockNetworkLoads(
env, java_object_.obj());
return Java_AwContentsIoThreadClient_shouldBlockNetworkLoads(env,
java_object_);
}
void AwContentsIoThreadClientImpl::NewDownload(
......@@ -429,13 +427,8 @@ void AwContentsIoThreadClientImpl::NewDownload(
ConvertUTF8ToJavaString(env, mime_type);
Java_AwContentsIoThreadClient_onDownloadStart(
env,
java_object_.obj(),
jstring_url.obj(),
jstring_user_agent.obj(),
jstring_content_disposition.obj(),
jstring_mime_type.obj(),
content_length);
env, java_object_, jstring_url, jstring_user_agent,
jstring_content_disposition, jstring_mime_type, content_length);
}
void AwContentsIoThreadClientImpl::NewLoginRequest(const string& realm,
......@@ -453,8 +446,8 @@ void AwContentsIoThreadClientImpl::NewLoginRequest(const string& realm,
if (!account.empty())
jaccount = ConvertUTF8ToJavaString(env, account);
Java_AwContentsIoThreadClient_newLoginRequest(
env, java_object_.obj(), jrealm.obj(), jaccount.obj(), jargs.obj());
Java_AwContentsIoThreadClient_newLoginRequest(env, java_object_, jrealm,
jaccount, jargs);
}
void AwContentsIoThreadClientImpl::OnReceivedError(
......@@ -471,16 +464,10 @@ void AwContentsIoThreadClientImpl::OnReceivedError(
env, net::ErrorToString(request->status().error()));
Java_AwContentsIoThreadClient_onReceivedError(
env,
java_object_.obj(),
web_request.jstring_url.obj(),
web_request.is_main_frame,
web_request.has_user_gesture,
web_request.jstring_method.obj(),
web_request.jstringArray_header_names.obj(),
web_request.jstringArray_header_values.obj(),
error_code,
jstring_description.obj());
env, java_object_, web_request.jstring_url, web_request.is_main_frame,
web_request.has_user_gesture, web_request.jstring_method,
web_request.jstringArray_header_names,
web_request.jstringArray_header_values, error_code, jstring_description);
}
void AwContentsIoThreadClientImpl::OnReceivedHttpError(
......@@ -520,20 +507,12 @@ void AwContentsIoThreadClientImpl::OnReceivedHttpError(
ToJavaArrayOfStrings(env, response_header_values);
Java_AwContentsIoThreadClient_onReceivedHttpError(
env,
java_object_.obj(),
web_request.jstring_url.obj(),
web_request.is_main_frame,
web_request.has_user_gesture,
web_request.jstring_method.obj(),
web_request.jstringArray_header_names.obj(),
web_request.jstringArray_header_values.obj(),
jstring_mime_type.obj(),
jstring_encoding.obj(),
status_code,
jstring_reason.obj(),
jstringArray_response_header_names.obj(),
jstringArray_response_header_values.obj());
env, java_object_, web_request.jstring_url, web_request.is_main_frame,
web_request.has_user_gesture, web_request.jstring_method,
web_request.jstringArray_header_names,
web_request.jstringArray_header_values, jstring_mime_type,
jstring_encoding, status_code, jstring_reason,
jstringArray_response_header_names, jstringArray_response_header_values);
}
} // namespace android_webview
......@@ -51,7 +51,7 @@ bool AwGLFunctor::RequestInvokeGL(bool wait_for_completion) {
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null())
return false;
return Java_AwGLFunctor_requestInvokeGL(env, obj.obj(), wait_for_completion);
return Java_AwGLFunctor_requestInvokeGL(env, obj, wait_for_completion);
}
void AwGLFunctor::DetachFunctorFromView() {
......@@ -59,7 +59,7 @@ void AwGLFunctor::DetachFunctorFromView() {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (!obj.is_null())
Java_AwGLFunctor_detachFunctorFromView(env, obj.obj());
Java_AwGLFunctor_detachFunctorFromView(env, obj);
}
void AwGLFunctor::Destroy(JNIEnv* env,
......
......@@ -35,7 +35,7 @@ AwHttpAuthHandler::AwHttpAuthHandler(AwLoginDelegate* login_delegate,
AwHttpAuthHandler:: ~AwHttpAuthHandler() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
Java_AwHttpAuthHandler_handlerDestroyed(base::android::AttachCurrentThread(),
http_auth_handler_.obj());
http_auth_handler_);
}
void AwHttpAuthHandler::Proceed(JNIEnv* env,
......
......@@ -40,8 +40,7 @@ AwMessagePortServiceImpl::~AwMessagePortServiceImpl() {
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null())
return;
Java_AwMessagePortService_unregisterNativeAwMessagePortService(env,
obj.obj());
Java_AwMessagePortService_unregisterNativeAwMessagePortService(env, obj);
}