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

Issue 2739553003: Make ComputedStyleBase abstract. (Closed)

Created:
3 years, 9 months ago by shend
Modified:
3 years, 9 months ago
Reviewers:
meade_UTC10, sashab
CC:
blink-reviews, blink-reviews-style_chromium.org, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make ComputedStyleBase abstract. Currently ComputedStyleBase can be instantiated, and a ComputedStyle can be deleted via a pointer to ComputedStyleBase. Both of these could cause issues since ComputedStyleBase should be an abstract class. This patch moves the ComputedStyleBase constructor and destructor to be protected so that only ComputedStyle can call them. BUG=628043 Review-Url: https://codereview.chromium.org/2739553003 Cr-Commit-Position: refs/heads/master@{#457579} Committed: https://chromium.googlesource.com/chromium/src/+/ffd34d347dc1889ae692610c4d35cc2fc97ca9c0

Patch Set 1 #

Total comments: 2

Patch Set 2 : Make abstract #

Patch Set 3 : Rebase #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -13 lines) Patch
M third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl View 1 2 2 chunks +14 lines, -13 lines 1 comment Download

Messages

Total messages: 37 (20 generated)
shend
Hi Eddy, PTAL
3 years, 9 months ago (2017-03-09 17:49:09 UTC) #6
meade_UTC10
https://codereview.chromium.org/2739553003/diff/1/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl File third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl (left): https://codereview.chromium.org/2739553003/diff/1/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl#oldcode30 third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl:30: ~ComputedStyleBase() {} I'm a bit surprised this isn't virtual. ...
3 years, 9 months ago (2017-03-10 04:04:46 UTC) #7
meade_UTC10
+sasha for opinions on C++ idioms My opinion is that all base classes should have ...
3 years, 9 months ago (2017-03-10 04:34:37 UTC) #9
sashab
https://codereview.chromium.org/2739553003/diff/1/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl File third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl (left): https://codereview.chromium.org/2739553003/diff/1/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl#oldcode30 third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl:30: ~ComputedStyleBase() {} On 2017/03/10 04:04:46, Eddy wrote: > I'm ...
3 years, 9 months ago (2017-03-10 04:51:02 UTC) #10
shend
On 2017/03/10 at 04:51:02, sashab wrote: > https://codereview.chromium.org/2739553003/diff/1/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl > File third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl (left): > > https://codereview.chromium.org/2739553003/diff/1/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl#oldcode30 ...
3 years, 9 months ago (2017-03-10 05:45:39 UTC) #11
meade_UTC10
On 2017/03/10 05:45:39, shend wrote: > On 2017/03/10 at 04:51:02, sashab wrote: > > > ...
3 years, 9 months ago (2017-03-10 06:40:14 UTC) #12
shend
On 2017/03/10 at 06:40:14, meade wrote: > On 2017/03/10 05:45:39, shend wrote: > > On ...
3 years, 9 months ago (2017-03-10 14:38:26 UTC) #13
meade_UTC10
On 2017/03/10 14:38:26, shend wrote: > On 2017/03/10 at 06:40:14, meade wrote: > > On ...
3 years, 9 months ago (2017-03-13 06:40:42 UTC) #14
shend
On 2017/03/13 at 06:40:42, meade wrote: > On 2017/03/10 14:38:26, shend wrote: > > On ...
3 years, 9 months ago (2017-03-13 06:55:02 UTC) #15
meade_UTC10
On 2017/03/13 06:55:02, shend wrote: > On 2017/03/13 at 06:40:42, meade wrote: > > On ...
3 years, 9 months ago (2017-03-13 07:00:11 UTC) #16
sashab
> There's two types of protection that we can provide to CSB: > 1. protected ...
3 years, 9 months ago (2017-03-13 07:46:59 UTC) #17
shend
On 2017/03/13 at 07:46:59, sashab wrote: > > There's two types of protection that we ...
3 years, 9 months ago (2017-03-13 21:14:52 UTC) #18
meade_UTC10
lgtm
3 years, 9 months ago (2017-03-14 06:57:41 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2739553003/40001
3 years, 9 months ago (2017-03-16 22:07:17 UTC) #32
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/ffd34d347dc1889ae692610c4d35cc2fc97ca9c0
3 years, 9 months ago (2017-03-16 22:14:21 UTC) #35
sashab
Thanks darren, but please add a comment explaining this. Also, in future, can we avoid ...
3 years, 9 months ago (2017-03-16 23:55:31 UTC) #36
shend
3 years, 9 months ago (2017-03-17 00:08:11 UTC) #37
Message was sent while issue was closed.
On 2017/03/16 at 23:55:31, sashab wrote:
> Thanks darren, but please add a comment explaining this.
> 
> Also, in future, can we avoid words like "abstract" unless it has a specific
meaning in C++? Eg abstract in C++ actually means at least one function is
virtual - https://www.tutorialspoint.com/cplusplus/cpp_interfaces.htm (pretty
sure this is just a reinterpretation of java though). Don't want someone looking
at this patch and being like "oh, the title says abstract but the class isn't
virtual, I guess Darren forgot to add virtual methods, I'll fix that" ;)
> 
>
https://codereview.chromium.org/2739553003/diff/40001/third_party/WebKit/Sour...
> File
third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl
(right):
> 
>
https://codereview.chromium.org/2739553003/diff/40001/third_party/WebKit/Sour...
> third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl:85:
~ComputedStyleBase() = default;
> I like this, but can we add a comment here like:
> // Make the ComputedStyleBase destructor protected so that you can only create
one if it is a ComputedStyle.

Oops, will do.

Powered by Google App Engine
This is Rietveld 408576698