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

Unified Diff: content/child/background_sync/background_sync_provider_thread_proxy.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
« no previous file with comments | « no previous file | content/child/navigator_connect/service_port_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/background_sync/background_sync_provider_thread_proxy.cc
diff --git a/content/child/background_sync/background_sync_provider_thread_proxy.cc b/content/child/background_sync/background_sync_provider_thread_proxy.cc
index 1937cf3e0ae750773c71bc6804da22dc729c0ef6..90584bfc8380a6d31a2280ddd33303e83e52439a 100644
--- a/content/child/background_sync/background_sync_provider_thread_proxy.cc
+++ b/content/child/background_sync/background_sync_provider_thread_proxy.cc
@@ -106,8 +106,10 @@ void BackgroundSyncProviderThreadProxy::unregisterBackgroundSync(
main_thread_task_runner_->PostTask(
FROM_HERE,
base::Bind(&BackgroundSyncProvider::unregisterBackgroundSync,
- base::Unretained(sync_provider_), periodicity, id, tag,
- service_worker_registration,
+ base::Unretained(sync_provider_), periodicity, id,
+ // We cast WebString to string16 before crossing threads
+ // for thread-safety.
+ static_cast<base::string16>(tag), service_worker_registration,
new CallbackThreadAdapter<bool*, blink::WebSyncError*>(
make_scoped_ptr(callbacks),
WorkerTaskRunner::Instance()->CurrentWorkerId())));
@@ -123,8 +125,10 @@ void BackgroundSyncProviderThreadProxy::getRegistration(
main_thread_task_runner_->PostTask(
FROM_HERE,
base::Bind(&BackgroundSyncProvider::getRegistration,
- base::Unretained(sync_provider_), periodicity, tag,
- service_worker_registration,
+ base::Unretained(sync_provider_), periodicity,
+ // We cast WebString to string16 before crossing threads
+ // for thread-safety.
+ static_cast<base::string16>(tag), service_worker_registration,
new CallbackThreadAdapter<blink::WebSyncRegistration*,
blink::WebSyncError*>(
make_scoped_ptr(callbacks),
« no previous file with comments | « no previous file | content/child/navigator_connect/service_port_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698