Bug 1769290 - Part 11: Apply mozilla-js-handle-rooted-typedef against widget r=andi

Differential Revision: https://phabricator.services.mozilla.com/D150793
This commit is contained in:
Kagami Sascha Rosylight 2022-07-04 20:57:18 +00:00
Родитель fb118b670b
Коммит 1f1d706cf6
2 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -1550,7 +1550,7 @@ void GfxInfoBase::RemoveCollector(GfxInfoCollectorBase* collector) {
}
static void AppendMonitor(JSContext* aCx, widget::Screen& aScreen,
JS::HandleObject aOutArray, int32_t aIndex) {
JS::Handle<JSObject*> aOutArray, int32_t aIndex) {
JS::Rooted<JSObject*> obj(aCx, JS_NewPlainObject(aCx));
auto screenSize = aScreen.GetRect().Size();
@ -1583,7 +1583,8 @@ static void AppendMonitor(JSContext* aCx, widget::Screen& aScreen,
JS_SetElement(aCx, aOutArray, aIndex, element);
}
nsresult GfxInfoBase::FindMonitors(JSContext* aCx, JS::HandleObject aOutArray) {
nsresult GfxInfoBase::FindMonitors(JSContext* aCx,
JS::Handle<JSObject*> aOutArray) {
int32_t index = 0;
auto& sm = ScreenManager::GetSingleton();
for (auto& screen : sm.CurrentScreenList()) {
@ -1600,7 +1601,7 @@ nsresult GfxInfoBase::FindMonitors(JSContext* aCx, JS::HandleObject aOutArray) {
}
NS_IMETHODIMP
GfxInfoBase::GetMonitors(JSContext* aCx, JS::MutableHandleValue aResult) {
GfxInfoBase::GetMonitors(JSContext* aCx, JS::MutableHandle<JS::Value> aResult) {
JS::Rooted<JSObject*> array(aCx, JS::NewArrayObject(aCx, 0));
nsresult rv = FindMonitors(aCx, array);

Просмотреть файл

@ -55,7 +55,7 @@ class GfxInfoBase : public nsIGfxInfo,
nsAString& _retval) override;
NS_IMETHOD GetMonitors(JSContext* cx,
JS::MutableHandleValue _retval) override;
JS::MutableHandle<JS::Value> _retval) override;
NS_IMETHOD GetFailures(nsTArray<int32_t>& indices,
nsTArray<nsCString>& failures) override;
NS_IMETHOD_(void) LogFailure(const nsACString& failure) override;
@ -106,7 +106,7 @@ class GfxInfoBase : public nsIGfxInfo,
// Convenience to get the application version
static const nsCString& GetApplicationVersion();
virtual nsresult FindMonitors(JSContext* cx, JS::HandleObject array);
virtual nsresult FindMonitors(JSContext* cx, JS::Handle<JSObject*> array);
static void SetFeatureStatus(
nsTArray<mozilla::gfx::GfxInfoFeatureStatus>&& aFS);