mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge b2g-inbound to m-c.
This commit is contained in:
commit
2a22e940cd
@ -19,7 +19,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="0292e64ef8451df104dcf9ac3b2c6749b81684dd"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="65fba428f8d76336b33ddd9e15900357953600ba">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="0292e64ef8451df104dcf9ac3b2c6749b81684dd"/>
|
||||
|
@ -18,7 +18,7 @@
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/>
|
||||
|
@ -4,6 +4,6 @@
|
||||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "2fccee502f455ba2ca7178efa5cf247d90df8afb",
|
||||
"revision": "a0017eff21d39da46b6e8cf993f8fecf9ccb2af2",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/>
|
||||
|
36
b2g/config/mozconfigs/linux32_gecko/debug
Normal file
36
b2g/config/mozconfigs/linux32_gecko/debug
Normal file
@ -0,0 +1,36 @@
|
||||
. "$topsrcdir/b2g/config/mozconfigs/common"
|
||||
. "$topsrcdir/build/unix/mozconfig.linux32"
|
||||
|
||||
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
|
||||
ac_add_options --enable-update-packaging
|
||||
ac_add_options --enable-signmar
|
||||
ac_add_options --enable-debug
|
||||
|
||||
# Nightlies only since this has a cost in performance
|
||||
#ac_add_options --enable-js-diagnostics
|
||||
|
||||
# This will overwrite the default of stripping everything and keep the symbol table.
|
||||
# This is useful for profiling and debugging and only increases the package size
|
||||
# by 2 MBs.
|
||||
STRIP_FLAGS="--strip-debug"
|
||||
|
||||
# Needed to enable breakpad in application.ini
|
||||
export MOZILLA_OFFICIAL=1
|
||||
|
||||
export MOZ_TELEMETRY_REPORTING=1
|
||||
|
||||
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
|
||||
# DISABLED WHILE NOT ON TRY ac_add_options --enable-warnings-as-errors
|
||||
|
||||
# Use ccache
|
||||
. "$topsrcdir/build/mozconfig.cache"
|
||||
|
||||
#B2G options
|
||||
ac_add_options --enable-application=b2g
|
||||
ENABLE_MARIONETTE=1
|
||||
ac_add_options --disable-elf-hack
|
||||
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
|
||||
|
||||
GAIADIR=$topsrcdir/gaia
|
||||
|
||||
. "$topsrcdir/b2g/config/mozconfigs/common.override"
|
31
b2g/config/mozconfigs/win32_gecko/debug
Normal file
31
b2g/config/mozconfigs/win32_gecko/debug
Normal file
@ -0,0 +1,31 @@
|
||||
. "$topsrcdir/b2g/config/mozconfigs/common"
|
||||
|
||||
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
|
||||
ac_add_options --enable-update-packaging
|
||||
ac_add_options --enable-jemalloc
|
||||
ac_add_options --enable-signmar
|
||||
ac_add_options --enable-debug
|
||||
|
||||
# Nightlies only since this has a cost in performance
|
||||
ac_add_options --enable-js-diagnostics
|
||||
|
||||
# Needed to enable breakpad in application.ini
|
||||
export MOZILLA_OFFICIAL=1
|
||||
|
||||
export MOZ_TELEMETRY_REPORTING=1
|
||||
|
||||
if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then
|
||||
. $topsrcdir/build/win32/mozconfig.vs2010-win64
|
||||
else
|
||||
. $topsrcdir/build/win32/mozconfig.vs2010
|
||||
fi
|
||||
|
||||
# B2G Options
|
||||
ac_add_options --enable-application=b2g
|
||||
ENABLE_MARIONETTE=1
|
||||
|
||||
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
|
||||
|
||||
GAIADIR=$topsrcdir/gaia
|
||||
|
||||
. "$topsrcdir/b2g/config/mozconfigs/common.override"
|
@ -17,7 +17,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
|
||||
|
@ -849,7 +849,7 @@ MediaStreamGraphImpl::CreateOrDestroyAudioStreams(GraphTime aAudioOutputStartTim
|
||||
// match the system's ideal channel configuration.
|
||||
// NOTE: we presume this is either fast or async-under-the-covers
|
||||
audioOutputStream->mStream->Init(2, mSampleRate,
|
||||
AudioChannel::Normal,
|
||||
aStream->mAudioChannelType,
|
||||
AudioStream::LowLatency);
|
||||
audioOutputStream->mTrackID = tracks->GetID();
|
||||
|
||||
@ -1784,6 +1784,7 @@ MediaStream::MediaStream(DOMMediaStream* aWrapper)
|
||||
, mMainThreadFinished(false)
|
||||
, mMainThreadDestroyed(false)
|
||||
, mGraph(nullptr)
|
||||
, mAudioChannelType(dom::AudioChannel::Normal)
|
||||
{
|
||||
MOZ_COUNT_CTOR(MediaStream);
|
||||
// aWrapper should not already be connected to a MediaStream! It needs
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "nsAutoRef.h"
|
||||
#include "speex/speex_resampler.h"
|
||||
#include "AudioMixer.h"
|
||||
#include "mozilla/dom/AudioChannelBinding.h"
|
||||
|
||||
class nsIRunnable;
|
||||
|
||||
@ -524,6 +525,8 @@ public:
|
||||
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const;
|
||||
virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
void SetAudioChannelType(dom::AudioChannel aType) { mAudioChannelType = aType; }
|
||||
|
||||
protected:
|
||||
virtual void AdvanceTimeVaryingValuesToCurrentTime(GraphTime aCurrentTime, GraphTime aBlockedTime)
|
||||
{
|
||||
@ -650,6 +653,8 @@ protected:
|
||||
|
||||
// Our media stream graph
|
||||
MediaStreamGraphImpl* mGraph;
|
||||
|
||||
dom::AudioChannel mAudioChannelType;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -424,18 +424,6 @@ bool OmxDecoder::TryLoad() {
|
||||
|
||||
// read audio metadata
|
||||
if (mAudioSource.get()) {
|
||||
// For RTSP, we don't read the audio source for now.
|
||||
// The metadata of RTSP will be obtained through SDP at connection time.
|
||||
if (mResource->GetRtspPointer()) {
|
||||
sp<MetaData> meta = mAudioSource->getFormat();
|
||||
if (!meta->findInt32(kKeyChannelCount, &mAudioChannels) ||
|
||||
!meta->findInt32(kKeySampleRate, &mAudioSampleRate)) {
|
||||
NS_WARNING("Couldn't get audio metadata from OMX decoder");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// To reliably get the channel and sample rate data we need to read from the
|
||||
// audio source until we get a INFO_FORMAT_CHANGE status
|
||||
status_t err = mAudioSource->read(&mAudioBuffer);
|
||||
|
@ -303,11 +303,11 @@ nsresult
|
||||
RtspOmxReader::ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags)
|
||||
{
|
||||
SetActive();
|
||||
|
||||
nsresult rv = MediaOmxReader::ReadMetadata(aInfo, aTags);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
SetActive();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -65,15 +65,6 @@ public:
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Override FindStartTime() to return null pointer.
|
||||
// For Rtsp, we don't have the first video frame in DECODING_METADATA state.
|
||||
// It will be available until player request Play() and media decoder enters
|
||||
// DECODING state.
|
||||
virtual VideoData* FindStartTime(int64_t& aOutStartTime)
|
||||
MOZ_FINAL MOZ_OVERRIDE {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
virtual void SetIdle() MOZ_OVERRIDE;
|
||||
virtual void SetActive() MOZ_OVERRIDE;
|
||||
|
||||
|
@ -77,6 +77,7 @@ static float GetSampleRateForAudioContext(bool aIsOffline, float aSampleRate)
|
||||
|
||||
AudioContext::AudioContext(nsPIDOMWindow* aWindow,
|
||||
bool aIsOffline,
|
||||
AudioChannel aChannel,
|
||||
uint32_t aNumberOfChannels,
|
||||
uint32_t aLength,
|
||||
float aSampleRate)
|
||||
@ -92,8 +93,8 @@ AudioContext::AudioContext(nsPIDOMWindow* aWindow,
|
||||
|
||||
// Note: AudioDestinationNode needs an AudioContext that must already be
|
||||
// bound to the window.
|
||||
mDestination = new AudioDestinationNode(this, aIsOffline, aNumberOfChannels,
|
||||
aLength, aSampleRate);
|
||||
mDestination = new AudioDestinationNode(this, aIsOffline, aChannel,
|
||||
aNumberOfChannels, aLength, aSampleRate);
|
||||
// We skip calling SetIsOnlyNodeForContext during mDestination's constructor,
|
||||
// because we can only call SetIsOnlyNodeForContext after mDestination has
|
||||
// been set up.
|
||||
@ -137,6 +138,24 @@ AudioContext::Constructor(const GlobalObject& aGlobal,
|
||||
return object.forget();
|
||||
}
|
||||
|
||||
/* static */ already_AddRefed<AudioContext>
|
||||
AudioContext::Constructor(const GlobalObject& aGlobal,
|
||||
AudioChannel aChannel,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.GetAsSupports());
|
||||
if (!window) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsRefPtr<AudioContext> object = new AudioContext(window, false, aChannel);
|
||||
|
||||
RegisterWeakMemoryReporter(object);
|
||||
|
||||
return object.forget();
|
||||
}
|
||||
|
||||
/* static */ already_AddRefed<AudioContext>
|
||||
AudioContext::Constructor(const GlobalObject& aGlobal,
|
||||
uint32_t aNumberOfChannels,
|
||||
@ -162,6 +181,7 @@ AudioContext::Constructor(const GlobalObject& aGlobal,
|
||||
|
||||
nsRefPtr<AudioContext> object = new AudioContext(window,
|
||||
true,
|
||||
AudioChannel::Normal,
|
||||
aNumberOfChannels,
|
||||
aLength,
|
||||
aSampleRate);
|
||||
|
@ -67,6 +67,7 @@ class AudioContext MOZ_FINAL : public DOMEventTargetHelper,
|
||||
{
|
||||
AudioContext(nsPIDOMWindow* aParentWindow,
|
||||
bool aIsOffline,
|
||||
AudioChannel aChannel = AudioChannel::Normal,
|
||||
uint32_t aNumberOfChannels = 0,
|
||||
uint32_t aLength = 0,
|
||||
float aSampleRate = 0.0f);
|
||||
@ -95,6 +96,12 @@ public:
|
||||
static already_AddRefed<AudioContext>
|
||||
Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
|
||||
|
||||
// Constructor for regular AudioContext. A default audio channel is needed.
|
||||
static already_AddRefed<AudioContext>
|
||||
Constructor(const GlobalObject& aGlobal,
|
||||
AudioChannel aChannel,
|
||||
ErrorResult& aRv);
|
||||
|
||||
// Constructor for offline AudioContext
|
||||
static already_AddRefed<AudioContext>
|
||||
Constructor(const GlobalObject& aGlobal,
|
||||
|
@ -228,6 +228,7 @@ NS_IMPL_RELEASE_INHERITED(AudioDestinationNode, AudioNode)
|
||||
|
||||
AudioDestinationNode::AudioDestinationNode(AudioContext* aContext,
|
||||
bool aIsOffline,
|
||||
AudioChannel aChannel,
|
||||
uint32_t aNumberOfChannels,
|
||||
uint32_t aLength,
|
||||
float aSampleRate)
|
||||
@ -252,13 +253,13 @@ AudioDestinationNode::AudioDestinationNode(AudioContext* aContext,
|
||||
static_cast<AudioNodeEngine*>(new DestinationNodeEngine(this));
|
||||
|
||||
mStream = graph->CreateAudioNodeStream(engine, MediaStreamGraph::EXTERNAL_STREAM);
|
||||
mStream->SetAudioChannelType(aChannel);
|
||||
mStream->AddMainThreadListener(this);
|
||||
mStream->AddAudioOutput(&gWebAudioOutputKey);
|
||||
|
||||
AudioChannel channel = AudioChannelService::GetDefaultAudioChannel();
|
||||
if (channel != AudioChannel::Normal) {
|
||||
if (aChannel != AudioChannel::Normal) {
|
||||
ErrorResult rv;
|
||||
SetMozAudioChannelType(channel, rv);
|
||||
SetMozAudioChannelType(aChannel, rv);
|
||||
}
|
||||
|
||||
if (!aIsOffline && UseAudioChannelService()) {
|
||||
|
@ -30,6 +30,7 @@ public:
|
||||
// whether it's in offline mode.
|
||||
AudioDestinationNode(AudioContext* aContext,
|
||||
bool aIsOffline,
|
||||
AudioChannel aChannel = AudioChannel::Normal,
|
||||
uint32_t aNumberOfChannels = 0,
|
||||
uint32_t aLength = 0,
|
||||
float aSampleRate = 0.0f);
|
||||
|
@ -66,7 +66,7 @@ function test_preferences(aChannel) {
|
||||
SpecialPowers.pushPermissions(
|
||||
[{ "type": "audio-channel-" + aChannel, "allow": false, "context": document }],
|
||||
function() {
|
||||
var ac = new AudioContext();
|
||||
var ac = new AudioContext(aChannel);
|
||||
ok(ac, "AudioContext created");
|
||||
is(ac.mozAudioChannelType, aChannel, "Default ac channel == '" + aChannel + "'");
|
||||
runTest();
|
||||
|
@ -87,8 +87,8 @@ AudioChannelService::Shutdown()
|
||||
NS_IMPL_ISUPPORTS2(AudioChannelService, nsIObserver, nsITimerCallback)
|
||||
|
||||
AudioChannelService::AudioChannelService()
|
||||
: mCurrentHigherChannel(INT32_MAX)
|
||||
, mCurrentVisibleHigherChannel(INT32_MAX)
|
||||
: mCurrentHigherChannel(-1)
|
||||
, mCurrentVisibleHigherChannel(-1)
|
||||
, mPlayableHiddenContentChildID(CONTENT_PROCESS_ID_UNKNOWN)
|
||||
, mDisabled(false)
|
||||
, mDefChannelChildID(CONTENT_PROCESS_ID_UNKNOWN)
|
||||
|
18
dom/audiochannel/tests/AudioChannelChromeScript.js
Normal file
18
dom/audiochannel/tests/AudioChannelChromeScript.js
Normal file
@ -0,0 +1,18 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
|
||||
const { Services } = Cu.import('resource://gre/modules/Services.jsm');
|
||||
const { SystemAppProxy } = Cu.import('resource://gre/modules/SystemAppProxy.jsm');
|
||||
|
||||
addMessageListener('init-chrome-event', function(message) {
|
||||
// listen mozChromeEvent and forward to content process.
|
||||
let type = message.type;
|
||||
|
||||
SystemAppProxy.addEventListener('mozChromeEvent', function(event) {
|
||||
let details = event.detail;
|
||||
if (details.type === type) {
|
||||
sendAsyncMessage('chrome-event', details);
|
||||
}
|
||||
}, true);
|
||||
});
|
99
dom/audiochannel/tests/file_audio.html
Normal file
99
dom/audiochannel/tests/file_audio.html
Normal file
@ -0,0 +1,99 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test audio-channel-changed & visible-audio-channel-changed mozChromeEvent</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content"></div>
|
||||
<script>
|
||||
var normalAudio;
|
||||
var contentAudio;
|
||||
var notificationAudio;
|
||||
var alarmAudio;
|
||||
var telephonyAudio;
|
||||
var ringerAudio;
|
||||
var publicnotificationAudio;
|
||||
|
||||
function playWithAudioType(audio, type) {
|
||||
audio.mozAudioChannelType = type;
|
||||
audio.src = "test.ogg";
|
||||
audio.loop = true;
|
||||
|
||||
audio.play();
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
// normal channel.
|
||||
normalAudio = new Audio();
|
||||
playWithAudioType(normalAudio, 'normal');
|
||||
|
||||
// content channel.
|
||||
contentAudio = new Audio();
|
||||
playWithAudioType(contentAudio, 'content');
|
||||
|
||||
// notification channel.
|
||||
notificationAudio = new Audio();
|
||||
playWithAudioType(notificationAudio, 'notification');
|
||||
|
||||
// alarm channel.
|
||||
alarmAudio = new Audio();
|
||||
playWithAudioType(alarmAudio, 'alarm');
|
||||
|
||||
// telephony channel.
|
||||
telephonyAudio = new Audio();
|
||||
playWithAudioType(telephonyAudio, 'telephony');
|
||||
|
||||
// ringer channel.
|
||||
ringerAudio = new Audio();
|
||||
playWithAudioType(ringerAudio, 'ringer');
|
||||
|
||||
// publicnotification channel.
|
||||
publicnotificationAudio = new Audio();
|
||||
playWithAudioType(publicnotificationAudio, 'publicnotification');
|
||||
|
||||
window.addEventListener('hashchange', function(event) {
|
||||
if (location.hash == "#pauseAudio") {
|
||||
publicnotificationAudio.pause();
|
||||
ringerAudio.pause();
|
||||
telephonyAudio.pause();
|
||||
}
|
||||
|
||||
if (location.hash == "#pauseAudioFollowing") {
|
||||
alarmAudio.pause();
|
||||
notificationAudio.pause();
|
||||
contentAudio.pause();
|
||||
normalAudio.pause();
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
function checkBackgroundStatus() {
|
||||
if (location.hash == "#fg") {
|
||||
runTest();
|
||||
return;
|
||||
}
|
||||
|
||||
if (document.hidden) {
|
||||
runTest();
|
||||
return;
|
||||
}
|
||||
|
||||
document.addEventListener('visibilitychange', function visibilityChange() {
|
||||
if (document.hidden) {
|
||||
runTest();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
SpecialPowers.pushPermissions(
|
||||
[{ "type": "audio-channel-content", "allow": 1, "context": document },
|
||||
{ "type": "audio-channel-notification", "allow": 1, "context": document },
|
||||
{ "type": "audio-channel-alarm", "allow": 1, "context": document },
|
||||
{ "type": "audio-channel-telephony", "allow": 1, "context": document },
|
||||
{ "type": "audio-channel-ringer", "allow": 1, "context": document },
|
||||
{ "type": "audio-channel-publicnotification", "allow": 1, "context": document }],
|
||||
checkBackgroundStatus);
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
7
dom/audiochannel/tests/mochitest.ini
Normal file
7
dom/audiochannel/tests/mochitest.ini
Normal file
@ -0,0 +1,7 @@
|
||||
[DEFAULT]
|
||||
support-files =
|
||||
file_audio.html
|
||||
AudioChannelChromeScript.js
|
||||
|
||||
[test_audioChannelChange.html]
|
||||
skip-if = (toolkit != 'gonk')
|
@ -11,5 +11,7 @@ CPP_UNIT_TESTS += [
|
||||
if CONFIG['OS_ARCH'] == 'WINNT':
|
||||
DEFINES['NOMINMAX'] = True
|
||||
|
||||
MOCHITEST_MANIFESTS += ['mochitest.ini']
|
||||
|
||||
FAIL_ON_WARNINGS = True
|
||||
|
||||
|
209
dom/audiochannel/tests/test_audioChannelChange.html
Normal file
209
dom/audiochannel/tests/test_audioChannelChange.html
Normal file
@ -0,0 +1,209 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test audio-channel-changed & visible-audio-channel-changed mozChromeEvent</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content"></div>
|
||||
<script type="application/javascript;version=1.7">
|
||||
var expectedAudioTypes;
|
||||
var expectedVisibleAudioTypes;
|
||||
var expectedVisibleAudioType;
|
||||
var index;
|
||||
var visibleIndex;
|
||||
var iframe1;
|
||||
var normalAudio;
|
||||
|
||||
function playWithAudioType(audio, type) {
|
||||
audio.mozAudioChannelType = type;
|
||||
audio.src = "test.ogg";
|
||||
audio.loop = true;
|
||||
|
||||
audio.play();
|
||||
}
|
||||
|
||||
function fgBgTestListener(message) {
|
||||
var type = message.type;
|
||||
var channel = message.channel;
|
||||
|
||||
if (type == 'audio-channel-changed') {
|
||||
is(channel, expectedAudioTypes[index], channel + " is received and expected " + expectedAudioTypes[index]);
|
||||
index++;
|
||||
}
|
||||
|
||||
if (type == 'visible-audio-channel-changed') {
|
||||
is(channel, expectedVisibleAudioType, channel + " is received and expected " + expectedVisibleAudioType);
|
||||
}
|
||||
|
||||
// All audio types are playing now so ask to pause them.
|
||||
// This call will stop audio from highest to telephony.
|
||||
if ('cmd-pause' == expectedAudioTypes[index]) {
|
||||
iframe1.src = 'file_audio.html#pauseAudio';
|
||||
index++;
|
||||
}
|
||||
|
||||
// According to there is a 1.5 second delay of releasing telephony,
|
||||
// we need to wait for it then continue to pause others.
|
||||
if ('cmd-secondPause' == expectedAudioTypes[index]) {
|
||||
iframe1.src = 'file_audio.html#pauseAudioFollowing';
|
||||
index++;
|
||||
}
|
||||
|
||||
if (index == expectedAudioTypes.length) {
|
||||
document.body.removeChild(iframe1);
|
||||
script.removeMessageListener('chrome-event', fgBgTestListener);
|
||||
normalAudio.pause();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
|
||||
// Channel of visible-audio-channel-changed event should be always normal.
|
||||
// Audios in background should not effect visible-audio-channel-changed.
|
||||
function runFgBgTest() {
|
||||
expectedAudioTypes = ["normal", "content", "notification",
|
||||
"alarm", "telephony", "ringer", "publicnotification", "cmd-pause",
|
||||
"ringer", "telephony", "alarm", "cmd-secondPause", "notification",
|
||||
"content", "normal"];
|
||||
expectedVisibleAudioType = "normal";
|
||||
index = 0;
|
||||
|
||||
script.addMessageListener('chrome-event', fgBgTestListener);
|
||||
|
||||
// To play a audio with normal channel in the foreground.
|
||||
normalAudio = new Audio();
|
||||
playWithAudioType(normalAudio, 'normal');
|
||||
|
||||
iframe1.src = 'file_audio.html#bg';
|
||||
document.body.appendChild(iframe1);
|
||||
iframe1.setVisible(false);
|
||||
}
|
||||
|
||||
function bgTestListener(message) {
|
||||
var type = message.type;
|
||||
var channel = message.channel;
|
||||
|
||||
if (type == 'audio-channel-changed') {
|
||||
is(channel, expectedAudioTypes[index], channel + " is received and expected " + expectedAudioTypes[index]);
|
||||
index++;
|
||||
}
|
||||
|
||||
if (type == 'visible-audio-channel-changed') {
|
||||
is(channel, expectedVisibleAudioType, channel + " is received and expected " + expectedVisibleAudioType);
|
||||
}
|
||||
|
||||
// All audio types are playing now so ask to pause them.
|
||||
if ('cmd-pause' == expectedAudioTypes[index]) {
|
||||
iframe1.src = 'file_audio.html#pauseAudio';
|
||||
index++;
|
||||
}
|
||||
|
||||
if ('cmd-secondPause' == expectedAudioTypes[index]) {
|
||||
iframe1.src = 'file_audio.html#pauseAudioFollowing';
|
||||
index++;
|
||||
}
|
||||
|
||||
if (index == expectedAudioTypes.length) {
|
||||
document.body.removeChild(iframe1);
|
||||
script.removeMessageListener('chrome-event', bgTestListener);
|
||||
runFgBgTest();
|
||||
}
|
||||
}
|
||||
|
||||
// 1. Channel of visible-audio-channel-changed event should be always none.
|
||||
// 2. normal is not allowed to be played in the background.
|
||||
function runBgTest() {
|
||||
expectedAudioTypes = ["content", "notification",
|
||||
"alarm", "telephony", "ringer", "publicnotification", "cmd-pause",
|
||||
"ringer", "telephony", "alarm", "cmd-secondPause", "notification",
|
||||
"content", "none"];
|
||||
expectedVisibleAudioType = "none";
|
||||
index = 0;
|
||||
|
||||
script.addMessageListener('chrome-event', bgTestListener);
|
||||
|
||||
iframe1.src = 'file_audio.html#bg';
|
||||
document.body.appendChild(iframe1);
|
||||
iframe1.setVisible(false);
|
||||
}
|
||||
|
||||
function fgTestListener(message) {
|
||||
var type = message.type;
|
||||
var channel = message.channel;
|
||||
|
||||
if (type == 'audio-channel-changed') {
|
||||
is(channel, expectedAudioTypes[index], channel + " is received and expected " + expectedAudioTypes[index]);
|
||||
index++;
|
||||
}
|
||||
|
||||
if (type == 'visible-audio-channel-changed') {
|
||||
is(channel, expectedAudioTypes[visibleIndex], channel + " is received and expected " + expectedAudioTypes[visibleIndex]);
|
||||
visibleIndex++;
|
||||
}
|
||||
|
||||
// All audio types are playing now so ask to pause them.
|
||||
if ('cmd-pause' == expectedAudioTypes[visibleIndex] &&
|
||||
'cmd-pause' == expectedAudioTypes[index]) {
|
||||
iframe1.src = 'file_audio.html#pauseAudio';
|
||||
visibleIndex++;
|
||||
index++;
|
||||
}
|
||||
|
||||
if ('cmd-secondPause' == expectedAudioTypes[visibleIndex] &&
|
||||
'cmd-secondPause' == expectedAudioTypes[index]) {
|
||||
iframe1.src = 'file_audio.html#pauseAudioFollowing';
|
||||
visibleIndex++;
|
||||
index++;
|
||||
}
|
||||
|
||||
if (index == expectedAudioTypes.length && visibleIndex == expectedAudioTypes.length) {
|
||||
document.body.removeChild(iframe1);
|
||||
script.removeMessageListener('chrome-event', fgTestListener);
|
||||
runBgTest();
|
||||
}
|
||||
}
|
||||
|
||||
// The foreground audio will effect both of audio-channel-changed and
|
||||
// visible-audio-channel-changed.
|
||||
function runFgTest() {
|
||||
expectedAudioTypes = ["normal", "content", "notification",
|
||||
"alarm", "telephony", "ringer", "publicnotification",
|
||||
"cmd-pause", "ringer", "telephony", "alarm",
|
||||
"cmd-secondPause", "notification", "content",
|
||||
"normal", "none"];
|
||||
|
||||
index = 0;
|
||||
visibleIndex = 0;
|
||||
|
||||
script.addMessageListener('chrome-event', fgTestListener);
|
||||
|
||||
iframe1 = document.createElement('iframe');
|
||||
iframe1.setAttribute('mozbrowser', true);
|
||||
iframe1.src = 'file_audio.html#fg';
|
||||
document.body.appendChild(iframe1);
|
||||
}
|
||||
|
||||
var url = SimpleTest.getTestFileURL("AudioChannelChromeScript.js")
|
||||
var script = SpecialPowers.loadChromeScript(url);
|
||||
script.sendAsyncMessage("init-chrome-event", {
|
||||
type: 'audio-channel-changed'
|
||||
});
|
||||
script.sendAsyncMessage("init-chrome-event", {
|
||||
type: 'visible-audio-channel-changed'
|
||||
});
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
SpecialPowers.pushPermissions(
|
||||
[{ "type": "browser", "allow": 1, "context": document },
|
||||
{ "type": "embed-apps", "allow": 1, "context": document },
|
||||
{ "type": "webapps-manage", "allow": 1, "context": document }], function() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.ipc.browser_frames.oop_by_default", true],
|
||||
["media.useAudioChannelService", true],
|
||||
["dom.mozBrowserFramesEnabled", true]]}, runFgTest);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -81,9 +81,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "gSystemMessenger",
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gSystemWorkerManager",
|
||||
"@mozilla.org/telephony/system-worker-manager;1",
|
||||
"nsISystemWorkerManager");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gSettingsService",
|
||||
"@mozilla.org/settingsService;1",
|
||||
"nsISettingsService");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "UUIDGenerator",
|
||||
"@mozilla.org/uuid-generator;1",
|
||||
"nsIUUIDGenerator");
|
||||
@ -415,11 +412,8 @@ function Nfc() {
|
||||
this.worker.onerror = this.onerror.bind(this);
|
||||
this.worker.onmessage = this.onmessage.bind(this);
|
||||
|
||||
Services.obs.addObserver(this, NFC.TOPIC_MOZSETTINGS_CHANGED, false);
|
||||
|
||||
gMessageManager.init(this);
|
||||
let lock = gSettingsService.createLock();
|
||||
lock.get(NFC.SETTING_NFC_ENABLED, this);
|
||||
|
||||
// Maps sessionId (that are generated from nfcd) with a unique guid : 'SessionToken'
|
||||
this.sessionTokenMap = {};
|
||||
this.targetsByRequestId = {};
|
||||
@ -434,12 +428,11 @@ Nfc.prototype = {
|
||||
classDescription: "Nfc",
|
||||
interfaces: [Ci.nsIWorkerHolder]}),
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIWorkerHolder,
|
||||
Ci.nsIObserver,
|
||||
Ci.nsISettingsServiceCallback]),
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIWorkerHolder]),
|
||||
|
||||
_currentSessionId: null,
|
||||
_enabled: false,
|
||||
|
||||
powerLevel: NFC.NFC_POWER_LEVEL_UNKNOWN,
|
||||
|
||||
onerror: function onerror(event) {
|
||||
debug("Got an error: " + event.filename + ":" +
|
||||
@ -526,6 +519,10 @@ Nfc.prototype = {
|
||||
}
|
||||
delete this.targetsByRequestId[message.requestId];
|
||||
|
||||
if (message.status == NFC.GECKO_NFC_ERROR_SUCCESS) {
|
||||
this.powerLevel = message.powerLevel;
|
||||
}
|
||||
|
||||
target.sendAsyncMessage("NFC:ConfigResponse", message);
|
||||
break;
|
||||
case "ConnectResponse": // Fall through.
|
||||
@ -575,8 +572,8 @@ Nfc.prototype = {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!this._enabled) {
|
||||
debug("NFC is not enabled.");
|
||||
if (this.powerLevel != NFC.NFC_POWER_LEVEL_ENABLED) {
|
||||
debug("NFC is not enabled. current powerLevel:" + this.powerLevel);
|
||||
this.sendNfcErrorResponse(message);
|
||||
return null;
|
||||
}
|
||||
@ -630,35 +627,6 @@ Nfc.prototype = {
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* nsISettingsServiceCallback
|
||||
*/
|
||||
|
||||
handle: function handle(aName, aResult) {
|
||||
switch(aName) {
|
||||
case NFC.SETTING_NFC_ENABLED:
|
||||
debug("'nfc.enabled' is now " + aResult);
|
||||
this._enabled = aResult;
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* nsIObserver
|
||||
*/
|
||||
|
||||
observe: function observe(subject, topic, data) {
|
||||
switch (topic) {
|
||||
case NFC.TOPIC_MOZSETTINGS_CHANGED:
|
||||
let setting = JSON.parse(data);
|
||||
if (setting) {
|
||||
let setting = JSON.parse(data);
|
||||
this.handle(setting.key, setting.value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
setConfig: function setConfig(prop) {
|
||||
this.sendToWorker("config", prop);
|
||||
}
|
||||
|
@ -66,9 +66,7 @@ this.NFC_POWER_LEVEL_DISABLED = 0;
|
||||
this.NFC_POWER_LEVEL_LOW = 1;
|
||||
this.NFC_POWER_LEVEL_ENABLED = 2;
|
||||
|
||||
this.TOPIC_MOZSETTINGS_CHANGED = "mozsettings-changed";
|
||||
this.TOPIC_XPCOM_SHUTDOWN = "xpcom-shutdown";
|
||||
this.SETTING_NFC_ENABLED = "nfc.enabled";
|
||||
|
||||
this.NFC_PEER_EVENT_READY = 0x01;
|
||||
this.NFC_PEER_EVENT_LOST = 0x02;
|
||||
|
@ -1498,6 +1498,11 @@ RilObject.prototype = {
|
||||
},
|
||||
|
||||
sendDialRequest: function(options) {
|
||||
// Always succeed.
|
||||
options.success = true;
|
||||
this.sendChromeMessage(options);
|
||||
this._createPendingOutgoingCall(options);
|
||||
|
||||
let Buf = this.context.Buf;
|
||||
Buf.newParcel(options.request, options);
|
||||
Buf.writeString(options.number);
|
||||
@ -1541,6 +1546,7 @@ RilObject.prototype = {
|
||||
|
||||
let callIndex = call.callIndex;
|
||||
if (callIndex === OUTGOING_PLACEHOLDER_CALL_INDEX) {
|
||||
if (DEBUG) this.context.debug("Hang up pending outgoing call.");
|
||||
this._removeVoiceCall(call, GECKO_CALL_ERROR_NORMAL_CALL_CLEARING);
|
||||
return;
|
||||
}
|
||||
@ -3846,14 +3852,14 @@ RilObject.prototype = {
|
||||
}
|
||||
|
||||
if (pendingOutgoingCall) {
|
||||
// We don't get a successful call for pendingOutgoingCall.
|
||||
if (!newCalls || Object.keys(newCalls).length === 0) {
|
||||
if (DEBUG) this.context.debug("No result for pending outgoing call.");
|
||||
pendingOutgoingCall.failCause = GECKO_CALL_ERROR_UNSPECIFIED;
|
||||
this._handleDisconnectedCall(pendingOutgoingCall);
|
||||
// We don't get a successful call for pendingOutgoingCall.
|
||||
this._removePendingOutgoingCall(GECKO_CALL_ERROR_UNSPECIFIED);
|
||||
} else {
|
||||
// Only remove it from currentCalls map. Will use the new call to
|
||||
// replace the placeholder.
|
||||
delete this.currentCalls[OUTGOING_PLACEHOLDER_CALL_INDEX];
|
||||
}
|
||||
|
||||
delete this.currentCalls[OUTGOING_PLACEHOLDER_CALL_INDEX];
|
||||
}
|
||||
|
||||
// Go through any remaining calls that are new to us.
|
||||
@ -3866,7 +3872,7 @@ RilObject.prototype = {
|
||||
(newCall.state === CALL_STATE_DIALING ||
|
||||
newCall.state === CALL_STATE_ALERTING)) {
|
||||
// Receive a new outgoing call which is already hung up by user.
|
||||
if (DEBUG) this.context.debug("Hang up pending outgoing call");
|
||||
if (DEBUG) this.context.debug("Pending outgoing call is hung up by user.");
|
||||
this.sendHangUpRequest(newCall.callIndex);
|
||||
} else {
|
||||
this._addNewVoiceCall(newCall);
|
||||
@ -3933,6 +3939,25 @@ RilObject.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
_createPendingOutgoingCall: function(options) {
|
||||
if (DEBUG) this.context.debug("Create a pending outgoing call.");
|
||||
this._addNewVoiceCall({
|
||||
number: options.number,
|
||||
state: CALL_STATE_DIALING,
|
||||
callIndex: OUTGOING_PLACEHOLDER_CALL_INDEX
|
||||
});
|
||||
},
|
||||
|
||||
_removePendingOutgoingCall: function(failCause) {
|
||||
let call = this.currentCalls[OUTGOING_PLACEHOLDER_CALL_INDEX];
|
||||
if (!call) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (DEBUG) this.context.debug("Remove pending outgoing call.");
|
||||
this._removeVoiceCall(pendingOutgoingCall, failCause);
|
||||
},
|
||||
|
||||
_ensureConference: function() {
|
||||
let oldState = this.currentConference.state;
|
||||
let remaining = Object.keys(this.currentConference.participants);
|
||||
@ -5329,24 +5354,14 @@ RilObject.prototype[REQUEST_GET_CURRENT_CALLS] = function REQUEST_GET_CURRENT_CA
|
||||
this._processCalls(calls);
|
||||
};
|
||||
RilObject.prototype[REQUEST_DIAL] = function REQUEST_DIAL(length, options) {
|
||||
options.success = (options.rilRequestError === 0);
|
||||
if (options.success) {
|
||||
this.sendChromeMessage(options);
|
||||
|
||||
// Create a pending outgoing call.
|
||||
if (DEBUG) this.context.debug("Create a pending outgoing call.");
|
||||
this._addNewVoiceCall({
|
||||
number: options.number,
|
||||
state: CALL_STATE_DIALING,
|
||||
callIndex: OUTGOING_PLACEHOLDER_CALL_INDEX
|
||||
});
|
||||
} else {
|
||||
this.getFailCauseCode((function(options, failCause) {
|
||||
options.errorMsg = failCause;
|
||||
this.sendChromeMessage(options);
|
||||
}).bind(this, options));
|
||||
// We already return a successful response before. Don't respond it again!
|
||||
if (options.rilRequestError) {
|
||||
this.getFailCauseCode((function(failCause) {
|
||||
this._removePendingOutgoingCall(failCause);
|
||||
}).bind(this));
|
||||
}
|
||||
};
|
||||
RilObject.prototype[REQUEST_DIAL_EMERGENCY_CALL] = RilObject.prototype[REQUEST_DIAL];
|
||||
RilObject.prototype[REQUEST_GET_IMSI] = function REQUEST_GET_IMSI(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
return;
|
||||
|
@ -13,7 +13,8 @@
|
||||
callback DecodeSuccessCallback = void (AudioBuffer decodedData);
|
||||
callback DecodeErrorCallback = void ();
|
||||
|
||||
[Constructor]
|
||||
[Constructor,
|
||||
Constructor(AudioChannel audioChannelType)]
|
||||
interface AudioContext : EventTarget {
|
||||
|
||||
readonly attribute AudioDestinationNode destination;
|
||||
@ -28,7 +29,7 @@ interface AudioContext : EventTarget {
|
||||
DecodeSuccessCallback successCallback,
|
||||
optional DecodeErrorCallback errorCallback);
|
||||
|
||||
// AudioNode creation
|
||||
// AudioNode creation
|
||||
[NewObject]
|
||||
AudioBufferSourceNode createBufferSource();
|
||||
|
||||
|
@ -558,6 +558,7 @@ var WifiManager = (function() {
|
||||
// Tell the event worker to start waiting for events.
|
||||
retryTimer = null;
|
||||
connectTries = 0;
|
||||
recvErrors = 0;
|
||||
manager.connectToSupplicant = true;
|
||||
didConnectSupplicant(function(){});
|
||||
return;
|
||||
@ -735,8 +736,8 @@ var WifiManager = (function() {
|
||||
if (eventData.indexOf("CTRL-EVENT-TERMINATING") === 0) {
|
||||
// As long the monitor socket is not closed and we haven't seen too many
|
||||
// recv errors yet, we will keep going for a bit longer.
|
||||
if (eventData.indexOf("connection closed") === -1 &&
|
||||
eventData.indexOf("recv error") !== -1 && ++recvErrors < 10)
|
||||
if (event.indexOf("connection closed") === -1 &&
|
||||
event.indexOf("recv error") !== -1 && ++recvErrors < 10)
|
||||
return true;
|
||||
|
||||
notifyStateChange({ state: "DISCONNECTED", BSSID: null, id: -1 });
|
||||
|
Loading…
Reference in New Issue
Block a user