mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-14 03:07:31 +09:00
Issue #2112 - Part 5: Remove Servo from forwarding code used by magic pointer classes
This commit is contained in:
parent
b1c9206051
commit
a93a7bed47
52 changed files with 274 additions and 1116 deletions
|
|
@ -48,47 +48,24 @@ public:
|
|||
public:
|
||||
friend class ::mozilla::RestyleManagerHandle;
|
||||
|
||||
bool IsGecko() const { return !IsServo(); }
|
||||
bool IsServo() const
|
||||
{
|
||||
MOZ_ASSERT(mValue, "RestyleManagerHandle null pointer dereference");
|
||||
return false;
|
||||
}
|
||||
|
||||
StyleBackendType BackendType() const
|
||||
{
|
||||
return IsGecko() ? StyleBackendType::Gecko :
|
||||
StyleBackendType::Servo;
|
||||
return StyleBackendType::Gecko;
|
||||
}
|
||||
|
||||
RestyleManager* AsGecko()
|
||||
{
|
||||
MOZ_ASSERT(IsGecko());
|
||||
return reinterpret_cast<RestyleManager*>(mValue);
|
||||
}
|
||||
|
||||
ServoRestyleManager* AsServo()
|
||||
{
|
||||
MOZ_ASSERT(IsServo());
|
||||
return reinterpret_cast<ServoRestyleManager*>(mValue & ~SERVO_BIT);
|
||||
}
|
||||
|
||||
RestyleManager* GetAsGecko() { return IsGecko() ? AsGecko() : nullptr; }
|
||||
ServoRestyleManager* GetAsServo() { return IsServo() ? AsServo() : nullptr; }
|
||||
RestyleManager* GetAsGecko() { return AsGecko(); }
|
||||
|
||||
const RestyleManager* AsGecko() const
|
||||
{
|
||||
return const_cast<Ptr*>(this)->AsGecko();
|
||||
}
|
||||
|
||||
const ServoRestyleManager* AsServo() const
|
||||
{
|
||||
MOZ_ASSERT(IsServo());
|
||||
return const_cast<Ptr*>(this)->AsServo();
|
||||
}
|
||||
|
||||
const RestyleManager* GetAsGecko() const { return IsGecko() ? AsGecko() : nullptr; }
|
||||
const ServoRestyleManager* GetAsServo() const { return IsServo() ? AsServo() : nullptr; }
|
||||
const RestyleManager* GetAsGecko() const { return AsGecko(); }
|
||||
|
||||
// These inline methods are defined in RestyleManagerHandleInlines.h.
|
||||
inline MozExternalRefCountType AddRef();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue