mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Merge mozilla-central and b2g-inbound
This commit is contained in:
commit
06c5cf0668
@ -21,6 +21,10 @@ XPCOMUtils.defineLazyGetter(this, "libcutils", function () {
|
||||
});
|
||||
#endif
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "uuidgen",
|
||||
"@mozilla.org/uuid-generator;1",
|
||||
"nsIUUIDGenerator");
|
||||
|
||||
// Once Bug 731746 - Allow chrome JS object to implement nsIDOMEventTarget
|
||||
// is resolved this helper could be removed.
|
||||
var SettingsListener = {
|
||||
@ -521,6 +525,14 @@ SettingsListener.observe('privacy.donottrackheader.enabled', false, function(val
|
||||
|
||||
SettingsListener.observe('privacy.donottrackheader.value', 1, function(value) {
|
||||
Services.prefs.setIntPref('privacy.donottrackheader.value', value);
|
||||
// If the user specifically disallows tracking, we set the value of
|
||||
// app.update.custom (update tracking ID) to an empty string.
|
||||
if (value == 1) {
|
||||
Services.prefs.setCharPref('app.update.custom', '');
|
||||
return;
|
||||
}
|
||||
// Otherwise, we assure that the update tracking ID exists.
|
||||
setUpdateTrackingId();
|
||||
});
|
||||
|
||||
// =================== Crash Reporting ====================
|
||||
@ -537,6 +549,39 @@ SettingsListener.observe('app.reportCrashes', 'ask', function(value) {
|
||||
});
|
||||
|
||||
// ================ Updates ================
|
||||
/**
|
||||
* For tracking purposes some partners require us to add an UUID to the
|
||||
* update URL. The update tracking ID will be an empty string if the
|
||||
* do-not-track feature specifically disallows tracking and it is reseted
|
||||
* to a different ID if the do-not-track value changes from disallow to allow.
|
||||
*/
|
||||
function setUpdateTrackingId() {
|
||||
try {
|
||||
let dntEnabled = Services.prefs.getBoolPref('privacy.donottrackheader.enabled');
|
||||
let dntValue = Services.prefs.getIntPref('privacy.donottrackheader.value');
|
||||
// If the user specifically decides to disallow tracking (1), we just bail out.
|
||||
if (dntEnabled && (dntValue == 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
let trackingId =
|
||||
Services.prefs.getPrefType('app.update.custom') ==
|
||||
Ci.nsIPrefBranch.PREF_STRING &&
|
||||
Services.prefs.getCharPref('app.update.custom');
|
||||
|
||||
// If there is no previous registered tracking ID, we generate a new one.
|
||||
// This should only happen on first usage or after changing the
|
||||
// do-not-track value from disallow to allow.
|
||||
if (!trackingId) {
|
||||
trackingId = uuidgen.generateUUID().toString().replace(/[{}]/g, "");
|
||||
Services.prefs.setCharPref('app.update.custom', trackingId);
|
||||
}
|
||||
} catch(e) {
|
||||
dump('Error getting tracking ID ' + e + '\n');
|
||||
}
|
||||
}
|
||||
setUpdateTrackingId();
|
||||
|
||||
SettingsListener.observe('app.update.interval', 86400, function(value) {
|
||||
Services.prefs.setIntPref('app.update.interval', value);
|
||||
});
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"revision": "f1f4304e9f2fe7bcf79b1e6ead334706c119ac4a",
|
||||
"revision": "94fca24c87ab20a96fe6927d234ccc98518ce416",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -83,10 +83,10 @@ USING_BLUETOOTH_NAMESPACE
|
||||
|
||||
namespace {
|
||||
|
||||
StaticRefPtr<BluetoothService> gBluetoothService;
|
||||
StaticRefPtr<BluetoothService> sBluetoothService;
|
||||
|
||||
bool gInShutdown = false;
|
||||
bool gToggleInProgress = false;
|
||||
bool sInShutdown = false;
|
||||
bool sToggleInProgress = false;
|
||||
|
||||
bool
|
||||
IsMainProcess()
|
||||
@ -145,26 +145,26 @@ public:
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
NS_ENSURE_TRUE(gBluetoothService, NS_OK);
|
||||
NS_ENSURE_TRUE(sBluetoothService, NS_OK);
|
||||
|
||||
if (gInShutdown) {
|
||||
gBluetoothService = nullptr;
|
||||
if (sInShutdown) {
|
||||
sBluetoothService = nullptr;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Update mEnabled of BluetoothService object since
|
||||
// StartInternal/StopInternal have been already done.
|
||||
gBluetoothService->SetEnabled(mEnabled);
|
||||
gToggleInProgress = false;
|
||||
sBluetoothService->SetEnabled(mEnabled);
|
||||
sToggleInProgress = false;
|
||||
|
||||
nsAutoString signalName;
|
||||
signalName = mEnabled ? NS_LITERAL_STRING("Enabled")
|
||||
: NS_LITERAL_STRING("Disabled");
|
||||
BluetoothSignal signal(signalName, NS_LITERAL_STRING(KEY_MANAGER), true);
|
||||
gBluetoothService->DistributeSignal(signal);
|
||||
sBluetoothService->DistributeSignal(signal);
|
||||
|
||||
// Event 'AdapterAdded' has to be fired after firing 'Enabled'
|
||||
gBluetoothService->TryFiringAdapterAdded();
|
||||
sBluetoothService->TryFiringAdapterAdded();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -189,7 +189,7 @@ public:
|
||||
|
||||
/**
|
||||
* mEnabled: expected status of bluetooth
|
||||
* gBluetoothService->IsEnabled(): real status of bluetooth
|
||||
* sBluetoothService->IsEnabled(): real status of bluetooth
|
||||
*
|
||||
* When two values are the same, we don't switch on/off bluetooth
|
||||
* but we still do ToggleBtAck task. One special case happens at startup
|
||||
@ -198,17 +198,17 @@ public:
|
||||
*
|
||||
* Please see bug 892392 for more information.
|
||||
*/
|
||||
if (!mIsStartup && mEnabled == gBluetoothService->IsEnabledInternal()) {
|
||||
if (!mIsStartup && mEnabled == sBluetoothService->IsEnabledInternal()) {
|
||||
BT_WARNING("Bluetooth has already been enabled/disabled before.");
|
||||
} else {
|
||||
// Switch on/off bluetooth
|
||||
if (mEnabled) {
|
||||
if (NS_FAILED(gBluetoothService->StartInternal())) {
|
||||
if (NS_FAILED(sBluetoothService->StartInternal())) {
|
||||
BT_WARNING("Bluetooth service failed to start!");
|
||||
mEnabled = !mEnabled;
|
||||
}
|
||||
} else {
|
||||
if (NS_FAILED(gBluetoothService->StopInternal())) {
|
||||
if (NS_FAILED(sBluetoothService->StopInternal())) {
|
||||
BT_WARNING("Bluetooth service failed to stop!");
|
||||
mEnabled = !mEnabled;
|
||||
}
|
||||
@ -257,8 +257,8 @@ public:
|
||||
|
||||
// It is theoretically possible to shut down before the first settings check
|
||||
// has completed (though extremely unlikely).
|
||||
if (gBluetoothService) {
|
||||
return gBluetoothService->HandleStartupSettingsCheck(aResult.toBoolean());
|
||||
if (sBluetoothService) {
|
||||
return sBluetoothService->HandleStartupSettingsCheck(aResult.toBoolean());
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@ -278,7 +278,7 @@ NS_IMPL_ISUPPORTS1(BluetoothService, nsIObserver)
|
||||
bool
|
||||
BluetoothService::IsToggling() const
|
||||
{
|
||||
return gToggleInProgress;
|
||||
return sToggleInProgress;
|
||||
}
|
||||
|
||||
BluetoothService::~BluetoothService()
|
||||
@ -463,7 +463,7 @@ BluetoothService::StartStopBluetooth(bool aStart, bool aIsStartup)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (gInShutdown) {
|
||||
if (sInShutdown) {
|
||||
if (aStart) {
|
||||
// Don't try to start if we're already shutting down.
|
||||
MOZ_ASSERT(false, "Start called while in shutdown!");
|
||||
@ -547,8 +547,8 @@ BluetoothService::SetEnabled(bool aEnabled)
|
||||
* aEnabled: expected status of bluetooth
|
||||
*/
|
||||
if (mEnabled == aEnabled) {
|
||||
BT_WARNING("Bluetooth has already been enabled/disabled before\
|
||||
or the toggling is failed.");
|
||||
BT_WARNING("Bluetooth has already been enabled/disabled before"
|
||||
"or the toggling is failed.");
|
||||
}
|
||||
|
||||
mEnabled = aEnabled;
|
||||
@ -558,7 +558,7 @@ nsresult
|
||||
BluetoothService::HandleStartup()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(!gToggleInProgress);
|
||||
MOZ_ASSERT(!sToggleInProgress);
|
||||
|
||||
nsCOMPtr<nsISettingsService> settings =
|
||||
do_GetService("@mozilla.org/settingsService;1");
|
||||
@ -572,7 +572,7 @@ BluetoothService::HandleStartup()
|
||||
rv = settingsLock->Get(BLUETOOTH_ENABLED_SETTING, callback);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
gToggleInProgress = true;
|
||||
sToggleInProgress = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -659,12 +659,12 @@ BluetoothService::HandleSettingsChanged(const nsAString& aData)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
if (gToggleInProgress || value.toBoolean() == IsEnabled()) {
|
||||
if (sToggleInProgress || value.toBoolean() == IsEnabled()) {
|
||||
// Nothing to do here.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
gToggleInProgress = true;
|
||||
sToggleInProgress = true;
|
||||
|
||||
nsresult rv = StartStopBluetooth(value.toBoolean(), false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -682,7 +682,7 @@ BluetoothService::HandleShutdown()
|
||||
// bluetooth is going away, and then we wait for them to acknowledge. Then we
|
||||
// close down all the bluetooth machinery.
|
||||
|
||||
gInShutdown = true;
|
||||
sInShutdown = true;
|
||||
|
||||
Cleanup();
|
||||
|
||||
@ -745,12 +745,12 @@ BluetoothService::Get()
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
// If we already exist, exit early
|
||||
if (gBluetoothService) {
|
||||
return gBluetoothService;
|
||||
if (sBluetoothService) {
|
||||
return sBluetoothService;
|
||||
}
|
||||
|
||||
// If we're in shutdown, don't create a new instance
|
||||
if (gInShutdown) {
|
||||
if (sInShutdown) {
|
||||
BT_WARNING("BluetoothService can't be created during shutdown");
|
||||
return nullptr;
|
||||
}
|
||||
@ -764,8 +764,8 @@ BluetoothService::Get()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
gBluetoothService = service;
|
||||
return gBluetoothService;
|
||||
sBluetoothService = service;
|
||||
return sBluetoothService;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -570,9 +570,12 @@ BluetoothHfpManager::ProcessVolumeControl(bthf_volume_type_t aType,
|
||||
if (aType == BTHF_VOLUME_TYPE_MIC) {
|
||||
mCurrentVgm = aVolume;
|
||||
} else if (aType == BTHF_VOLUME_TYPE_SPK) {
|
||||
// Adjust volume by headset
|
||||
mReceiveVgsFlag = true;
|
||||
NS_ENSURE_TRUE_VOID(aVolume != mCurrentVgs);
|
||||
|
||||
if (aVolume == mCurrentVgs) {
|
||||
// Keep current volume
|
||||
return;
|
||||
}
|
||||
|
||||
nsString data;
|
||||
data.AppendInt(aVolume);
|
||||
@ -851,10 +854,7 @@ BluetoothHfpManager::HandleVoiceConnectionChanged(uint32_t aClientId)
|
||||
// Signal
|
||||
JS::Value value;
|
||||
voiceInfo->GetRelSignalStrength(&value);
|
||||
if (!value.isNumber()) {
|
||||
BT_WARNING("Failed to get relSignalStrength in BluetoothHfpManager");
|
||||
return;
|
||||
}
|
||||
NS_ENSURE_TRUE_VOID(value.isNumber());
|
||||
mSignal = (int)ceil(value.toNumber() / 20.0);
|
||||
|
||||
UpdateDeviceCIND();
|
||||
|
@ -37,12 +37,6 @@ public:
|
||||
aName.AssignLiteral("OPP");
|
||||
}
|
||||
|
||||
/*
|
||||
* Channel of reserved services are fixed values, please check
|
||||
* function add_reserved_service_records() in
|
||||
* external/bluetooth/bluez/src/adapter.c for more information.
|
||||
*/
|
||||
static const int DEFAULT_OPP_CHANNEL = 10;
|
||||
static const int MAX_PACKET_LENGTH = 0xFFFE;
|
||||
|
||||
virtual ~BluetoothOppManager();
|
||||
|
@ -605,10 +605,12 @@ BluetoothSocket::Connect(const nsAString& aDeviceAddress, int aChannel)
|
||||
// TODO: uuid as argument
|
||||
int fd;
|
||||
NS_ENSURE_TRUE(BT_STATUS_SUCCESS ==
|
||||
sBluetoothSocketInterface->connect((bt_bdaddr_t *) &remoteBdAddress,
|
||||
(btsock_type_t) BTSOCK_RFCOMM,
|
||||
sBluetoothSocketInterface->connect(&remoteBdAddress,
|
||||
BTSOCK_RFCOMM,
|
||||
UUID_OBEX_OBJECT_PUSH,
|
||||
aChannel, &fd, (mAuth << 1) | mEncrypt),
|
||||
aChannel,
|
||||
&fd,
|
||||
(mAuth << 1) | mEncrypt),
|
||||
false);
|
||||
NS_ENSURE_TRUE(fd >= 0, false);
|
||||
|
||||
@ -626,10 +628,12 @@ BluetoothSocket::Listen(int aChannel)
|
||||
nsAutoCString serviceName("OBEX Object Push");
|
||||
int fd;
|
||||
NS_ENSURE_TRUE(BT_STATUS_SUCCESS ==
|
||||
sBluetoothSocketInterface->listen((btsock_type_t) BTSOCK_RFCOMM,
|
||||
sBluetoothSocketInterface->listen(BTSOCK_RFCOMM,
|
||||
serviceName.get(),
|
||||
UUID_OBEX_OBJECT_PUSH,
|
||||
aChannel, &fd, (mAuth << 1) | mEncrypt),
|
||||
aChannel,
|
||||
&fd,
|
||||
(mAuth << 1) | mEncrypt),
|
||||
false);
|
||||
NS_ENSURE_TRUE(fd >= 0, false);
|
||||
|
||||
|
@ -666,9 +666,12 @@ static nsresult
|
||||
StartStopGonkBluetooth(bool aShouldEnable)
|
||||
{
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
|
||||
NS_ENSURE_TRUE(sBtInterface, NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(sIsBtEnabled != aShouldEnable, NS_OK);
|
||||
|
||||
if (sIsBtEnabled == aShouldEnable) {
|
||||
// Keep current enable status
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
int ret = aShouldEnable ? sBtInterface->enable() : sBtInterface->disable();
|
||||
NS_ENSURE_TRUE(ret == BT_STATUS_SUCCESS, NS_ERROR_FAILURE);
|
||||
@ -1221,13 +1224,6 @@ BluetoothServiceBluedroid::SendFile(const nsAString& aDeviceAddress,
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
// Force to stop discovery, otherwise socket connecting would fail
|
||||
if (!IsReady() || BT_STATUS_SUCCESS != sBtInterface->cancel_discovery()) {
|
||||
NS_NAMED_LITERAL_STRING(errorStr, "Calling cancel_discovery() failed");
|
||||
DispatchBluetoothReply(aRunnable, BluetoothValue(true), errorStr);
|
||||
return;
|
||||
}
|
||||
|
||||
// Currently we only support one device sending one file at a time,
|
||||
// so we don't need aDeviceAddress here because the target device
|
||||
// has been determined when calling 'Connect()'. Nevertheless, keep
|
||||
|
@ -389,7 +389,7 @@ BluetoothHfpManager::Reset()
|
||||
mCMER = false;
|
||||
mConnectScoRequest = false;
|
||||
mSlcConnected = false;
|
||||
mHspConnected = false;
|
||||
mIsHsp = false;
|
||||
mReceiveVgsFlag = false;
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
@ -620,14 +620,10 @@ BluetoothHfpManager::HandleVoiceConnectionChanged(uint32_t aClientId)
|
||||
}
|
||||
UpdateCIND(CINDType::SERVICE, service);
|
||||
|
||||
uint8_t signal;
|
||||
JS::Value value;
|
||||
voiceInfo->GetRelSignalStrength(&value);
|
||||
if (!value.isNumber()) {
|
||||
BT_WARNING("Failed to get relSignalStrength in BluetoothHfpManager");
|
||||
return;
|
||||
}
|
||||
signal = ceil(value.toNumber() / 20.0);
|
||||
NS_ENSURE_TRUE_VOID(value.isNumber());
|
||||
uint8_t signal = ceil(value.toNumber() / 20.0);
|
||||
UpdateCIND(CINDType::SIGNAL, signal);
|
||||
|
||||
/**
|
||||
@ -1642,13 +1638,14 @@ BluetoothHfpManager::OnSocketConnectSuccess(BluetoothSocket* aSocket)
|
||||
*/
|
||||
if (aSocket == mHandsfreeSocket) {
|
||||
MOZ_ASSERT(!mSocket);
|
||||
mIsHsp = false;
|
||||
mHandsfreeSocket.swap(mSocket);
|
||||
|
||||
mHeadsetSocket->Disconnect();
|
||||
mHeadsetSocket = nullptr;
|
||||
} else if (aSocket == mHeadsetSocket) {
|
||||
MOZ_ASSERT(!mSocket);
|
||||
mHspConnected = true;
|
||||
mIsHsp = true;
|
||||
mHeadsetSocket.swap(mSocket);
|
||||
|
||||
mHandsfreeSocket->Disconnect();
|
||||
@ -1743,6 +1740,8 @@ BluetoothHfpManager::OnGetServiceChannel(const nsAString& aDeviceAddress,
|
||||
} else if (NS_FAILED(bs->GetServiceChannel(aDeviceAddress,
|
||||
hspUuid, this))) {
|
||||
OnConnect(NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
|
||||
} else {
|
||||
mIsHsp = true;
|
||||
}
|
||||
|
||||
return;
|
||||
@ -1829,7 +1828,7 @@ BluetoothHfpManager::ConnectSco(BluetoothReplyRunnable* aRunnable)
|
||||
|
||||
// If we are not using HSP, we have to make sure Service Level Connection
|
||||
// established before we start to set up SCO (synchronous connection).
|
||||
if (!mSlcConnected && !mHspConnected) {
|
||||
if (!mSlcConnected && !mIsHsp) {
|
||||
mConnectScoRequest = true;
|
||||
BT_WARNING("ConnectSco called before Service Level Connection established");
|
||||
return false;
|
||||
|
@ -191,7 +191,7 @@ private:
|
||||
bool mCMER;
|
||||
bool mConnectScoRequest;
|
||||
bool mSlcConnected;
|
||||
bool mHspConnected;
|
||||
bool mIsHsp;
|
||||
#ifdef MOZ_B2G_RIL
|
||||
bool mFirstCKPD;
|
||||
int mNetworkSelectionMode;
|
||||
|
@ -37,12 +37,6 @@ public:
|
||||
aName.AssignLiteral("OPP");
|
||||
}
|
||||
|
||||
/*
|
||||
* Channel of reserved services are fixed values, please check
|
||||
* function add_reserved_service_records() in
|
||||
* external/bluetooth/bluez/src/adapter.c for more information.
|
||||
*/
|
||||
static const int DEFAULT_OPP_CHANNEL = 10;
|
||||
static const int MAX_PACKET_LENGTH = 0xFFFE;
|
||||
|
||||
virtual ~BluetoothOppManager();
|
||||
|
@ -21,7 +21,7 @@ USING_BLUETOOTH_NAMESPACE
|
||||
|
||||
namespace {
|
||||
|
||||
BluetoothServiceChildProcess* gBluetoothService;
|
||||
BluetoothServiceChildProcess* sBluetoothService;
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
@ -33,19 +33,19 @@ BluetoothChild::BluetoothChild(BluetoothServiceChildProcess* aBluetoothService)
|
||||
: mShutdownState(Running)
|
||||
{
|
||||
MOZ_COUNT_CTOR(BluetoothChild);
|
||||
MOZ_ASSERT(!gBluetoothService);
|
||||
MOZ_ASSERT(!sBluetoothService);
|
||||
MOZ_ASSERT(aBluetoothService);
|
||||
|
||||
gBluetoothService = aBluetoothService;
|
||||
sBluetoothService = aBluetoothService;
|
||||
}
|
||||
|
||||
BluetoothChild::~BluetoothChild()
|
||||
{
|
||||
MOZ_COUNT_DTOR(BluetoothChild);
|
||||
MOZ_ASSERT(gBluetoothService);
|
||||
MOZ_ASSERT(sBluetoothService);
|
||||
MOZ_ASSERT(mShutdownState == Dead);
|
||||
|
||||
gBluetoothService = nullptr;
|
||||
sBluetoothService = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@ -61,9 +61,9 @@ BluetoothChild::BeginShutdown()
|
||||
void
|
||||
BluetoothChild::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
MOZ_ASSERT(gBluetoothService);
|
||||
MOZ_ASSERT(sBluetoothService);
|
||||
|
||||
gBluetoothService->NoteDeadActor();
|
||||
sBluetoothService->NoteDeadActor();
|
||||
|
||||
#ifdef DEBUG
|
||||
mShutdownState = Dead;
|
||||
@ -73,18 +73,18 @@ BluetoothChild::ActorDestroy(ActorDestroyReason aWhy)
|
||||
bool
|
||||
BluetoothChild::RecvNotify(const BluetoothSignal& aSignal)
|
||||
{
|
||||
MOZ_ASSERT(gBluetoothService);
|
||||
MOZ_ASSERT(sBluetoothService);
|
||||
|
||||
gBluetoothService->DistributeSignal(aSignal);
|
||||
sBluetoothService->DistributeSignal(aSignal);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothChild::RecvEnabled(const bool& aEnabled)
|
||||
{
|
||||
MOZ_ASSERT(gBluetoothService);
|
||||
MOZ_ASSERT(sBluetoothService);
|
||||
|
||||
gBluetoothService->SetEnabled(aEnabled);
|
||||
sBluetoothService->SetEnabled(aEnabled);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -403,7 +403,7 @@ BluetoothRequestParent::DoRequest(const ConnectedDevicePropertiesRequest& aReque
|
||||
MOZ_ASSERT(mRequestType == Request::TConnectedDevicePropertiesRequest);
|
||||
nsresult rv =
|
||||
mService->GetConnectedDevicePropertiesInternal(aRequest.serviceUuid(),
|
||||
mReplyRunnable.get());
|
||||
mReplyRunnable.get());
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
|
||||
return true;
|
||||
|
@ -18,7 +18,7 @@ USING_BLUETOOTH_NAMESPACE
|
||||
|
||||
namespace {
|
||||
|
||||
BluetoothChild* gBluetoothChild;
|
||||
BluetoothChild* sBluetoothChild;
|
||||
|
||||
inline
|
||||
void
|
||||
@ -27,13 +27,13 @@ SendRequest(BluetoothReplyRunnable* aRunnable, const Request& aRequest)
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(aRunnable);
|
||||
|
||||
NS_WARN_IF_FALSE(gBluetoothChild,
|
||||
NS_WARN_IF_FALSE(sBluetoothChild,
|
||||
"Calling methods on BluetoothServiceChildProcess during "
|
||||
"shutdown!");
|
||||
|
||||
if (gBluetoothChild) {
|
||||
if (sBluetoothChild) {
|
||||
BluetoothRequestChild* actor = new BluetoothRequestChild(aRunnable);
|
||||
gBluetoothChild->SendPBluetoothRequestConstructor(actor, aRequest);
|
||||
sBluetoothChild->SendPBluetoothRequestConstructor(actor, aRequest);
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ SendRequest(BluetoothReplyRunnable* aRunnable, const Request& aRequest)
|
||||
BluetoothServiceChildProcess*
|
||||
BluetoothServiceChildProcess::Create()
|
||||
{
|
||||
MOZ_ASSERT(!gBluetoothChild);
|
||||
MOZ_ASSERT(!sBluetoothChild);
|
||||
|
||||
mozilla::dom::ContentChild* contentChild =
|
||||
mozilla::dom::ContentChild::GetSingleton();
|
||||
@ -51,8 +51,8 @@ BluetoothServiceChildProcess::Create()
|
||||
|
||||
BluetoothServiceChildProcess* btService = new BluetoothServiceChildProcess();
|
||||
|
||||
gBluetoothChild = new BluetoothChild(btService);
|
||||
contentChild->SendPBluetoothConstructor(gBluetoothChild);
|
||||
sBluetoothChild = new BluetoothChild(btService);
|
||||
contentChild->SendPBluetoothConstructor(sBluetoothChild);
|
||||
|
||||
return btService;
|
||||
}
|
||||
@ -63,14 +63,14 @@ BluetoothServiceChildProcess::BluetoothServiceChildProcess()
|
||||
|
||||
BluetoothServiceChildProcess::~BluetoothServiceChildProcess()
|
||||
{
|
||||
gBluetoothChild = nullptr;
|
||||
sBluetoothChild = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothServiceChildProcess::NoteDeadActor()
|
||||
{
|
||||
MOZ_ASSERT(gBluetoothChild);
|
||||
gBluetoothChild = nullptr;
|
||||
MOZ_ASSERT(sBluetoothChild);
|
||||
sBluetoothChild = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@ -78,8 +78,8 @@ BluetoothServiceChildProcess::RegisterBluetoothSignalHandler(
|
||||
const nsAString& aNodeName,
|
||||
BluetoothSignalObserver* aHandler)
|
||||
{
|
||||
if (gBluetoothChild && !IsSignalRegistered(aNodeName)) {
|
||||
gBluetoothChild->SendRegisterSignalHandler(nsString(aNodeName));
|
||||
if (sBluetoothChild && !IsSignalRegistered(aNodeName)) {
|
||||
sBluetoothChild->SendRegisterSignalHandler(nsString(aNodeName));
|
||||
}
|
||||
BluetoothService::RegisterBluetoothSignalHandler(aNodeName, aHandler);
|
||||
}
|
||||
@ -90,8 +90,8 @@ BluetoothServiceChildProcess::UnregisterBluetoothSignalHandler(
|
||||
BluetoothSignalObserver* aHandler)
|
||||
{
|
||||
BluetoothService::UnregisterBluetoothSignalHandler(aNodeName, aHandler);
|
||||
if (gBluetoothChild && !IsSignalRegistered(aNodeName)) {
|
||||
gBluetoothChild->SendUnregisterSignalHandler(nsString(aNodeName));
|
||||
if (sBluetoothChild && !IsSignalRegistered(aNodeName)) {
|
||||
sBluetoothChild->SendUnregisterSignalHandler(nsString(aNodeName));
|
||||
}
|
||||
}
|
||||
|
||||
@ -361,8 +361,8 @@ BluetoothServiceChildProcess::HandleShutdown()
|
||||
{
|
||||
// If this process is shutting down then we need to disconnect ourselves from
|
||||
// the parent.
|
||||
if (gBluetoothChild) {
|
||||
gBluetoothChild->BeginShutdown();
|
||||
if (sBluetoothChild) {
|
||||
sBluetoothChild->BeginShutdown();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -590,7 +590,6 @@ TabChild::HandlePossibleViewportChange()
|
||||
// by AsyncPanZoomController and causes a blurry flash.
|
||||
bool isFirstPaint;
|
||||
nsresult rv = utils->GetIsFirstPaint(&isFirstPaint);
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||
if (NS_FAILED(rv) || isFirstPaint) {
|
||||
// FIXME/bug 799585(?): GetViewportInfo() returns a defaultZoom of
|
||||
// 0.0 to mean "did not calculate a zoom". In that case, we default
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "nsVolumeService.h"
|
||||
#include "AutoMounterSetting.h"
|
||||
#include "base/message_loop.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "mozilla/FileUtils.h"
|
||||
#include "mozilla/Hal.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
@ -331,20 +332,6 @@ AutoMounterResponseCallback::ResponseReceived(const VolumeCommand* aCommand)
|
||||
}
|
||||
}
|
||||
|
||||
class AutoBool {
|
||||
public:
|
||||
explicit AutoBool(bool &aBool) : mBool(aBool) {
|
||||
mBool = true;
|
||||
}
|
||||
|
||||
~AutoBool() {
|
||||
mBool = false;
|
||||
}
|
||||
|
||||
private:
|
||||
bool &mBool;
|
||||
};
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
void
|
||||
@ -360,7 +347,8 @@ AutoMounter::UpdateState()
|
||||
// things up.
|
||||
return;
|
||||
}
|
||||
AutoBool inUpdateStateDetector(inUpdateState);
|
||||
AutoRestore<bool> inUpdateStateDetector(inUpdateState);
|
||||
inUpdateState = true;
|
||||
|
||||
MOZ_ASSERT(MessageLoop::current() == XRE_GetIOMessageLoop());
|
||||
|
||||
|
@ -192,20 +192,24 @@ var WifiManager = (function() {
|
||||
});
|
||||
}
|
||||
|
||||
function unloadDriver(callback) {
|
||||
function unloadDriver(type, callback) {
|
||||
if (!unloadDriverEnabled) {
|
||||
// Unloading drivers is generally unnecessary and
|
||||
// can trigger bugs in some drivers.
|
||||
// On properly written drivers, bringing the interface
|
||||
// down powers down the interface.
|
||||
notify("supplicantlost", { success: true });
|
||||
if (type === WIFI_FIRMWARE_STATION) {
|
||||
notify("supplicantlost", { success: true });
|
||||
}
|
||||
callback(0);
|
||||
return;
|
||||
}
|
||||
|
||||
wifiCommand.unloadDriver(function(status) {
|
||||
driverLoaded = (status < 0);
|
||||
notify("supplicantlost", { success: true });
|
||||
if (type === WIFI_FIRMWARE_STATION) {
|
||||
notify("supplicantlost", { success: true });
|
||||
}
|
||||
callback(status);
|
||||
});
|
||||
}
|
||||
@ -879,7 +883,7 @@ var WifiManager = (function() {
|
||||
cancelWaitForDriverReadyTimer();
|
||||
wifiCommand.startSupplicant(function (status) {
|
||||
if (status < 0) {
|
||||
unloadDriver(function() {
|
||||
unloadDriver(WIFI_FIRMWARE_STATION, function() {
|
||||
callback(status);
|
||||
});
|
||||
manager.state = "UNINITIALIZED";
|
||||
@ -914,7 +918,7 @@ var WifiManager = (function() {
|
||||
wifiCommand.closeSupplicantConnection(function () {
|
||||
manager.state = "UNINITIALIZED";
|
||||
netUtil.disableInterface(manager.ifname, function (ok) {
|
||||
unloadDriver(callback);
|
||||
unloadDriver(WIFI_FIRMWARE_STATION, callback);
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -962,7 +966,7 @@ var WifiManager = (function() {
|
||||
// Should we fire a dom event if we fail to set wifi tethering ?
|
||||
debug("Disable Wifi tethering result: " + (result ? result : "successfully"));
|
||||
// Unload wifi driver even if we fail to control wifi tethering.
|
||||
unloadDriver(function(status) {
|
||||
unloadDriver(WIFI_FIRMWARE_AP, function(status) {
|
||||
if (status < 0) {
|
||||
debug("Fail to unload wifi driver");
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ NfcConnector::CreateAddr(bool aIsServer,
|
||||
case AF_INET:
|
||||
aAddr.in.sin_family = af;
|
||||
aAddr.in.sin_port = htons(NFC_TEST_PORT);
|
||||
aAddr.in.sin_addr.s_addr = htons(INADDR_LOOPBACK);
|
||||
aAddr.in.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
|
||||
aAddrSize = sizeof(sockaddr_in);
|
||||
break;
|
||||
default:
|
||||
|
@ -251,7 +251,7 @@ RilConnector::CreateAddr(bool aIsServer,
|
||||
case AF_INET:
|
||||
aAddr.in.sin_family = af;
|
||||
aAddr.in.sin_port = htons(RIL_TEST_PORT + mClientId);
|
||||
aAddr.in.sin_addr.s_addr = htons(INADDR_LOOPBACK);
|
||||
aAddr.in.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
|
||||
aAddrSize = sizeof(sockaddr_in);
|
||||
break;
|
||||
default:
|
||||
|
@ -65,7 +65,7 @@ static void
|
||||
Reporter(int nr, siginfo_t *info, void *void_context)
|
||||
{
|
||||
ucontext_t *ctx = static_cast<ucontext_t*>(void_context);
|
||||
unsigned int syscall, arg1;
|
||||
unsigned long syscall, args[6];
|
||||
|
||||
if (nr != SIGSYS) {
|
||||
return;
|
||||
@ -78,9 +78,16 @@ Reporter(int nr, siginfo_t *info, void *void_context)
|
||||
}
|
||||
|
||||
syscall = SECCOMP_SYSCALL(ctx);
|
||||
arg1 = SECCOMP_PARM1(ctx);
|
||||
args[0] = SECCOMP_PARM1(ctx);
|
||||
args[1] = SECCOMP_PARM2(ctx);
|
||||
args[2] = SECCOMP_PARM3(ctx);
|
||||
args[3] = SECCOMP_PARM4(ctx);
|
||||
args[4] = SECCOMP_PARM5(ctx);
|
||||
args[5] = SECCOMP_PARM6(ctx);
|
||||
|
||||
LOG_ERROR("PID %u is missing syscall %u, arg1 %u\n", getpid(), syscall, arg1);
|
||||
LOG_ERROR("seccomp sandbox violation: pid %u, syscall %lu, args %lu %lu %lu"
|
||||
" %lu %lu %lu. Killing process.", getpid(), syscall,
|
||||
args[0], args[1], args[2], args[3], args[4], args[5]);
|
||||
|
||||
_exit(127);
|
||||
}
|
||||
|
@ -432,6 +432,64 @@
|
||||
"layout/style/test/test_visited_reftests.html":"bug 870262, :visited support",
|
||||
|
||||
"Harness_sanity/test_sanityEventUtils.html": "bug 688052",
|
||||
"Harness_sanity/test_sanitySimpletest.html": "bug 688052"
|
||||
"Harness_sanity/test_sanitySimpletest.html": "bug 688052",
|
||||
|
||||
"content/base/test/csp/test_CSP_bug909029.html": "debug-only failure",
|
||||
"content/base/test/test_bug578096.html": "debug-only failure; crash",
|
||||
"content/base/test/test_bug827160.html": "debug-only failure",
|
||||
"content/base/test/test_bug585978.html": "debug-only timeout",
|
||||
"content/base/test/csp/test_CSP_bug941404.html": "debug-only failure",
|
||||
"content/base/test/csp/test_bug886164.html": "debug-only failure",
|
||||
"content/base/test/csp/test_nonce_source.html": "debug-only failure",
|
||||
"content/base/test/csp/test_policyuri_regression_from_multipolicy.html": "debug-only failure",
|
||||
"content/canvas/test/test_canvas.html": "debug-only crash; bug 933541",
|
||||
"content/events/test/test_bug864040.html": "debug-only failure",
|
||||
"content/html/content/test/forms/test_input_range_mouse_and_touch_events.html": "debug-only failure; bug 926546",
|
||||
"content/html/content/test/test_bug595449.html": "debug-only failure",
|
||||
"content/html/content/test/test_bug841466.html": "debug-only failure",
|
||||
"content/html/content/test/test_ignoreuserfocus.html": "debug-only failure",
|
||||
"docshell/test/test_bug570341.html": "debug-only failure",
|
||||
"docshell/test/test_bug529119-2.html": "debug-only failure",
|
||||
"dom/apps/tests/test_app_update.html": "debug-only failure",
|
||||
"dom/apps/tests/test_packaged_app_update.html": "debug-only timeout",
|
||||
"dom/bindings/test/test_exceptions_from_jsimplemented.html": "debug-only failure; bug 926547",
|
||||
"dom/camera/test/test_camera.html": "debug-only failure; no assertions when 34 were expected",
|
||||
"dom/contacts/tests/test_contacts_basics.html": "debug-only failure",
|
||||
"dom/contacts/tests/test_contacts_getall.html": "debug-only failure",
|
||||
"dom/datastore/tests/test_arrays.html": "debug-only failure; time out",
|
||||
"dom/datastore/tests/test_sync.html": "debug-only failure; time out",
|
||||
"dom/imptests/editing/selecttest/test_extend.html": "debug-only failure; time out",
|
||||
"dom/imptests/editing/selecttest/test_selectAllChildren.html": "debug-only failure",
|
||||
"dom/imptests/html/dom/": "debug-only failure",
|
||||
"dom/imptests/html/html/": "debug-only failure",
|
||||
"dom/imptests/webapps/": "debug-only failure",
|
||||
"dom/indexedDB/test/test_success_events_after_abort.html": "debug-only failure; time out",
|
||||
"dom/media/tests/mochitest/test_getUserMedia_playVideoAudioTwice.html": "debug-only failure; bug 926558",
|
||||
"dom/media/tests/mochitest/test_getUserMedia_stopVideoAudioStream.html": "debug-only failure",
|
||||
"dom/media/tests/mochitest/test_getUserMedia_basicVideo.html": "debug-only failure",
|
||||
"dom/media/tests/ipc/test_ipc.html": "debug-only failure",
|
||||
"dom/permission/tests/test_idle.html": "debug-only failure",
|
||||
"dom/settings/tests/": "debug-only failure, bug 932878",
|
||||
"dom/src/jsurl/test/test_bug351633-2.html": "debug-only failure",
|
||||
"dom/src/jsurl/test/test_bug351633-4.html": "debug-only failure",
|
||||
"dom/tests/mochitest/localstorage/test_localStorageOriginsEquals.html": "debug-only timeout",
|
||||
"dom/tests/mochitest/ajax/jquery/test_jQuery.html": "debug-only timeout",
|
||||
"dom/tests/mochitest/ajax/scriptaculous/test_Scriptaculous.html": "debug-only failure",
|
||||
"dom/tests/mochitest/ajax/prototype/test_Prototype.html": "debug-only timeout",
|
||||
"dom/tests/mochitest/geolocation/test_errorcheck.html": "debug-only timeout",
|
||||
"dom/tests/mochitest/localstorage/test_cookieSession.html": "debug-only failure",
|
||||
"dom/tests/mochitest/orientation/test_bug507902.html": "debug-only failure",
|
||||
"dom/workers/test/test_csp.html": "debug-only failure",
|
||||
"dom/workers/test/test_url.html": "debug-only crash, bug 931887",
|
||||
"dom/workers/test/test_jsversion.html": "debug-only failure",
|
||||
"layout/forms/test/test_bug542914.html": "debug-only failure",
|
||||
"layout/base/tests/test_reftests_with_caret.html": "debug-only timeout",
|
||||
"layout/generic/test/test_bug448860.html": "debug-only failure",
|
||||
"layout/style/test/test_media_queries.html": "debug-only failure; timed out",
|
||||
"layout/style/test/test_selectors.html": "debug-only failure; timed out",
|
||||
"layout/style/test/test_value_cloning.html": "debug-only failure; timed out",
|
||||
"layout/style/test/test_value_computation.html": "debug-only failure",
|
||||
"layout/style/test/test_value_storage.html": "debug-only failure",
|
||||
"layout/style/test/test_pseudoelement_state.html": "debug-only failure"
|
||||
}
|
||||
}
|
||||
|
@ -14,10 +14,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
#ifndef MOZ_WIDGET_GONK
|
||||
Cu.import("resource://gre/modules/LightweightThemeManager.jsm");
|
||||
#endif
|
||||
Cu.import("resource://gre/modules/ctypes.jsm");
|
||||
Cu.import("resource://gre/modules/ThirdPartyCookieProbe.jsm");
|
||||
Cu.import("resource://gre/modules/TelemetryFile.jsm");
|
||||
Cu.import("resource://gre/modules/UITelemetry.jsm");
|
||||
|
||||
// When modifying the payload in incompatible ways, please bump this version number
|
||||
const PAYLOAD_VERSION = 1;
|
||||
@ -67,6 +64,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "UpdateChannel",
|
||||
"resource://gre/modules/UpdateChannel.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AddonManagerPrivate",
|
||||
"resource://gre/modules/AddonManager.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryFile",
|
||||
"resource://gre/modules/TelemetryFile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "UITelemetry",
|
||||
"resource://gre/modules/UITelemetry.jsm");
|
||||
|
||||
@ -93,6 +92,7 @@ let processInfo = {
|
||||
},
|
||||
getCounters_Windows: function() {
|
||||
if (!this._initialized){
|
||||
Cu.import("resource://gre/modules/ctypes.jsm");
|
||||
this._IO_COUNTERS = new ctypes.StructType("IO_COUNTERS", [
|
||||
{'readOps': ctypes.unsigned_long_long},
|
||||
{'writeOps': ctypes.unsigned_long_long},
|
||||
|
@ -31,6 +31,7 @@ const PREF_APP_UPDATE_CERT_CHECKATTRS = "app.update.cert.checkAttributes";
|
||||
const PREF_APP_UPDATE_CERT_ERRORS = "app.update.cert.errors";
|
||||
const PREF_APP_UPDATE_CERT_MAXERRORS = "app.update.cert.maxErrors";
|
||||
const PREF_APP_UPDATE_CERT_REQUIREBUILTIN = "app.update.cert.requireBuiltIn";
|
||||
const PREF_APP_UPDATE_CUSTOM = "app.update.custom";
|
||||
const PREF_APP_UPDATE_ENABLED = "app.update.enabled";
|
||||
const PREF_APP_UPDATE_METRO_ENABLED = "app.update.metro.enabled";
|
||||
const PREF_APP_UPDATE_IDLETIME = "app.update.idletime";
|
||||
@ -40,12 +41,12 @@ const PREF_APP_UPDATE_LASTUPDATETIME = "app.update.lastUpdateTime.backgroun
|
||||
const PREF_APP_UPDATE_LOG = "app.update.log";
|
||||
const PREF_APP_UPDATE_MODE = "app.update.mode";
|
||||
const PREF_APP_UPDATE_NEVER_BRANCH = "app.update.never.";
|
||||
const PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED = "app.update.notifiedUnsupported";
|
||||
const PREF_APP_UPDATE_POSTUPDATE = "app.update.postupdate";
|
||||
const PREF_APP_UPDATE_PROMPTWAITTIME = "app.update.promptWaitTime";
|
||||
const PREF_APP_UPDATE_SHOW_INSTALLED_UI = "app.update.showInstalledUI";
|
||||
const PREF_APP_UPDATE_SILENT = "app.update.silent";
|
||||
const PREF_APP_UPDATE_STAGING_ENABLED = "app.update.staging.enabled";
|
||||
const PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED = "app.update.notifiedUnsupported";
|
||||
const PREF_APP_UPDATE_URL = "app.update.url";
|
||||
const PREF_APP_UPDATE_URL_DETAILS = "app.update.url.details";
|
||||
const PREF_APP_UPDATE_URL_OVERRIDE = "app.update.url.override";
|
||||
@ -1980,7 +1981,7 @@ const UpdateServiceFactory = {
|
||||
function UpdateService() {
|
||||
LOG("Creating UpdateService");
|
||||
Services.obs.addObserver(this, "xpcom-shutdown", false);
|
||||
Services.prefs.addObserver("app.update.log", this, false);
|
||||
Services.prefs.addObserver(PREF_APP_UPDATE_LOG, this, false);
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
// PowerManagerService::SyncProfile (which is called for Reboot, PowerOff
|
||||
// and Restart) sends the profile-change-net-teardown event. We can then
|
||||
@ -2050,7 +2051,7 @@ UpdateService.prototype = {
|
||||
#endif
|
||||
case "xpcom-shutdown":
|
||||
Services.obs.removeObserver(this, topic);
|
||||
Services.prefs.removeObserver("app.update.log", this);
|
||||
Services.prefs.removeObserver(PREF_APP_UPDATE_LOG, this);
|
||||
|
||||
if (this._retryTimer) {
|
||||
this._retryTimer.cancel();
|
||||
@ -3595,6 +3596,7 @@ Checker.prototype = {
|
||||
getDistributionPrefValue(PREF_APP_DISTRIBUTION));
|
||||
url = url.replace(/%DISTRIBUTION_VERSION%/g,
|
||||
getDistributionPrefValue(PREF_APP_DISTRIBUTION_VERSION));
|
||||
url = url.replace(/%CUSTOM%/g, getPref("getCharPref", PREF_APP_UPDATE_CUSTOM, ""));
|
||||
url = url.replace(/\+/g, "%2B");
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
|
@ -394,5 +394,19 @@ function run_test_pt13() {
|
||||
|
||||
function check_test_pt13() {
|
||||
do_check_eq(getResult(gRequestURL), "?extra=param&force=1");
|
||||
run_test_pt14();
|
||||
}
|
||||
|
||||
function run_test_pt14() {
|
||||
Services.prefs.setCharPref("app.update.custom", "custom");
|
||||
gCheckFunc = check_test_pt14;
|
||||
var url = URL_PREFIX + "?custom=%CUSTOM%";
|
||||
logTestInfo("testing url constructed with %CUSTOM% - " + url);
|
||||
setUpdateURLOverride(url);
|
||||
gUpdateChecker.checkForUpdates(updateCheckListener, true);
|
||||
}
|
||||
|
||||
function check_test_pt14() {
|
||||
do_check_eq(getResult(gRequestURL), "?custom=custom&force=1");
|
||||
do_test_finished();
|
||||
}
|
||||
|
@ -68,7 +68,6 @@ static nsIntRect sVirtualBounds;
|
||||
|
||||
static nsRefPtr<GLContext> sGLContext;
|
||||
static nsTArray<nsWindow *> sTopWindows;
|
||||
static nsWindow *gWindowToRedraw = nullptr;
|
||||
static nsWindow *gFocusedWindow = nullptr;
|
||||
static bool sFramebufferOpen;
|
||||
static bool sUsingOMTC;
|
||||
@ -185,20 +184,24 @@ nsWindow::DoDraw(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gWindowToRedraw) {
|
||||
if (sTopWindows.IsEmpty()) {
|
||||
LOG(" no window to draw, bailing");
|
||||
return;
|
||||
}
|
||||
|
||||
nsIntRegion region = gWindowToRedraw->mDirtyRegion;
|
||||
gWindowToRedraw->mDirtyRegion.SetEmpty();
|
||||
nsWindow *targetWindow = (nsWindow *)sTopWindows[0];
|
||||
while (targetWindow->GetLastChild())
|
||||
targetWindow = (nsWindow *)targetWindow->GetLastChild();
|
||||
|
||||
nsIWidgetListener* listener = gWindowToRedraw->GetWidgetListener();
|
||||
nsIntRegion region = sTopWindows[0]->mDirtyRegion;
|
||||
sTopWindows[0]->mDirtyRegion.SetEmpty();
|
||||
|
||||
nsIWidgetListener* listener = targetWindow->GetWidgetListener();
|
||||
if (listener) {
|
||||
listener->WillPaintWindow(gWindowToRedraw);
|
||||
listener->WillPaintWindow(targetWindow);
|
||||
}
|
||||
|
||||
LayerManager* lm = gWindowToRedraw->GetLayerManager();
|
||||
LayerManager* lm = targetWindow->GetLayerManager();
|
||||
if (mozilla::layers::LAYERS_CLIENT == lm->GetBackendType()) {
|
||||
// No need to do anything, the compositor will handle drawing
|
||||
} else if (mozilla::layers::LAYERS_BASIC == lm->GetBackendType()) {
|
||||
@ -217,12 +220,12 @@ nsWindow::DoDraw(void)
|
||||
|
||||
// No double-buffering needed.
|
||||
AutoLayerManagerSetup setupLayerManager(
|
||||
gWindowToRedraw, ctx, mozilla::layers::BUFFER_NONE,
|
||||
targetWindow, ctx, mozilla::layers::BUFFER_NONE,
|
||||
ScreenRotation(EffectiveScreenRotation()));
|
||||
|
||||
listener = gWindowToRedraw->GetWidgetListener();
|
||||
listener = targetWindow->GetWidgetListener();
|
||||
if (listener) {
|
||||
listener->PaintWindow(gWindowToRedraw, region);
|
||||
listener->PaintWindow(targetWindow, region);
|
||||
}
|
||||
}
|
||||
|
||||
@ -234,7 +237,7 @@ nsWindow::DoDraw(void)
|
||||
NS_RUNTIMEABORT("Unexpected layer manager type");
|
||||
}
|
||||
|
||||
listener = gWindowToRedraw->GetWidgetListener();
|
||||
listener = targetWindow->GetWidgetListener();
|
||||
if (listener) {
|
||||
listener->DidPaintWindow();
|
||||
}
|
||||
@ -281,11 +284,10 @@ nsWindow::Create(nsIWidget *aParent,
|
||||
|
||||
mBounds = aRect;
|
||||
|
||||
nsWindow *parent = (nsWindow *)aNativeParent;
|
||||
mParent = parent;
|
||||
mParent = (nsWindow *)aParent;
|
||||
mVisible = false;
|
||||
|
||||
if (!aNativeParent) {
|
||||
if (!aParent) {
|
||||
mBounds = sVirtualBounds;
|
||||
}
|
||||
|
||||
@ -301,11 +303,11 @@ nsWindow::Create(nsIWidget *aParent,
|
||||
NS_IMETHODIMP
|
||||
nsWindow::Destroy(void)
|
||||
{
|
||||
mOnDestroyCalled = true;
|
||||
sTopWindows.RemoveElement(this);
|
||||
if (this == gWindowToRedraw)
|
||||
gWindowToRedraw = nullptr;
|
||||
if (this == gFocusedWindow)
|
||||
gFocusedWindow = nullptr;
|
||||
nsBaseWidget::OnDestroy();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -379,8 +381,8 @@ nsWindow::Resize(double aX,
|
||||
if (mWidgetListener)
|
||||
mWidgetListener->WindowResized(this, mBounds.width, mBounds.height);
|
||||
|
||||
if (aRepaint && gWindowToRedraw)
|
||||
gWindowToRedraw->Invalidate(sVirtualBounds);
|
||||
if (aRepaint)
|
||||
Invalidate(sVirtualBounds);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -416,14 +418,13 @@ nsWindow::ConfigureChildren(const nsTArray<nsIWidget::Configuration>&)
|
||||
NS_IMETHODIMP
|
||||
nsWindow::Invalidate(const nsIntRect &aRect)
|
||||
{
|
||||
nsWindow *parent = mParent;
|
||||
while (parent && parent != sTopWindows[0])
|
||||
parent = parent->mParent;
|
||||
if (parent != sTopWindows[0])
|
||||
nsWindow *top = mParent;
|
||||
while (top && top->mParent)
|
||||
top = top->mParent;
|
||||
if (top != sTopWindows[0] && this != sTopWindows[0])
|
||||
return NS_OK;
|
||||
|
||||
mDirtyRegion.Or(mDirtyRegion, aRect);
|
||||
gWindowToRedraw = this;
|
||||
gDrawRequest = true;
|
||||
mozilla::NotifyEvent();
|
||||
return NS_OK;
|
||||
@ -451,8 +452,6 @@ nsWindow::GetNativeData(uint32_t aDataType)
|
||||
switch (aDataType) {
|
||||
case NS_NATIVE_WINDOW:
|
||||
return GetGonkDisplay()->GetNativeWindow();
|
||||
case NS_NATIVE_WIDGET:
|
||||
return this;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@ -764,12 +763,12 @@ nsScreenGonk::SetRotation(uint32_t aRotation)
|
||||
sVirtualBounds = gScreenBounds;
|
||||
}
|
||||
|
||||
nsAppShell::NotifyScreenRotation();
|
||||
|
||||
for (unsigned int i = 0; i < sTopWindows.Length(); i++)
|
||||
sTopWindows[i]->Resize(sVirtualBounds.width,
|
||||
sVirtualBounds.height,
|
||||
!i);
|
||||
|
||||
nsAppShell::NotifyScreenRotation();
|
||||
true);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user