mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1011810. Return the right type from getIccById. r=htsai,smaug
This commit is contained in:
parent
9a622cefe4
commit
8e2f0fbfc3
@ -26,11 +26,10 @@ public:
|
||||
void
|
||||
Shutdown();
|
||||
|
||||
already_AddRefed<Icc>
|
||||
Icc*
|
||||
GetIcc()
|
||||
{
|
||||
nsRefPtr<Icc> icc = mIcc;
|
||||
return icc.forget();
|
||||
return mIcc;
|
||||
}
|
||||
|
||||
private:
|
||||
@ -49,4 +48,4 @@ private:
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_IccListener_h
|
||||
#endif // mozilla_dom_IccListener_h
|
||||
|
@ -102,21 +102,21 @@ IccManager::GetIccIds(nsTArray<nsString>& aIccIds)
|
||||
{
|
||||
nsTArray<nsRefPtr<IccListener>>::size_type i;
|
||||
for (i = 0; i < mIccListeners.Length(); ++i) {
|
||||
nsRefPtr<Icc> icc = mIccListeners[i]->GetIcc();
|
||||
Icc* icc = mIccListeners[i]->GetIcc();
|
||||
if (icc) {
|
||||
aIccIds.AppendElement(icc->GetIccId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
already_AddRefed<nsISupports>
|
||||
Icc*
|
||||
IccManager::GetIccById(const nsAString& aIccId) const
|
||||
{
|
||||
nsTArray<nsRefPtr<IccListener>>::size_type i;
|
||||
for (i = 0; i < mIccListeners.Length(); ++i) {
|
||||
nsRefPtr<Icc> icc = mIccListeners[i]->GetIcc();
|
||||
Icc* icc = mIccListeners[i]->GetIcc();
|
||||
if (icc && aIccId == icc->GetIccId()) {
|
||||
return icc.forget();
|
||||
return icc;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
|
@ -14,6 +14,7 @@ namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class IccListener;
|
||||
class Icc;
|
||||
|
||||
class IccManager MOZ_FINAL : public DOMEventTargetHelper
|
||||
{
|
||||
@ -42,7 +43,7 @@ public:
|
||||
void
|
||||
GetIccIds(nsTArray<nsString>& aIccIds);
|
||||
|
||||
already_AddRefed<nsISupports>
|
||||
Icc*
|
||||
GetIccById(const nsAString& aIccId) const;
|
||||
|
||||
nsPIDOMWindow*
|
||||
|
@ -239,7 +239,7 @@ interface MozIccManager : EventTarget
|
||||
*
|
||||
* @return see MozIcc.webidl for the detail.
|
||||
*/
|
||||
nsISupports getIccById(DOMString iccId);
|
||||
MozIcc? getIccById(DOMString iccId);
|
||||
|
||||
/**
|
||||
* 'oniccdetected' event is notified whenever a new ICC is detected.
|
||||
|
Loading…
Reference in New Issue
Block a user