New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 898591 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , iOS , Chrome , Mac , Fuchsia
Pri: 3
Type: Feature



Sign in to add a comment

Add helper for scoping callbacks

Project Member Reported by dcheng@chromium.org, Oct 24

Issue description

Today, callbacks can escape their scope, so we try to enforce that the receiver object is explicitly annotated with lifetime requirements. This leads to a lot of base::Unretained() with comments like "this is safe because it never outlives the scope", et cetera. It's also one of the reasons we don't allow capturing lambdas with Callback, since there's a fear that it would be easy to bypass the lifetime safety checks.

CallbackRegion [1] is a proposal to add the ability to create callbacks on the stack, and ensure that they can't be stored / used after the stack scope is destroyed.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1220629
 
Cc: palmer@chromium.org
+palmer, is there a label to use for this sort of work?
Components: Security Internals
Labels: -Type-Bug base-hardening OS-Android OS-Chrome OS-Fuchsia OS-iOS OS-Linux OS-Mac OS-Windows Type-Feature
Could always invent a new label, I guess. How about "base-hardening"?

Sign in to add a comment