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

Issue 209433004: Do not zero-initialize RawPtr. (Closed)

Created:
6 years, 9 months ago by Mads Ager (chromium)
Modified:
6 years, 9 months ago
CC:
blink-reviews, Mikhail, adamk+blink_chromium.org, Inactive, abarth-chromium
Visibility:
Public.

Description

Do not zero-initialize RawPtr. RawPtr is a transition type that will be removed and replace with a normal pointer. Normal pointers are not default initialized and therefore RawPtr shouldn't be either. Instead, we introduce a zap value in debug mode to make it easier to find uninitialized RawPtrs during the transition. R=erik.corry@gmail.com, oilpan-reviews@chromium.org, tkent@chromium.org, zerny@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=169922

Patch Set 1 #

Total comments: 1

Patch Set 2 : Fix uses of RefPtrWillBeRawPtr #

Total comments: 30

Patch Set 3 : Address comments. #

Total comments: 4

Patch Set 4 : Rebase on top of Ian's change #

Patch Set 5 : Fix compilation on gcc and msvc #

Unified diffs Side-by-side diffs Delta from patch set Stats (+204 lines, -179 lines) Patch
M Source/bindings/v8/V8Binding.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/animation/CompositorAnimationsTest.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/animation/css/CSSAnimations.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/BasicShapeFunctions.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSBasicShapes.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSCalculationValue.cpp View 1 2 3 chunks +4 lines, -4 lines 0 comments Download
M Source/core/css/CSSCalculationValueTest.cpp View 1 2 chunks +2 lines, -3 lines 0 comments Download
M Source/core/css/CSSComputedStyleDeclaration.cpp View 1 10 chunks +19 lines, -19 lines 0 comments Download
M Source/core/css/CSSGradientValue.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSParserValues.cpp View 1 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/css/CSSPrimitiveValue.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSValueList.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSValuePool.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/ElementRuleCollector.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/MediaQueryExp.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/StylePropertySerializer.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/css/StyleRule.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/parser/BisonCSSParser-in.cpp View 1 5 chunks +5 lines, -5 lines 0 comments Download
M Source/core/css/parser/CSSPropertyParser.cpp View 1 2 3 68 chunks +133 lines, -113 lines 0 comments Download
M Source/core/dom/StyleEngine.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/editing/EditingStyle.cpp View 1 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/frame/ImageBitmapTest.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/page/EventHandler.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGFontFaceElement.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGFontFaceSrcElement.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/xml/XPathParser.h View 1 2 2 chunks +2 lines, -3 lines 0 comments Download
M Source/modules/webdatabase/DatabaseBackend.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/modules/webdatabase/DatabaseServer.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/wtf/RawPtr.h View 1 2 3 4 3 chunks +9 lines, -1 line 0 comments Download

Messages

Total messages: 41 (0 generated)
Mads Ager (chromium)
6 years, 9 months ago (2014-03-24 09:16:10 UTC) #1
Erik Corry
lgtm
6 years, 9 months ago (2014-03-24 09:18:46 UTC) #2
tkent
lgtm https://codereview.chromium.org/209433004/diff/1/Source/wtf/RawPtr.h File Source/wtf/RawPtr.h (right): https://codereview.chromium.org/209433004/diff/1/Source/wtf/RawPtr.h#newcode124 Source/wtf/RawPtr.h:124: static const uintptr_t rawPtrZapValue = 0x3a3a3a3a; nit: I ...
6 years, 9 months ago (2014-03-24 09:27:05 UTC) #3
wibling-chromium
lgtm
6 years, 9 months ago (2014-03-24 09:36:21 UTC) #4
Mads Ager (chromium)
Thanks guys. Before I can land this I need to update quite a bit of ...
6 years, 9 months ago (2014-03-24 10:09:14 UTC) #5
zerny-chromium
lgtm
6 years, 9 months ago (2014-03-24 10:12:38 UTC) #6
tkent
can we remove this constructor?
6 years, 9 months ago (2014-03-24 10:57:29 UTC) #7
Mads Ager (chromium)
I think that will be hard. We will want RefPtrWillBeRawPtr in collections which require a ...
6 years, 9 months ago (2014-03-24 11:07:42 UTC) #8
Mads Ager (chromium)
Those should be Members of course, so maybe it would be simpler to just remove ...
6 years, 9 months ago (2014-03-24 11:09:13 UTC) #9
haraken
> Those should be Members of course, so maybe it would be simpler to just ...
6 years, 9 months ago (2014-03-24 11:15:09 UTC) #10
Mads Ager (chromium)
{ A* a; if (condition) a = something; else a = somethingElse; } I would ...
6 years, 9 months ago (2014-03-24 11:20:34 UTC) #11
Mads Ager (chromium)
Bindings macros is another place that uses these. type var; { ExcpetionThingie scope; var = ...
6 years, 9 months ago (2014-03-24 11:23:27 UTC) #12
haraken
On 2014/03/24 11:20:34, Mads Ager (chromium) wrote: > { > A* a; > if (condition) ...
6 years, 9 months ago (2014-03-24 11:23:47 UTC) #13
haraken
> Bindings macros is another place that uses these. > > type var; > { ...
6 years, 9 months ago (2014-03-24 11:25:10 UTC) #14
haraken
On 2014/03/24 11:25:10, haraken wrote: > > Bindings macros is another place that uses these. ...
6 years, 9 months ago (2014-03-24 11:26:16 UTC) #15
Mads Ager (chromium)
Let me keep digging. I'll let you know what I find. :) On Mon, Mar ...
6 years, 9 months ago (2014-03-24 11:32:39 UTC) #16
Mads Ager (chromium)
Updated all usages of RefPtrWillBeRawPtr. I'm not getting rid of the default constructor in this ...
6 years, 9 months ago (2014-03-24 13:40:21 UTC) #17
haraken
I think you need to rebase with Ian's CL that changed RefPtrWillBeRawPtrs in stack-allocated objects ...
6 years, 9 months ago (2014-03-24 13:52:54 UTC) #18
zerny-chromium
Ditto to Haraken's stack-allocated remarks and otherwise lgtm
6 years, 9 months ago (2014-03-24 14:07:51 UTC) #19
Mads Ager (chromium)
Thanks. I'll merge with Ian's changes. I updated this to not have the RawPtr members ...
6 years, 9 months ago (2014-03-24 14:27:30 UTC) #20
Mads Ager (chromium)
And rebased on top of Ian's changes. PTAL
6 years, 9 months ago (2014-03-24 14:35:45 UTC) #21
haraken
LGTM https://codereview.chromium.org/209433004/diff/40001/Source/core/css/parser/CSSPropertyParser.cpp File Source/core/css/parser/CSSPropertyParser.cpp (right): https://codereview.chromium.org/209433004/diff/40001/Source/core/css/parser/CSSPropertyParser.cpp#newcode5351 Source/core/css/parser/CSSPropertyParser.cpp:5351: RefPtrWillBeRawPtr<CSSPrimitiveValue> color = nullptr; These should be RefPtrWillBeMembers.
6 years, 9 months ago (2014-03-24 14:39:06 UTC) #22
zerny-chromium
lgtm https://codereview.chromium.org/209433004/diff/40001/Source/core/css/parser/CSSPropertyParser.cpp File Source/core/css/parser/CSSPropertyParser.cpp (right): https://codereview.chromium.org/209433004/diff/40001/Source/core/css/parser/CSSPropertyParser.cpp#newcode5351 Source/core/css/parser/CSSPropertyParser.cpp:5351: RefPtrWillBeRawPtr<CSSPrimitiveValue> color = nullptr; On 2014/03/24 14:39:06, haraken ...
6 years, 9 months ago (2014-03-24 14:41:41 UTC) #23
Mads Ager (chromium)
https://codereview.chromium.org/209433004/diff/40001/Source/core/css/parser/CSSPropertyParser.cpp File Source/core/css/parser/CSSPropertyParser.cpp (right): https://codereview.chromium.org/209433004/diff/40001/Source/core/css/parser/CSSPropertyParser.cpp#newcode5351 Source/core/css/parser/CSSPropertyParser.cpp:5351: RefPtrWillBeRawPtr<CSSPrimitiveValue> color = nullptr; On 2014/03/24 14:41:41, zerny-chromium wrote: ...
6 years, 9 months ago (2014-03-24 14:43:16 UTC) #24
zerny-chromium
https://codereview.chromium.org/209433004/diff/40001/Source/core/css/parser/CSSPropertyParser.cpp File Source/core/css/parser/CSSPropertyParser.cpp (right): https://codereview.chromium.org/209433004/diff/40001/Source/core/css/parser/CSSPropertyParser.cpp#newcode5351 Source/core/css/parser/CSSPropertyParser.cpp:5351: RefPtrWillBeRawPtr<CSSPrimitiveValue> color = nullptr; On 2014/03/24 14:43:16, Mads Ager ...
6 years, 9 months ago (2014-03-24 14:45:06 UTC) #25
wibling-chromium
lgtm
6 years, 9 months ago (2014-03-24 15:35:45 UTC) #26
Mads Ager (chromium)
The CQ bit was checked by ager@chromium.org
6 years, 9 months ago (2014-03-25 07:08:37 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ager@chromium.org/209433004/60001
6 years, 9 months ago (2014-03-25 07:08:47 UTC) #28
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-25 07:11:06 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on win_blink_compile_dbg
6 years, 9 months ago (2014-03-25 07:11:07 UTC) #30
Mads Ager (chromium)
The CQ bit was checked by ager@chromium.org
6 years, 9 months ago (2014-03-25 07:17:39 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ager@chromium.org/209433004/60001
6 years, 9 months ago (2014-03-25 07:17:46 UTC) #32
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-25 07:20:12 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on linux_blink_rel
6 years, 9 months ago (2014-03-25 07:20:20 UTC) #34
Mads Ager (chromium)
The CQ bit was checked by ager@chromium.org
6 years, 9 months ago (2014-03-25 07:39:40 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ager@chromium.org/209433004/70001
6 years, 9 months ago (2014-03-25 07:39:58 UTC) #36
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-25 07:41:29 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on mac_blink_rel
6 years, 9 months ago (2014-03-25 07:41:30 UTC) #38
Mads Ager (chromium)
The CQ bit was checked by ager@chromium.org
6 years, 9 months ago (2014-03-25 07:42:59 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ager@chromium.org/209433004/70001
6 years, 9 months ago (2014-03-25 07:43:05 UTC) #40
commit-bot: I haz the power
6 years, 9 months ago (2014-03-25 08:46:08 UTC) #41
Message was sent while issue was closed.
Change committed as 169922

Powered by Google App Engine
This is Rietveld 408576698