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

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, ...@@ -135,9 +135,7 @@ AndroidStreamReaderURLRequestJobDelegateImpl::OpenInputStream(JNIEnv* env,
ConvertUTF8ToJavaString(env, url.spec()); ConvertUTF8ToJavaString(env, url.spec());
ScopedJavaLocalRef<jobject> stream = ScopedJavaLocalRef<jobject> stream =
android_webview::Java_AndroidProtocolHandler_open( android_webview::Java_AndroidProtocolHandler_open(
env, env, GetResourceContext(env), jurl);
GetResourceContext(env).obj(),
jurl.obj());
if (stream.is_null()) { if (stream.is_null()) {
DLOG(ERROR) << "Unable to open input stream for Android URL"; DLOG(ERROR) << "Unable to open input stream for Android URL";
...@@ -171,9 +169,7 @@ bool AndroidStreamReaderURLRequestJobDelegateImpl::GetMimeType( ...@@ -171,9 +169,7 @@ bool AndroidStreamReaderURLRequestJobDelegateImpl::GetMimeType(
InputStreamImpl::FromInputStream(stream); InputStreamImpl::FromInputStream(stream);
ScopedJavaLocalRef<jstring> returned_type = ScopedJavaLocalRef<jstring> returned_type =
android_webview::Java_AndroidProtocolHandler_getMimeType( android_webview::Java_AndroidProtocolHandler_getMimeType(
env, env, GetResourceContext(env), stream_impl->jobj(), url);
GetResourceContext(env).obj(),
stream_impl->jobj(), url.obj());
if (returned_type.is_null()) if (returned_type.is_null())
return false; return false;
......
...@@ -134,8 +134,7 @@ void AwAutofillClient::ShowAutofillPopupImpl( ...@@ -134,8 +134,7 @@ void AwAutofillClient::ShowAutofillPopupImpl(
ScopedJavaLocalRef<jstring> label = ScopedJavaLocalRef<jstring> label =
ConvertUTF16ToJavaString(env, suggestions[i].label); ConvertUTF16ToJavaString(env, suggestions[i].label);
Java_AwAutofillClient_addToAutofillSuggestionArray( Java_AwAutofillClient_addToAutofillSuggestionArray(
env, data_array.obj(), i, name.obj(), label.obj(), env, data_array, i, name, label, suggestions[i].frontend_id);
suggestions[i].frontend_id);
} }
ui::ViewAndroid* view_android = web_contents_->GetNativeView(); ui::ViewAndroid* view_android = web_contents_->GetNativeView();
if (!view_android) if (!view_android)
...@@ -150,11 +149,7 @@ void AwAutofillClient::ShowAutofillPopupImpl( ...@@ -150,11 +149,7 @@ void AwAutofillClient::ShowAutofillPopupImpl(
return; return;
view_android->SetAnchorRect(view, element_bounds); view_android->SetAnchorRect(view, element_bounds);
Java_AwAutofillClient_showAutofillPopup(env, Java_AwAutofillClient_showAutofillPopup(env, obj, view, is_rtl, data_array);
obj.obj(),
view.obj(),
is_rtl,
data_array.obj());
} }
void AwAutofillClient::UpdateAutofillPopupDataListValues( void AwAutofillClient::UpdateAutofillPopupDataListValues(
...@@ -171,7 +166,7 @@ void AwAutofillClient::HideAutofillPopup() { ...@@ -171,7 +166,7 @@ void AwAutofillClient::HideAutofillPopup() {
if (obj.is_null()) if (obj.is_null())
return; return;
delegate_.reset(); delegate_.reset();
Java_AwAutofillClient_hideAutofillPopup(env, obj.obj()); Java_AwAutofillClient_hideAutofillPopup(env, obj);
} }
bool AwAutofillClient::IsAutocompleteEnabled() { bool AwAutofillClient::IsAutocompleteEnabled() {
......
This diff is collapsed.
...@@ -65,8 +65,7 @@ AwContentsClientBridge::~AwContentsClientBridge() { ...@@ -65,8 +65,7 @@ AwContentsClientBridge::~AwContentsClientBridge() {
if (!obj.is_null()) { if (!obj.is_null()) {
// Clear the weak reference from the java peer to the native object since // Clear the weak reference from the java peer to the native object since
// it is possible that java object lifetime can exceed the AwContens. // it is possible that java object lifetime can exceed the AwContens.
Java_AwContentsClientBridge_setNativeContentsClientBridge(env, obj.obj(), Java_AwContentsClientBridge_setNativeContentsClientBridge(env, obj, 0);
0);
} }
for (IDMap<content::ClientCertificateDelegate>::iterator iter( for (IDMap<content::ClientCertificateDelegate>::iterator iter(
...@@ -101,7 +100,7 @@ void AwContentsClientBridge::AllowCertificateError( ...@@ -101,7 +100,7 @@ void AwContentsClientBridge::AllowCertificateError(
int request_id = pending_cert_error_callbacks_.Add( int request_id = pending_cert_error_callbacks_.Add(
new CertErrorCallback(callback)); new CertErrorCallback(callback));
*cancel_request = !Java_AwContentsClientBridge_allowCertificateError( *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 the request is cancelled, then cancel the stored callback
if (*cancel_request) { if (*cancel_request) {
pending_cert_error_callbacks_.Remove(request_id); pending_cert_error_callbacks_.Remove(request_id);
...@@ -183,12 +182,7 @@ void AwContentsClientBridge::SelectClientCertificate( ...@@ -183,12 +182,7 @@ void AwContentsClientBridge::SelectClientCertificate(
env, cert_request_info->host_and_port.host()); env, cert_request_info->host_and_port.host());
Java_AwContentsClientBridge_selectClientCertificate( Java_AwContentsClientBridge_selectClientCertificate(
env, env, obj, request_id, key_types_ref, principals_ref, host_name_ref,
obj.obj(),
request_id,
key_types_ref.obj(),
principals_ref.obj(),
host_name_ref.obj(),
cert_request_info->host_and_port.port()); cert_request_info->host_and_port.port());
// Release the guard. // Release the guard.
...@@ -291,26 +285,22 @@ void AwContentsClientBridge::RunJavaScriptDialog( ...@@ -291,26 +285,22 @@ void AwContentsClientBridge::RunJavaScriptDialog(
switch (message_type) { switch (message_type) {
case content::JAVASCRIPT_MESSAGE_TYPE_ALERT: { case content::JAVASCRIPT_MESSAGE_TYPE_ALERT: {
devtools_instrumentation::ScopedEmbedderCallbackTask("onJsAlert"); devtools_instrumentation::ScopedEmbedderCallbackTask("onJsAlert");
Java_AwContentsClientBridge_handleJsAlert( Java_AwContentsClientBridge_handleJsAlert(env, obj, jurl, jmessage,
env, obj.obj(), jurl.obj(), jmessage.obj(), callback_id); callback_id);
break; break;
} }
case content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM: { case content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM: {
devtools_instrumentation::ScopedEmbedderCallbackTask("onJsConfirm"); devtools_instrumentation::ScopedEmbedderCallbackTask("onJsConfirm");
Java_AwContentsClientBridge_handleJsConfirm( Java_AwContentsClientBridge_handleJsConfirm(env, obj, jurl, jmessage,
env, obj.obj(), jurl.obj(), jmessage.obj(), callback_id); callback_id);
break; break;
} }
case content::JAVASCRIPT_MESSAGE_TYPE_PROMPT: { case content::JAVASCRIPT_MESSAGE_TYPE_PROMPT: {
ScopedJavaLocalRef<jstring> jdefault_value( ScopedJavaLocalRef<jstring> jdefault_value(
ConvertUTF16ToJavaString(env, default_prompt_text)); ConvertUTF16ToJavaString(env, default_prompt_text));
devtools_instrumentation::ScopedEmbedderCallbackTask("onJsPrompt"); devtools_instrumentation::ScopedEmbedderCallbackTask("onJsPrompt");
Java_AwContentsClientBridge_handleJsPrompt(env, Java_AwContentsClientBridge_handleJsPrompt(env, obj, jurl, jmessage,
obj.obj(), jdefault_value, callback_id);
jurl.obj(),
jmessage.obj(),
jdefault_value.obj(),
callback_id);
break; break;
} }
default: default:
...@@ -341,8 +331,8 @@ void AwContentsClientBridge::RunBeforeUnloadDialog( ...@@ -341,8 +331,8 @@ void AwContentsClientBridge::RunBeforeUnloadDialog(
ConvertUTF16ToJavaString(env, message_text)); ConvertUTF16ToJavaString(env, message_text));
devtools_instrumentation::ScopedEmbedderCallbackTask("onJsBeforeUnload"); devtools_instrumentation::ScopedEmbedderCallbackTask("onJsBeforeUnload");
Java_AwContentsClientBridge_handleJsBeforeUnload( Java_AwContentsClientBridge_handleJsBeforeUnload(env, obj, jurl, jmessage,
env, obj.obj(), jurl.obj(), jmessage.obj(), callback_id); callback_id);
} }
bool AwContentsClientBridge::ShouldOverrideUrlLoading(const base::string16& url, bool AwContentsClientBridge::ShouldOverrideUrlLoading(const base::string16& url,
...@@ -357,7 +347,7 @@ bool AwContentsClientBridge::ShouldOverrideUrlLoading(const base::string16& url, ...@@ -357,7 +347,7 @@ bool AwContentsClientBridge::ShouldOverrideUrlLoading(const base::string16& url,
devtools_instrumentation::ScopedEmbedderCallbackTask( devtools_instrumentation::ScopedEmbedderCallbackTask(
"shouldOverrideUrlLoading"); "shouldOverrideUrlLoading");
return Java_AwContentsClientBridge_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, void AwContentsClientBridge::ConfirmJsResult(JNIEnv* env,
......
...@@ -111,7 +111,7 @@ void AwContentsClientBridgeTest::TestCertType(SSLClientCertType type, ...@@ -111,7 +111,7 @@ void AwContentsClientBridgeTest::TestCertType(SSLClientCertType type,
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
EXPECT_EQ(0, cert_selected_callbacks_); EXPECT_EQ(0, cert_selected_callbacks_);
ScopedJavaLocalRef<jobjectArray> key_types = ScopedJavaLocalRef<jobjectArray> key_types =
Java_MockAwContentsClientBridge_getKeyTypes(env_, jbridge_.obj()); Java_MockAwContentsClientBridge_getKeyTypes(env_, jbridge_);
std::vector<std::string> vec; std::vector<std::string> vec;
base::android::AppendJavaStringArrayToStringVector(env_, base::android::AppendJavaStringArrayToStringVector(env_,
key_types.obj(), key_types.obj(),
...@@ -131,8 +131,8 @@ TEST_F(AwContentsClientBridgeTest, ...@@ -131,8 +131,8 @@ TEST_F(AwContentsClientBridgeTest,
base::WrapUnique(new TestClientCertificateDelegate(this))); base::WrapUnique(new TestClientCertificateDelegate(this)));
bridge_->ProvideClientCertificateResponse( bridge_->ProvideClientCertificateResponse(
env_, jbridge_, env_, jbridge_,
Java_MockAwContentsClientBridge_getRequestId(env_, jbridge_.obj()), Java_MockAwContentsClientBridge_getRequestId(env_, jbridge_),
Java_MockAwContentsClientBridge_createTestCertChain(env_, jbridge_.obj()), Java_MockAwContentsClientBridge_createTestCertChain(env_, jbridge_),
nullptr); nullptr);
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
EXPECT_EQ(nullptr, selected_cert_); EXPECT_EQ(nullptr, selected_cert_);
...@@ -148,8 +148,7 @@ TEST_F(AwContentsClientBridgeTest, ...@@ -148,8 +148,7 @@ TEST_F(AwContentsClientBridgeTest,
bridge_->SelectClientCertificate( bridge_->SelectClientCertificate(
cert_request_info_.get(), cert_request_info_.get(),
base::WrapUnique(new TestClientCertificateDelegate(this))); base::WrapUnique(new TestClientCertificateDelegate(this)));
int requestId = int requestId = Java_MockAwContentsClientBridge_getRequestId(env_, jbridge_);
Java_MockAwContentsClientBridge_getRequestId(env_, jbridge_.obj());
bridge_->ProvideClientCertificateResponse(env_, jbridge_, requestId, nullptr, bridge_->ProvideClientCertificateResponse(env_, jbridge_, requestId, nullptr,
nullptr); nullptr);
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
......
...@@ -307,8 +307,7 @@ AwContentsIoThreadClientImpl::GetCacheMode() const { ...@@ -307,8 +307,7 @@ AwContentsIoThreadClientImpl::GetCacheMode() const {
JNIEnv* env = AttachCurrentThread(); JNIEnv* env = AttachCurrentThread();
return static_cast<AwContentsIoThreadClient::CacheMode>( return static_cast<AwContentsIoThreadClient::CacheMode>(
Java_AwContentsIoThreadClient_getCacheMode( Java_AwContentsIoThreadClient_getCacheMode(env, java_object_));
env, java_object_.obj()));
} }
...@@ -356,8 +355,8 @@ void AwContentsIoThreadClientImpl::ShouldInterceptRequestAsync( ...@@ -356,8 +355,8 @@ void AwContentsIoThreadClientImpl::ShouldInterceptRequestAsync(
JNIEnv* env = AttachCurrentThread(); JNIEnv* env = AttachCurrentThread();
if (bg_thread_client_object_.is_null() && !java_object_.is_null()) { if (bg_thread_client_object_.is_null() && !java_object_.is_null()) {
bg_thread_client_object_.Reset( bg_thread_client_object_.Reset(
Java_AwContentsIoThreadClient_getBackgroundThreadClient( Java_AwContentsIoThreadClient_getBackgroundThreadClient(env,
env, java_object_.obj())); java_object_));
} }
if (!bg_thread_client_object_.is_null()) { if (!bg_thread_client_object_.is_null()) {
get_response = base::Bind( get_response = base::Bind(
...@@ -374,8 +373,8 @@ bool AwContentsIoThreadClientImpl::ShouldBlockContentUrls() const { ...@@ -374,8 +373,8 @@ bool AwContentsIoThreadClientImpl::ShouldBlockContentUrls() const {
return false; return false;
JNIEnv* env = AttachCurrentThread(); JNIEnv* env = AttachCurrentThread();
return Java_AwContentsIoThreadClient_shouldBlockContentUrls( return Java_AwContentsIoThreadClient_shouldBlockContentUrls(env,
env, java_object_.obj()); java_object_);
} }
bool AwContentsIoThreadClientImpl::ShouldBlockFileUrls() const { bool AwContentsIoThreadClientImpl::ShouldBlockFileUrls() const {
...@@ -384,8 +383,7 @@ bool AwContentsIoThreadClientImpl::ShouldBlockFileUrls() const { ...@@ -384,8 +383,7 @@ bool AwContentsIoThreadClientImpl::ShouldBlockFileUrls() const {
return false; return false;
JNIEnv* env = AttachCurrentThread(); JNIEnv* env = AttachCurrentThread();
return Java_AwContentsIoThreadClient_shouldBlockFileUrls( return Java_AwContentsIoThreadClient_shouldBlockFileUrls(env, java_object_);
env, java_object_.obj());
} }
bool AwContentsIoThreadClientImpl::ShouldAcceptThirdPartyCookies() const { bool AwContentsIoThreadClientImpl::ShouldAcceptThirdPartyCookies() const {
...@@ -395,7 +393,7 @@ bool AwContentsIoThreadClientImpl::ShouldAcceptThirdPartyCookies() const { ...@@ -395,7 +393,7 @@ bool AwContentsIoThreadClientImpl::ShouldAcceptThirdPartyCookies() const {
JNIEnv* env = AttachCurrentThread(); JNIEnv* env = AttachCurrentThread();
return Java_AwContentsIoThreadClient_shouldAcceptThirdPartyCookies( return Java_AwContentsIoThreadClient_shouldAcceptThirdPartyCookies(
env, java_object_.obj()); env, java_object_);
} }
bool AwContentsIoThreadClientImpl::ShouldBlockNetworkLoads() const { bool AwContentsIoThreadClientImpl::ShouldBlockNetworkLoads() const {
...@@ -404,8 +402,8 @@ bool AwContentsIoThreadClientImpl::ShouldBlockNetworkLoads() const { ...@@ -404,8 +402,8 @@ bool AwContentsIoThreadClientImpl::ShouldBlockNetworkLoads() const {
return false; return false;
JNIEnv* env = AttachCurrentThread(); JNIEnv* env = AttachCurrentThread();
return Java_AwContentsIoThreadClient_shouldBlockNetworkLoads( return Java_AwContentsIoThreadClient_shouldBlockNetworkLoads(env,
env, java_object_.obj()); java_object_);
} }
void AwContentsIoThreadClientImpl::NewDownload( void AwContentsIoThreadClientImpl::NewDownload(
...@@ -429,13 +427,8 @@ void AwContentsIoThreadClientImpl::NewDownload( ...@@ -429,13 +427,8 @@ void AwContentsIoThreadClientImpl::NewDownload(
ConvertUTF8ToJavaString(env, mime_type); ConvertUTF8ToJavaString(env, mime_type);
Java_AwContentsIoThreadClient_onDownloadStart( Java_AwContentsIoThreadClient_onDownloadStart(
env, env, java_object_, jstring_url, jstring_user_agent,
java_object_.obj(), jstring_content_disposition, jstring_mime_type, content_length);
jstring_url.obj(),
jstring_user_agent.obj(),
jstring_content_disposition.obj(),
jstring_mime_type.obj(),
content_length);
} }
void AwContentsIoThreadClientImpl::NewLoginRequest(const string& realm, void AwContentsIoThreadClientImpl::NewLoginRequest(const string& realm,
...@@ -453,8 +446,8 @@ void AwContentsIoThreadClientImpl::NewLoginRequest(const string& realm, ...@@ -453,8 +446,8 @@ void AwContentsIoThreadClientImpl::NewLoginRequest(const string& realm,
if (!account.empty()) if (!account.empty())
jaccount = ConvertUTF8ToJavaString(env, account); jaccount = ConvertUTF8ToJavaString(env, account);
Java_AwContentsIoThreadClient_newLoginRequest( Java_AwContentsIoThreadClient_newLoginRequest(env, java_object_, jrealm,
env, java_object_.obj(), jrealm.obj(), jaccount.obj(), jargs.obj()); jaccount, jargs);
} }
void AwContentsIoThreadClientImpl::OnReceivedError( void AwContentsIoThreadClientImpl::OnReceivedError(
...@@ -471,16 +464,10 @@ void AwContentsIoThreadClientImpl::OnReceivedError( ...@@ -471,16 +464,10 @@ void AwContentsIoThreadClientImpl::OnReceivedError(
env, net::ErrorToString(request->status().error())); env, net::ErrorToString(request->status().error()));
Java_AwContentsIoThreadClient_onReceivedError( Java_AwContentsIoThreadClient_onReceivedError(
env, env, java_object_, web_request.jstring_url, web_request.is_main_frame,
java_object_.obj(), web_request.has_user_gesture, web_request.jstring_method,
web_request.jstring_url.obj(), web_request.jstringArray_header_names,
web_request.is_main_frame, web_request.jstringArray_header_values, error_code, jstring_description);
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());
} }
void AwContentsIoThreadClientImpl::OnReceivedHttpError( void AwContentsIoThreadClientImpl::OnReceivedHttpError(
...@@ -520,20 +507,12 @@ void AwContentsIoThreadClientImpl::OnReceivedHttpError( ...@@ -520,20 +507,12 @@ void AwContentsIoThreadClientImpl::OnReceivedHttpError(
ToJavaArrayOfStrings(env, response_header_values); ToJavaArrayOfStrings(env, response_header_values);
Java_AwContentsIoThreadClient_onReceivedHttpError( Java_AwContentsIoThreadClient_onReceivedHttpError(
env, env, java_object_, web_request.jstring_url, web_request.is_main_frame,
java_object_.obj(), web_request.has_user_gesture, web_request.jstring_method,
web_request.jstring_url.obj(), web_request.jstringArray_header_names,
web_request.is_main_frame, web_request.jstringArray_header_values, jstring_mime_type,
web_request.has_user_gesture, jstring_encoding, status_code, jstring_reason,
web_request.jstring_method.obj(), jstringArray_response_header_names, jstringArray_response_header_values);
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());
} }
} // namespace android_webview } // namespace android_webview
...@@ -51,7 +51,7 @@ bool AwGLFunctor::RequestInvokeGL(bool wait_for_completion) { ...@@ -51,7 +51,7 @@ bool AwGLFunctor::RequestInvokeGL(bool wait_for_completion) {
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null()) if (obj.is_null())
return false; return false;
return Java_AwGLFunctor_requestInvokeGL(env, obj.obj(), wait_for_completion); return Java_AwGLFunctor_requestInvokeGL(env, obj, wait_for_completion);
} }
void AwGLFunctor::DetachFunctorFromView() { void AwGLFunctor::DetachFunctorFromView() {
...@@ -59,7 +59,7 @@ void AwGLFunctor::DetachFunctorFromView() { ...@@ -59,7 +59,7 @@ void AwGLFunctor::DetachFunctorFromView() {
JNIEnv* env = AttachCurrentThread(); JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (!obj.is_null()) if (!obj.is_null())
Java_AwGLFunctor_detachFunctorFromView(env, obj.obj()); Java_AwGLFunctor_detachFunctorFromView(env, obj);
} }
void AwGLFunctor::Destroy(JNIEnv* env, void AwGLFunctor::Destroy(JNIEnv* env,
......
...@@ -35,7 +35,7 @@ AwHttpAuthHandler::AwHttpAuthHandler(AwLoginDelegate* login_delegate, ...@@ -35,7 +35,7 @@ AwHttpAuthHandler::AwHttpAuthHandler(AwLoginDelegate* login_delegate,
AwHttpAuthHandler:: ~AwHttpAuthHandler() { AwHttpAuthHandler:: ~AwHttpAuthHandler() {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
Java_AwHttpAuthHandler_handlerDestroyed(base::android::AttachCurrentThread(), Java_AwHttpAuthHandler_handlerDestroyed(base::android::AttachCurrentThread(),
http_auth_handler_.obj()); http_auth_handler_);
} }
void AwHttpAuthHandler::Proceed(JNIEnv* env, void AwHttpAuthHandler::Proceed(JNIEnv* env,
......
...@@ -40,8 +40,7 @@ AwMessagePortServiceImpl::~AwMessagePortServiceImpl() { ...@@ -40,8 +40,7 @@ AwMessagePortServiceImpl::~AwMessagePortServiceImpl() {
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null()) if (obj.is_null())
return; return;
Java_AwMessagePortService_unregisterNativeAwMessagePortService(env, Java_AwMessagePortService_unregisterNativeAwMessagePortService(env, obj);
obj.obj());
} }
void AwMessagePortServiceImpl::Init(JNIEnv* env, jobject obj) { void AwMessagePortServiceImpl::Init(JNIEnv* env, jobject obj) {
...@@ -105,11 +104,8 @@ void AwMessagePortServiceImpl::OnConvertedWebToAppMessage( ...@@ -105,11 +104,8 @@ void AwMessagePortServiceImpl::OnConvertedWebToAppMessage(
ScopedJavaLocalRef<jstring> jmsg = ConvertUTF16ToJavaString(env, value); ScopedJavaLocalRef<jstring> jmsg = ConvertUTF16ToJavaString(env, value);
ScopedJavaLocalRef<jintArray> jports = ScopedJavaLocalRef<jintArray> jports =
ToJavaIntArray(env, sent_message_port_ids); ToJavaIntArray(env, sent_message_port_ids);
Java_AwMessagePortService_onReceivedMessage(env, Java_AwMessagePortService_onReceivedMessage(env, jobj, message_port_id, jmsg,
jobj.obj(), jports);
message_port_id,
jmsg.obj(),
jports.obj());
} }
void AwMessagePortServiceImpl::OnMessagePortMessageFilterClosing( void AwMessagePortServiceImpl::OnMessagePortMessageFilterClosing(
...@@ -218,8 +214,8 @@ void AwMessagePortServiceImpl::OnMessageChannelCreated( ...@@ -218,8 +214,8 @@ void AwMessagePortServiceImpl::OnMessageChannelCreated(
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null()) if (obj.is_null())
return; return;
Java_AwMessagePortService_onMessageChannelCreated(env, obj.obj(), *port1, Java_AwMessagePortService_onMessageChannelCreated(env, obj, *port1, *port2,
*port2, ports->obj());