DescriptionRemoved local RefPtr objects created from PassRefPtr arguments.
Removed local RefPtr objects created from PassRefPtr arguments and
converted the PassRefPtr arguments to RefPtr.
This patch deals with one specific corner case of copying PassRefPtr
objects to RefPtr objects, where PassRefPtr arguments are copied into
local RefPtr objects to be used throughout the function.
All instances of PassRefPtr objects being copied into RefPtr objects
need to be wrapped in std::move to avoid introducing ref churn in
future changes when all PassRefPtr objects will be replaced with RefPtr
objects. In these cases of creating a local RefPtr just to copy the
PassRefPtr argument into, a std::move wrap doesn't make sense as it
would result in a final state where a RefPtr argument is moved into a
local RefPtr for no reason. So to handle these cases I have converted
the PassRefPtr arguments to RefPtr in advance, and removed the local
RefPtr argumen, instead using the passed RefPtr throughout the
methods. In most cases the RefPtr argument name has been changed to
match the previousf name of the local RefPtr.
The syntax of the local RefPtr variables have also been changed to
use std::move wraps instead of calling RefPtr::Release in cases
where the RefPtr is no longer needed locally after passing.
Note that std::move wraps have been introduced in some cases where
RefPtr::Release() was not being called but should have been.
BUG=494719
Review-Url: https://codereview.chromium.org/2807073002
Cr-Commit-Position: refs/heads/master@{#463565}
Committed: https://chromium.googlesource.com/chromium/src/+/ad3dfab7e0e948209a3a68e1900a038c86182502
Patch Set 1 #
Total comments: 3
Patch Set 2 : addressed review #Messages
Total messages: 17 (9 generated)
|