DescriptionMove 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 #
Messages
Total messages: 18 (15 generated)
|