Bug 1419581 - Part 2: Guard media Fennec JNI primitives with MOZ_NATIVE_DEVICES. r=jchen

MozReview-Commit-ID: 3NWZ6BL5Tlr

--HG--
extra : rebase_source : 7db66ec51c0a3337527c76d02109db71804d23f8
This commit is contained in:
Nick Alexander 2017-12-06 20:28:04 -08:00
Родитель a056b461cc
Коммит d61bdc9e40
5 изменённых файлов: 9 добавлений и 0 удалений

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

@ -550,6 +550,7 @@ endif
# @BuildFlag annotation in Java). For example, add a "MOZ_FOO \" line to this # @BuildFlag annotation in Java). For example, add a "MOZ_FOO \" line to this
# list to support @BuildFlag(MOZ_FOO). # list to support @BuildFlag(MOZ_FOO).
BINDING_BUILD_FLAGS = \ BINDING_BUILD_FLAGS = \
MOZ_NATIVE_DEVICES \
$(NULL) $(NULL)
# Preprocess a JNI binding file using the build flags defined above. # Preprocess a JNI binding file using the build flags defined above.

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

@ -20,11 +20,13 @@ import android.view.WindowManager;
import org.mozilla.gecko.AppConstants.Versions; import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.annotation.BuildFlag;
import org.mozilla.gecko.annotation.WrapForJNI; import org.mozilla.gecko.annotation.WrapForJNI;
/** /**
* A MediaPlayerManager with API 17+ Presentation support. * A MediaPlayerManager with API 17+ Presentation support.
*/ */
@BuildFlag("MOZ_NATIVE_DEVICES")
@TargetApi(17) @TargetApi(17)
public class PresentationMediaPlayerManager extends MediaPlayerManager { public class PresentationMediaPlayerManager extends MediaPlayerManager {

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

@ -83,6 +83,7 @@ const JNINativeMethod MemoryMonitor::Natives<Impl>::methods[] = {
::template Wrap<&Impl::DispatchMemoryPressure>) ::template Wrap<&Impl::DispatchMemoryPressure>)
}; };
#ifdef MOZ_NATIVE_DEVICES
template<class Impl> template<class Impl>
class PresentationMediaPlayerManager::Natives : public mozilla::jni::NativeImpl<PresentationMediaPlayerManager, Impl> class PresentationMediaPlayerManager::Natives : public mozilla::jni::NativeImpl<PresentationMediaPlayerManager, Impl>
{ {
@ -106,6 +107,7 @@ const JNINativeMethod PresentationMediaPlayerManager::Natives<Impl>::methods[] =
::template Wrap<&Impl::RemovePresentationSurface>) ::template Wrap<&Impl::RemovePresentationSurface>)
}; };
#endif // MOZ_NATIVE_DEVICES
template<class Impl> template<class Impl>
class Telemetry::Natives : public mozilla::jni::NativeImpl<Telemetry, Impl> class Telemetry::Natives : public mozilla::jni::NativeImpl<Telemetry, Impl>
{ {

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

@ -174,6 +174,7 @@ const char MemoryMonitor::name[] =
constexpr char MemoryMonitor::DispatchMemoryPressure_t::name[]; constexpr char MemoryMonitor::DispatchMemoryPressure_t::name[];
constexpr char MemoryMonitor::DispatchMemoryPressure_t::signature[]; constexpr char MemoryMonitor::DispatchMemoryPressure_t::signature[];
#ifdef MOZ_NATIVE_DEVICES
const char PresentationMediaPlayerManager::name[] = const char PresentationMediaPlayerManager::name[] =
"org/mozilla/gecko/PresentationMediaPlayerManager"; "org/mozilla/gecko/PresentationMediaPlayerManager";
@ -186,6 +187,7 @@ constexpr char PresentationMediaPlayerManager::InvalidateAndScheduleComposite_t:
constexpr char PresentationMediaPlayerManager::RemovePresentationSurface_t::name[]; constexpr char PresentationMediaPlayerManager::RemovePresentationSurface_t::name[];
constexpr char PresentationMediaPlayerManager::RemovePresentationSurface_t::signature[]; constexpr char PresentationMediaPlayerManager::RemovePresentationSurface_t::signature[];
#endif // MOZ_NATIVE_DEVICES
const char Telemetry::name[] = const char Telemetry::name[] =
"org/mozilla/gecko/Telemetry"; "org/mozilla/gecko/Telemetry";

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

@ -518,6 +518,7 @@ public:
template<class Impl> class Natives; template<class Impl> class Natives;
}; };
#ifdef MOZ_NATIVE_DEVICES
class PresentationMediaPlayerManager : public mozilla::jni::ObjectBase<PresentationMediaPlayerManager> class PresentationMediaPlayerManager : public mozilla::jni::ObjectBase<PresentationMediaPlayerManager>
{ {
public: public:
@ -585,6 +586,7 @@ public:
template<class Impl> class Natives; template<class Impl> class Natives;
}; };
#endif // MOZ_NATIVE_DEVICES
class Telemetry : public mozilla::jni::ObjectBase<Telemetry> class Telemetry : public mozilla::jni::ObjectBase<Telemetry>
{ {
public: public: