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

MozReview-Commit-ID: 3NWZ6BL5Tlr

--HG--
extra : rebase_source : 8cc4621269ac24abe889494ccfa80e6f90c7f428
extra : intermediate-source : 072108d165905e8e6dfdc6720512b6610e30cd68
extra : source : 2ea82ff4a757a0aeb7bdd8cff611d5b92dec14eb
This commit is contained in:
Nick Alexander 2017-12-06 20:28:04 -08:00
Родитель 5545cfcfe1
Коммит b2dc9043ec
7 изменённых файлов: 19 добавлений и 1 удалений

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

@ -556,7 +556,12 @@ endif
# List of build flags used by auto-generated JNI bindings (through the
# @BuildFlag annotation in Java). For example, add a "MOZ_FOO \" line to this
# list to support @BuildFlag(MOZ_FOO).
#
# Be sure that the given BUILD_FLAG is exposed to the generated JNI
# wrapper compilation environment! This might mean adding a local
# DEFINE in /widget/android and/or /widget/android/fennec.
BINDING_BUILD_FLAGS = \
MOZ_NATIVE_DEVICES \
$(NULL)
# 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.annotation.BuildFlag;
import org.mozilla.gecko.annotation.WrapForJNI;
/**
* A MediaPlayerManager with API 17+ Presentation support.
*/
@BuildFlag("MOZ_NATIVE_DEVICES")
@TargetApi(17)
public class PresentationMediaPlayerManager extends MediaPlayerManager {

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

@ -83,6 +83,7 @@ const JNINativeMethod MemoryMonitor::Natives<Impl>::methods[] = {
::template Wrap<&Impl::DispatchMemoryPressure>)
};
#ifdef MOZ_NATIVE_DEVICES
template<class Impl>
class PresentationMediaPlayerManager::Natives : public mozilla::jni::NativeImpl<PresentationMediaPlayerManager, Impl>
{
@ -106,6 +107,7 @@ const JNINativeMethod PresentationMediaPlayerManager::Natives<Impl>::methods[] =
::template Wrap<&Impl::RemovePresentationSurface>)
};
#endif // MOZ_NATIVE_DEVICES
template<class 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::signature[];
#ifdef MOZ_NATIVE_DEVICES
const char PresentationMediaPlayerManager::name[] =
"org/mozilla/gecko/PresentationMediaPlayerManager";
@ -186,6 +187,7 @@ constexpr char PresentationMediaPlayerManager::InvalidateAndScheduleComposite_t:
constexpr char PresentationMediaPlayerManager::RemovePresentationSurface_t::name[];
constexpr char PresentationMediaPlayerManager::RemovePresentationSurface_t::signature[];
#endif // MOZ_NATIVE_DEVICES
const char Telemetry::name[] =
"org/mozilla/gecko/Telemetry";

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

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

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

@ -22,3 +22,6 @@ LOCAL_INCLUDES += [
'/widget',
'/widget/android',
]
if CONFIG['MOZ_NATIVE_DEVICES']:
DEFINES['MOZ_NATIVE_DEVICES'] = True

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

@ -78,5 +78,7 @@ CXXFLAGS += ['-Wno-error=shadow']
OS_LIBS += ['android']
#DEFINES['DEBUG_WIDGETS'] = True
if CONFIG['MOZ_NATIVE_DEVICES']:
DEFINES['MOZ_NATIVE_DEVICES'] = True
#DEFINES['DEBUG_WIDGETS'] = True