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

Issue 1868933003: [NOT COMMITTED] Inline TaskTraits' destructor per it only having POD type members (Closed)

Created:
4 years, 8 months ago by gab
Modified:
4 years, 8 months ago
Reviewers:
robliao
CC:
chromium-reviews, fdoray
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Inline TaskTraits' destructor per it only having POD type members BUG=553459

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -3 lines) Patch
M base/task_scheduler/task_traits.h View 1 chunk +1 line, -1 line 3 comments Download
M base/task_scheduler/task_traits.cc View 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
gab
Rob makes sense to you? (CC fdoray, simple CL doesn't require 2 reviewers)
4 years, 8 months ago (2016-04-07 17:37:46 UTC) #2
robliao
https://codereview.chromium.org/1868933003/diff/1/base/task_scheduler/task_traits.h File base/task_scheduler/task_traits.h (right): https://codereview.chromium.org/1868933003/diff/1/base/task_scheduler/task_traits.h#newcode90 base/task_scheduler/task_traits.h:90: ~TaskTraits() = default; The Chromium guidance is "Define them ...
4 years, 8 months ago (2016-04-07 17:43:18 UTC) #3
gab
https://codereview.chromium.org/1868933003/diff/1/base/task_scheduler/task_traits.h File base/task_scheduler/task_traits.h (right): https://codereview.chromium.org/1868933003/diff/1/base/task_scheduler/task_traits.h#newcode90 base/task_scheduler/task_traits.h:90: ~TaskTraits() = default; On 2016/04/07 17:43:18, robliao wrote: > ...
4 years, 8 months ago (2016-04-08 21:00:04 UTC) #4
gab
4 years, 8 months ago (2016-04-08 21:01:48 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/1868933003/diff/1/base/task_scheduler/task_tr...
File base/task_scheduler/task_traits.h (right):

https://codereview.chromium.org/1868933003/diff/1/base/task_scheduler/task_tr...
base/task_scheduler/task_traits.h:90: ~TaskTraits() = default;
On 2016/04/08 21:00:04, gab wrote:
> On 2016/04/07 17:43:18, robliao wrote:
> > The Chromium guidance is
> > 
> > "Define them in the implementation file unless you really need them to be
> > inlined."
> > 
> > Also noted, this also apparently breaks forward declared variables
(presumably
> > since the compiler now needs to know everything about setting the object
up). 
> 
> Hmm, interesting, do we expect TaskTraits to be fwd-declared much?
> 
> > 
> >
>
https://www.chromium.org/developers/coding-style/cpp-dos-and-donts#TOC-Stop-i...
> > 
> > Having said that, do we gain something from inlining this destructor?
> 
> If it's not inlined then SchedulerParallelTaskRunner also has to have an
> explicit out-of-line destructor:
>
https://codereview.chromium.org/1708773002/diff/550001/base/task_scheduler/sc...
> 
> (that review is why I wondered whether TaskTraits had a trivial inline
> destructor with POD types only)
> 
> But I guess the point of that style rule is that having that dependency on
> SchedulerParallelTaskRunner is no good anyways (probably doesn't matter much
in
> that case since all callers won't inline but rather use virtual dispatch to
get
> to the destructor but wtv).

Actually that destructor is private so virtual dispatch is really the only way
to get to it and inlining isn't a concern, so nothing needs to change, ignore me
:-)!

> 
> So I guess not inlining is the right thing here after all.
> 
> Closing, thanks.

Powered by Google App Engine
This is Rietveld 408576698