Commit d317e89d authored by pcc's avatar pcc Committed by Commit bot

Make WDDestroyableResult<T> derive from WDResult<T>.

This fixes an issue found by -fsanitize=cfi-derived-cast caused by code that
casts a WDResult<T> pointer to WDDestroyableResult<T>.

BUG=457523
R=caitkp@chromium.org

Review URL: https://codereview.chromium.org/1021043002

Cr-Commit-Position: refs/heads/master@{#321644}
parent 06681dfb
......@@ -81,14 +81,13 @@ template <class T> class WDResult : public WDTypedResult {
DISALLOW_COPY_AND_ASSIGN(WDResult);
};
template <class T> class WDDestroyableResult : public WDTypedResult {
template <class T> class WDDestroyableResult : public WDResult<T> {
public:
WDDestroyableResult(
WDResultType type,
const T& v,
const DestroyCallback& callback)
: WDTypedResult(type),
value_(v),
: WDResult<T>(type, v),
callback_(callback) {
}
......@@ -102,13 +101,7 @@ template <class T> class WDDestroyableResult : public WDTypedResult {
}
}
// Return a single value result.
T GetValue() const {
return value_;
}
private:
T value_;
DestroyCallback callback_;
DISALLOW_COPY_AND_ASSIGN(WDDestroyableResult);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment