Bug 1419581 - Part 3: Guard PresentationMediaPlayer windows with MOZ_NATIVE_DEVICES. r=jchen

MozReview-Commit-ID: 3ZlVUMufn2g

--HG--
extra : rebase_source : 539690b6ebe6fd5805d2be379c3732350f1b223f
This commit is contained in:
Nick Alexander 2018-01-05 11:35:00 -08:00
Родитель e7b25fe604
Коммит 3d8b16b3ab
2 изменённых файлов: 10 добавлений и 0 удалений

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

@ -1139,6 +1139,7 @@ public:
template<> const char
nsWindow::NativePtr<nsWindow::LayerViewSupport>::sName[] = "LayerViewSupport";
#ifdef MOZ_NATIVE_DEVICES
/* PresentationMediaPlayerManager native calls access inner nsWindow functionality so PMPMSupport is a child class of nsWindow */
class nsWindow::PMPMSupport final
: public PresentationMediaPlayerManager::Natives<PMPMSupport>
@ -1223,6 +1224,7 @@ public:
ANativeWindow* nsWindow::PMPMSupport::sWindow;
EGLSurface nsWindow::PMPMSupport::sSurface;
#endif
nsWindow::GeckoViewSupport::~GeckoViewSupport()
@ -1390,9 +1392,11 @@ nsWindow::InitNatives()
nsWindow::GeckoViewSupport::Base::Init();
nsWindow::LayerViewSupport::Init();
nsWindow::NPZCSupport::Init();
#ifdef MOZ_NATIVE_DEVICES
if (jni::IsFennec()) {
nsWindow::PMPMSupport::Init();
}
#endif
GeckoEditableSupport::Init();
}
@ -2074,11 +2078,13 @@ nsWindow::GetNativeData(uint32_t aDataType)
}
return nullptr;
#ifdef MOZ_NATIVE_DEVICES
case NS_PRESENTATION_WINDOW:
return PMPMSupport::sWindow;
case NS_PRESENTATION_SURFACE:
return PMPMSupport::sSurface;
#endif
}
return nullptr;
@ -2088,9 +2094,11 @@ void
nsWindow::SetNativeData(uint32_t aDataType, uintptr_t aVal)
{
switch (aDataType) {
#ifdef MOZ_NATIVE_DEVICES
case NS_PRESENTATION_SURFACE:
PMPMSupport::sSurface = reinterpret_cast<EGLSurface>(aVal);
break;
#endif
}
}

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

@ -193,8 +193,10 @@ private:
// keep it last in the list, so its destructor is called first.
mozilla::UniquePtr<GeckoViewSupport> mGeckoViewSupport;
#ifdef MOZ_NATIVE_DEVICES
// Class that implements native PresentationMediaPlayerManager calls.
class PMPMSupport;
#endif
mozilla::Atomic<bool, mozilla::ReleaseAcquire> mContentDocumentDisplayed;