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

Issue 2961083002: Move base::WeakPtr's null ctor out-of-line (Closed)

Created:
3 years, 5 months ago by hans
Modified:
3 years, 5 months ago
Reviewers:
Nico
CC:
chromium-reviews, danakj+watch_chromium.org, gavinp+memory_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Move base::WeakPtr's null ctor out-of-line They already invoke the out-of-line constructor for WeakPtrBase (which needs to set up the WeakReference, so being out of line makes sense). Because of that, doing ptr_ = nullptr inline doesn't any performance but costs size. Since WeakPtr is a template, move the ptr_ member into the non-template WeakPtrBase and initialize it in that class's out-of-line ctor. This is expected to reduce the binary size by ~8KB on Android and 48KB on x64 Linux. BUG=728324 Review-Url: https://codereview.chromium.org/2961083002 Cr-Commit-Position: refs/heads/master@{#483474} Committed: https://chromium.googlesource.com/chromium/src/+/cc65b2990c22909896c5b08ad5e6b159a6bef5f5

Patch Set 1 #

Patch Set 2 : up-cast in WeakPtr copy/move ctors; fixes headless tests #

Patch Set 3 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -31 lines) Patch
M base/memory/weak_ptr.h View 1 2 5 chunks +23 lines, -17 lines 0 comments Download
M base/memory/weak_ptr.cc View 1 2 1 chunk +4 lines, -6 lines 0 comments Download
M base/memory/weak_ptr_unittest.nc View 1 5 chunks +8 lines, -8 lines 0 comments Download

Messages

Total messages: 18 (15 generated)
Nico
lgtm
3 years, 5 months ago (2017-06-28 20:54:03 UTC) #8
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/2961083002/40001
3 years, 5 months ago (2017-06-29 18:31:09 UTC) #14
commit-bot: I haz the power
3 years, 5 months ago (2017-06-29 20:36:01 UTC) #18
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/cc65b2990c22909896c5b08ad5e6...

Powered by Google App Engine
This is Rietveld 408576698