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

Unified Diff: base/critical_closure.h

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase Created 3 years, 8 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 | base/critical_closure_internal_ios.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/critical_closure.h
diff --git a/base/critical_closure.h b/base/critical_closure.h
index 35ce2b5c46eaef880bd328eb50347eba29ebe211..94c618dfbb129d7ebb305919476b2964326b9ac7 100644
--- a/base/critical_closure.h
+++ b/base/critical_closure.h
@@ -29,13 +29,13 @@ bool IsMultiTaskingSupported();
// |ios::ScopedCriticalAction|.
class CriticalClosure {
public:
- explicit CriticalClosure(Closure closure);
+ explicit CriticalClosure(OnceClosure closure);
~CriticalClosure();
void Run();
private:
ios::ScopedCriticalAction critical_action_;
- Closure closure_;
+ OnceClosure closure_;
DISALLOW_COPY_AND_ASSIGN(CriticalClosure);
};
@@ -57,13 +57,14 @@ class CriticalClosure {
// background running time, |MakeCriticalClosure| should be applied on them
// before posting.
#if defined(OS_IOS)
-inline Closure MakeCriticalClosure(Closure closure) {
+inline OnceClosure MakeCriticalClosure(OnceClosure closure) {
DCHECK(internal::IsMultiTaskingSupported());
- return base::Bind(&internal::CriticalClosure::Run,
- Owned(new internal::CriticalClosure(std::move(closure))));
+ return base::BindOnce(
+ &internal::CriticalClosure::Run,
+ Owned(new internal::CriticalClosure(std::move(closure))));
}
#else // defined(OS_IOS)
-inline Closure MakeCriticalClosure(Closure closure) {
+inline OnceClosure MakeCriticalClosure(OnceClosure closure) {
// No-op for platforms where the application does not need to acquire
// background time for closures to finish when it goes into the background.
return closure;
« no previous file with comments | « no previous file | base/critical_closure_internal_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698