mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-21 14:47:31 +09:00
Merge remote-tracking branch 'origin/master' into custom
This commit is contained in:
commit
e54fcd15f1
56 changed files with 23 additions and 1671 deletions
|
|
@ -164,13 +164,6 @@ all.h
|
||||||
alloca.h
|
alloca.h
|
||||||
alloc.h
|
alloc.h
|
||||||
alsa/asoundlib.h
|
alsa/asoundlib.h
|
||||||
#ifdef ANDROID
|
|
||||||
android/ashmem.h
|
|
||||||
android/log.h
|
|
||||||
android/looper.h
|
|
||||||
android/native_window.h
|
|
||||||
android_audio/AudioSystem.h
|
|
||||||
#endif
|
|
||||||
ansi_parms.h
|
ansi_parms.h
|
||||||
a.out.h
|
a.out.h
|
||||||
app/Cursor.h
|
app/Cursor.h
|
||||||
|
|
@ -200,14 +193,6 @@ atlimpl.cpp
|
||||||
atlwin.cpp
|
atlwin.cpp
|
||||||
ATSTypes.h
|
ATSTypes.h
|
||||||
ATSUnicode.h
|
ATSUnicode.h
|
||||||
#ifdef ANDROID
|
|
||||||
audio_effects/effect_aec.h
|
|
||||||
audio_effects/effect_ns.h
|
|
||||||
AudioParameter.h
|
|
||||||
AudioSystem.h
|
|
||||||
AudioTrack.h
|
|
||||||
avc_utils.h
|
|
||||||
#endif
|
|
||||||
Balloons.h
|
Balloons.h
|
||||||
base/pblock.h
|
base/pblock.h
|
||||||
base/PCR_Base.h
|
base/PCR_Base.h
|
||||||
|
|
@ -218,18 +203,6 @@ Beep.h
|
||||||
be/kernel/image.h
|
be/kernel/image.h
|
||||||
be/kernel/OS.h
|
be/kernel/OS.h
|
||||||
bfd.h
|
bfd.h
|
||||||
#ifdef ANDROID
|
|
||||||
binder/Binder.h
|
|
||||||
binder/BinderService.h
|
|
||||||
binder/IBinder.h
|
|
||||||
binder/IInterface.h
|
|
||||||
binder/IMemory.h
|
|
||||||
binder/IPCThreadState.h
|
|
||||||
binder/IPermissionController.h
|
|
||||||
binder/IServiceManager.h
|
|
||||||
binder/Parcel.h
|
|
||||||
binder/ProcessState.h
|
|
||||||
#endif
|
|
||||||
Bitmap.h
|
Bitmap.h
|
||||||
bitset
|
bitset
|
||||||
blapi.h
|
blapi.h
|
||||||
|
|
@ -308,10 +281,6 @@ dfb_types.h
|
||||||
directfb_strings.h
|
directfb_strings.h
|
||||||
directfb_keyboard.h
|
directfb_keyboard.h
|
||||||
callconv.h
|
callconv.h
|
||||||
#ifdef ANDROID
|
|
||||||
camera/Camera.h
|
|
||||||
camera/CameraParameters.h
|
|
||||||
#endif
|
|
||||||
Carbon/Carbon.h
|
Carbon/Carbon.h
|
||||||
CarbonEvents.h
|
CarbonEvents.h
|
||||||
Carbon.h
|
Carbon.h
|
||||||
|
|
@ -335,9 +304,6 @@ Clipboard.h
|
||||||
cmplrs/stsupport.h
|
cmplrs/stsupport.h
|
||||||
Cocoa/Cocoa.h
|
Cocoa/Cocoa.h
|
||||||
CodeFragments.h
|
CodeFragments.h
|
||||||
#ifdef ANDROID
|
|
||||||
ColorConverter.h
|
|
||||||
#endif
|
|
||||||
comdef.h
|
comdef.h
|
||||||
commctrl.h
|
commctrl.h
|
||||||
COMMCTRL.H
|
COMMCTRL.H
|
||||||
|
|
@ -366,15 +332,6 @@ ctype.h
|
||||||
curl/curl.h
|
curl/curl.h
|
||||||
curl/easy.h
|
curl/easy.h
|
||||||
curses.h
|
curses.h
|
||||||
#ifdef ANDROID
|
|
||||||
cutils/android_reboot.h
|
|
||||||
cutils/atomic.h
|
|
||||||
cutils/compiler.h
|
|
||||||
cutils/log.h
|
|
||||||
cutils/native_handle.h
|
|
||||||
cutils/properties.h
|
|
||||||
cutils/sockets.h
|
|
||||||
#endif
|
|
||||||
cxxabi.h
|
cxxabi.h
|
||||||
DateTimeUtils.h
|
DateTimeUtils.h
|
||||||
dbus/dbus.h
|
dbus/dbus.h
|
||||||
|
|
@ -429,19 +386,6 @@ fontconfig/fontconfig.h
|
||||||
fontconfig/fcfreetype.h
|
fontconfig/fcfreetype.h
|
||||||
Font.h
|
Font.h
|
||||||
Fonts.h
|
Fonts.h
|
||||||
#ifdef ANDROID
|
|
||||||
foundation/ABase.h
|
|
||||||
foundation/ABitReader.h
|
|
||||||
foundation/ABuffer.h
|
|
||||||
foundation/ADebug.h
|
|
||||||
foundation/AHandler.h
|
|
||||||
foundation/AHandlerReflector.h
|
|
||||||
foundation/ALooper.h
|
|
||||||
foundation/AMessage.h
|
|
||||||
foundation/AString.h
|
|
||||||
foundation/base64.h
|
|
||||||
foundation/hexdump.h
|
|
||||||
#endif
|
|
||||||
fp.h
|
fp.h
|
||||||
fpieee.h
|
fpieee.h
|
||||||
frame/log.h
|
frame/log.h
|
||||||
|
|
@ -505,33 +449,8 @@ gssapi.h
|
||||||
gtk/gtk.h
|
gtk/gtk.h
|
||||||
gtk/gtkx.h
|
gtk/gtkx.h
|
||||||
gtk/gtkunixprint.h
|
gtk/gtkunixprint.h
|
||||||
#ifdef ANDROID
|
|
||||||
gui/BufferQueue.h
|
|
||||||
gui/ConsumerBase.h
|
|
||||||
gui/GraphicBufferAlloc.h
|
|
||||||
gui/IConsumerListener.h
|
|
||||||
gui/IGraphicBufferAlloc.h
|
|
||||||
gui/IGraphicBufferProducer.h
|
|
||||||
gui/ISurfaceComposer.h
|
|
||||||
gui/ISurfaceComposerClient.h
|
|
||||||
gui/ISurfaceTexture.h
|
|
||||||
gui/Surface.h
|
|
||||||
gui/SurfaceComposerClient.h
|
|
||||||
gui/SurfaceTextureClient.h
|
|
||||||
hardware/audio.h
|
|
||||||
hardware/gralloc.h
|
|
||||||
hardware/hardware.h
|
|
||||||
hardware/hwcomposer.h
|
|
||||||
hardware/lights.h
|
|
||||||
hardware/power.h
|
|
||||||
hardware_legacy/power.h
|
|
||||||
hardware_legacy/uevent.h
|
|
||||||
#endif
|
|
||||||
HIToolbox/HIToolbox.h
|
HIToolbox/HIToolbox.h
|
||||||
hlink.h
|
hlink.h
|
||||||
#ifdef ANDROID
|
|
||||||
HTTPBase.h
|
|
||||||
#endif
|
|
||||||
ia64/sys/inline.h
|
ia64/sys/inline.h
|
||||||
Icons.h
|
Icons.h
|
||||||
iconv.h
|
iconv.h
|
||||||
|
|
@ -623,10 +542,6 @@ libgnomeui/gnome-icon-theme.h
|
||||||
libgnomeui/gnome-ui-init.h
|
libgnomeui/gnome-ui-init.h
|
||||||
limits.h
|
limits.h
|
||||||
link.h
|
link.h
|
||||||
#ifdef ANDROID
|
|
||||||
linux/android_alarm.h
|
|
||||||
linux/ashmem.h
|
|
||||||
#endif
|
|
||||||
linux/ioprio.h
|
linux/ioprio.h
|
||||||
linux/kernel.h
|
linux/kernel.h
|
||||||
linux/limits.h
|
linux/limits.h
|
||||||
|
|
@ -712,53 +627,6 @@ mapix.h
|
||||||
Math64.h
|
Math64.h
|
||||||
math.h
|
math.h
|
||||||
mbstring.h
|
mbstring.h
|
||||||
#ifdef ANDROID
|
|
||||||
android/native_window.h
|
|
||||||
android/native_window_jni.h
|
|
||||||
media/AudioEffect.h
|
|
||||||
media/AudioSystem.h
|
|
||||||
media/ICrypto.h
|
|
||||||
media/IOMX.h
|
|
||||||
media/MediaProfiles.h
|
|
||||||
media/MediaRecorderBase.h
|
|
||||||
media/openmax/OMX_Audio.h
|
|
||||||
media/stagefright/AACWriter.h
|
|
||||||
media/stagefright/AMRWriter.h
|
|
||||||
media/stagefright/AudioSource.h
|
|
||||||
media/stagefright/DataSource.h
|
|
||||||
media/stagefright/foundation/ABase.h
|
|
||||||
media/stagefright/foundation/ABitReader.h
|
|
||||||
media/stagefright/foundation/ABuffer.h
|
|
||||||
media/stagefright/foundation/ADebug.h
|
|
||||||
media/stagefright/foundation/AHandler.h
|
|
||||||
media/stagefright/foundation/AHandlerReflector.h
|
|
||||||
media/stagefright/foundation/ALooper.h
|
|
||||||
media/stagefright/foundation/AMessage.h
|
|
||||||
media/stagefright/foundation/AString.h
|
|
||||||
media/stagefright/foundation/base64.h
|
|
||||||
media/stagefright/foundation/hexdump.h
|
|
||||||
media/stagefright/MediaBuffer.h
|
|
||||||
media/stagefright/MediaBufferGroup.h
|
|
||||||
media/stagefright/MediaCodec.h
|
|
||||||
media/stagefright/MediaCodecList.h
|
|
||||||
media/stagefright/MediaCodecSource.h
|
|
||||||
media/stagefright/MediaDefs.h
|
|
||||||
media/stagefright/MediaErrors.h
|
|
||||||
media/stagefright/MediaExtractor.h
|
|
||||||
media/stagefright/MediaSource.h
|
|
||||||
media/stagefright/MediaWriter.h
|
|
||||||
media/stagefright/MetaData.h
|
|
||||||
media/stagefright/MPEG2TSWriter.h
|
|
||||||
media/stagefright/MPEG4Writer.h
|
|
||||||
media/stagefright/OMXClient.h
|
|
||||||
media/stagefright/OMXCodec.h
|
|
||||||
media/stagefright/openmax/OMX_Core.h
|
|
||||||
media/stagefright/openmax/OMX_Index.h
|
|
||||||
media/stagefright/openmax/OMX_IVCommon.h
|
|
||||||
media/stagefright/openmax/OMX_Types.h
|
|
||||||
media/stagefright/openmax/OMX_Video.h
|
|
||||||
media/stagefright/Utils.h
|
|
||||||
#endif
|
|
||||||
mem.h
|
mem.h
|
||||||
memory.h
|
memory.h
|
||||||
Memory.h
|
Memory.h
|
||||||
|
|
@ -798,10 +666,6 @@ Objsafe.h
|
||||||
ojiapitests.h
|
ojiapitests.h
|
||||||
ole2.h
|
ole2.h
|
||||||
oleidl.h
|
oleidl.h
|
||||||
#ifdef ANDROID
|
|
||||||
OMX.h
|
|
||||||
OMX_Component.h
|
|
||||||
#endif
|
|
||||||
OpenGL/OpenGL.h
|
OpenGL/OpenGL.h
|
||||||
OpenTptInternet.h
|
OpenTptInternet.h
|
||||||
OpenTransport.h
|
OpenTransport.h
|
||||||
|
|
@ -847,10 +711,6 @@ PP_Resources.h
|
||||||
PP_Types.h
|
PP_Types.h
|
||||||
Printing.h
|
Printing.h
|
||||||
Print/PMPrintingDialogExtensions.h
|
Print/PMPrintingDialogExtensions.h
|
||||||
#ifdef ANDROID
|
|
||||||
private/android_filesystem_config.h
|
|
||||||
private/qucomextra_p.h
|
|
||||||
#endif
|
|
||||||
Processes.h
|
Processes.h
|
||||||
process.h
|
process.h
|
||||||
Process.h
|
Process.h
|
||||||
|
|
@ -917,43 +777,6 @@ Sound.h
|
||||||
soundcard.h
|
soundcard.h
|
||||||
sqlite3.h
|
sqlite3.h
|
||||||
sstream
|
sstream
|
||||||
#ifdef ANDROID
|
|
||||||
stagefright/AACWriter.h
|
|
||||||
stagefright/AMRWriter.h
|
|
||||||
stagefright/AudioSource.h
|
|
||||||
stagefright/DataSource.h
|
|
||||||
stagefright/foundation/ABase.h
|
|
||||||
stagefright/foundation/ABitReader.h
|
|
||||||
stagefright/foundation/ABuffer.h
|
|
||||||
stagefright/foundation/ADebug.h
|
|
||||||
stagefright/foundation/AHandler.h
|
|
||||||
stagefright/foundation/AHandlerReflector.h
|
|
||||||
stagefright/foundation/ALooper.h
|
|
||||||
stagefright/foundation/AMessage.h
|
|
||||||
stagefright/foundation/AString.h
|
|
||||||
stagefright/foundation/base64.h
|
|
||||||
stagefright/foundation/hexdump.h
|
|
||||||
stagefright/MediaBuffer.h
|
|
||||||
stagefright/MediaBufferGroup.h
|
|
||||||
stagefright/MediaCodec.h
|
|
||||||
stagefright/MediaDefs.h
|
|
||||||
stagefright/MediaErrors.h
|
|
||||||
stagefright/MediaExtractor.h
|
|
||||||
stagefright/MediaSource.h
|
|
||||||
stagefright/MediaWriter.h
|
|
||||||
stagefright/MetaData.h
|
|
||||||
stagefright/MPEG2TSWriter.h
|
|
||||||
stagefright/MPEG4Writer.h
|
|
||||||
stagefright/OMXCodec.h
|
|
||||||
stagefright/OMXClient.h
|
|
||||||
stagefright/openmax/OMX_Component.h
|
|
||||||
stagefright/openmax/OMX_Core.h
|
|
||||||
stagefright/openmax/OMX_Index.h
|
|
||||||
stagefright/openmax/OMX_IVCommon.h
|
|
||||||
stagefright/openmax/OMX_Types.h
|
|
||||||
stagefright/openmax/OMX_Video.h
|
|
||||||
stagefright/Utils.h
|
|
||||||
#endif
|
|
||||||
StandardFile.h
|
StandardFile.h
|
||||||
starlet.h
|
starlet.h
|
||||||
stat.h
|
stat.h
|
||||||
|
|
@ -981,9 +804,6 @@ SupportDefs.h
|
||||||
support/String.h
|
support/String.h
|
||||||
support/SupportDefs.h
|
support/SupportDefs.h
|
||||||
support/TLS.h
|
support/TLS.h
|
||||||
#ifdef ANDROID
|
|
||||||
suspend/autosuspend.h
|
|
||||||
#endif
|
|
||||||
svrcore.h
|
svrcore.h
|
||||||
symconst.h
|
symconst.h
|
||||||
sym.h
|
sym.h
|
||||||
|
|
@ -1071,12 +891,6 @@ sys/unistd.h
|
||||||
sys/utsname.h
|
sys/utsname.h
|
||||||
sys/vfs.h
|
sys/vfs.h
|
||||||
sys/wait.h
|
sys/wait.h
|
||||||
#ifdef ANDROID
|
|
||||||
sysutils/NetlinkEvent.h
|
|
||||||
system/audio.h
|
|
||||||
system/graphics.h
|
|
||||||
system/window.h
|
|
||||||
#endif
|
|
||||||
tables.h
|
tables.h
|
||||||
TArray.h
|
TArray.h
|
||||||
TArrayIterator.h
|
TArrayIterator.h
|
||||||
|
|
@ -1119,15 +933,6 @@ UEventMgr.h
|
||||||
UException.h
|
UException.h
|
||||||
UExtractFromAEDesc.h
|
UExtractFromAEDesc.h
|
||||||
UGWorld.h
|
UGWorld.h
|
||||||
#ifdef ANDROID
|
|
||||||
ui/ANativeObjectBase.h
|
|
||||||
ui/egl/android_natives.h
|
|
||||||
ui/Fence.h
|
|
||||||
ui/FramebufferNativeWindow.h
|
|
||||||
ui/GraphicBuffer.h
|
|
||||||
ui/Rect.h
|
|
||||||
ui/Region.h
|
|
||||||
#endif
|
|
||||||
UKeyFilters.h
|
UKeyFilters.h
|
||||||
ulocks.h
|
ulocks.h
|
||||||
ulserrno.h
|
ulserrno.h
|
||||||
|
|
@ -1149,28 +954,6 @@ UReanimator.h
|
||||||
URegions.h
|
URegions.h
|
||||||
URegistrar.h
|
URegistrar.h
|
||||||
UResourceMgr.h
|
UResourceMgr.h
|
||||||
#ifdef ANDROID
|
|
||||||
utils/BitSet.h
|
|
||||||
utils/CallStack.h
|
|
||||||
utils/Errors.h
|
|
||||||
utils/FileMap.h
|
|
||||||
utils/KeyedVector.h
|
|
||||||
utils/List.h
|
|
||||||
utils/Log.h
|
|
||||||
utils/Looper.h
|
|
||||||
utils/PropertyMap.h
|
|
||||||
utils/RefBase.h
|
|
||||||
utils/String16.h
|
|
||||||
utils/String8.h
|
|
||||||
utils/threads.h
|
|
||||||
utils/TextOutput.h
|
|
||||||
utils/Timers.h
|
|
||||||
utils/Trace.h
|
|
||||||
utils/TypeHelpers.h
|
|
||||||
utils/Unicode.h
|
|
||||||
utils/Vector.h
|
|
||||||
utils/VectorImpl.h
|
|
||||||
#endif
|
|
||||||
urlhist.h
|
urlhist.h
|
||||||
urlmon.h
|
urlmon.h
|
||||||
UScrap.h
|
UScrap.h
|
||||||
|
|
|
||||||
|
|
@ -84,9 +84,6 @@ function _setAppProperties(aObj, aApp) {
|
||||||
aObj.csp = aApp.csp;
|
aObj.csp = aApp.csp;
|
||||||
aObj.installOrigin = aApp.installOrigin;
|
aObj.installOrigin = aApp.installOrigin;
|
||||||
aObj.origin = aApp.origin;
|
aObj.origin = aApp.origin;
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
aObj.apkPackageName = aApp.apkPackageName;
|
|
||||||
#endif
|
|
||||||
aObj.receipts = aApp.receipts ? JSON.parse(JSON.stringify(aApp.receipts)) : null;
|
aObj.receipts = aApp.receipts ? JSON.parse(JSON.stringify(aApp.receipts)) : null;
|
||||||
aObj.installTime = aApp.installTime;
|
aObj.installTime = aApp.installTime;
|
||||||
aObj.manifestURL = aApp.manifestURL;
|
aObj.manifestURL = aApp.manifestURL;
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,7 @@ EXTRA_COMPONENTS += [
|
||||||
|
|
||||||
EXTRA_JS_MODULES += [
|
EXTRA_JS_MODULES += [
|
||||||
'AppsServiceChild.jsm',
|
'AppsServiceChild.jsm',
|
||||||
|
'AppsUtils.jsm',
|
||||||
'PermissionsInstaller.jsm',
|
'PermissionsInstaller.jsm',
|
||||||
'PermissionsTable.jsm',
|
'PermissionsTable.jsm',
|
||||||
]
|
]
|
||||||
|
|
||||||
EXTRA_PP_JS_MODULES += [
|
|
||||||
'AppsUtils.jsm',
|
|
||||||
]
|
|
||||||
|
|
|
||||||
|
|
@ -159,16 +159,8 @@ bool
|
||||||
IsEnableAudioCompetingForAllAgents()
|
IsEnableAudioCompetingForAllAgents()
|
||||||
{
|
{
|
||||||
// In general, the audio competing should only be for audible media and it
|
// In general, the audio competing should only be for audible media and it
|
||||||
// helps user can focus on one media at the same time. However, we hope to
|
// helps user can focus on one media at the same time.
|
||||||
// treat all media as the same in the mobile device. First reason is we have
|
|
||||||
// media control on fennec and we just want to control one media at once time.
|
|
||||||
// Second reason is to reduce the bandwidth, avoiding to play any non-audible
|
|
||||||
// media in background which user doesn't notice about.
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
return sAudioChannelCompetingAllAgents;
|
return sAudioChannelCompetingAllAgents;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
|
||||||
|
|
@ -309,40 +309,9 @@ ScreenOrientation::LockInternal(ScreenOrientationInternal aOrientation, ErrorRes
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
// User agent does not support locking the screen orientation.
|
// User agent does not support locking the screen orientation.
|
||||||
p->MaybeReject(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
|
p->MaybeReject(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
|
||||||
return p.forget();
|
return p.forget();
|
||||||
#else
|
|
||||||
LockPermission perm = GetLockOrientationPermission(true);
|
|
||||||
if (perm == LOCK_DENIED) {
|
|
||||||
p->MaybeReject(NS_ERROR_DOM_SECURITY_ERR);
|
|
||||||
return p.forget();
|
|
||||||
}
|
|
||||||
|
|
||||||
nsCOMPtr<nsIDocShellTreeItem> root;
|
|
||||||
docShell->GetSameTypeRootTreeItem(getter_AddRefs(root));
|
|
||||||
nsCOMPtr<nsIDocShell> rootShell(do_QueryInterface(root));
|
|
||||||
if (!rootShell) {
|
|
||||||
aRv.Throw(NS_ERROR_UNEXPECTED);
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
rootShell->SetOrientationLock(aOrientation);
|
|
||||||
AbortOrientationPromises(rootShell);
|
|
||||||
|
|
||||||
doc->SetOrientationPendingPromise(p);
|
|
||||||
|
|
||||||
nsCOMPtr<nsIRunnable> lockOrientationTask =
|
|
||||||
new LockOrientationTask(this, p, aOrientation, doc,
|
|
||||||
perm == FULLSCREEN_LOCK_ALLOWED);
|
|
||||||
aRv = NS_DispatchToMainThread(lockOrientationTask);
|
|
||||||
if (NS_WARN_IF(aRv.Failed())) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
return p.forget();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
|
|
@ -49,9 +49,6 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "chrome/common/ipc_channel.h" // for IPC::Channel::kMaximumMessageSize
|
#include "chrome/common/ipc_channel.h" // for IPC::Channel::kMaximumMessageSize
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
#include <android/log.h>
|
|
||||||
#endif
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
# if defined(SendMessage)
|
# if defined(SendMessage)
|
||||||
|
|
@ -896,9 +893,6 @@ nsFrameMessageManager::GetChildAt(uint32_t aIndex,
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsFrameMessageManager::Dump(const nsAString& aStr)
|
nsFrameMessageManager::Dump(const nsAString& aStr)
|
||||||
{
|
{
|
||||||
#ifdef ANDROID
|
|
||||||
__android_log_print(ANDROID_LOG_INFO, "Gecko", "%s", NS_ConvertUTF16toUTF8(aStr).get());
|
|
||||||
#endif
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
if (IsDebuggerPresent()) {
|
if (IsDebuggerPresent()) {
|
||||||
OutputDebugStringW(PromiseFlatString(aStr).get());
|
OutputDebugStringW(PromiseFlatString(aStr).get());
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,6 @@
|
||||||
#include "mozilla/dom/Timeout.h"
|
#include "mozilla/dom/Timeout.h"
|
||||||
#include "mozilla/dom/TimeoutHandler.h"
|
#include "mozilla/dom/TimeoutHandler.h"
|
||||||
#include "mozilla/IntegerPrintfMacros.h"
|
#include "mozilla/IntegerPrintfMacros.h"
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
#include "mozilla/dom/WindowOrientationObserver.h"
|
|
||||||
#endif
|
|
||||||
#include "nsDOMOfflineResourceList.h"
|
#include "nsDOMOfflineResourceList.h"
|
||||||
#include "nsError.h"
|
#include "nsError.h"
|
||||||
#include "nsIIdleService.h"
|
#include "nsIIdleService.h"
|
||||||
|
|
@ -251,10 +248,6 @@ class nsIScriptTimeoutHandler;
|
||||||
#endif // check
|
#endif // check
|
||||||
#include "AccessCheck.h"
|
#include "AccessCheck.h"
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
#include <android/log.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#define getpid _getpid
|
#define getpid _getpid
|
||||||
|
|
@ -1917,10 +1910,6 @@ nsGlobalWindow::CleanUp()
|
||||||
mSpeechSynthesis = nullptr;
|
mSpeechSynthesis = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
mOrientationChangeObserver = nullptr;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ClearControllers();
|
ClearControllers();
|
||||||
|
|
||||||
mOpener = nullptr; // Forces Release
|
mOpener = nullptr; // Forces Release
|
||||||
|
|
@ -2041,10 +2030,6 @@ nsGlobalWindow::FreeInnerObjects(bool aForDocumentOpen)
|
||||||
mScreen = nullptr;
|
mScreen = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
mOrientationChangeObserver = nullptr;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (mDoc) {
|
if (mDoc) {
|
||||||
// Remember the document's principal and URI.
|
// Remember the document's principal and URI.
|
||||||
mDocumentPrincipal = mDoc->NodePrincipal();
|
mDocumentPrincipal = mDoc->NodePrincipal();
|
||||||
|
|
@ -7132,9 +7117,6 @@ nsGlobalWindow::Dump(const nsAString& aStr)
|
||||||
MOZ_LOG(nsContentUtils::DOMDumpLog(), LogLevel::Debug, ("[Window.Dump] %s", cstr));
|
MOZ_LOG(nsContentUtils::DOMDumpLog(), LogLevel::Debug, ("[Window.Dump] %s", cstr));
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
PrintToDebugger(cstr);
|
PrintToDebugger(cstr);
|
||||||
#endif
|
|
||||||
#ifdef ANDROID
|
|
||||||
__android_log_write(ANDROID_LOG_INFO, "GeckoDump", cstr);
|
|
||||||
#endif
|
#endif
|
||||||
FILE *fp = gDumpFile ? gDumpFile : stdout;
|
FILE *fp = gDumpFile ? gDumpFile : stdout;
|
||||||
fputs(cstr, fp);
|
fputs(cstr, fp);
|
||||||
|
|
@ -13764,27 +13746,6 @@ nsGlobalWindow::DisableDeviceSensor(uint32_t aType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
void
|
|
||||||
nsGlobalWindow::EnableOrientationChangeListener()
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(IsInnerWindow());
|
|
||||||
if (!nsContentUtils::ShouldResistFingerprinting(mDocShell) &&
|
|
||||||
!mOrientationChangeObserver) {
|
|
||||||
mOrientationChangeObserver =
|
|
||||||
new WindowOrientationObserver(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
nsGlobalWindow::DisableOrientationChangeListener()
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(IsInnerWindow());
|
|
||||||
|
|
||||||
mOrientationChangeObserver = nullptr;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
nsGlobalWindow::SetHasGamepadEventListener(bool aHasGamepad/* = true*/)
|
nsGlobalWindow::SetHasGamepadEventListener(bool aHasGamepad/* = true*/)
|
||||||
{
|
{
|
||||||
|
|
@ -14471,15 +14432,6 @@ nsGlobalWindow::InitWasOffline()
|
||||||
mWasOffline = NS_IsOffline();
|
mWasOffline = NS_IsOffline();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
int16_t
|
|
||||||
nsGlobalWindow::Orientation(CallerType aCallerType) const
|
|
||||||
{
|
|
||||||
return nsContentUtils::ResistFingerprinting(aCallerType) ?
|
|
||||||
0 : WindowOrientationObserver::OrientationAngle();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Console*
|
Console*
|
||||||
nsGlobalWindow::GetConsole(ErrorResult& aRv)
|
nsGlobalWindow::GetConsole(ErrorResult& aRv)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -135,9 +135,6 @@ class TabGroup;
|
||||||
class Timeout;
|
class Timeout;
|
||||||
class U2F;
|
class U2F;
|
||||||
class WakeLock;
|
class WakeLock;
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
class WindowOrientationObserver;
|
|
||||||
#endif
|
|
||||||
class Worklet;
|
class Worklet;
|
||||||
namespace cache {
|
namespace cache {
|
||||||
class CacheStorage;
|
class CacheStorage;
|
||||||
|
|
@ -622,11 +619,6 @@ public:
|
||||||
virtual void EnableDeviceSensor(uint32_t aType) override;
|
virtual void EnableDeviceSensor(uint32_t aType) override;
|
||||||
virtual void DisableDeviceSensor(uint32_t aType) override;
|
virtual void DisableDeviceSensor(uint32_t aType) override;
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
virtual void EnableOrientationChangeListener() override;
|
|
||||||
virtual void DisableOrientationChangeListener() override;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
virtual void EnableTimeChangeNotifications() override;
|
virtual void EnableTimeChangeNotifications() override;
|
||||||
virtual void DisableTimeChangeNotifications() override;
|
virtual void DisableTimeChangeNotifications() override;
|
||||||
|
|
||||||
|
|
@ -884,10 +876,6 @@ public:
|
||||||
nsIDOMOfflineResourceList* GetApplicationCache(mozilla::ErrorResult& aError);
|
nsIDOMOfflineResourceList* GetApplicationCache(mozilla::ErrorResult& aError);
|
||||||
already_AddRefed<nsIDOMOfflineResourceList> GetApplicationCache() override;
|
already_AddRefed<nsIDOMOfflineResourceList> GetApplicationCache() override;
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
int16_t Orientation(mozilla::dom::CallerType aCallerType) const;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
mozilla::dom::Console* GetConsole(mozilla::ErrorResult& aRv);
|
mozilla::dom::Console* GetConsole(mozilla::ErrorResult& aRv);
|
||||||
|
|
||||||
// https://w3c.github.io/webappsec-secure-contexts/#dom-window-issecurecontext
|
// https://w3c.github.io/webappsec-secure-contexts/#dom-window-issecurecontext
|
||||||
|
|
@ -1915,10 +1903,6 @@ protected:
|
||||||
|
|
||||||
nsTArray<uint32_t> mEnabledSensors;
|
nsTArray<uint32_t> mEnabledSensors;
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
nsAutoPtr<mozilla::dom::WindowOrientationObserver> mOrientationChangeObserver;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MOZ_WEBSPEECH
|
#ifdef MOZ_WEBSPEECH
|
||||||
// mSpeechSynthesis is only used on inner windows.
|
// mSpeechSynthesis is only used on inner windows.
|
||||||
RefPtr<mozilla::dom::SpeechSynthesis> mSpeechSynthesis;
|
RefPtr<mozilla::dom::SpeechSynthesis> mSpeechSynthesis;
|
||||||
|
|
|
||||||
|
|
@ -438,11 +438,6 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void DisableDeviceSensor(uint32_t aType) = 0;
|
virtual void DisableDeviceSensor(uint32_t aType) = 0;
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
virtual void EnableOrientationChangeListener() = 0;
|
|
||||||
virtual void DisableOrientationChangeListener() = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
virtual void EnableTimeChangeNotifications() = 0;
|
virtual void EnableTimeChangeNotifications() = 0;
|
||||||
virtual void DisableTimeChangeNotifications() = 0;
|
virtual void DisableTimeChangeNotifications() = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -145,9 +145,6 @@ WebGLContext::BindFramebuffer(GLenum target, WebGLFramebuffer* wfb)
|
||||||
} else {
|
} else {
|
||||||
GLuint framebuffername = wfb->mGLName;
|
GLuint framebuffername = wfb->mGLName;
|
||||||
gl->fBindFramebuffer(target, framebuffername);
|
gl->fBindFramebuffer(target, framebuffername);
|
||||||
#ifdef ANDROID
|
|
||||||
wfb->mIsFB = true;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (target) {
|
switch (target) {
|
||||||
|
|
@ -982,14 +979,6 @@ WebGLContext::IsFramebuffer(const WebGLFramebuffer* fb)
|
||||||
if (!ValidateIsObject("isFramebuffer", fb))
|
if (!ValidateIsObject("isFramebuffer", fb))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
if (gl->WorkAroundDriverBugs() &&
|
|
||||||
gl->Renderer() == GLRenderer::AndroidEmulator)
|
|
||||||
{
|
|
||||||
return fb->mIsFB;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MakeContextCurrent();
|
MakeContextCurrent();
|
||||||
return gl->fIsFramebuffer(fb->mGLName);
|
return gl->fIsFramebuffer(fb->mGLName);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -621,9 +621,6 @@ WebGLFBAttachPoint::GetParameter(const char* funcName, WebGLContext* webgl, JSCo
|
||||||
WebGLFramebuffer::WebGLFramebuffer(WebGLContext* webgl, GLuint fbo)
|
WebGLFramebuffer::WebGLFramebuffer(WebGLContext* webgl, GLuint fbo)
|
||||||
: WebGLRefCountedObject(webgl)
|
: WebGLRefCountedObject(webgl)
|
||||||
, mGLName(fbo)
|
, mGLName(fbo)
|
||||||
#ifdef ANDROID
|
|
||||||
, mIsFB(false)
|
|
||||||
#endif
|
|
||||||
, mDepthAttachment(this, LOCAL_GL_DEPTH_ATTACHMENT)
|
, mDepthAttachment(this, LOCAL_GL_DEPTH_ATTACHMENT)
|
||||||
, mStencilAttachment(this, LOCAL_GL_STENCIL_ATTACHMENT)
|
, mStencilAttachment(this, LOCAL_GL_STENCIL_ATTACHMENT)
|
||||||
, mDepthStencilAttachment(this, LOCAL_GL_DEPTH_STENCIL_ATTACHMENT)
|
, mDepthStencilAttachment(this, LOCAL_GL_DEPTH_STENCIL_ATTACHMENT)
|
||||||
|
|
@ -657,10 +654,6 @@ WebGLFramebuffer::Delete()
|
||||||
mContext->gl->fDeleteFramebuffers(1, &mGLName);
|
mContext->gl->fDeleteFramebuffers(1, &mGLName);
|
||||||
|
|
||||||
LinkedListElement<WebGLFramebuffer>::removeFrom(mContext->mFramebuffers);
|
LinkedListElement<WebGLFramebuffer>::removeFrom(mContext->mFramebuffers);
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
mIsFB = false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////
|
////
|
||||||
|
|
|
||||||
|
|
@ -155,17 +155,6 @@ public:
|
||||||
const GLuint mGLName;
|
const GLuint mGLName;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
#ifdef ANDROID
|
|
||||||
// Bug 1140459: Some drivers (including our test slaves!) don't
|
|
||||||
// give reasonable answers for IsRenderbuffer, maybe others.
|
|
||||||
// This shows up on Android 2.3 emulator.
|
|
||||||
//
|
|
||||||
// So we track the `is a Framebuffer` state ourselves.
|
|
||||||
bool mIsFB;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
////
|
|
||||||
|
|
||||||
WebGLFBAttachPoint mDepthAttachment;
|
WebGLFBAttachPoint mDepthAttachment;
|
||||||
WebGLFBAttachPoint mStencilAttachment;
|
WebGLFBAttachPoint mStencilAttachment;
|
||||||
WebGLFBAttachPoint mDepthStencilAttachment;
|
WebGLFBAttachPoint mDepthStencilAttachment;
|
||||||
|
|
|
||||||
|
|
@ -351,10 +351,6 @@ EventListenerManager::AddEventListenerInternal(
|
||||||
EnableDevice(eDeviceLight);
|
EnableDevice(eDeviceLight);
|
||||||
} else if (aTypeAtom == nsGkAtoms::ondevicemotion) {
|
} else if (aTypeAtom == nsGkAtoms::ondevicemotion) {
|
||||||
EnableDevice(eDeviceMotion);
|
EnableDevice(eDeviceMotion);
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
} else if (aTypeAtom == nsGkAtoms::onorientationchange) {
|
|
||||||
EnableDevice(eOrientationChange);
|
|
||||||
#endif
|
|
||||||
} else if (aTypeAtom == nsGkAtoms::ontouchstart ||
|
} else if (aTypeAtom == nsGkAtoms::ontouchstart ||
|
||||||
aTypeAtom == nsGkAtoms::ontouchend ||
|
aTypeAtom == nsGkAtoms::ontouchend ||
|
||||||
aTypeAtom == nsGkAtoms::ontouchmove ||
|
aTypeAtom == nsGkAtoms::ontouchmove ||
|
||||||
|
|
@ -480,9 +476,6 @@ EventListenerManager::IsDeviceType(EventMessage aEventMessage)
|
||||||
case eDeviceLight:
|
case eDeviceLight:
|
||||||
case eDeviceProximity:
|
case eDeviceProximity:
|
||||||
case eUserProximity:
|
case eUserProximity:
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
case eOrientationChange:
|
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -500,21 +493,10 @@ EventListenerManager::EnableDevice(EventMessage aEventMessage)
|
||||||
|
|
||||||
switch (aEventMessage) {
|
switch (aEventMessage) {
|
||||||
case eDeviceOrientation:
|
case eDeviceOrientation:
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
// Falls back to SENSOR_ROTATION_VECTOR and SENSOR_ORIENTATION if
|
|
||||||
// unavailable on device.
|
|
||||||
window->EnableDeviceSensor(SENSOR_GAME_ROTATION_VECTOR);
|
|
||||||
#else
|
|
||||||
window->EnableDeviceSensor(SENSOR_ORIENTATION);
|
window->EnableDeviceSensor(SENSOR_ORIENTATION);
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case eAbsoluteDeviceOrientation:
|
case eAbsoluteDeviceOrientation:
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
// Falls back to SENSOR_ORIENTATION if unavailable on device.
|
|
||||||
window->EnableDeviceSensor(SENSOR_ROTATION_VECTOR);
|
|
||||||
#else
|
|
||||||
window->EnableDeviceSensor(SENSOR_ORIENTATION);
|
window->EnableDeviceSensor(SENSOR_ORIENTATION);
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case eDeviceProximity:
|
case eDeviceProximity:
|
||||||
case eUserProximity:
|
case eUserProximity:
|
||||||
|
|
@ -528,11 +510,6 @@ EventListenerManager::EnableDevice(EventMessage aEventMessage)
|
||||||
window->EnableDeviceSensor(SENSOR_LINEAR_ACCELERATION);
|
window->EnableDeviceSensor(SENSOR_LINEAR_ACCELERATION);
|
||||||
window->EnableDeviceSensor(SENSOR_GYROSCOPE);
|
window->EnableDeviceSensor(SENSOR_GYROSCOPE);
|
||||||
break;
|
break;
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
case eOrientationChange:
|
|
||||||
window->EnableOrientationChangeListener();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
NS_WARNING("Enabling an unknown device sensor.");
|
NS_WARNING("Enabling an unknown device sensor.");
|
||||||
break;
|
break;
|
||||||
|
|
@ -549,17 +526,9 @@ EventListenerManager::DisableDevice(EventMessage aEventMessage)
|
||||||
|
|
||||||
switch (aEventMessage) {
|
switch (aEventMessage) {
|
||||||
case eDeviceOrientation:
|
case eDeviceOrientation:
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
// Disable all potential fallback sensors.
|
|
||||||
window->DisableDeviceSensor(SENSOR_GAME_ROTATION_VECTOR);
|
|
||||||
window->DisableDeviceSensor(SENSOR_ROTATION_VECTOR);
|
|
||||||
#endif
|
|
||||||
window->DisableDeviceSensor(SENSOR_ORIENTATION);
|
window->DisableDeviceSensor(SENSOR_ORIENTATION);
|
||||||
break;
|
break;
|
||||||
case eAbsoluteDeviceOrientation:
|
case eAbsoluteDeviceOrientation:
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
window->DisableDeviceSensor(SENSOR_ROTATION_VECTOR);
|
|
||||||
#endif
|
|
||||||
window->DisableDeviceSensor(SENSOR_ORIENTATION);
|
window->DisableDeviceSensor(SENSOR_ORIENTATION);
|
||||||
break;
|
break;
|
||||||
case eDeviceMotion:
|
case eDeviceMotion:
|
||||||
|
|
@ -574,11 +543,6 @@ EventListenerManager::DisableDevice(EventMessage aEventMessage)
|
||||||
case eDeviceLight:
|
case eDeviceLight:
|
||||||
window->DisableDeviceSensor(SENSOR_LIGHT);
|
window->DisableDeviceSensor(SENSOR_LIGHT);
|
||||||
break;
|
break;
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
case eOrientationChange:
|
|
||||||
window->DisableOrientationChangeListener();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
NS_WARNING("Disabling an unknown device sensor.");
|
NS_WARNING("Disabling an unknown device sensor.");
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -566,12 +566,6 @@ WINDOW_EVENT(online,
|
||||||
eOnline,
|
eOnline,
|
||||||
EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly,
|
EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly,
|
||||||
eBasicEventClass)
|
eBasicEventClass)
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
WINDOW_EVENT(orientationchange,
|
|
||||||
eOrientationChange,
|
|
||||||
EventNameType_HTMLBodyOrFramesetOnly,
|
|
||||||
eBasicEventClass)
|
|
||||||
#endif
|
|
||||||
WINDOW_EVENT(pagehide,
|
WINDOW_EVENT(pagehide,
|
||||||
ePageHide,
|
ePageHide,
|
||||||
EventNameType_HTMLBodyOrFramesetOnly,
|
EventNameType_HTMLBodyOrFramesetOnly,
|
||||||
|
|
|
||||||
|
|
@ -204,10 +204,7 @@ TouchEvent::PrefEnabled(nsIDocShell* aDocShell)
|
||||||
enabled = false;
|
enabled = false;
|
||||||
} else {
|
} else {
|
||||||
if (sPrefCacheValue == 2) {
|
if (sPrefCacheValue == 2) {
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
#if defined(XP_WIN) || MOZ_WIDGET_GTK == 3
|
||||||
// Touch support is always enabled on B2G and android.
|
|
||||||
enabled = true;
|
|
||||||
#elif defined(XP_WIN) || MOZ_WIDGET_GTK == 3
|
|
||||||
static bool sDidCheckTouchDeviceSupport = false;
|
static bool sDidCheckTouchDeviceSupport = false;
|
||||||
static bool sIsTouchDeviceSupportPresent = false;
|
static bool sIsTouchDeviceSupportPresent = false;
|
||||||
// On Windows and GTK3 we auto-detect based on device support.
|
// On Windows and GTK3 we auto-detect based on device support.
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,6 @@
|
||||||
|
|
||||||
class nsIPrincipal;
|
class nsIPrincipal;
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
#include "AndroidLocationProvider.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MOZ_GPSD
|
#ifdef MOZ_GPSD
|
||||||
#include "GpsdLocationProvider.h"
|
#include "GpsdLocationProvider.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -646,10 +642,6 @@ nsresult nsGeolocationService::Init()
|
||||||
|
|
||||||
obs->AddObserver(this, "xpcom-shutdown", false);
|
obs->AddObserver(this, "xpcom-shutdown", false);
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
mProvider = new AndroidLocationProvider();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_GTK
|
#ifdef MOZ_WIDGET_GTK
|
||||||
#ifdef MOZ_GPSD
|
#ifdef MOZ_GPSD
|
||||||
if (Preferences::GetBool("geo.provider.use_gpsd", false)) {
|
if (Preferences::GetBool("geo.provider.use_gpsd", false)) {
|
||||||
|
|
|
||||||
|
|
@ -846,28 +846,7 @@ private:
|
||||||
|
|
||||||
bool CanOwnerPlayUnsupportedTypeMedia() const
|
bool CanOwnerPlayUnsupportedTypeMedia() const
|
||||||
{
|
{
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
// This was only something to check on Android. Stubbed now.
|
||||||
// On Fennec, we will user an external app to open unsupported media types.
|
|
||||||
if (!Preferences::GetBool("media.openUnsupportedTypeWithExternalApp")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!mError) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t errorCode = mError->Code();
|
|
||||||
if (errorCode != MEDIA_ERR_SRC_NOT_SUPPORTED) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If media doesn't start playing, we don't need to open it.
|
|
||||||
if (mOwner->Paused()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
#endif
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -6190,13 +6169,6 @@ HTMLMediaElement::IsAllowedToPlay()
|
||||||
if (!mHasUserInteraction &&
|
if (!mHasUserInteraction &&
|
||||||
!IsAutoplayEnabled() &&
|
!IsAutoplayEnabled() &&
|
||||||
!EventStateManager::IsHandlingUserInput()) {
|
!EventStateManager::IsHandlingUserInput()) {
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
nsContentUtils::DispatchTrustedEvent(OwnerDoc(),
|
|
||||||
static_cast<nsIContent*>(this),
|
|
||||||
NS_LITERAL_STRING("MozAutoplayMediaBlocked"),
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
#endif
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -265,12 +265,6 @@ nsIFormControl::IsSingleLineTextControl(bool aExcludePassword, uint32_t aType)
|
||||||
aType == NS_FORM_INPUT_SEARCH ||
|
aType == NS_FORM_INPUT_SEARCH ||
|
||||||
aType == NS_FORM_INPUT_TEL ||
|
aType == NS_FORM_INPUT_TEL ||
|
||||||
aType == NS_FORM_INPUT_URL ||
|
aType == NS_FORM_INPUT_URL ||
|
||||||
// TODO: those are temporary until bug 773205 is fixed.
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
// On Android, date/time input appears as a normal text box.
|
|
||||||
aType == NS_FORM_INPUT_TIME ||
|
|
||||||
aType == NS_FORM_INPUT_DATE ||
|
|
||||||
#endif
|
|
||||||
aType == NS_FORM_INPUT_MONTH ||
|
aType == NS_FORM_INPUT_MONTH ||
|
||||||
aType == NS_FORM_INPUT_WEEK ||
|
aType == NS_FORM_INPUT_WEEK ||
|
||||||
aType == NS_FORM_INPUT_DATETIME_LOCAL ||
|
aType == NS_FORM_INPUT_DATETIME_LOCAL ||
|
||||||
|
|
|
||||||
|
|
@ -121,10 +121,6 @@
|
||||||
LogLevel::Debug, \
|
LogLevel::Debug, \
|
||||||
_args )
|
_args )
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
#define IDB_MOBILE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define BLOB_IMPL_STORED_FILE_IID \
|
#define BLOB_IMPL_STORED_FILE_IID \
|
||||||
{0x6b505c84, 0x2c60, 0x4ffb, {0x8b, 0x91, 0xfe, 0x22, 0xb1, 0xec, 0x75, 0xe2}}
|
{0x6b505c84, 0x2c60, 0x4ffb, {0x8b, 0x91, 0xfe, 0x22, 0xb1, 0xec, 0x75, 0xe2}}
|
||||||
|
|
||||||
|
|
@ -189,12 +185,7 @@ const int32_t kStorageProgressGranularity = 1000;
|
||||||
// Changing the value here will override the page size of new databases only.
|
// Changing the value here will override the page size of new databases only.
|
||||||
// A journal mode change and VACUUM are needed to change existing databases, so
|
// A journal mode change and VACUUM are needed to change existing databases, so
|
||||||
// the best way to do that is to use the schema version upgrade mechanism.
|
// the best way to do that is to use the schema version upgrade mechanism.
|
||||||
const uint32_t kSQLitePageSizeOverride =
|
const uint32_t kSQLitePageSizeOverride = 4096;
|
||||||
#ifdef IDB_MOBILE
|
|
||||||
2048;
|
|
||||||
#else
|
|
||||||
4096;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static_assert(kSQLitePageSizeOverride == /* mozStorage default */ 0 ||
|
static_assert(kSQLitePageSizeOverride == /* mozStorage default */ 0 ||
|
||||||
(kSQLitePageSizeOverride % 2 == 0 &&
|
(kSQLitePageSizeOverride % 2 == 0 &&
|
||||||
|
|
@ -2621,25 +2612,6 @@ UpgradeSchemaFrom12_0To13_0(mozIStorageConnection* aConnection,
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
#ifdef IDB_MOBILE
|
|
||||||
int32_t defaultPageSize;
|
|
||||||
rv = aConnection->GetDefaultPageSize(&defaultPageSize);
|
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Enable auto_vacuum mode and update the page size to the platform default.
|
|
||||||
nsAutoCString upgradeQuery("PRAGMA auto_vacuum = FULL; PRAGMA page_size = ");
|
|
||||||
upgradeQuery.AppendInt(defaultPageSize);
|
|
||||||
|
|
||||||
rv = aConnection->ExecuteSimpleSQL(upgradeQuery);
|
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
*aVacuumNeeded = true;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rv = aConnection->SetSchemaVersion(MakeSchemaVersion(13, 0));
|
rv = aConnection->SetSchemaVersion(MakeSchemaVersion(13, 0));
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||||
return rv;
|
return rv;
|
||||||
|
|
@ -3583,15 +3555,9 @@ UpgradeSchemaFrom17_0To18_0Helper::DoUpgradeInternal(
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finally, turn on auto_vacuum mode. We use full auto_vacuum mode to reclaim
|
// Finally, turn on auto_vacuum mode.
|
||||||
// disk space on mobile devices (at the cost of some COMMIT speed), and
|
|
||||||
// incremental auto_vacuum mode on desktop builds.
|
|
||||||
rv = aConnection->ExecuteSimpleSQL(
|
rv = aConnection->ExecuteSimpleSQL(
|
||||||
#ifdef IDB_MOBILE
|
|
||||||
NS_LITERAL_CSTRING("PRAGMA auto_vacuum = FULL;")
|
|
||||||
#else
|
|
||||||
NS_LITERAL_CSTRING("PRAGMA auto_vacuum = INCREMENTAL;")
|
NS_LITERAL_CSTRING("PRAGMA auto_vacuum = INCREMENTAL;")
|
||||||
#endif
|
|
||||||
);
|
);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||||
return rv;
|
return rv;
|
||||||
|
|
@ -4223,7 +4189,6 @@ SetDefaultPragmas(mozIStorageConnection* aConnection)
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef IDB_MOBILE
|
|
||||||
if (kSQLiteGrowthIncrement) {
|
if (kSQLiteGrowthIncrement) {
|
||||||
// This is just an optimization so ignore the failure if the disk is
|
// This is just an optimization so ignore the failure if the disk is
|
||||||
// currently too full.
|
// currently too full.
|
||||||
|
|
@ -4233,7 +4198,6 @@ SetDefaultPragmas(mozIStorageConnection* aConnection)
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // IDB_MOBILE
|
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
@ -4285,13 +4249,6 @@ SetJournalMode(mozIStorageConnection* aConnection)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
NS_WARNING("Failed to set WAL mode, falling back to normal journal mode.");
|
NS_WARNING("Failed to set WAL mode, falling back to normal journal mode.");
|
||||||
#ifdef IDB_MOBILE
|
|
||||||
rv = aConnection->ExecuteSimpleSQL(journalModeQueryStart +
|
|
||||||
NS_LITERAL_CSTRING("truncate"));
|
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
@ -4533,14 +4490,7 @@ CreateStorageConnection(nsIFile* aDBFile,
|
||||||
|
|
||||||
// We have to set the auto_vacuum mode before opening a transaction.
|
// We have to set the auto_vacuum mode before opening a transaction.
|
||||||
rv = connection->ExecuteSimpleSQL(
|
rv = connection->ExecuteSimpleSQL(
|
||||||
#ifdef IDB_MOBILE
|
|
||||||
// Turn on full auto_vacuum mode to reclaim disk space on mobile
|
|
||||||
// devices (at the cost of some COMMIT speed).
|
|
||||||
NS_LITERAL_CSTRING("PRAGMA auto_vacuum = FULL;")
|
|
||||||
#else
|
|
||||||
// Turn on incremental auto_vacuum mode on desktop builds.
|
|
||||||
NS_LITERAL_CSTRING("PRAGMA auto_vacuum = INCREMENTAL;")
|
NS_LITERAL_CSTRING("PRAGMA auto_vacuum = INCREMENTAL;")
|
||||||
#endif
|
|
||||||
);
|
);
|
||||||
if (rv == NS_ERROR_FILE_NO_DEVICE_SPACE) {
|
if (rv == NS_ERROR_FILE_NO_DEVICE_SPACE) {
|
||||||
// mozstorage translates SQLITE_FULL to NS_ERROR_FILE_NO_DEVICE_SPACE,
|
// mozstorage translates SQLITE_FULL to NS_ERROR_FILE_NO_DEVICE_SPACE,
|
||||||
|
|
@ -21105,14 +21055,6 @@ FactoryOp::CheckPermission(ContentParent* aContentParent,
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef IDB_MOBILE
|
|
||||||
if (persistenceType == PERSISTENCE_TYPE_PERSISTENT &&
|
|
||||||
!QuotaManager::IsOriginInternal(origin) &&
|
|
||||||
!isApp) {
|
|
||||||
return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
PermissionRequestBase::PermissionValue permission;
|
PermissionRequestBase::PermissionValue permission;
|
||||||
|
|
||||||
if (QuotaManager::IsFirstPromptRequired(persistenceType, origin, isApp)) {
|
if (QuotaManager::IsFirstPromptRequired(persistenceType, origin, isApp)) {
|
||||||
|
|
@ -29589,7 +29531,6 @@ FileHelper::SyncCopy(nsIInputStream* aInputStream,
|
||||||
} // namespace dom
|
} // namespace dom
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
#undef IDB_MOBILE
|
|
||||||
#undef IDB_DEBUG_LOG
|
#undef IDB_DEBUG_LOG
|
||||||
#undef ASSERT_UNLESS_FUZZING
|
#undef ASSERT_UNLESS_FUZZING
|
||||||
#undef DISABLE_ASSERTS_FOR_FUZZING
|
#undef DISABLE_ASSERTS_FOR_FUZZING
|
||||||
|
|
|
||||||
|
|
@ -130,10 +130,6 @@
|
||||||
|
|
||||||
#include "PermissionMessageUtils.h"
|
#include "PermissionMessageUtils.h"
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
#include "APKOpen.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#define getpid _getpid
|
#define getpid _getpid
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
#include "ContentParent.h"
|
#include "ContentParent.h"
|
||||||
#include "TabParent.h"
|
#include "TabParent.h"
|
||||||
|
|
||||||
#if defined(ANDROID) || defined(LINUX)
|
#if defined(LINUX)
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
# include <sys/resource.h>
|
# include <sys/resource.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -177,7 +177,7 @@
|
||||||
#include "signaling/src/peerconnection/WebrtcGlobalParent.h"
|
#include "signaling/src/peerconnection/WebrtcGlobalParent.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ANDROID) || defined(LINUX)
|
#if defined(LINUX)
|
||||||
#include "nsSystemInfo.h"
|
#include "nsSystemInfo.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -185,18 +185,10 @@
|
||||||
#include "mozilla/Hal.h"
|
#include "mozilla/Hal.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
# include "gfxAndroidPlatform.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MOZ_PERMISSIONS
|
#ifdef MOZ_PERMISSIONS
|
||||||
# include "nsPermissionManager.h"
|
# include "nsPermissionManager.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
# include "AndroidBridge.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_GTK
|
#ifdef MOZ_WIDGET_GTK
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1521,7 +1513,7 @@ ContentParent::OnChannelConnected(int32_t pid)
|
||||||
{
|
{
|
||||||
SetOtherProcessId(pid);
|
SetOtherProcessId(pid);
|
||||||
|
|
||||||
#if defined(ANDROID) || defined(LINUX)
|
#if defined(LINUX)
|
||||||
// Check nice preference
|
// Check nice preference
|
||||||
int32_t nice = Preferences::GetInt("dom.ipc.content.nice", 0);
|
int32_t nice = Preferences::GetInt("dom.ipc.content.nice", 0);
|
||||||
|
|
||||||
|
|
@ -2222,9 +2214,6 @@ ContentParent::OnVarChanged(const GfxVarUpdate& aVar)
|
||||||
bool
|
bool
|
||||||
ContentParent::RecvReadFontList(InfallibleTArray<FontListEntry>* retValue)
|
ContentParent::RecvReadFontList(InfallibleTArray<FontListEntry>* retValue)
|
||||||
{
|
{
|
||||||
#ifdef ANDROID
|
|
||||||
gfxAndroidPlatform::GetPlatform()->GetSystemFontList(retValue);
|
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2382,19 +2371,6 @@ bool
|
||||||
ContentParent::RecvGetSystemColors(const uint32_t& colorsCount,
|
ContentParent::RecvGetSystemColors(const uint32_t& colorsCount,
|
||||||
InfallibleTArray<uint32_t>* colors)
|
InfallibleTArray<uint32_t>* colors)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
NS_ASSERTION(AndroidBridge::Bridge() != nullptr, "AndroidBridge is not available");
|
|
||||||
if (AndroidBridge::Bridge() == nullptr) {
|
|
||||||
// Do not fail - the colors won't be right, but it's not critical
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
colors->AppendElements(colorsCount);
|
|
||||||
|
|
||||||
// The array elements correspond to the members of AndroidSystemColors structure,
|
|
||||||
// so just pass the pointer to the elements buffer
|
|
||||||
AndroidBridge::Bridge()->GetSystemColors((AndroidSystemColors*)colors->Elements());
|
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2403,17 +2379,6 @@ ContentParent::RecvGetIconForExtension(const nsCString& aFileExt,
|
||||||
const uint32_t& aIconSize,
|
const uint32_t& aIconSize,
|
||||||
InfallibleTArray<uint8_t>* bits)
|
InfallibleTArray<uint8_t>* bits)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
NS_ASSERTION(AndroidBridge::Bridge() != nullptr, "AndroidBridge is not available");
|
|
||||||
if (AndroidBridge::Bridge() == nullptr) {
|
|
||||||
// Do not fail - just no icon will be shown
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bits->AppendElements(aIconSize * aIconSize * 4);
|
|
||||||
|
|
||||||
AndroidBridge::Bridge()->GetIconForExtension(aFileExt, aIconSize, bits->Elements());
|
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2422,11 +2387,6 @@ ContentParent::RecvGetShowPasswordSetting(bool* showPassword)
|
||||||
{
|
{
|
||||||
// default behavior is to show the last password character
|
// default behavior is to show the last password character
|
||||||
*showPassword = true;
|
*showPassword = true;
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
NS_ASSERTION(AndroidBridge::Bridge() != nullptr, "AndroidBridge is not available");
|
|
||||||
|
|
||||||
*showPassword = java::GeckoAppShell::GetShowPasswordSetting();
|
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4477,13 +4437,8 @@ ContentParent::RecvEndDriverCrashGuard(const uint32_t& aGuardType)
|
||||||
bool
|
bool
|
||||||
ContentParent::RecvGetAndroidSystemInfo(AndroidSystemInfo* aInfo)
|
ContentParent::RecvGetAndroidSystemInfo(AndroidSystemInfo* aInfo)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
nsSystemInfo::GetAndroidSystemInfo(aInfo);
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
MOZ_CRASH("wrong platform!");
|
MOZ_CRASH("wrong platform!");
|
||||||
return false;
|
return false;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,7 @@
|
||||||
#include "mozilla/SharedThreadPool.h"
|
#include "mozilla/SharedThreadPool.h"
|
||||||
#include "mozilla/dom/ContentChild.h"
|
#include "mozilla/dom/ContentChild.h"
|
||||||
|
|
||||||
#ifndef MOZ_WIDGET_ANDROID
|
|
||||||
#include "WebMSample.h"
|
#include "WebMSample.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
// Update this version number to force re-running the benchmark. Such as when
|
// Update this version number to force re-running the benchmark. Such as when
|
||||||
|
|
@ -34,9 +31,6 @@ VP9Benchmark::IsVP9DecodeFast()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
bool hasPref = Preferences::HasUserValue(sBenchmarkFpsPref);
|
bool hasPref = Preferences::HasUserValue(sBenchmarkFpsPref);
|
||||||
uint32_t hadRecentUpdate = Preferences::GetUint(sBenchmarkFpsVersionCheck, 0U);
|
uint32_t hadRecentUpdate = Preferences::GetUint(sBenchmarkFpsVersionCheck, 0U);
|
||||||
|
|
||||||
|
|
@ -81,7 +75,6 @@ VP9Benchmark::IsVP9DecodeFast()
|
||||||
Preferences::GetUint("media.benchmark.vp9.threshold", 150);
|
Preferences::GetUint("media.benchmark.vp9.threshold", 150);
|
||||||
|
|
||||||
return decodeFps >= threshold;
|
return decodeFps >= threshold;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Benchmark::Benchmark(MediaDataDemuxer* aDemuxer, const Parameters& aParameters)
|
Benchmark::Benchmark(MediaDataDemuxer* aDemuxer, const Parameters& aParameters)
|
||||||
|
|
|
||||||
|
|
@ -277,9 +277,7 @@ void InitLibrary()
|
||||||
PrefChanged(PREF_CUBEB_LATENCY_MSG, nullptr);
|
PrefChanged(PREF_CUBEB_LATENCY_MSG, nullptr);
|
||||||
Preferences::RegisterCallback(PrefChanged, PREF_CUBEB_LATENCY_PLAYBACK);
|
Preferences::RegisterCallback(PrefChanged, PREF_CUBEB_LATENCY_PLAYBACK);
|
||||||
Preferences::RegisterCallback(PrefChanged, PREF_CUBEB_LATENCY_MSG);
|
Preferences::RegisterCallback(PrefChanged, PREF_CUBEB_LATENCY_MSG);
|
||||||
#ifndef MOZ_WIDGET_ANDROID
|
|
||||||
NS_DispatchToMainThread(NS_NewRunnableFunction(&InitBrandName));
|
NS_DispatchToMainThread(NS_NewRunnableFunction(&InitBrandName));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShutdownLibrary()
|
void ShutdownLibrary()
|
||||||
|
|
|
||||||
|
|
@ -21,16 +21,11 @@
|
||||||
extern mozilla::LazyLogModule gMediaStreamGraphLog;
|
extern mozilla::LazyLogModule gMediaStreamGraphLog;
|
||||||
#define STREAM_LOG(type, msg) MOZ_LOG(gMediaStreamGraphLog, type, msg)
|
#define STREAM_LOG(type, msg) MOZ_LOG(gMediaStreamGraphLog, type, msg)
|
||||||
|
|
||||||
// We don't use NSPR log here because we want this interleaved with adb logcat
|
// XXX: We didn't use NSPR log here because we wanted this interleaved with
|
||||||
// on Android/B2G
|
// adb logcat on Android/B2G. This is no longer a concern; use NSPR?
|
||||||
// #define ENABLE_LIFECYCLE_LOG
|
// #define ENABLE_LIFECYCLE_LOG
|
||||||
#ifdef ENABLE_LIFECYCLE_LOG
|
#ifdef ENABLE_LIFECYCLE_LOG
|
||||||
#ifdef ANDROID
|
|
||||||
#include "android/log.h"
|
|
||||||
#define LIFECYCLE_LOG(...) __android_log_print(ANDROID_LOG_INFO, "Gecko - MSG" , __VA_ARGS__); printf(__VA_ARGS__);printf("\n");
|
|
||||||
#else
|
|
||||||
#define LIFECYCLE_LOG(...) printf(__VA_ARGS__);printf("\n");
|
#define LIFECYCLE_LOG(...) printf(__VA_ARGS__);printf("\n");
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
#define LIFECYCLE_LOG(...)
|
#define LIFECYCLE_LOG(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,6 @@
|
||||||
#ifndef MEDIA_PREFS_H
|
#ifndef MEDIA_PREFS_H
|
||||||
#define MEDIA_PREFS_H
|
#define MEDIA_PREFS_H
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "mozilla/Atomics.h"
|
#include "mozilla/Atomics.h"
|
||||||
|
|
||||||
// First time MediaPrefs::GetSingleton() needs to be called on the main thread,
|
// First time MediaPrefs::GetSingleton() needs to be called on the main thread,
|
||||||
|
|
@ -105,11 +101,6 @@ private:
|
||||||
DECL_MEDIA_PREF("media.eme.enabled", EMEEnabled, bool, false);
|
DECL_MEDIA_PREF("media.eme.enabled", EMEEnabled, bool, false);
|
||||||
DECL_MEDIA_PREF("media.use-blank-decoder", PDMUseBlankDecoder, bool, false);
|
DECL_MEDIA_PREF("media.use-blank-decoder", PDMUseBlankDecoder, bool, false);
|
||||||
DECL_MEDIA_PREF("media.gpu-process-decoder", PDMUseGPUDecoder, bool, false);
|
DECL_MEDIA_PREF("media.gpu-process-decoder", PDMUseGPUDecoder, bool, false);
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
DECL_MEDIA_PREF("media.android-media-codec.enabled", PDMAndroidMediaCodecEnabled, bool, false);
|
|
||||||
DECL_MEDIA_PREF("media.android-media-codec.preferred", PDMAndroidMediaCodecPreferred, bool, false);
|
|
||||||
DECL_MEDIA_PREF("media.android-remote-codec.enabled", PDMAndroidRemoteCodecEnabled, bool, false);
|
|
||||||
#endif
|
|
||||||
#ifdef MOZ_FFMPEG
|
#ifdef MOZ_FFMPEG
|
||||||
DECL_MEDIA_PREF("media.ffmpeg.enabled", PDMFFmpegEnabled, bool, true);
|
DECL_MEDIA_PREF("media.ffmpeg.enabled", PDMFFmpegEnabled, bool, true);
|
||||||
DECL_MEDIA_PREF("media.libavcodec.allow-obsolete", LibavcodecAllowObsolete, bool, false);
|
DECL_MEDIA_PREF("media.libavcodec.allow-obsolete", LibavcodecAllowObsolete, bool, false);
|
||||||
|
|
@ -171,15 +162,7 @@ private:
|
||||||
// Default value functions
|
// Default value functions
|
||||||
static int32_t MediaDecoderLimitDefault()
|
static int32_t MediaDecoderLimitDefault()
|
||||||
{
|
{
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
// Setting a decoder limit was only necessary for Android; set no decoder limit.
|
||||||
if (AndroidBridge::Bridge() &&
|
|
||||||
AndroidBridge::Bridge()->GetAPIVersion() < 18) {
|
|
||||||
// Older Android versions have broken support for multiple simultaneous
|
|
||||||
// decoders, see bug 1278574.
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
// Otherwise, set no decoder limit.
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,6 @@
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
#include "mozilla/dom/MediaSource.h"
|
#include "mozilla/dom/MediaSource.h"
|
||||||
#include "DecoderTraits.h"
|
#include "DecoderTraits.h"
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
#include "FennecJNIWrappers.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
@ -104,12 +101,6 @@ HavePluginForKeySystem(const nsCString& aKeySystem)
|
||||||
{
|
{
|
||||||
bool havePlugin = HaveGMPFor(NS_LITERAL_CSTRING(GMP_API_DECRYPTOR),
|
bool havePlugin = HaveGMPFor(NS_LITERAL_CSTRING(GMP_API_DECRYPTOR),
|
||||||
{ aKeySystem });
|
{ aKeySystem });
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
// Check if we can use MediaDrm for this keysystem.
|
|
||||||
if (!havePlugin) {
|
|
||||||
havePlugin = mozilla::java::MediaDrmProxy::IsSchemeSupported(aKeySystem);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return havePlugin;
|
return havePlugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -167,16 +158,6 @@ MediaKeySystemAccess::GetKeySystemStatus(const nsAString& aKeySystem,
|
||||||
return MediaKeySystemStatus::Cdm_disabled;
|
return MediaKeySystemStatus::Cdm_disabled;
|
||||||
}
|
}
|
||||||
return EnsureCDMInstalled(aKeySystem, aOutMessage);
|
return EnsureCDMInstalled(aKeySystem, aOutMessage);
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
} else if (Preferences::GetBool("media.mediadrm-widevinecdm.visible", false)) {
|
|
||||||
nsCString keySystem = NS_ConvertUTF16toUTF8(aKeySystem);
|
|
||||||
bool supported = mozilla::java::MediaDrmProxy::IsSchemeSupported(keySystem);
|
|
||||||
if (!supported) {
|
|
||||||
aOutMessage = NS_LITERAL_CSTRING("Widevine CDM is not available");
|
|
||||||
return MediaKeySystemStatus::Cdm_not_installed;
|
|
||||||
}
|
|
||||||
return MediaKeySystemStatus::Available;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -332,9 +313,6 @@ GetSupportedKeySystems()
|
||||||
widevine.mPersistentState = KeySystemFeatureSupport::Requestable;
|
widevine.mPersistentState = KeySystemFeatureSupport::Requestable;
|
||||||
widevine.mDistinctiveIdentifier = KeySystemFeatureSupport::Prohibited;
|
widevine.mDistinctiveIdentifier = KeySystemFeatureSupport::Prohibited;
|
||||||
widevine.mSessionTypes.AppendElement(MediaKeySessionType::Temporary);
|
widevine.mSessionTypes.AppendElement(MediaKeySessionType::Temporary);
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
widevine.mSessionTypes.AppendElement(MediaKeySessionType::Persistent_license);
|
|
||||||
#endif
|
|
||||||
widevine.mAudioRobustness.AppendElement(NS_LITERAL_STRING("SW_SECURE_CRYPTO"));
|
widevine.mAudioRobustness.AppendElement(NS_LITERAL_STRING("SW_SECURE_CRYPTO"));
|
||||||
widevine.mVideoRobustness.AppendElement(NS_LITERAL_STRING("SW_SECURE_DECODE"));
|
widevine.mVideoRobustness.AppendElement(NS_LITERAL_STRING("SW_SECURE_DECODE"));
|
||||||
#if defined(XP_WIN)
|
#if defined(XP_WIN)
|
||||||
|
|
@ -346,49 +324,13 @@ GetSupportedKeySystems()
|
||||||
if (WMFDecoderModule::HasAAC()) {
|
if (WMFDecoderModule::HasAAC()) {
|
||||||
widevine.mMP4.SetCanDecrypt(EME_CODEC_AAC);
|
widevine.mMP4.SetCanDecrypt(EME_CODEC_AAC);
|
||||||
}
|
}
|
||||||
#elif !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
widevine.mMP4.SetCanDecrypt(EME_CODEC_AAC);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
using namespace mozilla::java;
|
|
||||||
// MediaDrm.isCryptoSchemeSupported only allows passing
|
|
||||||
// "video/mp4" or "video/webm" for mimetype string.
|
|
||||||
// See https://developer.android.com/reference/android/media/MediaDrm.html#isCryptoSchemeSupported(java.util.UUID, java.lang.String)
|
|
||||||
// for more detail.
|
|
||||||
typedef struct {
|
|
||||||
const nsCString& mMimeType;
|
|
||||||
const nsCString& mEMECodecType;
|
|
||||||
const char16_t* mCodecType;
|
|
||||||
KeySystemContainerSupport* mSupportType;
|
|
||||||
} DataForValidation;
|
|
||||||
|
|
||||||
DataForValidation validationList[] = {
|
|
||||||
{ nsCString("video/mp4"), EME_CODEC_H264, MediaDrmProxy::AVC, &widevine.mMP4 },
|
|
||||||
{ nsCString("audio/mp4"), EME_CODEC_AAC, MediaDrmProxy::AAC, &widevine.mMP4 },
|
|
||||||
{ nsCString("video/webm"), EME_CODEC_VP8, MediaDrmProxy::VP8, &widevine.mWebM },
|
|
||||||
{ nsCString("video/webm"), EME_CODEC_VP9, MediaDrmProxy::VP9, &widevine.mWebM},
|
|
||||||
{ nsCString("audio/webm"), EME_CODEC_VORBIS, MediaDrmProxy::VORBIS, &widevine.mWebM},
|
|
||||||
{ nsCString("audio/webm"), EME_CODEC_OPUS, MediaDrmProxy::OPUS, &widevine.mWebM},
|
|
||||||
};
|
|
||||||
|
|
||||||
for (const auto& data: validationList) {
|
|
||||||
if (MediaDrmProxy::IsCryptoSchemeSupported(kEMEKeySystemWidevine,
|
|
||||||
data.mMimeType)) {
|
|
||||||
if (MediaDrmProxy::CanDecode(data.mCodecType)) {
|
|
||||||
data.mSupportType->SetCanDecryptAndDecode(data.mEMECodecType);
|
|
||||||
} else {
|
|
||||||
data.mSupportType->SetCanDecrypt(data.mEMECodecType);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
widevine.mMP4.SetCanDecryptAndDecode(EME_CODEC_H264);
|
widevine.mMP4.SetCanDecryptAndDecode(EME_CODEC_H264);
|
||||||
widevine.mWebM.SetCanDecrypt(EME_CODEC_VORBIS);
|
widevine.mWebM.SetCanDecrypt(EME_CODEC_VORBIS);
|
||||||
widevine.mWebM.SetCanDecrypt(EME_CODEC_OPUS);
|
widevine.mWebM.SetCanDecrypt(EME_CODEC_OPUS);
|
||||||
widevine.mWebM.SetCanDecryptAndDecode(EME_CODEC_VP8);
|
widevine.mWebM.SetCanDecryptAndDecode(EME_CODEC_VP8);
|
||||||
widevine.mWebM.SetCanDecryptAndDecode(EME_CODEC_VP9);
|
widevine.mWebM.SetCanDecryptAndDecode(EME_CODEC_VP9);
|
||||||
#endif
|
|
||||||
keySystemConfigs.AppendElement(Move(widevine));
|
keySystemConfigs.AppendElement(Move(widevine));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,6 @@
|
||||||
#include "mozilla/dom/DOMException.h"
|
#include "mozilla/dom/DOMException.h"
|
||||||
#include "mozilla/dom/UnionTypes.h"
|
#include "mozilla/dom/UnionTypes.h"
|
||||||
#include "GMPCDMProxy.h"
|
#include "GMPCDMProxy.h"
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
#include "mozilla/MediaDrmCDMProxy.h"
|
|
||||||
#endif
|
|
||||||
#include "mozilla/EMEUtils.h"
|
#include "mozilla/EMEUtils.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
#include "nsIScriptObjectPrincipal.h"
|
#include "nsIScriptObjectPrincipal.h"
|
||||||
|
|
@ -330,14 +327,6 @@ already_AddRefed<CDMProxy>
|
||||||
MediaKeys::CreateCDMProxy()
|
MediaKeys::CreateCDMProxy()
|
||||||
{
|
{
|
||||||
RefPtr<CDMProxy> proxy;
|
RefPtr<CDMProxy> proxy;
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
if (IsWidevineKeySystem(mKeySystem)) {
|
|
||||||
proxy = new MediaDrmCDMProxy(this,
|
|
||||||
mKeySystem,
|
|
||||||
mConfig.mDistinctiveIdentifier == MediaKeysRequirement::Required,
|
|
||||||
mConfig.mPersistentState == MediaKeysRequirement::Required);
|
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
proxy = new GMPCDMProxy(this,
|
proxy = new GMPCDMProxy(this,
|
||||||
mKeySystem,
|
mKeySystem,
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,6 @@
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
#include "mozilla/WindowsVersion.h"
|
#include "mozilla/WindowsVersion.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
#include "nsIGfxInfo.h"
|
|
||||||
#endif
|
|
||||||
#include "mozilla/layers/LayersTypes.h"
|
#include "mozilla/layers/LayersTypes.h"
|
||||||
|
|
||||||
#include "PDMFactory.h"
|
#include "PDMFactory.h"
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,6 @@
|
||||||
#include "mozilla/gfx/gfxVars.h"
|
#include "mozilla/gfx/gfxVars.h"
|
||||||
#include "mozilla/Sprintf.h"
|
#include "mozilla/Sprintf.h"
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct JSContext;
|
struct JSContext;
|
||||||
class JSObject;
|
class JSObject;
|
||||||
|
|
||||||
|
|
@ -72,12 +68,7 @@ IsWebMForced(DecoderDoctorDiagnostics* aDiagnostics)
|
||||||
DecoderTraits::IsMP4TypeAndEnabled(NS_LITERAL_CSTRING("video/mp4"),
|
DecoderTraits::IsMP4TypeAndEnabled(NS_LITERAL_CSTRING("video/mp4"),
|
||||||
aDiagnostics);
|
aDiagnostics);
|
||||||
bool hwsupported = gfx::gfxVars::CanUseHardwareVideoDecoding();
|
bool hwsupported = gfx::gfxVars::CanUseHardwareVideoDecoding();
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
return !mp4supported || !hwsupported || VP9Benchmark::IsVP9DecodeFast() ||
|
|
||||||
java::HardwareCodecCapabilityUtils::HasHWVP9();
|
|
||||||
#else
|
|
||||||
return !mp4supported || !hwsupported || VP9Benchmark::IsVP9DecodeFast();
|
return !mp4supported || !hwsupported || VP9Benchmark::IsVP9DecodeFast();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,6 @@
|
||||||
#ifdef MOZ_APPLEMEDIA
|
#ifdef MOZ_APPLEMEDIA
|
||||||
#include "AppleDecoderModule.h"
|
#include "AppleDecoderModule.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
#include "AndroidDecoderModule.h"
|
|
||||||
#endif
|
|
||||||
#include "GMPDecoderModule.h"
|
#include "GMPDecoderModule.h"
|
||||||
|
|
||||||
#include "mozilla/CDMProxy.h"
|
#include "mozilla/CDMProxy.h"
|
||||||
|
|
@ -356,13 +353,6 @@ PDMFactory::CreatePDMs()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
if(MediaPrefs::PDMAndroidMediaCodecPreferred() &&
|
|
||||||
MediaPrefs::PDMAndroidMediaCodecEnabled()) {
|
|
||||||
m = new AndroidDecoderModule();
|
|
||||||
StartupPDM(m);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
if (MediaPrefs::PDMWMFEnabled() && IsVistaOrLater() && !IsWin7AndPre2000Compatible()) {
|
if (MediaPrefs::PDMWMFEnabled() && IsVistaOrLater() && !IsWin7AndPre2000Compatible()) {
|
||||||
// *Only* use WMF on Vista and later, as if Firefox is run in Windows 95
|
// *Only* use WMF on Vista and later, as if Firefox is run in Windows 95
|
||||||
|
|
@ -400,12 +390,6 @@ PDMFactory::CreatePDMs()
|
||||||
m = new AppleDecoderModule();
|
m = new AppleDecoderModule();
|
||||||
StartupPDM(m);
|
StartupPDM(m);
|
||||||
#endif
|
#endif
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
if(MediaPrefs::PDMAndroidMediaCodecEnabled()){
|
|
||||||
m = new AndroidDecoderModule();
|
|
||||||
StartupPDM(m);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m = new AgnosticDecoderModule();
|
m = new AgnosticDecoderModule();
|
||||||
StartupPDM(m);
|
StartupPDM(m);
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,6 @@
|
||||||
#include "nsIPrefService.h"
|
#include "nsIPrefService.h"
|
||||||
#include "nsIPrefBranch.h"
|
#include "nsIPrefBranch.h"
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
#include "nsISupportsUtils.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MOZ_WEBRTC
|
#ifdef MOZ_WEBRTC
|
||||||
#include "YuvStamper.h"
|
#include "YuvStamper.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -192,12 +188,7 @@ MediaEngineDefaultVideoSource::Start(SourceMediaStream* aStream, TrackID aID,
|
||||||
mTrackID = aID;
|
mTrackID = aID;
|
||||||
|
|
||||||
// Start timer for subsequent frames
|
// Start timer for subsequent frames
|
||||||
#if defined(MOZ_WIDGET_ANDROID) && defined(DEBUG)
|
|
||||||
// emulator debug is very, very slow and has problems dealing with realtime audio inputs
|
|
||||||
mTimer->InitWithCallback(this, (1000 / mOpts.mFPS)*10, nsITimer::TYPE_REPEATING_SLACK);
|
|
||||||
#else
|
|
||||||
mTimer->InitWithCallback(this, 1000 / mOpts.mFPS, nsITimer::TYPE_REPEATING_SLACK);
|
mTimer->InitWithCallback(this, 1000 / mOpts.mFPS, nsITimer::TYPE_REPEATING_SLACK);
|
||||||
#endif
|
|
||||||
mState = kStarted;
|
mState = kStarted;
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,6 @@ static mozilla::LazyLogModule sGetUserMediaLog("GetUserMedia");
|
||||||
#include "nsITabSource.h"
|
#include "nsITabSource.h"
|
||||||
#include "MediaTrackConstraints.h"
|
#include "MediaTrackConstraints.h"
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
#include "AndroidJNIWrapper.h"
|
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#define LOG(args) MOZ_LOG(sGetUserMediaLog, mozilla::LogLevel::Debug, args)
|
#define LOG(args) MOZ_LOG(sGetUserMediaLog, mozilla::LogLevel::Debug, args)
|
||||||
|
|
||||||
|
|
@ -146,17 +141,6 @@ MediaEngineWebRTC::EnumerateVideoDevices(dom::MediaSourceEnum aMediaSource,
|
||||||
|
|
||||||
mozilla::camera::CaptureEngine capEngine = mozilla::camera::InvalidEngine;
|
mozilla::camera::CaptureEngine capEngine = mozilla::camera::InvalidEngine;
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
// get the JVM
|
|
||||||
JavaVM* jvm;
|
|
||||||
JNIEnv* const env = jni::GetEnvForThread();
|
|
||||||
MOZ_ALWAYS_TRUE(!env->GetJavaVM(&jvm));
|
|
||||||
|
|
||||||
if (webrtc::VideoEngine::SetAndroidObjects(jvm) != 0) {
|
|
||||||
LOG(("VieCapture:SetAndroidObjects Failed"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
bool scaryKind = false; // flag sources with cross-origin exploit potential
|
bool scaryKind = false; // flag sources with cross-origin exploit potential
|
||||||
|
|
||||||
switch (aMediaSource) {
|
switch (aMediaSource) {
|
||||||
|
|
@ -289,20 +273,6 @@ MediaEngineWebRTC::EnumerateAudioDevices(dom::MediaSourceEnum aMediaSource,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
jobject context = mozilla::AndroidBridge::Bridge()->GetGlobalContextRef();
|
|
||||||
|
|
||||||
// get the JVM
|
|
||||||
JavaVM* jvm;
|
|
||||||
JNIEnv* const env = jni::GetEnvForThread();
|
|
||||||
MOZ_ALWAYS_TRUE(!env->GetJavaVM(&jvm));
|
|
||||||
|
|
||||||
if (webrtc::VoiceEngine::SetAndroidObjects(jvm, (void*)context) != 0) {
|
|
||||||
LOG(("VoiceEngine:SetAndroidObjects Failed"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!mVoiceEngine) {
|
if (!mVoiceEngine) {
|
||||||
mConfig.Set<webrtc::ExtendedFilter>(new webrtc::ExtendedFilter(mExtendedFilter));
|
mConfig.Set<webrtc::ExtendedFilter>(new webrtc::ExtendedFilter(mExtendedFilter));
|
||||||
mConfig.Set<webrtc::DelayAgnostic>(new webrtc::DelayAgnostic(mDelayAgnostic));
|
mConfig.Set<webrtc::DelayAgnostic>(new webrtc::DelayAgnostic(mDelayAgnostic));
|
||||||
|
|
@ -338,12 +308,8 @@ MediaEngineWebRTC::EnumerateAudioDevices(dom::MediaSourceEnum aMediaSource,
|
||||||
int nDevices = 0;
|
int nDevices = 0;
|
||||||
mAudioInput->GetNumOfRecordingDevices(nDevices);
|
mAudioInput->GetNumOfRecordingDevices(nDevices);
|
||||||
int i;
|
int i;
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
i = 0; // Bug 1037025 - let the OS handle defaulting for now on android/b2g
|
|
||||||
#else
|
|
||||||
// -1 is "default communications device" depending on OS in webrtc.org code
|
// -1 is "default communications device" depending on OS in webrtc.org code
|
||||||
i = -1;
|
i = -1;
|
||||||
#endif
|
|
||||||
for (; i < nDevices; i++) {
|
for (; i < nDevices; i++) {
|
||||||
// We use constants here because GetRecordingDeviceName takes char[128].
|
// We use constants here because GetRecordingDeviceName takes char[128].
|
||||||
char deviceName[128];
|
char deviceName[128];
|
||||||
|
|
|
||||||
|
|
@ -23,23 +23,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
#include <android/log.h>
|
|
||||||
extern "C" char* PrintJSStack();
|
|
||||||
static void LogFunctionAndJSStack(const char* funcname) {
|
|
||||||
char *jsstack = PrintJSStack();
|
|
||||||
__android_log_print(ANDROID_LOG_INFO, "PowerManagerService", \
|
|
||||||
"Call to %s. The JS stack is:\n%s\n",
|
|
||||||
funcname,
|
|
||||||
jsstack ? jsstack : "<no JS stack>");
|
|
||||||
JS_smprintf_free(jsstack);
|
|
||||||
}
|
|
||||||
// bug 839452
|
|
||||||
#define LOG_FUNCTION_AND_JS_STACK() \
|
|
||||||
LogFunctionAndJSStack(__PRETTY_FUNCTION__);
|
|
||||||
#else
|
|
||||||
#define LOG_FUNCTION_AND_JS_STACK()
|
#define LOG_FUNCTION_AND_JS_STACK()
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,9 @@ const {
|
||||||
const {PushDB} = Cu.import("resource://gre/modules/PushDB.jsm");
|
const {PushDB} = Cu.import("resource://gre/modules/PushDB.jsm");
|
||||||
|
|
||||||
const CONNECTION_PROTOCOLS = (function() {
|
const CONNECTION_PROTOCOLS = (function() {
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
const {PushServiceAndroidGCM} = Cu.import("resource://gre/modules/PushServiceAndroidGCM.jsm");
|
|
||||||
return [PushServiceAndroidGCM];
|
|
||||||
#else
|
|
||||||
const {PushServiceWebSocket} = Cu.import("resource://gre/modules/PushServiceWebSocket.jsm");
|
const {PushServiceWebSocket} = Cu.import("resource://gre/modules/PushServiceWebSocket.jsm");
|
||||||
const {PushServiceHttp2} = Cu.import("resource://gre/modules/PushServiceHttp2.jsm");
|
const {PushServiceHttp2} = Cu.import("resource://gre/modules/PushServiceHttp2.jsm");
|
||||||
return [PushServiceWebSocket, PushServiceHttp2];
|
return [PushServiceWebSocket, PushServiceHttp2];
|
||||||
#endif
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
XPCOMUtils.defineLazyServiceGetter(this, "gPushNotifier",
|
XPCOMUtils.defineLazyServiceGetter(this, "gPushNotifier",
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,10 @@ EXTRA_COMPONENTS += [
|
||||||
EXTRA_JS_MODULES += [
|
EXTRA_JS_MODULES += [
|
||||||
'PushCrypto.jsm',
|
'PushCrypto.jsm',
|
||||||
'PushDB.jsm',
|
'PushDB.jsm',
|
||||||
'PushServiceHttp2.jsm',
|
|
||||||
'PushServiceWebSocket.jsm',
|
|
||||||
]
|
|
||||||
|
|
||||||
EXTRA_PP_JS_MODULES += [
|
|
||||||
'PushRecord.jsm',
|
'PushRecord.jsm',
|
||||||
'PushService.jsm',
|
'PushService.jsm',
|
||||||
|
'PushServiceHttp2.jsm',
|
||||||
|
'PushServiceWebSocket.jsm',
|
||||||
]
|
]
|
||||||
|
|
||||||
MOCHITEST_MANIFESTS += [
|
MOCHITEST_MANIFESTS += [
|
||||||
|
|
|
||||||
|
|
@ -365,15 +365,6 @@ Window implements TouchEventHandlers;
|
||||||
|
|
||||||
Window implements OnErrorEventHandlerForWindow;
|
Window implements OnErrorEventHandlerForWindow;
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
// https://compat.spec.whatwg.org/#windoworientation-interface
|
|
||||||
partial interface Window {
|
|
||||||
[NeedsCallerType]
|
|
||||||
readonly attribute short orientation;
|
|
||||||
attribute EventHandler onorientationchange;
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_SIDEBAR
|
#ifdef HAVE_SIDEBAR
|
||||||
// Mozilla extension
|
// Mozilla extension
|
||||||
partial interface Window {
|
partial interface Window {
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,6 @@
|
||||||
#include "nsWindowWatcher.h"
|
#include "nsWindowWatcher.h"
|
||||||
#include "nsWeakReference.h"
|
#include "nsWeakReference.h"
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
using namespace mozilla::dom::workers;
|
using namespace mozilla::dom::workers;
|
||||||
|
|
@ -512,12 +508,6 @@ public:
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
// This fires an intent that will start launching Fennec and foreground it,
|
|
||||||
// if necessary.
|
|
||||||
java::GeckoAppShell::OpenWindowForNotification();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
nsCOMPtr<nsPIDOMWindowOuter> window;
|
nsCOMPtr<nsPIDOMWindowOuter> window;
|
||||||
nsresult rv = OpenWindow(getter_AddRefs(window));
|
nsresult rv = OpenWindow(getter_AddRefs(window));
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
|
@ -573,44 +563,6 @@ public:
|
||||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
else if (rv == NS_ERROR_NOT_AVAILABLE) {
|
|
||||||
// We couldn't get a browser window, so Fennec must not be running.
|
|
||||||
// Send an Intent to launch Fennec and wait for "BrowserChrome:Ready"
|
|
||||||
// to try opening a window again.
|
|
||||||
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
|
|
||||||
NS_ENSURE_STATE(os);
|
|
||||||
|
|
||||||
WorkerPrivate* workerPrivate = mPromiseProxy->GetWorkerPrivate();
|
|
||||||
MOZ_ASSERT(workerPrivate);
|
|
||||||
|
|
||||||
RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
|
|
||||||
if (!swm) {
|
|
||||||
// browser shutdown
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsCOMPtr<nsIPrincipal> principal = workerPrivate->GetPrincipal();
|
|
||||||
MOZ_ASSERT(principal);
|
|
||||||
|
|
||||||
RefPtr<ServiceWorkerRegistrationInfo> registration =
|
|
||||||
swm->GetRegistration(principal, NS_ConvertUTF16toUTF8(mScope));
|
|
||||||
if (NS_WARN_IF(!registration)) {
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
RefPtr<ServiceWorkerInfo> serviceWorkerInfo =
|
|
||||||
registration->GetServiceWorkerInfoById(workerPrivate->ServiceWorkerID());
|
|
||||||
if (NS_WARN_IF(!serviceWorkerInfo)) {
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
os->AddObserver(static_cast<nsIObserver*>(serviceWorkerInfo->WorkerPrivate()),
|
|
||||||
"BrowserChrome:Ready", true);
|
|
||||||
serviceWorkerInfo->WorkerPrivate()->AddPendingWindow(this);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
RefPtr<ResolveOpenWindowRunnable> resolveRunnable =
|
RefPtr<ResolveOpenWindowRunnable> resolveRunnable =
|
||||||
new ResolveOpenWindowRunnable(mPromiseProxy, nullptr, rv);
|
new ResolveOpenWindowRunnable(mPromiseProxy, nullptr, rv);
|
||||||
|
|
|
||||||
|
|
@ -91,10 +91,6 @@
|
||||||
#include "prthread.h"
|
#include "prthread.h"
|
||||||
#include "xpcpublic.h"
|
#include "xpcpublic.h"
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
#include <android/log.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#include "nsThreadManager.h"
|
#include "nsThreadManager.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -334,11 +330,6 @@ LogErrorToConsole(const WorkerErrorReport& aReport, uint64_t aInnerWindowId)
|
||||||
|
|
||||||
static const char kErrorString[] = "JS error in Web Worker: %s [%s:%u]";
|
static const char kErrorString[] = "JS error in Web Worker: %s [%s:%u]";
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
__android_log_print(ANDROID_LOG_INFO, "Gecko", kErrorString, msg.get(),
|
|
||||||
filename.get(), aReport.mLineNumber);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
fprintf(stderr, kErrorString, msg.get(), filename.get(), aReport.mLineNumber);
|
fprintf(stderr, kErrorString, msg.get(), filename.get(), aReport.mLineNumber);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,6 @@
|
||||||
#include "nsIServiceWorkerManager.h"
|
#include "nsIServiceWorkerManager.h"
|
||||||
#include "nsIScriptTimeoutHandler.h"
|
#include "nsIScriptTimeoutHandler.h"
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
#include <android/log.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "Crypto.h"
|
#include "Crypto.h"
|
||||||
#include "Principal.h"
|
#include "Principal.h"
|
||||||
#include "RuntimeService.h"
|
#include "RuntimeService.h"
|
||||||
|
|
@ -378,9 +374,6 @@ WorkerGlobalScope::Dump(const Optional<nsAString>& aString) const
|
||||||
NS_ConvertUTF16toUTF8 str(aString.Value());
|
NS_ConvertUTF16toUTF8 str(aString.Value());
|
||||||
|
|
||||||
MOZ_LOG(nsContentUtils::DOMDumpLog(), LogLevel::Debug, ("[Worker.Dump] %s", str.get()));
|
MOZ_LOG(nsContentUtils::DOMDumpLog(), LogLevel::Debug, ("[Worker.Dump] %s", str.get()));
|
||||||
#ifdef ANDROID
|
|
||||||
__android_log_print(ANDROID_LOG_INFO, "Gecko", "%s", str.get());
|
|
||||||
#endif
|
|
||||||
fputs(str.get(), stdout);
|
fputs(str.get(), stdout);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,10 +92,6 @@ WorkletGlobalScope::Dump(const Optional<nsAString>& aString) const
|
||||||
|
|
||||||
NS_ConvertUTF16toUTF8 str(aString.Value());
|
NS_ConvertUTF16toUTF8 str(aString.Value());
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
__android_log_print(ANDROID_LOG_INFO, "Gecko", "%s", str.get());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
fputs(str.get(), stdout);
|
fputs(str.get(), stdout);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1854,10 +1854,8 @@ APZCTreeManager::FindRootContentOrRootApzc() const
|
||||||
{
|
{
|
||||||
mTreeLock.AssertCurrentThreadOwns();
|
mTreeLock.AssertCurrentThreadOwns();
|
||||||
|
|
||||||
// Note: this is intended to find the same "root" that would be found
|
// Note: this should find the RCD node if there is one, or the root APZC if
|
||||||
// by AsyncCompositionManager::ApplyAsyncContentTransformToTree inside
|
// there is not.
|
||||||
// the MOZ_WIDGET_ANDROID block. That is, it should find the RCD node if there
|
|
||||||
// is one, or the root APZC if there is not.
|
|
||||||
// Since BreadthFirstSearch is a pre-order search, we first do a search for
|
// Since BreadthFirstSearch is a pre-order search, we first do a search for
|
||||||
// the RCD, and then if we don't find one, we do a search for the root APZC.
|
// the RCD, and then if we don't find one, we do a search for the root APZC.
|
||||||
HitTestingTreeNode* resultNode = BreadthFirstSearch<ReverseIterator>(mRootNode.get(),
|
HitTestingTreeNode* resultNode = BreadthFirstSearch<ReverseIterator>(mRootNode.get(),
|
||||||
|
|
|
||||||
|
|
@ -520,13 +520,6 @@ GLContextCrashGuard::Initialize()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
// Disable the WebGL crash guard on Android - it doesn't use E10S, and
|
|
||||||
// its drivers will essentially never change, so the crash guard could
|
|
||||||
// permanently disable WebGL.
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DriverCrashGuard::Initialize();
|
DriverCrashGuard::Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -645,13 +645,6 @@ nsDeviceContext::FindScreen(nsIScreen** outScreen)
|
||||||
outScreen);
|
outScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
if (!(*outScreen)) {
|
|
||||||
nsCOMPtr<nsIScreen> screen = mWidget->GetWidgetScreen();
|
|
||||||
screen.forget(outScreen);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!(*outScreen)) {
|
if (!(*outScreen)) {
|
||||||
mScreenManager->GetPrimaryScreen(outScreen);
|
mScreenManager->GetPrimaryScreen(outScreen);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,337 +0,0 @@
|
||||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
|
|
||||||
#include "gfxAndroidPlatform.h"
|
|
||||||
#include "mozilla/gfx/2D.h"
|
|
||||||
#include "mozilla/CountingAllocatorBase.h"
|
|
||||||
#include "mozilla/Preferences.h"
|
|
||||||
|
|
||||||
#include "gfx2DGlue.h"
|
|
||||||
#include "gfxFT2FontList.h"
|
|
||||||
#include "gfxImageSurface.h"
|
|
||||||
#include "gfxTextRun.h"
|
|
||||||
#include "mozilla/dom/ContentChild.h"
|
|
||||||
#include "nsXULAppAPI.h"
|
|
||||||
#include "nsIScreen.h"
|
|
||||||
#include "nsIScreenManager.h"
|
|
||||||
#include "nsILocaleService.h"
|
|
||||||
#include "nsServiceManagerUtils.h"
|
|
||||||
#include "nsUnicodeProperties.h"
|
|
||||||
#include "gfxPrefs.h"
|
|
||||||
#include "cairo.h"
|
|
||||||
#include "VsyncSource.h"
|
|
||||||
|
|
||||||
#include "ft2build.h"
|
|
||||||
#include FT_FREETYPE_H
|
|
||||||
#include FT_MODULE_H
|
|
||||||
|
|
||||||
using namespace mozilla;
|
|
||||||
using namespace mozilla::dom;
|
|
||||||
using namespace mozilla::gfx;
|
|
||||||
using namespace mozilla::unicode;
|
|
||||||
|
|
||||||
static FT_Library gPlatformFTLibrary = nullptr;
|
|
||||||
|
|
||||||
class FreetypeReporter final : public nsIMemoryReporter,
|
|
||||||
public CountingAllocatorBase<FreetypeReporter>
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
~FreetypeReporter() {}
|
|
||||||
|
|
||||||
public:
|
|
||||||
NS_DECL_ISUPPORTS
|
|
||||||
|
|
||||||
static void* Malloc(FT_Memory, long size)
|
|
||||||
{
|
|
||||||
return CountingMalloc(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void Free(FT_Memory, void* p)
|
|
||||||
{
|
|
||||||
return CountingFree(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void*
|
|
||||||
Realloc(FT_Memory, long cur_size, long new_size, void* p)
|
|
||||||
{
|
|
||||||
return CountingRealloc(p, new_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
|
|
||||||
nsISupports* aData, bool aAnonymize) override
|
|
||||||
{
|
|
||||||
MOZ_COLLECT_REPORT(
|
|
||||||
"explicit/freetype", KIND_HEAP, UNITS_BYTES, MemoryAllocated(),
|
|
||||||
"Memory used by Freetype.");
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS(FreetypeReporter, nsIMemoryReporter)
|
|
||||||
|
|
||||||
template<> Atomic<size_t> CountingAllocatorBase<FreetypeReporter>::sAmount(0);
|
|
||||||
|
|
||||||
static FT_MemoryRec_ sFreetypeMemoryRecord;
|
|
||||||
|
|
||||||
gfxAndroidPlatform::gfxAndroidPlatform()
|
|
||||||
{
|
|
||||||
// A custom allocator. It counts allocations, enabling memory reporting.
|
|
||||||
sFreetypeMemoryRecord.user = nullptr;
|
|
||||||
sFreetypeMemoryRecord.alloc = FreetypeReporter::Malloc;
|
|
||||||
sFreetypeMemoryRecord.free = FreetypeReporter::Free;
|
|
||||||
sFreetypeMemoryRecord.realloc = FreetypeReporter::Realloc;
|
|
||||||
|
|
||||||
// These two calls are equivalent to FT_Init_FreeType(), but allow us to
|
|
||||||
// provide a custom memory allocator.
|
|
||||||
FT_New_Library(&sFreetypeMemoryRecord, &gPlatformFTLibrary);
|
|
||||||
FT_Add_Default_Modules(gPlatformFTLibrary);
|
|
||||||
|
|
||||||
RegisterStrongMemoryReporter(new FreetypeReporter());
|
|
||||||
|
|
||||||
mOffscreenFormat = GetScreenDepth() == 16
|
|
||||||
? SurfaceFormat::R5G6B5_UINT16
|
|
||||||
: SurfaceFormat::X8R8G8B8_UINT32;
|
|
||||||
|
|
||||||
if (gfxPrefs::AndroidRGB16Force()) {
|
|
||||||
mOffscreenFormat = SurfaceFormat::R5G6B5_UINT16;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gfxAndroidPlatform::~gfxAndroidPlatform()
|
|
||||||
{
|
|
||||||
FT_Done_Library(gPlatformFTLibrary);
|
|
||||||
gPlatformFTLibrary = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
already_AddRefed<gfxASurface>
|
|
||||||
gfxAndroidPlatform::CreateOffscreenSurface(const IntSize& aSize,
|
|
||||||
gfxImageFormat aFormat)
|
|
||||||
{
|
|
||||||
if (!Factory::AllowedSurfaceSize(aSize)) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
RefPtr<gfxASurface> newSurface;
|
|
||||||
newSurface = new gfxImageSurface(aSize, aFormat);
|
|
||||||
|
|
||||||
return newSurface.forget();
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
|
||||||
IsJapaneseLocale()
|
|
||||||
{
|
|
||||||
static bool sInitialized = false;
|
|
||||||
static bool sIsJapanese = false;
|
|
||||||
|
|
||||||
if (!sInitialized) {
|
|
||||||
sInitialized = true;
|
|
||||||
|
|
||||||
do { // to allow 'break' to abandon this block if a call fails
|
|
||||||
nsresult rv;
|
|
||||||
nsCOMPtr<nsILocaleService> ls =
|
|
||||||
do_GetService(NS_LOCALESERVICE_CONTRACTID, &rv);
|
|
||||||
if (NS_FAILED(rv)) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
nsCOMPtr<nsILocale> appLocale;
|
|
||||||
rv = ls->GetApplicationLocale(getter_AddRefs(appLocale));
|
|
||||||
if (NS_FAILED(rv)) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
nsString localeStr;
|
|
||||||
rv = appLocale->
|
|
||||||
GetCategory(NS_LITERAL_STRING(NSILOCALE_MESSAGE), localeStr);
|
|
||||||
if (NS_FAILED(rv)) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
const nsAString& lang = nsDependentSubstring(localeStr, 0, 2);
|
|
||||||
if (lang.EqualsLiteral("ja")) {
|
|
||||||
sIsJapanese = true;
|
|
||||||
}
|
|
||||||
} while (false);
|
|
||||||
}
|
|
||||||
|
|
||||||
return sIsJapanese;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gfxAndroidPlatform::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
|
|
||||||
Script aRunScript,
|
|
||||||
nsTArray<const char*>& aFontList)
|
|
||||||
{
|
|
||||||
static const char kDroidSansJapanese[] = "Droid Sans Japanese";
|
|
||||||
static const char kMotoyaLMaru[] = "MotoyaLMaru";
|
|
||||||
static const char kNotoSansCJKJP[] = "Noto Sans CJK JP";
|
|
||||||
static const char kNotoColorEmoji[] = "Noto Color Emoji";
|
|
||||||
|
|
||||||
EmojiPresentation emoji = GetEmojiPresentation(aCh);
|
|
||||||
if (emoji != EmojiPresentation::TextOnly) {
|
|
||||||
if (aNextCh == kVariationSelector16 ||
|
|
||||||
(aNextCh != kVariationSelector15 &&
|
|
||||||
emoji == EmojiPresentation::EmojiDefault)) {
|
|
||||||
// if char is followed by VS16, try for a color emoji glyph
|
|
||||||
aFontList.AppendElement(kNotoColorEmoji);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IS_IN_BMP(aCh)) {
|
|
||||||
// try language-specific "Droid Sans *" and "Noto Sans *" fonts for
|
|
||||||
// certain blocks, as most devices probably have these
|
|
||||||
uint8_t block = (aCh >> 8) & 0xff;
|
|
||||||
switch (block) {
|
|
||||||
case 0x05:
|
|
||||||
aFontList.AppendElement("Droid Sans Hebrew");
|
|
||||||
aFontList.AppendElement("Droid Sans Armenian");
|
|
||||||
break;
|
|
||||||
case 0x06:
|
|
||||||
aFontList.AppendElement("Droid Sans Arabic");
|
|
||||||
break;
|
|
||||||
case 0x09:
|
|
||||||
aFontList.AppendElement("Noto Sans Devanagari");
|
|
||||||
aFontList.AppendElement("Droid Sans Devanagari");
|
|
||||||
break;
|
|
||||||
case 0x0b:
|
|
||||||
aFontList.AppendElement("Noto Sans Tamil");
|
|
||||||
aFontList.AppendElement("Droid Sans Tamil");
|
|
||||||
break;
|
|
||||||
case 0x0e:
|
|
||||||
aFontList.AppendElement("Noto Sans Thai");
|
|
||||||
aFontList.AppendElement("Droid Sans Thai");
|
|
||||||
break;
|
|
||||||
case 0x10: case 0x2d:
|
|
||||||
aFontList.AppendElement("Droid Sans Georgian");
|
|
||||||
break;
|
|
||||||
case 0x12: case 0x13:
|
|
||||||
aFontList.AppendElement("Droid Sans Ethiopic");
|
|
||||||
break;
|
|
||||||
case 0xf9: case 0xfa:
|
|
||||||
if (IsJapaneseLocale()) {
|
|
||||||
aFontList.AppendElement(kMotoyaLMaru);
|
|
||||||
aFontList.AppendElement(kNotoSansCJKJP);
|
|
||||||
aFontList.AppendElement(kDroidSansJapanese);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (block >= 0x2e && block <= 0x9f && IsJapaneseLocale()) {
|
|
||||||
aFontList.AppendElement(kMotoyaLMaru);
|
|
||||||
aFontList.AppendElement(kNotoSansCJKJP);
|
|
||||||
aFontList.AppendElement(kDroidSansJapanese);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// and try Droid Sans Fallback as a last resort
|
|
||||||
aFontList.AppendElement("Droid Sans Fallback");
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gfxAndroidPlatform::GetSystemFontList(InfallibleTArray<FontListEntry>* retValue)
|
|
||||||
{
|
|
||||||
gfxFT2FontList::PlatformFontList()->GetSystemFontList(retValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
gfxPlatformFontList*
|
|
||||||
gfxAndroidPlatform::CreatePlatformFontList()
|
|
||||||
{
|
|
||||||
gfxPlatformFontList* list = new gfxFT2FontList();
|
|
||||||
if (NS_SUCCEEDED(list->InitFontList())) {
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
gfxPlatformFontList::Shutdown();
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
gfxAndroidPlatform::IsFontFormatSupported(nsIURI *aFontURI, uint32_t aFormatFlags)
|
|
||||||
{
|
|
||||||
// check for strange format flags
|
|
||||||
NS_ASSERTION(!(aFormatFlags & gfxUserFontSet::FLAG_FORMAT_NOT_USED),
|
|
||||||
"strange font format hint set");
|
|
||||||
|
|
||||||
// accept supported formats
|
|
||||||
if (aFormatFlags & gfxUserFontSet::FLAG_FORMATS_COMMON) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// reject all other formats, known and unknown
|
|
||||||
if (aFormatFlags != 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// no format hint set, need to look at data
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
gfxFontGroup *
|
|
||||||
gfxAndroidPlatform::CreateFontGroup(const FontFamilyList& aFontFamilyList,
|
|
||||||
const gfxFontStyle* aStyle,
|
|
||||||
gfxTextPerfMetrics* aTextPerf,
|
|
||||||
gfxUserFontSet* aUserFontSet,
|
|
||||||
gfxFloat aDevToCssSize)
|
|
||||||
{
|
|
||||||
return new gfxFontGroup(aFontFamilyList, aStyle, aTextPerf,
|
|
||||||
aUserFontSet, aDevToCssSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
FT_Library
|
|
||||||
gfxAndroidPlatform::GetFTLibrary()
|
|
||||||
{
|
|
||||||
return gPlatformFTLibrary;
|
|
||||||
}
|
|
||||||
|
|
||||||
already_AddRefed<ScaledFont>
|
|
||||||
gfxAndroidPlatform::GetScaledFontForFont(DrawTarget* aTarget, gfxFont *aFont)
|
|
||||||
{
|
|
||||||
return GetScaledFontForFontWithCairoSkia(aTarget, aFont);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
gfxAndroidPlatform::FontHintingEnabled()
|
|
||||||
{
|
|
||||||
// In "mobile" builds, we sometimes use non-reflow-zoom, so we
|
|
||||||
// might not want hinting. Let's see.
|
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
// On Android, we currently only use gecko to render web
|
|
||||||
// content that can always be be non-reflow-zoomed. So turn off
|
|
||||||
// hinting.
|
|
||||||
//
|
|
||||||
// XXX when gecko-android-java is used as an "app runtime", we may
|
|
||||||
// want to re-enable hinting for non-browser processes there.
|
|
||||||
return false;
|
|
||||||
#endif // MOZ_WIDGET_ANDROID
|
|
||||||
|
|
||||||
// Currently, we don't have any other targets, but if/when we do,
|
|
||||||
// decide how to handle them here.
|
|
||||||
|
|
||||||
NS_NOTREACHED("oops, what platform is this?");
|
|
||||||
return gfxPlatform::FontHintingEnabled();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
gfxAndroidPlatform::RequiresLinearZoom()
|
|
||||||
{
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
// On Android, we currently only use gecko to render web
|
|
||||||
// content that can always be be non-reflow-zoomed.
|
|
||||||
//
|
|
||||||
// XXX when gecko-android-java is used as an "app runtime", we may
|
|
||||||
// want to treat it like B2G and use linear zoom only for the web
|
|
||||||
// browser process, not other apps.
|
|
||||||
return true;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
NS_NOTREACHED("oops, what platform is this?");
|
|
||||||
return gfxPlatform::RequiresLinearZoom();
|
|
||||||
}
|
|
||||||
|
|
||||||
already_AddRefed<mozilla::gfx::VsyncSource>
|
|
||||||
gfxAndroidPlatform::CreateHardwareVsyncSource()
|
|
||||||
{
|
|
||||||
return gfxPlatform::CreateHardwareVsyncSource();
|
|
||||||
}
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
||||||
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#ifndef GFX_PLATFORM_ANDROID_H
|
|
||||||
#define GFX_PLATFORM_ANDROID_H
|
|
||||||
|
|
||||||
#include "gfxFT2Fonts.h"
|
|
||||||
#include "gfxPlatform.h"
|
|
||||||
#include "gfxUserFontSet.h"
|
|
||||||
#include "nsCOMPtr.h"
|
|
||||||
#include "nsTArray.h"
|
|
||||||
|
|
||||||
namespace mozilla {
|
|
||||||
namespace dom {
|
|
||||||
class FontListEntry;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
using mozilla::dom::FontListEntry;
|
|
||||||
|
|
||||||
typedef struct FT_LibraryRec_ *FT_Library;
|
|
||||||
|
|
||||||
class gfxAndroidPlatform : public gfxPlatform {
|
|
||||||
public:
|
|
||||||
gfxAndroidPlatform();
|
|
||||||
virtual ~gfxAndroidPlatform();
|
|
||||||
|
|
||||||
static gfxAndroidPlatform *GetPlatform() {
|
|
||||||
return (gfxAndroidPlatform*) gfxPlatform::GetPlatform();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual already_AddRefed<gfxASurface>
|
|
||||||
CreateOffscreenSurface(const IntSize& aSize,
|
|
||||||
gfxImageFormat aFormat) override;
|
|
||||||
|
|
||||||
virtual gfxImageFormat GetOffscreenFormat() override { return mOffscreenFormat; }
|
|
||||||
|
|
||||||
already_AddRefed<mozilla::gfx::ScaledFont>
|
|
||||||
GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont) override;
|
|
||||||
|
|
||||||
// to support IPC font list (sharing between chrome and content)
|
|
||||||
void GetSystemFontList(InfallibleTArray<FontListEntry>* retValue);
|
|
||||||
|
|
||||||
// platform implementations of font functions
|
|
||||||
virtual bool IsFontFormatSupported(nsIURI *aFontURI, uint32_t aFormatFlags) override;
|
|
||||||
virtual gfxPlatformFontList* CreatePlatformFontList() override;
|
|
||||||
|
|
||||||
virtual void GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
|
|
||||||
Script aRunScript,
|
|
||||||
nsTArray<const char*>& aFontList) override;
|
|
||||||
|
|
||||||
gfxFontGroup*
|
|
||||||
CreateFontGroup(const mozilla::FontFamilyList& aFontFamilyList,
|
|
||||||
const gfxFontStyle *aStyle,
|
|
||||||
gfxTextPerfMetrics* aTextPerf,
|
|
||||||
gfxUserFontSet *aUserFontSet,
|
|
||||||
gfxFloat aDevToCssSize) override;
|
|
||||||
|
|
||||||
virtual bool FontHintingEnabled() override;
|
|
||||||
virtual bool RequiresLinearZoom() override;
|
|
||||||
|
|
||||||
FT_Library GetFTLibrary();
|
|
||||||
|
|
||||||
virtual bool CanRenderContentToDataSurface() const override {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual already_AddRefed<mozilla::gfx::VsyncSource> CreateHardwareVsyncSource() override;
|
|
||||||
|
|
||||||
virtual bool SupportsApzTouchInput() const override {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
gfxImageFormat mOffscreenFormat;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* GFX_PLATFORM_ANDROID_H */
|
|
||||||
|
|
||||||
|
|
@ -492,15 +492,6 @@ FT2FontEntry::ReadCMAP(FontInfoData *aFontInfoData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
// Hack for the SamsungDevanagari font, bug 1012365:
|
|
||||||
// pretend the font supports U+0972.
|
|
||||||
if (!charmap->test(0x0972) &&
|
|
||||||
charmap->test(0x0905) && charmap->test(0x0945)) {
|
|
||||||
charmap->set(0x0972);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
mHasCmapTable = NS_SUCCEEDED(rv);
|
mHasCmapTable = NS_SUCCEEDED(rv);
|
||||||
if (mHasCmapTable) {
|
if (mHasCmapTable) {
|
||||||
gfxPlatformFontList *pfl = gfxPlatformFontList::PlatformFontList();
|
gfxPlatformFontList *pfl = gfxPlatformFontList::PlatformFontList();
|
||||||
|
|
@ -1562,12 +1553,6 @@ gfxFontFamily*
|
||||||
gfxFT2FontList::GetDefaultFontForPlatform(const gfxFontStyle* aStyle)
|
gfxFT2FontList::GetDefaultFontForPlatform(const gfxFontStyle* aStyle)
|
||||||
{
|
{
|
||||||
gfxFontFamily *ff = nullptr;
|
gfxFontFamily *ff = nullptr;
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
ff = FindFamily(NS_LITERAL_STRING("Roboto"));
|
|
||||||
if (!ff) {
|
|
||||||
ff = FindFamily(NS_LITERAL_STRING("Droid Sans"));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
/* TODO: what about Qt or other platforms that may use this? */
|
/* TODO: what about Qt or other platforms that may use this? */
|
||||||
return ff;
|
return ff;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1107,16 +1107,6 @@ HBUnicodeDecompose(hb_unicode_funcs_t *ufuncs,
|
||||||
hb_codepoint_t *b,
|
hb_codepoint_t *b,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
// Hack for the SamsungDevanagari font, bug 1012365:
|
|
||||||
// support U+0972 by decomposing it.
|
|
||||||
if (ab == 0x0972) {
|
|
||||||
*a = 0x0905;
|
|
||||||
*b = 0x0945;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!sNormalizer) {
|
if (!sNormalizer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,10 +87,6 @@
|
||||||
#include "gfxPlatformGtk.h" // xxx - for UseFcFontList
|
#include "gfxPlatformGtk.h" // xxx - for UseFcFontList
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
#include "TexturePoolOGL.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_SKIA
|
#ifdef USE_SKIA
|
||||||
# ifdef __GNUC__
|
# ifdef __GNUC__
|
||||||
# pragma GCC diagnostic push
|
# pragma GCC diagnostic push
|
||||||
|
|
@ -522,8 +518,6 @@ void RecordingPrefChanged(const char *aPrefName, void *aClosure)
|
||||||
#if defined(USE_SKIA)
|
#if defined(USE_SKIA)
|
||||||
static uint32_t GetSkiaGlyphCacheSize()
|
static uint32_t GetSkiaGlyphCacheSize()
|
||||||
{
|
{
|
||||||
// Only increase font cache size on non-android to save memory.
|
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
// 10mb as the default cache size on desktop due to talos perf tweaking.
|
// 10mb as the default cache size on desktop due to talos perf tweaking.
|
||||||
// Chromium uses 20mb and skia default uses 2mb.
|
// Chromium uses 20mb and skia default uses 2mb.
|
||||||
// We don't need to change the font cache count since we usually
|
// We don't need to change the font cache count since we usually
|
||||||
|
|
@ -535,9 +529,6 @@ static uint32_t GetSkiaGlyphCacheSize()
|
||||||
}
|
}
|
||||||
|
|
||||||
return cacheSize;
|
return cacheSize;
|
||||||
#else
|
|
||||||
return kDefaultGlyphCacheSize;
|
|
||||||
#endif // MOZ_WIDGET_ANDROID
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -671,11 +662,6 @@ gfxPlatform::Init()
|
||||||
|
|
||||||
GLContext::PlatformStartup();
|
GLContext::PlatformStartup();
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
// Texture pool init
|
|
||||||
TexturePoolOGL::Init();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Preferences::RegisterCallbackAndCall(RecordingPrefChanged, "gfx.2d.recording", nullptr);
|
Preferences::RegisterCallbackAndCall(RecordingPrefChanged, "gfx.2d.recording", nullptr);
|
||||||
|
|
||||||
CreateCMSOutputProfile();
|
CreateCMSOutputProfile();
|
||||||
|
|
@ -781,11 +767,6 @@ gfxPlatform::Shutdown()
|
||||||
|
|
||||||
gPlatform->mVsyncSource = nullptr;
|
gPlatform->mVsyncSource = nullptr;
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
// Shut down the texture pool
|
|
||||||
TexturePoolOGL::Shutdown();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Shut down the default GL context provider.
|
// Shut down the default GL context provider.
|
||||||
GLContextProvider::Shutdown();
|
GLContextProvider::Shutdown();
|
||||||
|
|
||||||
|
|
@ -2323,7 +2304,7 @@ gfxPlatform::GetTilesSupportInfo(mozilla::widget::InfoObject& aObj)
|
||||||
/*static*/ bool
|
/*static*/ bool
|
||||||
gfxPlatform::AsyncPanZoomEnabled()
|
gfxPlatform::AsyncPanZoomEnabled()
|
||||||
{
|
{
|
||||||
#if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_UIKIT)
|
#if !defined(MOZ_WIDGET_UIKIT)
|
||||||
// For XUL applications (everything but Firefox on Android) we only want
|
// For XUL applications (everything but Firefox on Android) we only want
|
||||||
// to use APZ when E10S is enabled or when the user explicitly enable it.
|
// to use APZ when E10S is enabled or when the user explicitly enable it.
|
||||||
if (BrowserTabsRemoteAutostart() || gfxPrefs::APZDesktopEnabled()) {
|
if (BrowserTabsRemoteAutostart() || gfxPrefs::APZDesktopEnabled()) {
|
||||||
|
|
@ -2331,8 +2312,6 @@ gfxPlatform::AsyncPanZoomEnabled()
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#elif defined(MOZ_WIDGET_ANDROID)
|
|
||||||
return true;
|
|
||||||
#else
|
#else
|
||||||
return gfxPrefs::AsyncPanZoomEnabledDoNotUseDirectly();
|
return gfxPrefs::AsyncPanZoomEnabledDoNotUseDirectly();
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -2356,10 +2335,6 @@ gfxPlatform::GetAcceleratedCompositorBackends(nsTArray<LayersBackend>& aBackends
|
||||||
NS_WARNING("OpenGL-accelerated layers are not supported on this system");
|
NS_WARNING("OpenGL-accelerated layers are not supported on this system");
|
||||||
tell_me_once = 1;
|
tell_me_once = 1;
|
||||||
}
|
}
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
NS_RUNTIMEABORT("OpenGL-accelerated layers are a hard requirement on this platform. "
|
|
||||||
"Cannot continue without support for them");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,24 +57,7 @@ EXPORTS.mozilla.gfx += [
|
||||||
'PrintTargetThebes.h',
|
'PrintTargetThebes.h',
|
||||||
]
|
]
|
||||||
|
|
||||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
||||||
EXPORTS += [
|
|
||||||
'gfxAndroidPlatform.h',
|
|
||||||
'gfxFT2FontBase.h',
|
|
||||||
'gfxFT2Fonts.h',
|
|
||||||
]
|
|
||||||
EXPORTS.mozilla.gfx += [
|
|
||||||
'PrintTargetPDF.h',
|
|
||||||
]
|
|
||||||
SOURCES += [
|
|
||||||
'gfxAndroidPlatform.cpp',
|
|
||||||
'gfxFT2FontBase.cpp',
|
|
||||||
'gfxFT2FontList.cpp',
|
|
||||||
'gfxFT2Fonts.cpp',
|
|
||||||
'gfxFT2Utils.cpp',
|
|
||||||
'PrintTargetPDF.cpp',
|
|
||||||
]
|
|
||||||
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
|
||||||
EXPORTS += [
|
EXPORTS += [
|
||||||
'gfxPlatformMac.h',
|
'gfxPlatformMac.h',
|
||||||
'gfxQuartzNativeDrawing.h',
|
'gfxQuartzNativeDrawing.h',
|
||||||
|
|
@ -231,7 +214,7 @@ LOCAL_INCLUDES += [
|
||||||
'/dom/xml',
|
'/dom/xml',
|
||||||
]
|
]
|
||||||
|
|
||||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gtk3'):
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
|
||||||
DEFINES['MOZ_ENABLE_FREETYPE'] = True
|
DEFINES['MOZ_ENABLE_FREETYPE'] = True
|
||||||
|
|
||||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||||
|
|
@ -244,9 +227,6 @@ CXXFLAGS += CONFIG['TK_CFLAGS']
|
||||||
CFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
|
CFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
|
||||||
CFLAGS += CONFIG['TK_CFLAGS']
|
CFLAGS += CONFIG['TK_CFLAGS']
|
||||||
|
|
||||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android'):
|
|
||||||
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
|
|
||||||
|
|
||||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
|
||||||
CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
|
CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,6 @@
|
||||||
#include "webrtc/voice_engine/voice_engine_impl.h"
|
#include "webrtc/voice_engine/voice_engine_impl.h"
|
||||||
#include "webrtc/system_wrappers/interface/clock.h"
|
#include "webrtc/system_wrappers/interface/clock.h"
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
#include "AndroidJNIWrapper.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
static const char* logTag ="WebrtcAudioSessionConduit";
|
static const char* logTag ="WebrtcAudioSessionConduit";
|
||||||
|
|
@ -261,17 +257,6 @@ MediaConduitErrorCode WebrtcAudioConduit::Init()
|
||||||
{
|
{
|
||||||
CSFLogDebug(logTag, "%s this=%p", __FUNCTION__, this);
|
CSFLogDebug(logTag, "%s this=%p", __FUNCTION__, this);
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
jobject context = jsjni_GetGlobalContextRef();
|
|
||||||
// get the JVM
|
|
||||||
JavaVM *jvm = jsjni_GetVM();
|
|
||||||
|
|
||||||
if (webrtc::VoiceEngine::SetAndroidObjects(jvm, (void*)context) != 0) {
|
|
||||||
CSFLogError(logTag, "%s Unable to set Android objects", __FUNCTION__);
|
|
||||||
return kMediaConduitSessionNotInited;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Per WebRTC APIs below function calls return nullptr on failure
|
// Per WebRTC APIs below function calls return nullptr on failure
|
||||||
if(!(mVoiceEngine = webrtc::VoiceEngine::Create()))
|
if(!(mVoiceEngine = webrtc::VoiceEngine::Create()))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,6 @@
|
||||||
|
|
||||||
#include "mozilla/Unused.h"
|
#include "mozilla/Unused.h"
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
#include "AndroidJNIWrapper.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// for ntohs
|
// for ntohs
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include "Winsock2.h"
|
#include "Winsock2.h"
|
||||||
|
|
@ -323,15 +319,6 @@ WebrtcVideoConduit::InitMain()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
// get the JVM
|
|
||||||
JavaVM *jvm = jsjni_GetVM();
|
|
||||||
|
|
||||||
if (webrtc::VideoEngine::SetAndroidObjects(jvm) != 0) {
|
|
||||||
CSFLogError(logTag, "%s: could not set Android objects", __FUNCTION__);
|
|
||||||
return kMediaConduitSessionNotInited;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
return kMediaConduitNoError;
|
return kMediaConduitNoError;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,6 @@
|
||||||
|
|
||||||
#include "mozilla/mozalloc_abort.h"
|
#include "mozilla/mozalloc_abort.h"
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
# include "APKOpen.h"
|
|
||||||
# include "dlfcn.h"
|
|
||||||
#endif
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "mozilla/Assertions.h"
|
#include "mozilla/Assertions.h"
|
||||||
|
|
|
||||||
|
|
@ -530,13 +530,6 @@ pref("media.navigator.audio.full_duplex", false);
|
||||||
pref("media.peerconnection.capture_delay", 50);
|
pref("media.peerconnection.capture_delay", 50);
|
||||||
pref("media.getusermedia.playout_delay", 40);
|
pref("media.getusermedia.playout_delay", 40);
|
||||||
pref("media.navigator.audio.full_duplex", false);
|
pref("media.navigator.audio.full_duplex", false);
|
||||||
#elif defined(ANDROID)
|
|
||||||
pref("media.peerconnection.capture_delay", 100);
|
|
||||||
pref("media.getusermedia.playout_delay", 100);
|
|
||||||
pref("media.navigator.audio.full_duplex", false);
|
|
||||||
// Whether to enable Webrtc Hardware acceleration support
|
|
||||||
pref("media.navigator.hardware.vp8_encode.acceleration_enabled", false);
|
|
||||||
pref("media.navigator.hardware.vp8_decode.acceleration_enabled", false);
|
|
||||||
#elif defined(XP_LINUX)
|
#elif defined(XP_LINUX)
|
||||||
pref("media.peerconnection.capture_delay", 70);
|
pref("media.peerconnection.capture_delay", 70);
|
||||||
pref("media.getusermedia.playout_delay", 50);
|
pref("media.getusermedia.playout_delay", 50);
|
||||||
|
|
@ -551,9 +544,7 @@ pref("media.navigator.audio.full_duplex", false);
|
||||||
|
|
||||||
pref("dom.webaudio.enabled", true);
|
pref("dom.webaudio.enabled", true);
|
||||||
|
|
||||||
#if !defined(ANDROID)
|
|
||||||
pref("media.getusermedia.screensharing.enabled", true);
|
pref("media.getusermedia.screensharing.enabled", true);
|
||||||
#endif
|
|
||||||
|
|
||||||
pref("media.getusermedia.screensharing.allowed_domains", "webex.com,*.webex.com,ciscospark.com,*.ciscospark.com,projectsquared.com,*.projectsquared.com,*.room.co,room.co,beta.talky.io,talky.io,*.clearslide.com,appear.in,*.appear.in,tokbox.com,*.tokbox.com,*.sso.francetelecom.fr,*.si.francetelecom.fr,*.sso.infra.ftgroup,*.multimedia-conference.orange-business.com,*.espacecollaboration.orange-business.com,free.gotomeeting.com,g2m.me,*.g2m.me,*.mypurecloud.com,*.mypurecloud.com.au,spreed.me,*.spreed.me,*.spreed.com,air.mozilla.org,*.circuit.com,*.yourcircuit.com,circuit.siemens.com,yourcircuit.siemens.com,circuitsandbox.net,*.unify.com,tandi.circuitsandbox.net,*.ericsson.net,*.cct.ericsson.net,*.opentok.com,*.conf.meetecho.com,meet.jit.si,*.meet.jit.si,web.stage.speakeasyapp.net,web.speakeasyapp.net,*.hipchat.me,*.beta-wspbx.com,*.wspbx.com,*.unifiedcloudit.com,*.smartboxuc.com,*.smartbox-uc.com,*.panterranetworks.com,pexipdemo.com,*.pexipdemo.com,pex.me,*.pex.me,*.rd.pexip.com,1click.io,*.1click.io,*.fuze.com,*.fuzemeeting.com,*.thinkingphones.com,gotomeeting.com,*.gotomeeting.com,gotowebinar.com,*.gotowebinar.com,gototraining.com,*.gototraining.com,citrix.com,*.citrix.com,expertcity.com,*.expertcity.com,citrixonline.com,*.citrixonline.com,g2m.me,*.g2m.me,gotomeet.me,*.gotomeet.me,gotomeet.at,*.gotomeet.at,miriadaxdes.miriadax.net,certificacion.miriadax.net,miriadax.net,*.wire.com,sylaps.com,*.sylaps.com,bluejeans.com,*.bluejeans.com,*.a.bluejeans.com,*.bbcollab.com");
|
pref("media.getusermedia.screensharing.allowed_domains", "webex.com,*.webex.com,ciscospark.com,*.ciscospark.com,projectsquared.com,*.projectsquared.com,*.room.co,room.co,beta.talky.io,talky.io,*.clearslide.com,appear.in,*.appear.in,tokbox.com,*.tokbox.com,*.sso.francetelecom.fr,*.si.francetelecom.fr,*.sso.infra.ftgroup,*.multimedia-conference.orange-business.com,*.espacecollaboration.orange-business.com,free.gotomeeting.com,g2m.me,*.g2m.me,*.mypurecloud.com,*.mypurecloud.com.au,spreed.me,*.spreed.me,*.spreed.com,air.mozilla.org,*.circuit.com,*.yourcircuit.com,circuit.siemens.com,yourcircuit.siemens.com,circuitsandbox.net,*.unify.com,tandi.circuitsandbox.net,*.ericsson.net,*.cct.ericsson.net,*.opentok.com,*.conf.meetecho.com,meet.jit.si,*.meet.jit.si,web.stage.speakeasyapp.net,web.speakeasyapp.net,*.hipchat.me,*.beta-wspbx.com,*.wspbx.com,*.unifiedcloudit.com,*.smartboxuc.com,*.smartbox-uc.com,*.panterranetworks.com,pexipdemo.com,*.pexipdemo.com,pex.me,*.pex.me,*.rd.pexip.com,1click.io,*.1click.io,*.fuze.com,*.fuzemeeting.com,*.thinkingphones.com,gotomeeting.com,*.gotomeeting.com,gotowebinar.com,*.gotowebinar.com,gototraining.com,*.gototraining.com,citrix.com,*.citrix.com,expertcity.com,*.expertcity.com,citrixonline.com,*.citrixonline.com,g2m.me,*.g2m.me,gotomeet.me,*.gotomeet.me,gotomeet.at,*.gotomeet.at,miriadaxdes.miriadax.net,certificacion.miriadax.net,miriadax.net,*.wire.com,sylaps.com,*.sylaps.com,bluejeans.com,*.bluejeans.com,*.a.bluejeans.com,*.bbcollab.com");
|
||||||
// OS/X 10.6 and XP have screen/window sharing off by default due to various issues - Caveat emptor
|
// OS/X 10.6 and XP have screen/window sharing off by default due to various issues - Caveat emptor
|
||||||
|
|
@ -572,7 +563,7 @@ pref("media.mediasource.enabled", true);
|
||||||
|
|
||||||
pref("media.mediasource.mp4.enabled", true);
|
pref("media.mediasource.mp4.enabled", true);
|
||||||
|
|
||||||
#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID)
|
#if defined(XP_WIN) || defined(XP_MACOSX)
|
||||||
pref("media.mediasource.webm.enabled", false);
|
pref("media.mediasource.webm.enabled", false);
|
||||||
#else
|
#else
|
||||||
pref("media.mediasource.webm.enabled", true);
|
pref("media.mediasource.webm.enabled", true);
|
||||||
|
|
@ -696,15 +687,7 @@ pref("apz.y_stationary_size_multiplier", "3.5");
|
||||||
pref("apz.zoom_animation_duration_ms", 250);
|
pref("apz.zoom_animation_duration_ms", 250);
|
||||||
pref("apz.scale_repaint_delay_ms", 500);
|
pref("apz.scale_repaint_delay_ms", 500);
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
#if !defined(MOZ_WIDGET_UIKIT)
|
||||||
// Mobile prefs
|
|
||||||
pref("apz.allow_zooming", true);
|
|
||||||
pref("apz.enlarge_displayport_when_clipped", true);
|
|
||||||
pref("apz.y_skate_size_multiplier", "1.5");
|
|
||||||
pref("apz.y_stationary_size_multiplier", "1.5");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_UIKIT)
|
|
||||||
pref("apz.desktop.enabled", false);
|
pref("apz.desktop.enabled", false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -716,10 +699,8 @@ pref("apz.desktop.enabled", false);
|
||||||
pref("gfx.hidpi.enabled", 2);
|
pref("gfx.hidpi.enabled", 2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
// Use containerless scrolling for now.
|
||||||
// Use containerless scrolling for now on desktop.
|
|
||||||
pref("layout.scroll.root-frame-containers", false);
|
pref("layout.scroll.root-frame-containers", false);
|
||||||
#endif
|
|
||||||
|
|
||||||
// Whether to enable LayerScope tool and default listening port
|
// Whether to enable LayerScope tool and default listening port
|
||||||
pref("gfx.layerscope.enabled", false);
|
pref("gfx.layerscope.enabled", false);
|
||||||
|
|
@ -753,11 +734,6 @@ pref("gfx.downloadable_fonts.disable_cache", false);
|
||||||
|
|
||||||
pref("gfx.downloadable_fonts.woff2.enabled", true);
|
pref("gfx.downloadable_fonts.woff2.enabled", true);
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
pref("gfx.bundled_fonts.enabled", true);
|
|
||||||
pref("gfx.bundled_fonts.force-enabled", false);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Do we fire a notification about missing fonts, so the front-end can decide
|
// Do we fire a notification about missing fonts, so the front-end can decide
|
||||||
// whether to try and do something about it (e.g. download additional fonts)?
|
// whether to try and do something about it (e.g. download additional fonts)?
|
||||||
pref("gfx.missing_fonts.notify", false);
|
pref("gfx.missing_fonts.notify", false);
|
||||||
|
|
@ -2032,9 +2008,6 @@ pref("network.proxy.no_proxies_on", "localhost, 127.0.0.1");
|
||||||
pref("network.proxy.failover_timeout", 1800); // 30 minutes
|
pref("network.proxy.failover_timeout", 1800); // 30 minutes
|
||||||
pref("network.online", true); //online/offline
|
pref("network.online", true); //online/offline
|
||||||
pref("network.cookie.cookieBehavior", 0); // 0-Accept, 1-dontAcceptForeign, 2-dontAcceptAny, 3-limitForeign
|
pref("network.cookie.cookieBehavior", 0); // 0-Accept, 1-dontAcceptForeign, 2-dontAcceptAny, 3-limitForeign
|
||||||
#ifdef ANDROID
|
|
||||||
pref("network.cookie.cookieBehavior", 0); // Keep the old default of accepting all cookies
|
|
||||||
#endif
|
|
||||||
pref("network.cookie.thirdparty.sessionOnly", false);
|
pref("network.cookie.thirdparty.sessionOnly", false);
|
||||||
pref("network.cookie.leave-secure-alone", true);
|
pref("network.cookie.leave-secure-alone", true);
|
||||||
pref("network.cookie.lifetimePolicy", 0); // 0-accept, 1-dontUse 2-acceptForSession, 3-acceptForNDays
|
pref("network.cookie.lifetimePolicy", 0); // 0-accept, 1-dontUse 2-acceptForSession, 3-acceptForNDays
|
||||||
|
|
@ -2079,12 +2052,8 @@ pref("intl.locale.matchOS", false);
|
||||||
pref("intl.fallbackCharsetList.ISO-8859-1", "windows-1252");
|
pref("intl.fallbackCharsetList.ISO-8859-1", "windows-1252");
|
||||||
pref("font.language.group", "chrome://global/locale/intl.properties");
|
pref("font.language.group", "chrome://global/locale/intl.properties");
|
||||||
|
|
||||||
// Android-specific pref to use key-events-only mode for IME-unaware webapps.
|
// Pref to use key-events-only mode for IME-unaware webapps. (legacy from android)
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
pref("intl.ime.hack.on_ime_unaware_apps.fire_key_events_for_composition", true);
|
|
||||||
#else
|
|
||||||
pref("intl.ime.hack.on_ime_unaware_apps.fire_key_events_for_composition", false);
|
pref("intl.ime.hack.on_ime_unaware_apps.fire_key_events_for_composition", false);
|
||||||
#endif
|
|
||||||
|
|
||||||
// If you use legacy Chinese IME which puts an ideographic space to composition
|
// If you use legacy Chinese IME which puts an ideographic space to composition
|
||||||
// string as placeholder, this pref might be useful. If this is true and when
|
// string as placeholder, this pref might be useful. If this is true and when
|
||||||
|
|
@ -3920,68 +3889,6 @@ pref("mousewheel.enable_pixel_scrolling", true);
|
||||||
# XP_MACOSX
|
# XP_MACOSX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
// Handled differently under Mac/Windows
|
|
||||||
pref("network.protocol-handler.warn-external.file", false);
|
|
||||||
pref("browser.drag_out_of_frame_style", 1);
|
|
||||||
|
|
||||||
// Middle-mouse handling
|
|
||||||
pref("middlemouse.paste", true);
|
|
||||||
pref("middlemouse.contentLoadURL", true);
|
|
||||||
pref("middlemouse.openNewWindow", true);
|
|
||||||
pref("middlemouse.scrollbarPosition", true);
|
|
||||||
|
|
||||||
pref("browser.urlbar.clickSelectsAll", false);
|
|
||||||
|
|
||||||
// Tab focus model bit field:
|
|
||||||
// 1 focuses text controls, 2 focuses other form elements, 4 adds links.
|
|
||||||
// Leave this at the default, 7, to match mozilla1.0-era user expectations.
|
|
||||||
// pref("accessibility.tabfocus", 1);
|
|
||||||
|
|
||||||
// autocomplete keyboard grab workaround
|
|
||||||
pref("autocomplete.grab_during_popup", true);
|
|
||||||
pref("autocomplete.ungrab_during_mode_switch", true);
|
|
||||||
|
|
||||||
// Default to using the system filepicker if possible, but allow
|
|
||||||
// toggling to use the XUL filepicker
|
|
||||||
pref("ui.allow_platform_file_picker", true);
|
|
||||||
|
|
||||||
pref("helpers.global_mime_types_file", "/etc/mime.types");
|
|
||||||
pref("helpers.global_mailcap_file", "/etc/mailcap");
|
|
||||||
pref("helpers.private_mime_types_file", "~/.mime.types");
|
|
||||||
pref("helpers.private_mailcap_file", "~/.mailcap");
|
|
||||||
pref("print.printer_list", ""); // list of printers, separated by spaces
|
|
||||||
pref("print.print_reversed", false);
|
|
||||||
pref("print.print_color", true);
|
|
||||||
pref("print.print_landscape", false);
|
|
||||||
pref("print.print_paper_size", 0);
|
|
||||||
|
|
||||||
// print_extra_margin enables platforms to specify an extra gap or margin
|
|
||||||
// around the content of the page for Print Preview only
|
|
||||||
pref("print.print_extra_margin", 0); // twips
|
|
||||||
|
|
||||||
/* PostScript print module prefs */
|
|
||||||
// pref("print.postscript.enabled", true);
|
|
||||||
|
|
||||||
// Setting default_level_parent to true makes the default level for popup
|
|
||||||
// windows "top" instead of "parent". On GTK2 platform, this is implemented
|
|
||||||
// with override-redirect windows which is the normal way to implement
|
|
||||||
// temporary popup windows. Setting this to false would make the default
|
|
||||||
// level "parent" which is implemented with managed windows.
|
|
||||||
// A problem with using managed windows is that metacity sometimes deactivates
|
|
||||||
// the parent window when the managed popup is shown.
|
|
||||||
pref("ui.panel.default_level_parent", true);
|
|
||||||
|
|
||||||
pref("mousewheel.system_scroll_override_on_root_content.enabled", false);
|
|
||||||
|
|
||||||
// Forward downloads with known OMA MIME types to Android's download manager
|
|
||||||
// instead of downloading them in the browser.
|
|
||||||
pref("browser.download.forward_oma_android_download_manager", false);
|
|
||||||
|
|
||||||
# ANDROID
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ANDROID
|
|
||||||
#ifndef XP_MACOSX
|
#ifndef XP_MACOSX
|
||||||
#ifdef XP_UNIX
|
#ifdef XP_UNIX
|
||||||
// Handled differently under Mac/Windows
|
// Handled differently under Mac/Windows
|
||||||
|
|
@ -4193,113 +4100,7 @@ pref("gfx.font_rendering.fontconfig.max_generic_substitutions", 3);
|
||||||
# XP_UNIX
|
# XP_UNIX
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(ANDROID)
|
|
||||||
|
|
||||||
pref("font.size.fixed.ar", 12);
|
|
||||||
|
|
||||||
pref("font.default.el", "sans-serif");
|
|
||||||
pref("font.size.fixed.el", 12);
|
|
||||||
|
|
||||||
pref("font.size.fixed.he", 12);
|
|
||||||
|
|
||||||
pref("font.default.x-cyrillic", "sans-serif");
|
|
||||||
pref("font.size.fixed.x-cyrillic", 12);
|
|
||||||
|
|
||||||
pref("font.default.x-unicode", "sans-serif");
|
|
||||||
pref("font.size.fixed.x-unicode", 12);
|
|
||||||
|
|
||||||
pref("font.default.x-western", "sans-serif");
|
|
||||||
pref("font.size.fixed.x-western", 12);
|
|
||||||
|
|
||||||
# ANDROID
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(ANDROID)
|
|
||||||
// We use the bundled fonts for Firefox for Android
|
|
||||||
|
|
||||||
pref("font.name-list.emoji", "Noto Color Emoji");
|
|
||||||
|
|
||||||
// ar
|
|
||||||
|
|
||||||
pref("font.name.serif.el", "Droid Serif"); // not Charis SIL Compact, only has a few Greek chars
|
|
||||||
pref("font.name.sans-serif.el", "Clear Sans");
|
|
||||||
pref("font.name.monospace.el", "Droid Sans Mono");
|
|
||||||
pref("font.name-list.serif.el", "Noto Serif");
|
|
||||||
pref("font.name-list.sans-serif.el", "Clear Sans, Roboto, Droid Sans");
|
|
||||||
|
|
||||||
pref("font.name.serif.he", "Droid Serif");
|
|
||||||
pref("font.name.sans-serif.he", "Clear Sans");
|
|
||||||
pref("font.name.monospace.he", "Droid Sans Mono");
|
|
||||||
pref("font.name-list.serif.he", "Noto Serif");
|
|
||||||
pref("font.name-list.sans-serif.he", "Droid Sans Hebrew, Clear Sans, Droid Sans");
|
|
||||||
|
|
||||||
pref("font.name.serif.ja", "Charis SIL Compact");
|
|
||||||
pref("font.name.sans-serif.ja", "Clear Sans");
|
|
||||||
pref("font.name.monospace.ja", "MotoyaLMaru");
|
|
||||||
pref("font.name-list.serif.ja", "Noto Serif, Droid Serif");
|
|
||||||
pref("font.name-list.sans-serif.ja", "Clear Sans, Roboto, Droid Sans, MotoyaLMaru, MotoyaLCedar, Noto Sans JP, Noto Sans CJK JP, Droid Sans Japanese");
|
|
||||||
pref("font.name-list.monospace.ja", "MotoyaLMaru, MotoyaLCedar, Droid Sans Mono CJK JP, Droid Sans Mono");
|
|
||||||
|
|
||||||
pref("font.name.serif.ko", "Charis SIL Compact");
|
|
||||||
pref("font.name.sans-serif.ko", "Clear Sans");
|
|
||||||
pref("font.name.monospace.ko", "Droid Sans Mono");
|
|
||||||
pref("font.name-list.serif.ko", "Noto Serif, Droid Serif, HYSerif");
|
|
||||||
pref("font.name-list.sans-serif.ko", "SmartGothic, NanumGothic, Noto Sans KR, Noto Sans CJK KR, DroidSansFallback, Droid Sans Fallback");
|
|
||||||
pref("font.name-list.monospace.ko", "Noto Sans Mono CJK KR");
|
|
||||||
|
|
||||||
pref("font.name.serif.th", "Charis SIL Compact");
|
|
||||||
pref("font.name.sans-serif.th", "Clear Sans");
|
|
||||||
pref("font.name.monospace.th", "Droid Sans Mono");
|
|
||||||
pref("font.name-list.serif.th", "Noto Serif, Droid Serif");
|
|
||||||
pref("font.name-list.sans-serif.th", "Droid Sans Thai, Clear Sans, Droid Sans");
|
|
||||||
|
|
||||||
pref("font.name.serif.x-cyrillic", "Charis SIL Compact");
|
|
||||||
pref("font.name.sans-serif.x-cyrillic", "Clear Sans");
|
|
||||||
pref("font.name.monospace.x-cyrillic", "Droid Sans Mono");
|
|
||||||
pref("font.name-list.serif.x-cyrillic", "Noto Serif, Droid Serif");
|
|
||||||
pref("font.name-list.sans-serif.x-cyrillic", "Clear Sans, Roboto, Droid Sans");
|
|
||||||
|
|
||||||
pref("font.name.serif.x-unicode", "Charis SIL Compact");
|
|
||||||
pref("font.name.sans-serif.x-unicode", "Clear Sans");
|
|
||||||
pref("font.name.monospace.x-unicode", "Droid Sans Mono");
|
|
||||||
pref("font.name-list.serif.x-unicode", "Noto Serif, Droid Serif");
|
|
||||||
pref("font.name-list.sans-serif.x-unicode", "Clear Sans, Roboto, Droid Sans");
|
|
||||||
|
|
||||||
pref("font.name.serif.x-western", "Charis SIL Compact");
|
|
||||||
pref("font.name.sans-serif.x-western", "Clear Sans");
|
|
||||||
pref("font.name.monospace.x-western", "Droid Sans Mono");
|
|
||||||
pref("font.name-list.serif.x-western", "Noto Serif, Droid Serif");
|
|
||||||
pref("font.name-list.sans-serif.x-western", "Clear Sans, Roboto, Droid Sans");
|
|
||||||
|
|
||||||
pref("font.name.serif.zh-CN", "Charis SIL Compact");
|
|
||||||
pref("font.name.sans-serif.zh-CN", "Clear Sans");
|
|
||||||
pref("font.name.monospace.zh-CN", "Droid Sans Mono");
|
|
||||||
pref("font.name-list.serif.zh-CN", "Noto Serif, Droid Serif, Droid Sans Fallback");
|
|
||||||
pref("font.name-list.sans-serif.zh-CN", "Roboto, Droid Sans, Noto Sans SC, Noto Sans CJK SC, Droid Sans Fallback");
|
|
||||||
pref("font.name-list.monospace.zh-CN", "Noto Sans Mono CJK SC, Droid Sans Fallback");
|
|
||||||
|
|
||||||
pref("font.name.serif.zh-HK", "Charis SIL Compact");
|
|
||||||
pref("font.name.sans-serif.zh-HK", "Clear Sans");
|
|
||||||
pref("font.name.monospace.zh-HK", "Droid Sans Mono");
|
|
||||||
pref("font.name-list.serif.zh-HK", "Noto Serif, Droid Serif, Droid Sans Fallback");
|
|
||||||
pref("font.name-list.sans-serif.zh-HK", "Roboto, Droid Sans, Noto Sans TC, Noto Sans SC, Noto Sans CJK TC, Droid Sans Fallback");
|
|
||||||
pref("font.name-list.monospace.zh-HK", "Noto Sans Mono CJK TC, Droid Sans Fallback");
|
|
||||||
|
|
||||||
pref("font.name.serif.zh-TW", "Charis SIL Compact");
|
|
||||||
pref("font.name.sans-serif.zh-TW", "Clear Sans");
|
|
||||||
pref("font.name.monospace.zh-TW", "Droid Sans Mono");
|
|
||||||
pref("font.name-list.serif.zh-TW", "Noto Serif, Droid Serif, Droid Sans Fallback");
|
|
||||||
pref("font.name-list.sans-serif.zh-TW", "Roboto, Droid Sans, Noto Sans TC, Noto Sans SC, Noto Sans CJK TC, Droid Sans Fallback");
|
|
||||||
pref("font.name-list.monospace.zh-TW", "Noto Sans Mono CJK TC, Droid Sans Fallback");
|
|
||||||
|
|
||||||
pref("font.name.serif.x-math", "Latin Modern Math");
|
|
||||||
pref("font.name-list.serif.x-math", "Latin Modern Math, XITS Math, Cambria Math, Libertinus Math, DejaVu Math TeX Gyre, TeX Gyre Bonum Math, TeX Gyre Pagella Math, TeX Gyre Schola, TeX Gyre Termes Math, STIX Math, Asana Math, STIXGeneral, DejaVu Serif, DejaVu Sans, Charis SIL Compact");
|
|
||||||
pref("font.name.sans-serif.x-math", "Clear Sans");
|
|
||||||
pref("font.name.monospace.x-math", "Droid Sans Mono");
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if OS_ARCH==AIX
|
#if OS_ARCH==AIX
|
||||||
|
|
||||||
|
|
@ -4436,12 +4237,7 @@ pref("canvas.image.cache.limit", 0);
|
||||||
pref("canvas.poisondata", false);
|
pref("canvas.poisondata", false);
|
||||||
|
|
||||||
// WebGL prefs
|
// WebGL prefs
|
||||||
#ifdef ANDROID
|
|
||||||
// Disable MSAA on mobile.
|
|
||||||
pref("gl.msaa-level", 0);
|
|
||||||
#else
|
|
||||||
pref("gl.msaa-level", 2);
|
pref("gl.msaa-level", 2);
|
||||||
#endif
|
|
||||||
pref("gl.require-hardware", false);
|
pref("gl.require-hardware", false);
|
||||||
#ifdef XP_MACOSX
|
#ifdef XP_MACOSX
|
||||||
pref("gl.multithreaded", true);
|
pref("gl.multithreaded", true);
|
||||||
|
|
@ -4536,13 +4332,7 @@ pref("layers.gpu-process.dev.enabled", true);
|
||||||
pref("layers.acceleration.draw-fps", false);
|
pref("layers.acceleration.draw-fps", false);
|
||||||
|
|
||||||
// Enable DEAA antialiasing for transformed layers in the compositor
|
// Enable DEAA antialiasing for transformed layers in the compositor
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
// Desktop prefs
|
|
||||||
pref("layers.deaa.enabled", true);
|
pref("layers.deaa.enabled", true);
|
||||||
#else
|
|
||||||
// Mobile prefs
|
|
||||||
pref("layers.deaa.enabled", false);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pref("layers.dump", false);
|
pref("layers.dump", false);
|
||||||
#ifdef MOZ_DUMP_PAINTING
|
#ifdef MOZ_DUMP_PAINTING
|
||||||
|
|
@ -4585,10 +4375,6 @@ pref("layers.tile-height", 512);
|
||||||
pref("layers.tiles.edge-padding", false);
|
pref("layers.tiles.edge-padding", false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
pref("layers.tiles.edge-padding", true);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Whether to animate simple opacity and transforms on the compositor
|
// Whether to animate simple opacity and transforms on the compositor
|
||||||
pref("layers.offmainthreadcomposition.async-animations", true);
|
pref("layers.offmainthreadcomposition.async-animations", true);
|
||||||
|
|
||||||
|
|
@ -4605,10 +4391,6 @@ pref("gfx.content.use-native-pushlayer", false);
|
||||||
|
|
||||||
pref("gfx.content.always-paint", false);
|
pref("gfx.content.always-paint", false);
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
pref("gfx.apitrace.enabled",false);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MOZ_X11
|
#ifdef MOZ_X11
|
||||||
pref("gfx.content.use-native-pushlayer", true);
|
pref("gfx.content.use-native-pushlayer", true);
|
||||||
#ifdef MOZ_WIDGET_GTK
|
#ifdef MOZ_WIDGET_GTK
|
||||||
|
|
@ -4842,12 +4624,8 @@ pref("layout.css.expensive-style-struct-assertions.enabled", false);
|
||||||
// enable JS dump() function.
|
// enable JS dump() function.
|
||||||
pref("browser.dom.window.dump.enabled", false);
|
pref("browser.dom.window.dump.enabled", false);
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
|
||||||
// Network Information API
|
// Network Information API
|
||||||
pref("dom.netinfo.enabled", true);
|
|
||||||
#else
|
|
||||||
pref("dom.netinfo.enabled", false);
|
pref("dom.netinfo.enabled", false);
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
// On 32-bit Windows, fire a low-memory notification if we have less than this
|
// On 32-bit Windows, fire a low-memory notification if we have less than this
|
||||||
|
|
@ -5311,11 +5089,7 @@ pref("reader.has_used_toolbar", false);
|
||||||
// Whether to use a vertical or horizontal toolbar.
|
// Whether to use a vertical or horizontal toolbar.
|
||||||
pref("reader.toolbar.vertical", true);
|
pref("reader.toolbar.vertical", true);
|
||||||
|
|
||||||
#if !defined(ANDROID)
|
|
||||||
pref("narrate.enabled", true);
|
pref("narrate.enabled", true);
|
||||||
#else
|
|
||||||
pref("narrate.enabled", false);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pref("narrate.test", false);
|
pref("narrate.test", false);
|
||||||
pref("narrate.rate", 0);
|
pref("narrate.rate", 0);
|
||||||
|
|
@ -5398,10 +5172,8 @@ pref("dom.maxHardwareConcurrency", 16);
|
||||||
// Shutdown the async osfile worker if it's no longer needed.
|
// Shutdown the async osfile worker if it's no longer needed.
|
||||||
pref("osfile.reset_worker_delay", 30000);
|
pref("osfile.reset_worker_delay", 30000);
|
||||||
|
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
pref("dom.webkitBlink.dirPicker.enabled", true);
|
pref("dom.webkitBlink.dirPicker.enabled", true);
|
||||||
pref("dom.webkitBlink.filesystem.enabled", true);
|
pref("dom.webkitBlink.filesystem.enabled", true);
|
||||||
#endif
|
|
||||||
|
|
||||||
pref("media.block-autoplay-until-in-foreground", true);
|
pref("media.block-autoplay-until-in-foreground", true);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1116,12 +1116,8 @@ TelemetryImpl::SnapshotSubsessionHistograms(bool clearSubsession,
|
||||||
JSContext *cx,
|
JSContext *cx,
|
||||||
JS::MutableHandle<JS::Value> ret)
|
JS::MutableHandle<JS::Value> ret)
|
||||||
{
|
{
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
return TelemetryHistogram::CreateHistogramSnapshots(cx, ret, true,
|
return TelemetryHistogram::CreateHistogramSnapshots(cx, ret, true,
|
||||||
clearSubsession);
|
clearSubsession);
|
||||||
#else
|
|
||||||
return NS_OK;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
|
|
||||||
|
|
@ -582,7 +582,6 @@ internal_GetHistogramByName(const nsACString &name, Histogram **ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This clones a histogram |existing| with the id |existingId| to a
|
* This clones a histogram |existing| with the id |existingId| to a
|
||||||
|
|
@ -670,7 +669,6 @@ internal_GetSubsessionHistogram(Histogram& existing)
|
||||||
cache[id] = clone;
|
cache[id] = clone;
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
internal_HistogramAdd(Histogram& histogram, int32_t value, uint32_t dataset)
|
internal_HistogramAdd(Histogram& histogram, int32_t value, uint32_t dataset)
|
||||||
|
|
@ -683,11 +681,9 @@ internal_HistogramAdd(Histogram& histogram, int32_t value, uint32_t dataset)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
if (Histogram* subsession = internal_GetSubsessionHistogram(histogram)) {
|
if (Histogram* subsession = internal_GetSubsessionHistogram(histogram)) {
|
||||||
subsession->Add(value);
|
subsession->Add(value);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// It is safe to add to the histogram now: the subsession histogram was already
|
// It is safe to add to the histogram now: the subsession histogram was already
|
||||||
// cloned from this so we won't add the sample twice.
|
// cloned from this so we won't add the sample twice.
|
||||||
|
|
@ -728,11 +724,9 @@ internal_HistogramClear(Histogram& aHistogram, bool onlySubsession)
|
||||||
aHistogram.Clear();
|
aHistogram.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
if (Histogram* subsession = internal_GetSubsessionHistogram(aHistogram)) {
|
if (Histogram* subsession = internal_GetSubsessionHistogram(aHistogram)) {
|
||||||
subsession->Clear();
|
subsession->Clear();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
@ -925,9 +919,7 @@ private:
|
||||||
typedef nsBaseHashtableET<nsCStringHashKey, Histogram*> KeyedHistogramEntry;
|
typedef nsBaseHashtableET<nsCStringHashKey, Histogram*> KeyedHistogramEntry;
|
||||||
typedef AutoHashtable<KeyedHistogramEntry> KeyedHistogramMapType;
|
typedef AutoHashtable<KeyedHistogramEntry> KeyedHistogramMapType;
|
||||||
KeyedHistogramMapType mHistogramMap;
|
KeyedHistogramMapType mHistogramMap;
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
KeyedHistogramMapType mSubsessionMap;
|
KeyedHistogramMapType mSubsessionMap;
|
||||||
#endif
|
|
||||||
|
|
||||||
static bool ReflectKeyedHistogram(KeyedHistogramEntry* entry,
|
static bool ReflectKeyedHistogram(KeyedHistogramEntry* entry,
|
||||||
JSContext* cx,
|
JSContext* cx,
|
||||||
|
|
@ -949,9 +941,7 @@ KeyedHistogram::KeyedHistogram(const nsACString &name,
|
||||||
uint32_t min, uint32_t max,
|
uint32_t min, uint32_t max,
|
||||||
uint32_t bucketCount, uint32_t dataset)
|
uint32_t bucketCount, uint32_t dataset)
|
||||||
: mHistogramMap()
|
: mHistogramMap()
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
, mSubsessionMap()
|
, mSubsessionMap()
|
||||||
#endif
|
|
||||||
, mName(name)
|
, mName(name)
|
||||||
, mExpiration(expiration)
|
, mExpiration(expiration)
|
||||||
, mHistogramType(histogramType)
|
, mHistogramType(histogramType)
|
||||||
|
|
@ -967,11 +957,7 @@ nsresult
|
||||||
KeyedHistogram::GetHistogram(const nsCString& key, Histogram** histogram,
|
KeyedHistogram::GetHistogram(const nsCString& key, Histogram** histogram,
|
||||||
bool subsession)
|
bool subsession)
|
||||||
{
|
{
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
KeyedHistogramMapType& map = subsession ? mSubsessionMap : mHistogramMap;
|
KeyedHistogramMapType& map = subsession ? mSubsessionMap : mHistogramMap;
|
||||||
#else
|
|
||||||
KeyedHistogramMapType& map = mHistogramMap;
|
|
||||||
#endif
|
|
||||||
KeyedHistogramEntry* entry = map.GetEntry(key);
|
KeyedHistogramEntry* entry = map.GetEntry(key);
|
||||||
if (entry) {
|
if (entry) {
|
||||||
*histogram = entry->mData;
|
*histogram = entry->mData;
|
||||||
|
|
@ -979,11 +965,9 @@ KeyedHistogram::GetHistogram(const nsCString& key, Histogram** histogram,
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCString histogramName;
|
nsCString histogramName;
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
if (subsession) {
|
if (subsession) {
|
||||||
histogramName.AppendLiteral(SUBSESSION_HISTOGRAM_PREFIX);
|
histogramName.AppendLiteral(SUBSESSION_HISTOGRAM_PREFIX);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
histogramName.Append(mName);
|
histogramName.Append(mName);
|
||||||
histogramName.AppendLiteral(KEYED_HISTOGRAM_NAME_SEPARATOR);
|
histogramName.AppendLiteral(KEYED_HISTOGRAM_NAME_SEPARATOR);
|
||||||
histogramName.Append(key);
|
histogramName.Append(key);
|
||||||
|
|
@ -1041,22 +1025,18 @@ KeyedHistogram::Add(const nsCString& key, uint32_t sample)
|
||||||
if (!histogram) {
|
if (!histogram) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
Histogram* subsession = GetHistogram(key, true);
|
Histogram* subsession = GetHistogram(key, true);
|
||||||
MOZ_ASSERT(subsession);
|
MOZ_ASSERT(subsession);
|
||||||
if (!subsession) {
|
if (!subsession) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!IsRecordingEnabled()) {
|
if (!IsRecordingEnabled()) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
histogram->Add(sample);
|
histogram->Add(sample);
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
subsession->Add(sample);
|
subsession->Add(sample);
|
||||||
#endif
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1067,7 +1047,6 @@ KeyedHistogram::Clear(bool onlySubsession)
|
||||||
if (!XRE_IsParentProcess()) {
|
if (!XRE_IsParentProcess()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
for (auto iter = mSubsessionMap.Iter(); !iter.Done(); iter.Next()) {
|
for (auto iter = mSubsessionMap.Iter(); !iter.Done(); iter.Next()) {
|
||||||
iter.Get()->mData->Clear();
|
iter.Get()->mData->Clear();
|
||||||
}
|
}
|
||||||
|
|
@ -1075,7 +1054,6 @@ KeyedHistogram::Clear(bool onlySubsession)
|
||||||
if (onlySubsession) {
|
if (onlySubsession) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
for (auto iter = mHistogramMap.Iter(); !iter.Done(); iter.Next()) {
|
for (auto iter = mHistogramMap.Iter(); !iter.Done(); iter.Next()) {
|
||||||
iter.Get()->mData->Clear();
|
iter.Get()->mData->Clear();
|
||||||
|
|
@ -1136,20 +1114,14 @@ nsresult
|
||||||
KeyedHistogram::GetJSSnapshot(JSContext* cx, JS::Handle<JSObject*> obj,
|
KeyedHistogram::GetJSSnapshot(JSContext* cx, JS::Handle<JSObject*> obj,
|
||||||
bool subsession, bool clearSubsession)
|
bool subsession, bool clearSubsession)
|
||||||
{
|
{
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
KeyedHistogramMapType& map = subsession ? mSubsessionMap : mHistogramMap;
|
KeyedHistogramMapType& map = subsession ? mSubsessionMap : mHistogramMap;
|
||||||
#else
|
|
||||||
KeyedHistogramMapType& map = mHistogramMap;
|
|
||||||
#endif
|
|
||||||
if (!map.ReflectIntoJS(&KeyedHistogram::ReflectKeyedHistogram, cx, obj)) {
|
if (!map.ReflectIntoJS(&KeyedHistogram::ReflectKeyedHistogram, cx, obj)) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
if (subsession && clearSubsession) {
|
if (subsession && clearSubsession) {
|
||||||
Clear(true);
|
Clear(true);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
@ -1636,7 +1608,6 @@ internal_JSHistogram_Clear(JSContext *cx, unsigned argc, JS::Value *vp)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool onlySubsession = false;
|
bool onlySubsession = false;
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
|
|
||||||
if (args.length() >= 1) {
|
if (args.length() >= 1) {
|
||||||
|
|
@ -1647,7 +1618,6 @@ internal_JSHistogram_Clear(JSContext *cx, unsigned argc, JS::Value *vp)
|
||||||
|
|
||||||
onlySubsession = JS::ToBoolean(args[0]);
|
onlySubsession = JS::ToBoolean(args[0]);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
Histogram *h = static_cast<Histogram*>(JS_GetPrivate(obj));
|
Histogram *h = static_cast<Histogram*>(JS_GetPrivate(obj));
|
||||||
MOZ_ASSERT(h);
|
MOZ_ASSERT(h);
|
||||||
|
|
@ -1873,16 +1843,13 @@ internal_JSKeyedHistogram_Snapshot(JSContext *cx, unsigned argc, JS::Value *vp)
|
||||||
return internal_KeyedHistogram_SnapshotImpl(cx, argc, vp, false, false);
|
return internal_KeyedHistogram_SnapshotImpl(cx, argc, vp, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
bool
|
bool
|
||||||
internal_JSKeyedHistogram_SubsessionSnapshot(JSContext *cx,
|
internal_JSKeyedHistogram_SubsessionSnapshot(JSContext *cx,
|
||||||
unsigned argc, JS::Value *vp)
|
unsigned argc, JS::Value *vp)
|
||||||
{
|
{
|
||||||
return internal_KeyedHistogram_SnapshotImpl(cx, argc, vp, true, false);
|
return internal_KeyedHistogram_SnapshotImpl(cx, argc, vp, true, false);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
bool
|
bool
|
||||||
internal_JSKeyedHistogram_SnapshotSubsessionAndClear(JSContext *cx,
|
internal_JSKeyedHistogram_SnapshotSubsessionAndClear(JSContext *cx,
|
||||||
unsigned argc,
|
unsigned argc,
|
||||||
|
|
@ -1895,7 +1862,6 @@ internal_JSKeyedHistogram_SnapshotSubsessionAndClear(JSContext *cx,
|
||||||
|
|
||||||
return internal_KeyedHistogram_SnapshotImpl(cx, argc, vp, true, true);
|
return internal_KeyedHistogram_SnapshotImpl(cx, argc, vp, true, true);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
internal_JSKeyedHistogram_Clear(JSContext *cx, unsigned argc, JS::Value *vp)
|
internal_JSKeyedHistogram_Clear(JSContext *cx, unsigned argc, JS::Value *vp)
|
||||||
|
|
@ -1910,7 +1876,6 @@ internal_JSKeyedHistogram_Clear(JSContext *cx, unsigned argc, JS::Value *vp)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
bool onlySubsession = false;
|
bool onlySubsession = false;
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
|
|
||||||
|
|
@ -1924,9 +1889,6 @@ internal_JSKeyedHistogram_Clear(JSContext *cx, unsigned argc, JS::Value *vp)
|
||||||
}
|
}
|
||||||
|
|
||||||
keyed->Clear(onlySubsession);
|
keyed->Clear(onlySubsession);
|
||||||
#else
|
|
||||||
keyed->Clear(false);
|
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1973,12 +1935,10 @@ internal_WrapAndReturnKeyedHistogram(KeyedHistogram *h, JSContext *cx,
|
||||||
if (!(JS_DefineFunction(cx, obj, "add", internal_JSKeyedHistogram_Add, 2, 0)
|
if (!(JS_DefineFunction(cx, obj, "add", internal_JSKeyedHistogram_Add, 2, 0)
|
||||||
&& JS_DefineFunction(cx, obj, "snapshot",
|
&& JS_DefineFunction(cx, obj, "snapshot",
|
||||||
internal_JSKeyedHistogram_Snapshot, 1, 0)
|
internal_JSKeyedHistogram_Snapshot, 1, 0)
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
&& JS_DefineFunction(cx, obj, "subsessionSnapshot",
|
&& JS_DefineFunction(cx, obj, "subsessionSnapshot",
|
||||||
internal_JSKeyedHistogram_SubsessionSnapshot, 1, 0)
|
internal_JSKeyedHistogram_SubsessionSnapshot, 1, 0)
|
||||||
&& JS_DefineFunction(cx, obj, "snapshotSubsessionAndClear",
|
&& JS_DefineFunction(cx, obj, "snapshotSubsessionAndClear",
|
||||||
internal_JSKeyedHistogram_SnapshotSubsessionAndClear, 0, 0)
|
internal_JSKeyedHistogram_SnapshotSubsessionAndClear, 0, 0)
|
||||||
#endif
|
|
||||||
&& JS_DefineFunction(cx, obj, "keys",
|
&& JS_DefineFunction(cx, obj, "keys",
|
||||||
internal_JSKeyedHistogram_Keys, 0, 0)
|
internal_JSKeyedHistogram_Keys, 0, 0)
|
||||||
&& JS_DefineFunction(cx, obj, "clear",
|
&& JS_DefineFunction(cx, obj, "clear",
|
||||||
|
|
@ -2419,14 +2379,12 @@ TelemetryHistogram::CreateHistogramSnapshots(JSContext *cx,
|
||||||
}
|
}
|
||||||
|
|
||||||
Histogram* original = h;
|
Histogram* original = h;
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
if (subsession) {
|
if (subsession) {
|
||||||
h = internal_GetSubsessionHistogram(*h);
|
h = internal_GetSubsessionHistogram(*h);
|
||||||
if (!h) {
|
if (!h) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
hobj = JS_NewPlainObject(cx);
|
hobj = JS_NewPlainObject(cx);
|
||||||
if (!hobj) {
|
if (!hobj) {
|
||||||
|
|
@ -2447,11 +2405,9 @@ TelemetryHistogram::CreateHistogramSnapshots(JSContext *cx,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(MOZ_WIDGET_ANDROID)
|
|
||||||
if (subsession && clearSubsession) {
|
if (subsession && clearSubsession) {
|
||||||
h->Clear();
|
h->Clear();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,8 +130,6 @@ MOZ_SAFE_BROWSING:
|
||||||
false,
|
false,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# NOTE! XP_LINUX has to go after MOZ_WIDGET_ANDROID otherwise Android
|
|
||||||
# builds will be misidentified as linux.
|
|
||||||
platform:
|
platform:
|
||||||
#ifdef MOZ_WIDGET_GTK
|
#ifdef MOZ_WIDGET_GTK
|
||||||
"linux",
|
"linux",
|
||||||
|
|
@ -139,8 +137,6 @@ MOZ_SAFE_BROWSING:
|
||||||
"win",
|
"win",
|
||||||
#elif XP_MACOSX
|
#elif XP_MACOSX
|
||||||
"macosx",
|
"macosx",
|
||||||
#elif MOZ_WIDGET_ANDROID
|
|
||||||
"android",
|
|
||||||
#elif XP_LINUX
|
#elif XP_LINUX
|
||||||
"linux",
|
"linux",
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue