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

Unified Diff: content/child/background_sync/background_sync_provider_thread_proxy.cc

Issue 1218073019: (WONT COMMIT) BackgroundSync: Run WebCallbacks::onSuccess indirectly (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 | no next file » | 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 6e40365f50427c11537fd6791fca87f43d0181d1..df9a980f612ddd94af525d4fdc270554c0f7ce53 100644
--- a/content/child/background_sync/background_sync_provider_thread_proxy.cc
+++ b/content/child/background_sync/background_sync_provider_thread_proxy.cc
@@ -20,6 +20,11 @@ namespace content {
namespace {
+template <typename S, typename T>
+void RunOnSuccess(scoped_ptr<blink::WebCallbacks<S, T>> callbacks, S* results) {
+ callbacks->onSuccess(results);
+}
+
// CallbackThreadAdapter<S,T> is a wrapper for WebCallbacks<S,T> which
// switches to a specific thread before calling the wrapped callback's
// onSuccess or onError methods.
@@ -39,8 +44,8 @@ class CallbackThreadAdapter : public blink::WebCallbacks<S, T> {
// silently discarded.
WorkerTaskRunner::Instance()->PostTask(
worker_thread_id_,
- base::Bind(&blink::WebCallbacks<S, T>::onSuccess,
- base::Owned(callbacks_.release()), results));
+ base::Bind(&RunOnSuccess<S, T>, base::Passed(callbacks_.Pass()),
+ results));
}
virtual void onError(T* error) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698