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

Unified Diff: base/critical_closure.h

Issue 10835032: Add APIs to protect critical tasks on iOS. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
Index: base/critical_closure.h
diff --git a/base/critical_closure.h b/base/critical_closure.h
new file mode 100644
index 0000000000000000000000000000000000000000..e0e24d47bfa4bd3c647dd43138ca227627dcd0e8
--- /dev/null
+++ b/base/critical_closure.h
@@ -0,0 +1,23 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_CRITICAL_CLOSURE_H_
+#define BASE_CRITICAL_CLOSURE_H_
+
+#include "base/callback.h"
+
+// Returns a closure that is protected when the application goes to the
+// background if possible, otherwise the original task is returned.
stuartmorgan 2012/07/31 07:58:15 s/background/background (on platforms where applic
+//
+// Example:
+// file_message_loop_proxy_->PostTask(
+// FROM_HERE,
+// MakeCriticalClosure(base::Bind(&WriteToDiskTask, path_, data)));
+//
+// Note new closures might be posted in this closure. If the new closures need
+// to be protected, |MakeCriticalClosure| should be applied on them before
+// posting.
+base::Closure MakeCriticalClosure(const base::Closure& closure);
+
+#endif // BASE_CRITICAL_CLOSURE_H_
« base/base.gypi ('K') | « base/base.gypi ('k') | base/critical_closure_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698