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

Unified Diff: content/child/service_worker/web_service_worker_impl.cc

Issue 2596173002: Use explicit WebString <-> string conversion methods for workers (Closed)
Patch Set: Created 4 years 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/service_worker/web_service_worker_impl.cc
diff --git a/content/child/service_worker/web_service_worker_impl.cc b/content/child/service_worker/web_service_worker_impl.cc
index cdbb0b0462df3a1c52dc3975f70b70b265d5c0e1..947359eb70a9e7f794c2934d61a3ffa0a60af94c 100644
--- a/content/child/service_worker/web_service_worker_impl.cc
+++ b/content/child/service_worker/web_service_worker_impl.cc
@@ -117,10 +117,9 @@ void WebServiceWorkerImpl::postMessage(
base::Bind(&SendPostMessageToWorkerOnMainThread,
base::RetainedRef(thread_safe_sender_),
handle_ref_->handle_id(), provider_impl->provider_id(),
- // We cast WebString to string16 before crossing
+ // We convert WebString to string16 before crossing
// threads for thread-safety.
- static_cast<base::string16>(message),
- url::Origin(source_origin),
+ message.utf16(), url::Origin(source_origin),
falken 2016/12/26 01:26:20 Do you know why this IPC should be a string16 and
base::Passed(base::WrapUnique(channels))));
}

Powered by Google App Engine
This is Rietveld 408576698