Index: base/critical_closure.h |
diff --git a/base/critical_closure.h b/base/critical_closure.h |
index 1b10cde7ce60c26836573783acc2e0252940a48d..35ce2b5c46eaef880bd328eb50347eba29ebe211 100644 |
--- a/base/critical_closure.h |
+++ b/base/critical_closure.h |
@@ -5,6 +5,8 @@ |
#ifndef BASE_CRITICAL_CLOSURE_H_ |
#define BASE_CRITICAL_CLOSURE_H_ |
+#include <utility> |
+ |
#include "base/callback.h" |
#include "base/macros.h" |
#include "build/build_config.h" |
@@ -27,7 +29,7 @@ bool IsMultiTaskingSupported(); |
// |ios::ScopedCriticalAction|. |
class CriticalClosure { |
public: |
- explicit CriticalClosure(const Closure& closure); |
+ explicit CriticalClosure(Closure closure); |
~CriticalClosure(); |
void Run(); |
@@ -55,13 +57,13 @@ class CriticalClosure { |
// background running time, |MakeCriticalClosure| should be applied on them |
// before posting. |
#if defined(OS_IOS) |
-inline Closure MakeCriticalClosure(const Closure& closure) { |
+inline Closure MakeCriticalClosure(Closure closure) { |
DCHECK(internal::IsMultiTaskingSupported()); |
return base::Bind(&internal::CriticalClosure::Run, |
- Owned(new internal::CriticalClosure(closure))); |
+ Owned(new internal::CriticalClosure(std::move(closure)))); |
} |
#else // defined(OS_IOS) |
-inline Closure MakeCriticalClosure(const Closure& closure) { |
+inline Closure MakeCriticalClosure(Closure 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; |