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

Issue 2674973005: Disallow static locals of ScriptWrappable-derived objects.

Created:
3 years, 10 months ago by sof
Modified:
3 years, 8 months ago
Reviewers:
haraken, dglazkov, dcheng
CC:
blink-reviews, blink-reviews-wtf_chromium.org, chromium-reviews, Mikhail
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Disallow static locals of ScriptWrappable-derived objects. Holding a static Persistent<> to a ScriptWrappable risks retaining the associated v8 wrapper object (and all it refers to), and risks leaking information across contexts. For now, disallow them by adding a static assert. R= BUG=688569

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -8 lines) Patch
M third_party/WebKit/Source/wtf/StdLibExtras.h View 2 chunks +15 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/wtf/TypeTraits.h View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 18 (7 generated)
sof
please take a look.
3 years, 10 months ago (2017-02-07 12:04:22 UTC) #5
haraken
This verification is nice to have. I'm just curious but do you have any idea ...
3 years, 10 months ago (2017-02-07 15:47:16 UTC) #8
sof
On 2017/02/07 15:47:16, haraken wrote: > This verification is nice to have. > > I'm ...
3 years, 10 months ago (2017-02-07 16:07:18 UTC) #9
dcheng
On 2017/02/07 16:07:18, sof wrote: > On 2017/02/07 15:47:16, haraken wrote: > > This verification ...
3 years, 10 months ago (2017-02-07 19:28:08 UTC) #10
sof
On 2017/02/07 19:28:08, dcheng wrote: > On 2017/02/07 16:07:18, sof wrote: > > On 2017/02/07 ...
3 years, 10 months ago (2017-02-07 21:56:08 UTC) #11
sof
On 2017/02/07 21:56:08, sof wrote: > On 2017/02/07 19:28:08, dcheng wrote: > > On 2017/02/07 ...
3 years, 10 months ago (2017-02-08 21:34:15 UTC) #12
dcheng
On 2017/02/08 21:34:15, sof wrote: > On 2017/02/07 21:56:08, sof wrote: > > On 2017/02/07 ...
3 years, 10 months ago (2017-02-08 22:19:48 UTC) #13
sof
On 2017/02/08 22:19:48, dcheng wrote: > On 2017/02/08 21:34:15, sof wrote: > > On 2017/02/07 ...
3 years, 10 months ago (2017-02-09 15:38:44 UTC) #14
dcheng
On 2017/02/09 15:38:44, sof wrote: > On 2017/02/08 22:19:48, dcheng wrote: > > On 2017/02/08 ...
3 years, 10 months ago (2017-02-09 18:28:45 UTC) #15
sof
On 2017/02/09 18:28:45, dcheng wrote: > On 2017/02/09 15:38:44, sof wrote: ... > > > ...
3 years, 10 months ago (2017-02-09 20:26:04 UTC) #16
sof
3 years, 10 months ago (2017-02-10 21:54:19 UTC) #17
On 2017/02/09 20:26:04, sof wrote:
> On 2017/02/09 18:28:45, dcheng wrote:
> > On 2017/02/09 15:38:44, sof wrote:
> ...
> > > > > 
> > > > > MouseEventManager::dragState()'s reachable Node + HTMLTableElements
> > > > > StylePropertySet singletons (they contain embedded CSSStyleDeclaration
> > > > > references) are two immediate sources of assert failure. I haven't
> looked
> > > into
> > > > > details if those are effectively benign, or not.
> > > > 
> > > > The MouseEventManager one is safe as long as the rest of the
drag-and-drop
> > > code
> > > > is bug-free =P
> > > > 
> > > > When we start a drag, we /should/ be resetting the source node and the
> > > > DataTransfer: in theory, there won't be cross-context leaks as long as
we
> > > > correctly manage this...
> > > 
> > > Yes, we have to resort to code reasoning for cases where such references
are
> > > safe & valid.
> > > 
> > > https://codereview.chromium.org/2680843006/ is now complete, but I'm
leaning
> > > towards this being too much machinery to add.
> > 
> > We could just simplify by removing the exceptions right? For example, we
could
> > move DragState to something like DragController and have it just be a normal
> > member.
> 
> Right, even as a straight Member<> of MouseEventManager? For some of the other
> cases, it's not so easy & natural.
> 
> We could actively discourage embedding ScriptWrappables in singletons via
> documentation, but an opt-out mechanism is needed, I'd say.

Instead of this CL, I propose doing https://codereview.chromium.org/2687193004/
+ https://codereview.chromium.org/2680843006/

Powered by Google App Engine
This is Rietveld 408576698