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

Issue 23532053: [abandoned] IDL attribute "SetHiddenValueTo" to build strong refs to wrapped object's dependen… (Closed)

Created:
7 years, 3 months ago by kouhei (in TOK)
Modified:
7 years, 2 months ago
CC:
blink-reviews, kojih, jsbell+bindings_chromium.org, eae+blinkwatch, abarth-chromium, marja+watch_chromium.org, dglazkov+blink, adamk+blink_chromium.org, Nate Chapin, do-not-use, Takashi Toyoshima
Visibility:
Public.

Description

This became http://crrev.com/26792002 implement custom IDL attribute "SetHiddenValueTo" to build strong refs to wrapped object's dependencies. This patch introduces new custom Blink IDL attribute "SetHiddenValueTo". When the attribute is specified, the wrapper is setNamedHiddenReference() to the wrapped object's dependencies specified by its argument. This ensures that the dependencies of wrapped object are kept alive while the wrapper is alive. This setNamedHiddenReference technique was previously used by NodeIterator/TreeWalker to fix cyclic reference cycles on Blink side, but they were implemented as a "customToV8", which introduced additional code complexity and potential source of bugs. This patch allows a developer to accomplish it with out using "customToV8". BUG=None

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -113 lines) Patch
M Source/bindings/bindings.gypi View 2 chunks +0 lines, -2 lines 0 comments Download
M Source/bindings/scripts/IDLAttributes.txt View 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/scripts/deprecated_code_generator_v8.pm View 2 chunks +26 lines, -1 line 2 comments Download
D Source/bindings/v8/custom/V8NodeIteratorCustom.cpp View 1 chunk +0 lines, -54 lines 0 comments Download
D Source/bindings/v8/custom/V8TreeWalkerCustom.cpp View 1 chunk +0 lines, -54 lines 0 comments Download
M Source/core/dom/NodeIterator.idl View 1 chunk +1 line, -1 line 2 comments Download
M Source/core/dom/TreeWalker.idl View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 21 (0 generated)
kouhei (in TOK)
haraken, nbarth: PTAL.
7 years, 3 months ago (2013-09-10 01:28:39 UTC) #1
kouhei (in TOK)
https://codereview.chromium.org/23532053/diff/1/Source/bindings/scripts/deprecated_code_generator_v8.pm File Source/bindings/scripts/deprecated_code_generator_v8.pm (right): https://codereview.chromium.org/23532053/diff/1/Source/bindings/scripts/deprecated_code_generator_v8.pm#newcode4009 Source/bindings/scripts/deprecated_code_generator_v8.pm:4009: I think we need to addIncludesForType(<$setHiddenValue return type>) here. ...
7 years, 3 months ago (2013-09-10 01:30:34 UTC) #2
Nils Barth (inactive)
Perl seems fine, module how to handle additional includes. Before landing, could you document SetHiddenValueTo ...
7 years, 3 months ago (2013-09-10 01:50:55 UTC) #3
haraken
https://codereview.chromium.org/23532053/diff/1/Source/core/dom/NodeIterator.idl File Source/core/dom/NodeIterator.idl (right): https://codereview.chromium.org/23532053/diff/1/Source/core/dom/NodeIterator.idl#newcode27 Source/core/dom/NodeIterator.idl:27: readonly attribute NodeFilter filter; I'm sorry for my previous ...
7 years, 3 months ago (2013-09-10 03:45:09 UTC) #4
kouhei (in TOK)
On 2013/09/10 03:45:09, haraken wrote: > https://codereview.chromium.org/23532053/diff/1/Source/core/dom/NodeIterator.idl > File Source/core/dom/NodeIterator.idl (right): > > https://codereview.chromium.org/23532053/diff/1/Source/core/dom/NodeIterator.idl#newcode27 > ...
7 years, 3 months ago (2013-09-10 03:52:36 UTC) #5
Nils Barth (inactive)
https://codereview.chromium.org/23532053/diff/1/Source/core/dom/NodeIterator.idl File Source/core/dom/NodeIterator.idl (right): https://codereview.chromium.org/23532053/diff/1/Source/core/dom/NodeIterator.idl#newcode27 Source/core/dom/NodeIterator.idl:27: readonly attribute NodeFilter filter; On 2013/09/10 03:45:09, haraken wrote: ...
7 years, 3 months ago (2013-09-10 03:55:08 UTC) #6
Nils Barth (inactive)
On 2013/09/10 03:52:36, kouhei wrote: > I strongly prefer SetHiddenValueTo for two reasons. > > ...
7 years, 3 months ago (2013-09-10 03:58:06 UTC) #7
haraken
> 1) KeepAttributeAliveForGC is simply not enough for some cases. > > The problem is ...
7 years, 3 months ago (2013-09-10 03:58:47 UTC) #8
kouhei (in TOK)
On 2013/09/10 03:58:47, haraken wrote: > > 1) KeepAttributeAliveForGC is simply not enough for some ...
7 years, 3 months ago (2013-09-10 04:38:21 UTC) #9
haraken
Thanks for the clarification. I read the code base and understand the situation. My general ...
7 years, 3 months ago (2013-09-10 05:32:09 UTC) #10
kouhei (google)
[ReachableTo] SGTM, assuming there is no performance difference. Let's go this way. WDYT about AdditionalIncludes? ...
7 years, 3 months ago (2013-09-10 05:44:54 UTC) #11
haraken
On 2013/09/10 05:44:54, kouhei (google) wrote: > [ReachableTo] SGTM, assuming there is no performance difference. ...
7 years, 3 months ago (2013-09-10 06:00:13 UTC) #12
haraken
> > [ReachableTo] SGTM, assuming there is no performance difference. Let's go > > this ...
7 years, 3 months ago (2013-09-10 06:02:01 UTC) #13
kouhei (in TOK)
> > WDYT about AdditionalIncludes? We stlil need it in [ReachableTo]. > > FYI: GenerateIsReachable ...
7 years, 3 months ago (2013-09-10 06:04:51 UTC) #14
kouhei (in TOK)
On 2013/09/10 06:02:01, haraken wrote: > > > [ReachableTo] SGTM, assuming there is no performance ...
7 years, 3 months ago (2013-09-10 06:07:55 UTC) #15
haraken
On 2013/09/10 06:04:51, kouhei wrote: > > > WDYT about AdditionalIncludes? We stlil need it ...
7 years, 3 months ago (2013-09-10 07:28:53 UTC) #16
haraken
> What we need would be something like [ReachableFrom=ownerNode^Node], which means > that ownerNode() returns ...
7 years, 3 months ago (2013-09-10 07:32:21 UTC) #17
kouhei (in TOK)
> However, [AddIncludes] won't be enough either, because you'll need to know the > return ...
7 years, 3 months ago (2013-09-10 07:35:47 UTC) #18
haraken
On 2013/09/10 07:35:47, kouhei wrote: > > However, [AddIncludes] won't be enough either, because you'll ...
7 years, 3 months ago (2013-09-10 07:44:40 UTC) #19
Nils Barth (inactive)
On 2013/09/10 07:32:21, haraken wrote: > Probably [ReachableFrom=Node ownerNode] works fine and looks fine? That ...
7 years, 3 months ago (2013-09-10 09:07:12 UTC) #20
Nils Barth (inactive)
7 years, 3 months ago (2013-09-10 09:14:03 UTC) #21
On 2013/09/10 07:32:21, haraken wrote:
> Probably [ReachableFrom=Node ownerNode] works fine and looks fine?

Reading more carefully, since we want to treat these differently:
easiest is:
[
 ReachableFrom=ownerNode,
 ReachableFromReturns=Node,
]

We could add an addition grammar production for these, as suggested above,
but I'm leery of putting arbitrary function signatures in extended attributes
unless it's really helpful.
(It might be -- it sounds like CG often needs this -- but it would be a pretty
big change)

Powered by Google App Engine
This is Rietveld 408576698