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

Unified Diff: content/child/navigator_connect/service_port_provider.cc

Issue 1257393005: [Thread Safety] Replace WebString bound by cross-thread base::Bind() with base::string16 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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: content/child/navigator_connect/service_port_provider.cc
diff --git a/content/child/navigator_connect/service_port_provider.cc b/content/child/navigator_connect/service_port_provider.cc
index 3f63b5f90ef974319c42e7914ede3f9d769710c8..c66a748dc1877689f65a1691e80e4a3f90533b6d 100644
--- a/content/child/navigator_connect/service_port_provider.cc
+++ b/content/child/navigator_connect/service_port_provider.cc
@@ -71,7 +71,9 @@ void ServicePortProvider::postMessage(
&WebMessagePortChannelImpl::ExtractMessagePortIDsWithoutQueueing,
base::Passed(&channel_array)),
base::Bind(&ServicePortProvider::PostMessageToBrowser, this, port_id,
- message));
+ // We cast WebString to string16 before crossing threads.
+ // for thread-safety.
+ static_cast<base::string16>(message)));
}
void ServicePortProvider::closePort(blink::WebServicePortID port_id) {

Powered by Google App Engine
This is Rietveld 408576698