mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1889496 - Fix the potential incomplete type when accessing nsPluginElement with RefPtr. r=layout-reviewers,emilio
We may get build bustages for fuzzer/asan build without this change: `member access into incomplete type 'nsPluginElement'`. nsMimeTypeArray.h forward-declares the `nsPluginElement` type, so it's not supposed to have any code that calls methods on instances of that type. The `do_AddRef` inline function internally calls `AddRef` on the passed-in thing, so we need to move that to the .cpp file which has the actual type definition available. Differential Revision: https://phabricator.services.mozilla.com/D206724
This commit is contained in:
parent
7fc0ce825d
commit
a1ca30417e
@ -94,3 +94,7 @@ JSObject* nsMimeType::WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) {
|
||||
return MimeType_Binding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
already_AddRefed<nsPluginElement> nsMimeType::EnabledPlugin() const {
|
||||
return do_AddRef(mPluginElement);
|
||||
}
|
||||
|
@ -83,9 +83,7 @@ class nsMimeType final : public nsWrapperCache {
|
||||
retval.SetKnownLiveString(kMimeDescription);
|
||||
}
|
||||
|
||||
already_AddRefed<nsPluginElement> EnabledPlugin() const {
|
||||
return do_AddRef(mPluginElement);
|
||||
}
|
||||
already_AddRefed<nsPluginElement> EnabledPlugin() const;
|
||||
|
||||
void GetSuffixes(mozilla::dom::DOMString& retval) const {
|
||||
retval.SetKnownLiveString(kMimeSuffix);
|
||||
|
Loading…
Reference in New Issue
Block a user