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

Issue 10835032: Add APIs to protect critical tasks on iOS. (Closed)

Created:
8 years, 4 months ago by Chen Yu
Modified:
8 years, 4 months ago
CC:
chromium-reviews, erikwright (departed), brettw-cc_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Add APIs to protect critical tasks on iOS. On iOS, once an application goes into the background, it receives no CPU cycles until it is moved to foreground. At any time the OS may kill the application, but the application itself is never told or given any chance to clean up. Thus the time before going into the background is critical to ensure certain tasks have chance to complete. Luckily, an application may ask for a little more time when going into the background by calling certain methods that let the OS know it wants to perform some short-lived work in the background. This cl provides APIs to protect critical tasks in this case. - A class is provided to mark the beginning and end of a critical task for iOS. - A wrapper around a task is introduced that annotates that a class is "critical". Right now we have the wrapping code for iOS and it is just a no-op for other platforms. BUG=NONE Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=149422

Patch Set 1 : #

Patch Set 2 : #

Total comments: 3

Patch Set 3 : Address review comments #

Total comments: 16

Patch Set 4 : Address review comments #

Total comments: 4

Patch Set 5 : address review comments #

Total comments: 2

Patch Set 6 : sync and address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+195 lines, -0 lines) Patch
M base/base.gypi View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
A base/critical_closure.h View 1 2 3 1 chunk +37 lines, -0 lines 0 comments Download
A base/critical_closure_ios.mm View 1 2 3 1 chunk +52 lines, -0 lines 0 comments Download
A base/ios/scoped_critical_action.h View 1 2 3 4 5 1 chunk +48 lines, -0 lines 0 comments Download
A base/ios/scoped_critical_action.mm View 1 2 3 4 1 chunk +54 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Chen Yu
Starting with stuartmorgan for initial look. Thanks!
8 years, 4 months ago (2012-07-30 14:17:19 UTC) #1
stuartmorgan
https://chromiumcodereview.appspot.com/10835032/diff/5005/base/base.gypi File base/base.gypi (right): https://chromiumcodereview.appspot.com/10835032/diff/5005/base/base.gypi#newcode91 base/base.gypi:91: 'critical_closure_stub.cc', There needs to be a line later that ...
8 years, 4 months ago (2012-07-31 07:58:15 UTC) #2
Chen Yu
Thanks for the review! I also move MakeCriticalClosure() to namespace base. PTAL. https://chromiumcodereview.appspot.com/10835032/diff/5005/base/base.gypi File base/base.gypi ...
8 years, 4 months ago (2012-07-31 10:38:50 UTC) #3
stuartmorgan
LGTM; over to Mark.
8 years, 4 months ago (2012-07-31 10:55:13 UTC) #4
Mark Mentovai
https://chromiumcodereview.appspot.com/10835032/diff/1002/base/critical_closure.h File base/critical_closure.h (right): https://chromiumcodereview.appspot.com/10835032/diff/1002/base/critical_closure.h#newcode12 base/critical_closure.h:12: // Returns a closure that is protected when the ...
8 years, 4 months ago (2012-07-31 23:16:33 UTC) #5
stuartmorgan
https://chromiumcodereview.appspot.com/10835032/diff/1002/base/critical_closure_stub.cc File base/critical_closure_stub.cc (right): https://chromiumcodereview.appspot.com/10835032/diff/1002/base/critical_closure_stub.cc#newcode9 base/critical_closure_stub.cc:9: base::Closure MakeCriticalClosure(const base::Closure& closure) { On 2012/07/31 23:16:33, Mark ...
8 years, 4 months ago (2012-08-01 04:31:55 UTC) #6
Chen Yu
Thanks for the review! PTAL. https://chromiumcodereview.appspot.com/10835032/diff/1002/base/critical_closure.h File base/critical_closure.h (right): https://chromiumcodereview.appspot.com/10835032/diff/1002/base/critical_closure.h#newcode12 base/critical_closure.h:12: // Returns a closure ...
8 years, 4 months ago (2012-08-01 11:26:13 UTC) #7
stuartmorgan
https://chromiumcodereview.appspot.com/10835032/diff/7005/base/ios/scoped_critical_action.mm File base/ios/scoped_critical_action.mm (right): https://chromiumcodereview.appspot.com/10835032/diff/7005/base/ios/scoped_critical_action.mm#newcode7 base/ios/scoped_critical_action.mm:7: #import <UIKit/UIKit.h> Blank line after this. https://chromiumcodereview.appspot.com/10835032/diff/7005/base/ios/scoped_critical_action.mm#newcode27 base/ios/scoped_critical_action.mm:27: DLOG(WARNING) ...
8 years, 4 months ago (2012-08-01 12:03:17 UTC) #8
Chen Yu
https://chromiumcodereview.appspot.com/10835032/diff/7005/base/ios/scoped_critical_action.mm File base/ios/scoped_critical_action.mm (right): https://chromiumcodereview.appspot.com/10835032/diff/7005/base/ios/scoped_critical_action.mm#newcode7 base/ios/scoped_critical_action.mm:7: #import <UIKit/UIKit.h> On 2012/08/01 12:03:17, stuartmorgan wrote: > Blank ...
8 years, 4 months ago (2012-08-01 12:15:27 UTC) #9
Mark Mentovai
LGTM https://chromiumcodereview.appspot.com/10835032/diff/1002/base/ios/scoped_critical_action.mm File base/ios/scoped_critical_action.mm (right): https://chromiumcodereview.appspot.com/10835032/diff/1002/base/ios/scoped_critical_action.mm#newcode19 base/ios/scoped_critical_action.mm:19: background_task_id_ = [[UIApplication sharedApplication] stuartmorgan wrote: > On ...
8 years, 4 months ago (2012-08-01 13:50:41 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/chenyu@chromium.org/10835032/13005
8 years, 4 months ago (2012-08-01 14:00:15 UTC) #11
commit-bot: I haz the power
8 years, 4 months ago (2012-08-01 15:42:17 UTC) #12
Change committed as 149422

Powered by Google App Engine
This is Rietveld 408576698