зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
5545cfcfe1
Коммит
b2dc9043ec
|
@ -556,7 +556,12 @@ endif
|
||||||
# List of build flags used by auto-generated JNI bindings (through the
|
# 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
|
# @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).
|
||||||
|
#
|
||||||
|
# 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 = \
|
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:
|
||||||
|
|
|
@ -22,3 +22,6 @@ LOCAL_INCLUDES += [
|
||||||
'/widget',
|
'/widget',
|
||||||
'/widget/android',
|
'/widget/android',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if CONFIG['MOZ_NATIVE_DEVICES']:
|
||||||
|
DEFINES['MOZ_NATIVE_DEVICES'] = True
|
||||||
|
|
|
@ -78,5 +78,7 @@ CXXFLAGS += ['-Wno-error=shadow']
|
||||||
|
|
||||||
OS_LIBS += ['android']
|
OS_LIBS += ['android']
|
||||||
|
|
||||||
#DEFINES['DEBUG_WIDGETS'] = True
|
if CONFIG['MOZ_NATIVE_DEVICES']:
|
||||||
|
DEFINES['MOZ_NATIVE_DEVICES'] = True
|
||||||
|
|
||||||
|
#DEFINES['DEBUG_WIDGETS'] = True
|
||||||
|
|
Загрузка…
Ссылка в новой задаче