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

Issue 59113007: Utilize PassRefPtr and C++ refs in more places in ShadowRoot code (Closed)

Created:
7 years, 1 month ago by adamk
Modified:
7 years, 1 month ago
Reviewers:
tkent, hayato, eseidel
CC:
blink-reviews, nessy, webcomponents-bugzilla_chromium.org, philipj_slow, eae+blinkwatch, feature-media-reviews_chromium.org, dglazkov+blink, adamk+blink_chromium.org, vcarbune.chromium
Visibility:
Public.

Description

Utilize PassRefPtr and C++ refs in more places in ShadowRoot code R=tkent@chromium.org

Patch Set 1 #

Total comments: 6

Patch Set 2 : Make win build happier #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -33 lines) Patch
M Source/core/dom/Element.h View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 chunk +5 lines, -5 lines 1 comment Download
M Source/core/dom/shadow/ElementShadow.h View 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/dom/shadow/ElementShadow.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLDetailsElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLDetailsElement.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/html/HTMLInputElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLInputElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLKeygenElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLKeygenElement.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLMediaElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLMeterElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLMeterElement.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLProgressElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLProgressElement.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLSummaryElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLSummaryElement.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/html/HTMLTextAreaElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLTextAreaElement.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/shadow/MediaControlElements.cpp View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
adamk
7 years, 1 month ago (2013-11-06 00:31:32 UTC) #1
tkent
lgtm
7 years, 1 month ago (2013-11-06 00:54:09 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/adamk@chromium.org/59113007/1
7 years, 1 month ago (2013-11-06 00:54:32 UTC) #3
eseidel
The names are all super confused in this code. This is not happy times. https://codereview.chromium.org/59113007/diff/1/Source/core/dom/Element.cpp ...
7 years, 1 month ago (2013-11-06 01:11:16 UTC) #4
eseidel
not lgtm. I guess mostly because of larger naming problems, but this patch just seems ...
7 years, 1 month ago (2013-11-06 01:11:55 UTC) #5
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 1 month ago (2013-11-06 01:50:11 UTC) #6
adamk
https://codereview.chromium.org/59113007/diff/1/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/59113007/diff/1/Source/core/dom/Element.cpp#newcode1737 Source/core/dom/Element.cpp:1737: return *shadowRoot; On 2013/11/06 01:11:17, eseidel wrote: > Who's ...
7 years, 1 month ago (2013-11-06 02:01:38 UTC) #7
eseidel
I'll be in SFO tomorrow morning. If you're OK to wait that long we can ...
7 years, 1 month ago (2013-11-06 02:03:32 UTC) #8
adamk
On 2013/11/06 02:03:32, eseidel wrote: > I'll be in SFO tomorrow morning. If you're OK ...
7 years, 1 month ago (2013-11-06 02:04:27 UTC) #9
eseidel
https://codereview.chromium.org/59113007/diff/210001/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/59113007/diff/210001/Source/core/dom/Element.cpp#newcode1735 Source/core/dom/Element.cpp:1735: RefPtr<ShadowRoot> shadowRoot = ensureShadow().addShadowRoot(*this, ShadowRoot::UserAgentShadowRoot); If the Shadow is ...
7 years, 1 month ago (2013-11-06 02:06:09 UTC) #10
Yuta Kitamura
Adding hayato@ who should have more knowledge on this area
7 years, 1 month ago (2013-11-06 02:08:06 UTC) #11
adamk
On 2013/11/06 02:08:06, Yuta Kitamura wrote: > Adding hayato@ who should have more knowledge on ...
7 years, 1 month ago (2013-11-06 02:12:10 UTC) #12
esprehn
On 2013/11/06 02:06:09, eseidel wrote: > ... > ensureShadow().addShadowRoot(*this, ShadowRoot::UserAgentShadowRoot); > If the Shadow is ...
7 years, 1 month ago (2013-11-06 02:16:24 UTC) #13
adamk
7 years, 1 month ago (2013-11-06 02:20:47 UTC) #14
On 2013/11/06 02:16:24, esprehn wrote:
> On 2013/11/06 02:06:09, eseidel wrote:
> > ...
> > ensureShadow().addShadowRoot(*this, ShadowRoot::UserAgentShadowRoot);
> > If the Shadow is holding onto this as long as it's alive, why would it
return
> a
> > PassRefPtr from add?  Why not just a raw pointer or a reference?
> > 
> > Why do we hold on to ShadowRoot here if it can't be deallocated by anything
we
> > call?  We definitely don't want to be the last ref to this ShadowRoot or
when
> we
> > return it it will be dead (since our RefPtr goes out of scope).
> 
> As the author of this code I'd prefer a reference as well. :) I intentionally
> didn't use a smart ptr since the caller doesn't need to retain ownership and
> making all callers of addShadowRoot() put the result into a RefPtr is silly.
> 
> I think Element::createShadowRoot should probably return a raw pointer
actually.

Actually, that was step 0 of my process, but the only caller is the bindings
which want a RefPtr anyway (and pass the reference on to toV8())

Powered by Google App Engine
This is Rietveld 408576698