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

Issue 1976943002: Avoid object slicing in WebCredential::create (Closed)

Created:
4 years, 7 months ago by vabr (Chromium)
Modified:
4 years, 7 months ago
Reviewers:
Mike West
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@2704
Target Ref:
refs/pending/branch-heads/2704
Project:
chromium
Visibility:
Public.

Description

Avoid 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -8 lines) Patch
M third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/exported/WebCredential.cpp View 1 chunk +5 lines, -6 lines 0 comments Download
M third_party/WebKit/public/platform/WebCredential.h View 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 2 (1 generated)
vabr (Chromium)
4 years, 7 months ago (2016-05-13 11:47:24 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
a11ede2c9225b66ee9403f5bf26eceb11987afb6.

Powered by Google App Engine
This is Rietveld 408576698