Chromium Code Reviews
DescriptionAvoid object slicing in WebCredential::create
WebCredential::create currently returns a WebCredential. It tries to create one
of its subclasses, WebPasswordCredential or WebFederatedCredential,
respectively, but those object get sliced to their common base upon returning,
because a function returning A cannot return B even if B is a subclass of A.
To fix that, this CL changes create() to return a pointer to a WebCredential.
This allows creating subclasses of it while keeping the return type as
declared.
R=mkwst@chromium.org
BUG=610646
Review-Url: https://codereview.chromium.org/1967693003
Cr-Commit-Position: refs/heads/master@{#392959}
(cherry picked from commit 9818ab57e995473e2d41d5bb40b6a9abd2682151)
Committed: https://chromium.googlesource.com/chromium/src/+/a11ede2c9225b66ee9403f5bf26eceb11987afb6
Patch Set 1 #
Messages
Total messages: 2 (1 generated)
|
|||||||||||||||||||||||||||||||||||||