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

Issue 23847002: Have StyleElement API take Document as a reference (Closed)

Created:
7 years, 3 months ago by do-not-use
Modified:
7 years, 3 months ago
Reviewers:
tkent, abarth-chromium
CC:
blink-reviews, eae+blinkwatch, dglazkov+blink, f(malita), adamk+blink_chromium.org, pdr, Stephen Chennney
Visibility:
Public.

Description

Have StyleElement API take Document as a reference Have StyleElement API take Document as a reference instead of a pointer since the document cannot be NULL. This also avoid converting the document reference into a pointer in call sites. BUG=281400 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=157042

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -31 lines) Patch
M Source/core/dom/StyleElement.h View 1 chunk +5 lines, -5 lines 0 comments Download
M Source/core/dom/StyleElement.cpp View 3 chunks +12 lines, -16 lines 0 comments Download
M Source/core/html/HTMLStyleElement.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLStyleElement.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/svg/SVGStyleElement.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/svg/SVGStyleElement.cpp View 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
do-not-use
7 years, 3 months ago (2013-08-31 18:51:20 UTC) #1
abarth-chromium
If we accidentally assigned to |document|, would that change the value of m_document somewhere? If ...
7 years, 3 months ago (2013-08-31 18:54:23 UTC) #2
do-not-use
On 2013/08/31 18:54:23, abarth wrote: > If we accidentally assigned to |document|, would that change ...
7 years, 3 months ago (2013-08-31 20:11:51 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@sisa.samsung.com/23847002/1
7 years, 3 months ago (2013-08-31 20:59:33 UTC) #4
commit-bot: I haz the power
Change committed as 157042
7 years, 3 months ago (2013-08-31 22:33:35 UTC) #5
abarth-chromium
On 2013/08/31 20:11:51, Christophe Dumez wrote: > A Document is not copyable. A good point. ...
7 years, 3 months ago (2013-09-01 14:51:42 UTC) #6
do-not-use
On 2013/09/01 14:51:42, abarth wrote: > On 2013/08/31 20:11:51, Christophe Dumez wrote: > > A ...
7 years, 3 months ago (2013-09-03 09:54:14 UTC) #7
abarth-chromium
7 years, 3 months ago (2013-09-03 20:52:17 UTC) #8
Message was sent while issue was closed.
On 2013/09/03 09:54:14, Christophe Dumez wrote:
> Well, actually, if the type was copyable you could already do that with a
> pointer:
> *document = *doc; // Would potentially change m_document somewhere via the
> document pointer.

Yes, but that's easier to see as a problem in a code review than

document = doc;

which looks just like a normal variable assignment.

In any case, this is all find for Document because it's not copiable.  We should
just be careful when mixing non-const references with copiable types.

Powered by Google App Engine
This is Rietveld 408576698