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

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: rebased 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 0caf92cd3afb770682d0379bf00fa9e5b2d77a82..fc542b259917e9b79b5c66e4056be2b007f76ac5 100644
--- a/android_webview/native/aw_message_port_service_impl.cc
+++ b/android_webview/native/aw_message_port_service_impl.cc
@@ -95,6 +95,12 @@ void AwMessagePortServiceImpl::OnConvertedWebToAppMessage(
<< message_port_id;
return;
}
+
+ // Add the ports to AwMessagePortService.
+ for (const auto& iter : sent_message_port_ids) {
hush (inactive) 2015/03/10 22:31:36 do you really need to use auto? It is just int?
sgurun-gerrit only 2015/03/10 23:20:13 either works.
+ AddPort(iter, ports_[message_port_id]);
+ }
+
ScopedJavaLocalRef<jstring> jmsg = ConvertUTF16ToJavaString(env, value);
ScopedJavaLocalRef<jintArray> jports =
ToJavaIntArray(env, sent_message_port_ids);
@@ -209,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