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

Unified Diff: android_webview/native/aw_message_port_service_impl.cc

Issue 995663002: Implement receiving transferred ports from JS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@flaky-test
Patch Set: address nit from nasko Created 5 years, 9 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: android_webview/native/aw_message_port_service_impl.cc
diff --git a/android_webview/native/aw_message_port_service_impl.cc b/android_webview/native/aw_message_port_service_impl.cc
index fcad27509b5110da8aeb382efdbcce2545259741..7e060191e13dc7e1d69927c06c3c283a39cc7687 100644
--- a/android_webview/native/aw_message_port_service_impl.cc
+++ b/android_webview/native/aw_message_port_service_impl.cc
@@ -96,6 +96,11 @@ void AwMessagePortServiceImpl::OnConvertedWebToAppMessage(
return;
}
+ // Add the ports to AwMessagePortService.
+ for (const auto& iter : sent_message_port_ids) {
+ AddPort(iter, ports_[message_port_id]);
+ }
+
ScopedJavaLocalRef<jstring> jmsg = ConvertUTF16ToJavaString(env, value);
ScopedJavaLocalRef<jintArray> jports =
ToJavaIntArray(env, sent_message_port_ids);
@@ -210,6 +215,7 @@ void AwMessagePortServiceImpl::OnMessageChannelCreated(
*port2, ports->obj());
}
+// Adds a new port to the message port service.
void AwMessagePortServiceImpl::AddPort(int message_port_id,
AwMessagePortMessageFilter* filter) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);

Powered by Google App Engine
This is Rietveld 408576698