mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge mozilla-central to mozilla-inbound
This commit is contained in:
commit
0ab3496e2a
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="e06971db7acf7a35c32eb74d675a4e12e288e6be">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="9d2378a9ef092ab1fc15c3a9f7fc4171aab59d57"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="321db3aed93a21f719fa918356f4200b8f465ac7"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -19,11 +19,11 @@
|
||||
<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="9d2378a9ef092ab1fc15c3a9f7fc4171aab59d57"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="321db3aed93a21f719fa918356f4200b8f465ac7"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d5d3f93914558b6f168447b805cd799c8233e300"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="6fa7a4936414ceb4055fd27f7a30e76790f834fb"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eb1795a9002eb142ac58c8d68f8f4ba094af07ca"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="2c31ac3a31a340b40ecd9c291df9b9613d3afa72"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d6a27295acb0a25926bf6290dd2532a7f9027864"/>
|
||||
<!-- Stock Android things -->
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="9d2378a9ef092ab1fc15c3a9f7fc4171aab59d57"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="321db3aed93a21f719fa918356f4200b8f465ac7"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d6a27295acb0a25926bf6290dd2532a7f9027864"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="e06971db7acf7a35c32eb74d675a4e12e288e6be">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="9d2378a9ef092ab1fc15c3a9f7fc4171aab59d57"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="321db3aed93a21f719fa918356f4200b8f465ac7"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -19,11 +19,11 @@
|
||||
<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="9d2378a9ef092ab1fc15c3a9f7fc4171aab59d57"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="321db3aed93a21f719fa918356f4200b8f465ac7"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d5d3f93914558b6f168447b805cd799c8233e300"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="6fa7a4936414ceb4055fd27f7a30e76790f834fb"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eb1795a9002eb142ac58c8d68f8f4ba094af07ca"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="2c31ac3a31a340b40ecd9c291df9b9613d3afa72"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d6a27295acb0a25926bf6290dd2532a7f9027864"/>
|
||||
<!-- Stock Android things -->
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="e06971db7acf7a35c32eb74d675a4e12e288e6be">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="9d2378a9ef092ab1fc15c3a9f7fc4171aab59d57"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="321db3aed93a21f719fa918356f4200b8f465ac7"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="9d2378a9ef092ab1fc15c3a9f7fc4171aab59d57"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="321db3aed93a21f719fa918356f4200b8f465ac7"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d6a27295acb0a25926bf6290dd2532a7f9027864"/>
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"git": {
|
||||
"git_revision": "9d2378a9ef092ab1fc15c3a9f7fc4171aab59d57",
|
||||
"git_revision": "321db3aed93a21f719fa918356f4200b8f465ac7",
|
||||
"remote": "https://git.mozilla.org/releases/gaia.git",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "255eba2ffe784601984ce72cd6acfc452c4f28f1",
|
||||
"revision": "4ec0e8fb78195772bef38253bc4b9b4b4f625e40",
|
||||
"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="9d2378a9ef092ab1fc15c3a9f7fc4171aab59d57"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="321db3aed93a21f719fa918356f4200b8f465ac7"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
|
||||
|
@ -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="9d2378a9ef092ab1fc15c3a9f7fc4171aab59d57"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="321db3aed93a21f719fa918356f4200b8f465ac7"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="9d2378a9ef092ab1fc15c3a9f7fc4171aab59d57"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="321db3aed93a21f719fa918356f4200b8f465ac7"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d6a27295acb0a25926bf6290dd2532a7f9027864"/>
|
||||
|
@ -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="9d2378a9ef092ab1fc15c3a9f7fc4171aab59d57"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="321db3aed93a21f719fa918356f4200b8f465ac7"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -31,8 +31,8 @@ function SimulatorProcess(options) {
|
||||
this.options = options;
|
||||
|
||||
EventEmitter.decorate(this);
|
||||
this.on("stdout", data => { console.log(data.trim()) });
|
||||
this.on("stderr", data => { console.error(data.trim()) });
|
||||
this.on("stdout", (e, data) => { console.log(data.trim()) });
|
||||
this.on("stderr", (e, data) => { console.error(data.trim()) });
|
||||
}
|
||||
|
||||
SimulatorProcess.prototype = {
|
||||
@ -108,7 +108,7 @@ SimulatorProcess.prototype = {
|
||||
kill: function() {
|
||||
let deferred = promise.defer();
|
||||
if (this.process) {
|
||||
this.once("exit", (exitCode) => {
|
||||
this.once("exit", (e, exitCode) => {
|
||||
this.shuttingDown = false;
|
||||
deferred.resolve(exitCode);
|
||||
});
|
||||
|
@ -16,7 +16,7 @@ Cu.import("resource://gre/modules/FxAccountsCommon.js", fxAccountsCommon);
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
|
||||
const PREF_LAST_FXA_USER = "identity.fxaccounts.lastSignedInUserHash";
|
||||
const PREF_SYNC_SHOW_CUSTOMIZATION = "services.sync.ui.showCustomizationDialog";
|
||||
const PREF_SYNC_SHOW_CUSTOMIZATION = "services.sync-setup.ui.showCustomizationDialog";
|
||||
|
||||
const ACTION_URL_PARAM = "action";
|
||||
|
||||
|
@ -4,8 +4,6 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
#endif
|
||||
|
||||
Cu.import("resource://gre/modules/NewTabUtils.jsm");
|
||||
|
||||
/**
|
||||
* Keeps thumbnails of open web pages up-to-date.
|
||||
*/
|
||||
|
@ -3872,7 +3872,10 @@ function OpenBrowserWindow(options)
|
||||
}
|
||||
|
||||
if (options && options.remote) {
|
||||
let omtcEnabled = gPrefService.getBoolPref("layers.offmainthreadcomposition.enabled");
|
||||
// If we're using remote tabs by default, then OMTC will be force-enabled,
|
||||
// despite the preference returning as false.
|
||||
let omtcEnabled = gPrefService.getBoolPref("layers.offmainthreadcomposition.enabled")
|
||||
|| Services.appinfo.browserTabsRemoteAutostart;
|
||||
if (!omtcEnabled) {
|
||||
alert("To use out-of-process tabs, you must set the layers.offmainthreadcomposition.enabled preference and restart. Opening a normal window instead.");
|
||||
} else {
|
||||
|
@ -33,8 +33,12 @@ const PREF_LOG_LEVEL = "browser.uitour.loglevel";
|
||||
const PREF_SEENPAGEIDS = "browser.uitour.seenPageIDs";
|
||||
|
||||
const BACKGROUND_PAGE_ACTIONS_ALLOWED = new Set([
|
||||
"endUrlbarCapture",
|
||||
"getConfiguration",
|
||||
"getTreatmentTag",
|
||||
"hideHighlight",
|
||||
"hideInfo",
|
||||
"hideMenu",
|
||||
"ping",
|
||||
"registerPageID",
|
||||
"setConfiguration",
|
||||
|
@ -377,6 +377,9 @@ this.ImportExport = {
|
||||
if (meta.id in DOMApplicationRegistry.webapps) {
|
||||
throw "DuplicateOrigin";
|
||||
}
|
||||
// We need to change the app directory name to match the new meta.id
|
||||
appDir.moveTo(appDir.parent, meta.id);
|
||||
|
||||
meta.origin = uri.prePath;
|
||||
}
|
||||
} else {
|
||||
|
@ -280,6 +280,13 @@ BluetoothAdapter::SetPropertyByValue(const BluetoothNamedValue& aValue)
|
||||
= value.get_ArrayOfnsString();
|
||||
|
||||
for (uint32_t i = 0; i < pairedDeviceAddresses.Length(); i++) {
|
||||
// Check whether or not the address exists in mDevices.
|
||||
if (mDevices.Contains(pairedDeviceAddresses[i])) {
|
||||
// If the paired device exists in mDevices, it would handle
|
||||
// 'PropertyChanged' signal in BluetoothDevice::Notify().
|
||||
continue;
|
||||
}
|
||||
|
||||
InfallibleTArray<BluetoothNamedValue> props;
|
||||
BT_APPEND_NAMED_VALUE(props, "Address", pairedDeviceAddresses[i]);
|
||||
BT_APPEND_NAMED_VALUE(props, "Paired", true);
|
||||
@ -288,10 +295,8 @@ BluetoothAdapter::SetPropertyByValue(const BluetoothNamedValue& aValue)
|
||||
nsRefPtr<BluetoothDevice> pairedDevice =
|
||||
BluetoothDevice::Create(GetOwner(), BluetoothValue(props));
|
||||
|
||||
// Append to adapter's device array if the device hasn't been created
|
||||
if (!mDevices.Contains(pairedDevice)) {
|
||||
mDevices.AppendElement(pairedDevice);
|
||||
}
|
||||
// Append to adapter's device array
|
||||
mDevices.AppendElement(pairedDevice);
|
||||
}
|
||||
|
||||
// Retrieve device properties, result will be handled by device objects.
|
||||
@ -885,14 +890,27 @@ BluetoothAdapter::HandleDevicePaired(const BluetoothValue& aValue)
|
||||
return;
|
||||
}
|
||||
|
||||
// Create paired device with 'address' and 'paired' attributes
|
||||
nsRefPtr<BluetoothDevice> pairedDevice =
|
||||
BluetoothDevice::Create(GetOwner(), aValue);
|
||||
const InfallibleTArray<BluetoothNamedValue>& arr =
|
||||
aValue.get_ArrayOfBluetoothNamedValue();
|
||||
|
||||
size_t index = mDevices.IndexOf(pairedDevice);
|
||||
MOZ_ASSERT(arr.Length() == 2 &&
|
||||
arr[0].value().type() == BluetoothValue::TnsString && // Address
|
||||
arr[1].value().type() == BluetoothValue::Tbool); // Paired
|
||||
MOZ_ASSERT(!arr[0].value().get_nsString().IsEmpty() &&
|
||||
arr[1].value().get_bool());
|
||||
|
||||
nsString deviceAddress = arr[0].value().get_nsString();
|
||||
|
||||
nsRefPtr<BluetoothDevice> pairedDevice = nullptr;
|
||||
|
||||
// Check whether or not the address exists in mDevices.
|
||||
size_t index = mDevices.IndexOf(deviceAddress);
|
||||
if (index == mDevices.NoIndex) {
|
||||
// Create a new device and append it to adapter's device array
|
||||
pairedDevice = BluetoothDevice::Create(GetOwner(), aValue);
|
||||
mDevices.AppendElement(pairedDevice);
|
||||
} else {
|
||||
// Use existing device
|
||||
pairedDevice = mDevices[index];
|
||||
}
|
||||
|
||||
@ -912,19 +930,19 @@ BluetoothAdapter::HandleDeviceUnpaired(const BluetoothValue& aValue)
|
||||
return;
|
||||
}
|
||||
|
||||
// Create unpaired device with 'address' and 'paired' attributes
|
||||
nsRefPtr<BluetoothDevice> unpairedDevice =
|
||||
BluetoothDevice::Create(GetOwner(), aValue);
|
||||
const InfallibleTArray<BluetoothNamedValue>& arr =
|
||||
aValue.get_ArrayOfBluetoothNamedValue();
|
||||
|
||||
size_t index = mDevices.IndexOf(unpairedDevice);
|
||||
MOZ_ASSERT(arr.Length() == 2 &&
|
||||
arr[0].value().type() == BluetoothValue::TnsString && // Address
|
||||
arr[1].value().type() == BluetoothValue::Tbool); // Paired
|
||||
MOZ_ASSERT(!arr[0].value().get_nsString().IsEmpty() &&
|
||||
!arr[1].value().get_bool());
|
||||
|
||||
nsString deviceAddress;
|
||||
if (index == mDevices.NoIndex) {
|
||||
unpairedDevice->GetAddress(deviceAddress);
|
||||
} else {
|
||||
mDevices[index]->GetAddress(deviceAddress);
|
||||
mDevices.RemoveElementAt(index);
|
||||
}
|
||||
nsString deviceAddress = arr[0].value().get_nsString();
|
||||
|
||||
// Remove the device with the same address
|
||||
mDevices.RemoveElement(deviceAddress);
|
||||
|
||||
// Notify application of unpaired device
|
||||
BluetoothDeviceEventInit init;
|
||||
|
@ -94,16 +94,6 @@ public:
|
||||
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
||||
virtual void DisconnectFromOwner() MOZ_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Override operator== for device comparison
|
||||
*/
|
||||
bool operator==(BluetoothDevice& aDevice) const
|
||||
{
|
||||
nsString address;
|
||||
aDevice.GetAddress(address);
|
||||
return mAddress.Equals(address);
|
||||
}
|
||||
|
||||
private:
|
||||
BluetoothDevice(nsPIDOMWindow* aOwner, const BluetoothValue& aValue);
|
||||
~BluetoothDevice();
|
||||
@ -187,4 +177,51 @@ private:
|
||||
|
||||
END_BLUETOOTH_NAMESPACE
|
||||
|
||||
/**
|
||||
* Explicit Specialization of Function Templates
|
||||
*
|
||||
* Allows customizing the template code for a given set of template arguments.
|
||||
* With this function template, nsTArray can handle comparison of
|
||||
* 'nsRefPtr<BluetoothDevice>' properly, including IndexOf() and Contains();
|
||||
*/
|
||||
template <>
|
||||
class nsDefaultComparator <nsRefPtr<mozilla::dom::bluetooth::BluetoothDevice>,
|
||||
nsRefPtr<mozilla::dom::bluetooth::BluetoothDevice>> {
|
||||
public:
|
||||
|
||||
bool Equals(
|
||||
const nsRefPtr<mozilla::dom::bluetooth::BluetoothDevice>& aDeviceA,
|
||||
const nsRefPtr<mozilla::dom::bluetooth::BluetoothDevice>& aDeviceB) const
|
||||
{
|
||||
nsString addressA, addressB;
|
||||
aDeviceA->GetAddress(addressA);
|
||||
aDeviceB->GetAddress(addressB);
|
||||
|
||||
return addressA.Equals(addressB);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Explicit Specialization of Function Templates
|
||||
*
|
||||
* Allows customizing the template code for a given set of template arguments.
|
||||
* With this function template, nsTArray can handle comparison between
|
||||
* 'nsRefPtr<BluetoothDevice>' and nsString properly, including IndexOf() and
|
||||
* Contains();
|
||||
*/
|
||||
template <>
|
||||
class nsDefaultComparator <nsRefPtr<mozilla::dom::bluetooth::BluetoothDevice>,
|
||||
nsString> {
|
||||
public:
|
||||
bool Equals(
|
||||
const nsRefPtr<mozilla::dom::bluetooth::BluetoothDevice>& aDevice,
|
||||
const nsString& aAddress) const
|
||||
{
|
||||
nsString deviceAddress;
|
||||
aDevice->GetAddress(deviceAddress);
|
||||
|
||||
return deviceAddress.Equals(aAddress);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -64,6 +64,8 @@ static nsString sAdapterBdName;
|
||||
static bool sAdapterDiscoverable(false);
|
||||
static bool sAdapterDiscovering(false);
|
||||
static bool sAdapterEnabled(false);
|
||||
// InfallibleTArray is an alias for nsTArray.
|
||||
static InfallibleTArray<nsString> sAdapterBondedAddressArray;
|
||||
|
||||
static BluetoothInterface* sBtInterface;
|
||||
static nsTArray<nsRefPtr<BluetoothProfileController> > sControllerArray;
|
||||
@ -422,6 +424,8 @@ BluetoothServiceBluedroid::GetAdaptersInternal(
|
||||
"Discoverable", sAdapterDiscoverable);
|
||||
BT_APPEND_NAMED_VALUE(properties.get_ArrayOfBluetoothNamedValue(),
|
||||
"Discovering", sAdapterDiscovering);
|
||||
BT_APPEND_NAMED_VALUE(properties.get_ArrayOfBluetoothNamedValue(),
|
||||
"PairedDevices", sAdapterBondedAddressArray);
|
||||
|
||||
BT_APPEND_NAMED_VALUE(adaptersProperties.get_ArrayOfBluetoothNamedValue(),
|
||||
"Adapter", properties);
|
||||
@ -1190,6 +1194,10 @@ BluetoothServiceBluedroid::AdapterStateChangedNotification(bool aState)
|
||||
sAdapterDiscovering = false;
|
||||
BT_APPEND_NAMED_VALUE(props, "Discovering", false);
|
||||
}
|
||||
if (!sAdapterBondedAddressArray.IsEmpty()) {
|
||||
BT_APPEND_NAMED_VALUE(props, "PairedDevices",
|
||||
InfallibleTArray<nsString>());
|
||||
}
|
||||
|
||||
BluetoothSignal signal(NS_LITERAL_STRING("PropertyChanged"),
|
||||
NS_LITERAL_STRING(KEY_ADAPTER), props);
|
||||
@ -1279,13 +1287,15 @@ BluetoothServiceBluedroid::AdapterPropertiesNotification(
|
||||
BT_LOGD("Adapter property: BONDED_DEVICES. Count: %d",
|
||||
p.mStringArray.Length());
|
||||
|
||||
nsTArray<nsString> pairedDeviceAddresses;
|
||||
// Whenever reloading paired devices, force refresh
|
||||
sAdapterBondedAddressArray.Clear();
|
||||
|
||||
for (size_t index = 0; index < p.mStringArray.Length(); index++) {
|
||||
pairedDeviceAddresses.AppendElement(p.mStringArray[index]);
|
||||
sAdapterBondedAddressArray.AppendElement(p.mStringArray[index]);
|
||||
}
|
||||
|
||||
BT_APPEND_NAMED_VALUE(propertiesArray, "PairedDevices", pairedDeviceAddresses);
|
||||
|
||||
BT_APPEND_NAMED_VALUE(propertiesArray, "PairedDevices",
|
||||
sAdapterBondedAddressArray);
|
||||
} else if (p.mType == PROPERTY_UNKNOWN) {
|
||||
/* Bug 1065999: working around unknown properties */
|
||||
} else {
|
||||
@ -1570,6 +1580,16 @@ BluetoothServiceBluedroid::BondStateChangedNotification(
|
||||
|
||||
bool bonded = (aState == BOND_STATE_BONDED);
|
||||
|
||||
// Update bonded address array
|
||||
nsString remoteBdAddr = nsString(aRemoteBdAddr);
|
||||
if (bonded) {
|
||||
if (!sAdapterBondedAddressArray.Contains(remoteBdAddr)) {
|
||||
sAdapterBondedAddressArray.AppendElement(remoteBdAddr);
|
||||
}
|
||||
} else {
|
||||
sAdapterBondedAddressArray.RemoveElement(remoteBdAddr);
|
||||
}
|
||||
|
||||
// Update attribute BluetoothDevice.paired
|
||||
InfallibleTArray<BluetoothNamedValue> propertiesArray;
|
||||
BT_APPEND_NAMED_VALUE(propertiesArray, "Paired", bonded);
|
||||
@ -1594,7 +1614,6 @@ BluetoothServiceBluedroid::BondStateChangedNotification(
|
||||
DispatchBluetoothReply(sBondingRunnableArray[0],
|
||||
BluetoothValue(true), EmptyString());
|
||||
sBondingRunnableArray.RemoveElementAt(0);
|
||||
|
||||
} else if (!bonded && !sUnbondingRunnableArray.IsEmpty()) {
|
||||
DispatchBluetoothReply(sUnbondingRunnableArray[0],
|
||||
BluetoothValue(true), EmptyString());
|
||||
|
@ -11,7 +11,9 @@
|
||||
#include "mp4_demuxer/MoofParser.h"
|
||||
#include "prlog.h"
|
||||
#include "MediaData.h"
|
||||
#ifdef MOZ_FMP4
|
||||
#include "MP4Stream.h"
|
||||
#endif
|
||||
#include "SourceBufferResource.h"
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
@ -214,6 +216,7 @@ private:
|
||||
int64_t mOffset;
|
||||
};
|
||||
|
||||
#ifdef MOZ_FMP4
|
||||
class MP4ContainerParser : public ContainerParser {
|
||||
public:
|
||||
MP4ContainerParser() :mMonitor("MP4ContainerParser Index Monitor") {}
|
||||
@ -322,6 +325,7 @@ private:
|
||||
nsRefPtr<SourceBufferResource> mResource;
|
||||
Monitor mMonitor;
|
||||
};
|
||||
#endif
|
||||
|
||||
/*static*/ ContainerParser*
|
||||
ContainerParser::CreateForMIMEType(const nsACString& aType)
|
||||
@ -330,9 +334,11 @@ ContainerParser::CreateForMIMEType(const nsACString& aType)
|
||||
return new WebMContainerParser();
|
||||
}
|
||||
|
||||
#ifdef MOZ_FMP4
|
||||
if (aType.LowerCaseEqualsLiteral("video/mp4") || aType.LowerCaseEqualsLiteral("audio/mp4")) {
|
||||
return new MP4ContainerParser();
|
||||
}
|
||||
#endif
|
||||
return new ContainerParser();
|
||||
}
|
||||
|
||||
|
@ -292,6 +292,12 @@ NfcContentHelper.prototype = {
|
||||
records: encodedRecords});
|
||||
},
|
||||
|
||||
callDefaultLostHandler: function callDefaultLostHandler(sessionToken, isP2P) {
|
||||
cpmm.sendAsyncMessage("NFC:CallDefaultLostHandler",
|
||||
{sessionToken: sessionToken,
|
||||
isP2P: isP2P});
|
||||
},
|
||||
|
||||
// nsIObserver
|
||||
observe: function observe(subject, topic, data) {
|
||||
if (topic == "xpcom-shutdown") {
|
||||
@ -363,9 +369,12 @@ NfcContentHelper.prototype = {
|
||||
case NFC.TAG_EVENT_LOST:
|
||||
this.eventListener.notifyTagLost(result.sessionToken);
|
||||
break;
|
||||
case NFC.RF_EVENT_STATE_CHANGE:
|
||||
case NFC.RF_EVENT_STATE_CHANGED:
|
||||
this._rfState = result.rfState;
|
||||
this.eventListener.notifyRFStateChange(this._rfState);
|
||||
this.eventListener.notifyRFStateChanged(this._rfState);
|
||||
break;
|
||||
case NFC.FOCUS_CHANGED:
|
||||
this.eventListener.notifyFocusChanged(result.focus);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -58,7 +58,8 @@ const NFC_IPC_MSG_ENTRIES = [
|
||||
{ permission: null,
|
||||
messages: ["NFC:AddEventListener",
|
||||
"NFC:QueryInfo",
|
||||
"NFC:CallDefaultFoundHandler"] },
|
||||
"NFC:CallDefaultFoundHandler",
|
||||
"NFC:CallDefaultLostHandler"] },
|
||||
|
||||
{ permission: "nfc",
|
||||
messages: ["NFC:ReadNDEF",
|
||||
@ -101,7 +102,7 @@ XPCOMUtils.defineLazyGetter(this, "gMessageManager", function () {
|
||||
|
||||
eventListeners: {},
|
||||
|
||||
focusApp: null,
|
||||
focusApp: NFC.SYSTEM_APP_ID,
|
||||
|
||||
init: function init(nfc) {
|
||||
this.nfc = nfc;
|
||||
@ -177,11 +178,21 @@ XPCOMUtils.defineLazyGetter(this, "gMessageManager", function () {
|
||||
},
|
||||
|
||||
setFocusApp: function setFocusApp(id, isFocus) {
|
||||
// if calling setNFCFocus(true) on the same browser-element, ignore.
|
||||
if (isFocus && (id == this.focusApp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.focusApp != NFC.SYSTEM_APP_ID) {
|
||||
this.onFocusChanged(this.focusApp, false);
|
||||
}
|
||||
|
||||
if (isFocus) {
|
||||
// Now we only support one focus app.
|
||||
this.focusApp = id;
|
||||
this.onFocusChanged(this.focusApp, true);
|
||||
} else if (this.focusApp == id){
|
||||
// Set focusApp to null means currently there is no foreground app.
|
||||
// Set focusApp to SystemApp means currently there is no foreground app.
|
||||
this.focusApp = NFC.SYSTEM_APP_ID;
|
||||
}
|
||||
},
|
||||
@ -235,6 +246,11 @@ XPCOMUtils.defineLazyGetter(this, "gMessageManager", function () {
|
||||
gSystemMessenger.broadcastMessage("nfc-manager-tech-discovered", sysMsg);
|
||||
},
|
||||
|
||||
callDefaultLostHandler: function callDefaultLostHandler(message) {
|
||||
// message.isP2P is not used.
|
||||
gSystemMessenger.broadcastMessage("nfc-manager-tech-lost", message.sessionToken);
|
||||
},
|
||||
|
||||
onTagFound: function onTagFound(message) {
|
||||
let target = this.eventListeners[this.focusApp] ||
|
||||
this.eventListeners[NFC.SYSTEM_APP_ID];
|
||||
@ -262,14 +278,24 @@ XPCOMUtils.defineLazyGetter(this, "gMessageManager", function () {
|
||||
sessionToken: sessionToken });
|
||||
},
|
||||
|
||||
onRFStateChange: function onRFStateChange(rfState) {
|
||||
onRFStateChanged: function onRFStateChanged(rfState) {
|
||||
for (let id in this.eventListeners) {
|
||||
this.notifyDOMEvent(this.eventListeners[id],
|
||||
{ event: NFC.RF_EVENT_STATE_CHANGE,
|
||||
{ event: NFC.RF_EVENT_STATE_CHANGED,
|
||||
rfState: rfState });
|
||||
}
|
||||
},
|
||||
|
||||
onFocusChanged: function onFocusChanged(focusApp, focus) {
|
||||
let target = this.eventListeners[focusApp];
|
||||
if (!target) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.notifyDOMEvent(target, { event: NFC.FOCUS_CHANGED,
|
||||
focus: focus });
|
||||
},
|
||||
|
||||
/**
|
||||
* nsIMessageListener interface methods.
|
||||
*/
|
||||
@ -328,6 +354,9 @@ XPCOMUtils.defineLazyGetter(this, "gMessageManager", function () {
|
||||
case "NFC:CallDefaultFoundHandler":
|
||||
this.callDefaultFoundHandler(message.data);
|
||||
return null;
|
||||
case "NFC:CallDefaultLostHandler":
|
||||
this.callDefaultLostHandler(message.data);
|
||||
return null;
|
||||
default:
|
||||
return this.nfc.receiveMessage(message);
|
||||
}
|
||||
@ -526,10 +555,6 @@ Nfc.prototype = {
|
||||
}
|
||||
|
||||
SessionHelper.unregisterSession(message.sessionId);
|
||||
// Do not expose the actual session to the content
|
||||
delete message.sessionId;
|
||||
|
||||
gSystemMessenger.broadcastMessage("nfc-manager-tech-lost", message);
|
||||
break;
|
||||
case "HCIEventTransactionNotification":
|
||||
this.notifyHCIEventTransaction(message);
|
||||
@ -539,7 +564,7 @@ Nfc.prototype = {
|
||||
|
||||
if (!message.errorMsg) {
|
||||
this.rfState = message.rfState;
|
||||
gMessageManager.onRFStateChange(this.rfState);
|
||||
gMessageManager.onRFStateChanged(this.rfState);
|
||||
}
|
||||
break;
|
||||
case "ReadNDEFResponse": // Fall through.
|
||||
|
@ -44,7 +44,8 @@ this.PEER_EVENT_LOST = 0x02;
|
||||
this.TAG_EVENT_FOUND = 0x03;
|
||||
this.TAG_EVENT_LOST = 0x04;
|
||||
this.PEER_EVENT_FOUND = 0x05;
|
||||
this.RF_EVENT_STATE_CHANGE = 0x06;
|
||||
this.RF_EVENT_STATE_CHANGED = 0x06;
|
||||
this.FOCUS_CHANGED = 0x07;
|
||||
|
||||
// This value should sync with |SYSTEM_APP_ID| in nsINfcContentHelper.idl
|
||||
this.SYSTEM_APP_ID = -1;
|
||||
|
@ -31,7 +31,7 @@ interface nsITagNDEFInfo : nsISupports
|
||||
readonly attribute boolean isFormatable;
|
||||
};
|
||||
|
||||
[scriptable, uuid(be09c440-8385-4210-bb7b-7d3333ec3d43)]
|
||||
[scriptable, uuid(151b4024-0443-434f-99ca-47ec247508ce)]
|
||||
interface nsINfcEventListener : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -83,7 +83,15 @@ interface nsINfcEventListener : nsISupports
|
||||
* @param rfState
|
||||
* RF state received from parent process
|
||||
*/
|
||||
void notifyRFStateChange(in DOMString rfState);
|
||||
void notifyRFStateChanged(in DOMString rfState);
|
||||
|
||||
/**
|
||||
* Callback function used to notify focus changed.
|
||||
*
|
||||
* @param focus
|
||||
* focus value receveid from parent process.
|
||||
*/
|
||||
void notifyFocusChanged(in boolean focus);
|
||||
};
|
||||
|
||||
[scriptable, uuid(6c913015-9658-46a9-88d9-6ecfda2bd020)]
|
||||
@ -111,7 +119,7 @@ interface nsINfcBrowserAPI : nsISupports
|
||||
in boolean isFocus);
|
||||
};
|
||||
|
||||
[scriptable, uuid(b35f4bf5-e1b8-45f4-b5d3-2ae9b6d5871e)]
|
||||
[scriptable, uuid(39e1b25b-5063-449e-b9e8-5514cdca9c3a)]
|
||||
interface nsINfcContentHelper : nsISupports
|
||||
{
|
||||
void init(in nsIDOMWindow window);
|
||||
@ -293,4 +301,17 @@ interface nsINfcContentHelper : nsISupports
|
||||
void callDefaultFoundHandler(in DOMString sessionToken,
|
||||
in boolean isP2P,
|
||||
in nsIVariant records);
|
||||
|
||||
/**
|
||||
* Notify parent process to call the default taglost or peerlost event
|
||||
* handler.
|
||||
*
|
||||
* @param sessionToken
|
||||
* Session token of this event.
|
||||
* @param isP2P
|
||||
* Is this a P2P Session.
|
||||
*/
|
||||
void callDefaultLostHandler(in DOMString sessionToken,
|
||||
in boolean isP2P);
|
||||
|
||||
};
|
||||
|
@ -456,9 +456,6 @@ MozNFCImpl.prototype = {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.eventService.addSystemEventListener(this._window, "visibilitychange",
|
||||
this, /* useCapture */false);
|
||||
|
||||
let tagImpl = new MozNFCTagImpl(this._window, sessionToken, tagInfo, ndefInfo);
|
||||
let tag = this._window.MozNFCTag._create(this._window, tagImpl);
|
||||
|
||||
@ -496,24 +493,24 @@ MozNFCImpl.prototype = {
|
||||
},
|
||||
|
||||
notifyTagLost: function notifyTagLost(sessionToken) {
|
||||
if (!this.handleTagLost(sessionToken)) {
|
||||
this._nfcContentHelper.callDefaultLostHandler(sessionToken, false);
|
||||
}
|
||||
},
|
||||
|
||||
handleTagLost: function handleTagLost(sessionToken) {
|
||||
if (this.hasDeadWrapper()) {
|
||||
dump("this._window or this.__DOM_IMPL__ is a dead wrapper.");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.checkPermissions(["nfc"])) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.nfcTag) {
|
||||
debug("No NFCTag object existing.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove system event listener only when tag and peer are both lost.
|
||||
if (!this.nfcPeer) {
|
||||
this.eventService.removeSystemEventListener(this._window, "visibilitychange",
|
||||
this, /* useCapture */false);
|
||||
return false;
|
||||
}
|
||||
|
||||
this.nfcTag.notifyLost();
|
||||
@ -522,6 +519,8 @@ MozNFCImpl.prototype = {
|
||||
debug("fire ontaglost " + sessionToken);
|
||||
let event = new this._window.Event("taglost");
|
||||
this.__DOM_IMPL__.dispatchEvent(event);
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
notifyPeerFound: function notifyPeerFound(sessionToken, isPeerReady) {
|
||||
@ -552,9 +551,6 @@ MozNFCImpl.prototype = {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.eventService.addSystemEventListener(this._window, "visibilitychange",
|
||||
this, /* useCapture */false);
|
||||
|
||||
let peerImpl = new MozNFCPeerImpl(this._window, sessionToken);
|
||||
this.nfcPeer = this._window.MozNFCPeer._create(this._window, peerImpl);
|
||||
|
||||
@ -590,24 +586,24 @@ MozNFCImpl.prototype = {
|
||||
},
|
||||
|
||||
notifyPeerLost: function notifyPeerLost(sessionToken) {
|
||||
if (!this.handlePeerLost(sessionToken)) {
|
||||
this._nfcContentHelper.callDefaultLostHandler(sessionToken, true);
|
||||
}
|
||||
},
|
||||
|
||||
handlePeerLost: function handlePeerLost(sessionToken) {
|
||||
if (this.hasDeadWrapper()) {
|
||||
dump("this._window or this.__DOM_IMPL__ is a dead wrapper.");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.checkPermissions(["nfc", "nfc-share"])) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.nfcPeer) {
|
||||
debug("No NFCPeer object existing.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove system event listener only when tag and peer are both lost.
|
||||
if (!this.nfcTag) {
|
||||
this.eventService.removeSystemEventListener(this._window, "visibilitychange",
|
||||
this, /* useCapture */false);
|
||||
return false;
|
||||
}
|
||||
|
||||
this.nfcPeer.notifyLost();
|
||||
@ -616,28 +612,30 @@ MozNFCImpl.prototype = {
|
||||
debug("fire onpeerlost");
|
||||
let event = new this._window.Event("peerlost");
|
||||
this.__DOM_IMPL__.dispatchEvent(event);
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
handleEvent: function handleEvent (event) {
|
||||
if (!this._window.document.hidden) {
|
||||
notifyRFStateChanged: function notifyRFStateChanged(rfState) {
|
||||
this._rfState = rfState;
|
||||
},
|
||||
|
||||
notifyFocusChanged: function notifyFocusChanged(focus) {
|
||||
if (focus) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.nfcTag) {
|
||||
debug("handleEvent notifyTagLost");
|
||||
debug("losing focus, call taglost.");
|
||||
this.notifyTagLost(this.nfcTag.session);
|
||||
}
|
||||
|
||||
if (this.nfcPeer) {
|
||||
debug("handleEvent notifyPeerLost");
|
||||
debug("losing focus, call peerlost.");
|
||||
this.notifyPeerLost(this.nfcPeer.session);
|
||||
}
|
||||
},
|
||||
|
||||
notifyRFStateChange: function notifyRFStateChange(rfState) {
|
||||
this._rfState = rfState;
|
||||
},
|
||||
|
||||
checkPermissions: function checkPermissions(perms) {
|
||||
let principal = this._window.document.nodePrincipal;
|
||||
for (let perm of perms) {
|
||||
@ -661,8 +659,7 @@ MozNFCImpl.prototype = {
|
||||
contractID: "@mozilla.org/nfc/manager;1",
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
|
||||
Ci.nsIDOMGlobalPropertyInitializer,
|
||||
Ci.nsINfcEventListener,
|
||||
Ci.nsIDOMEventListener]),
|
||||
Ci.nsINfcEventListener]),
|
||||
};
|
||||
|
||||
function NFCSendFileWrapper() {
|
||||
|
@ -204,6 +204,30 @@ MozMtpDatabase::RemoveEntryAndNotify(MtpObjectHandle aHandle, RefCountedMtpServe
|
||||
aMtpServer->sendObjectRemoved(aHandle);
|
||||
}
|
||||
|
||||
void
|
||||
MozMtpDatabase::UpdateEntryAndNotify(MtpObjectHandle aHandle, DeviceStorageFile* aFile, RefCountedMtpServer* aMtpServer)
|
||||
{
|
||||
UpdateEntry(aHandle, aFile);
|
||||
aMtpServer->sendObjectAdded(aHandle);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MozMtpDatabase::UpdateEntry(MtpObjectHandle aHandle, DeviceStorageFile* aFile)
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
|
||||
RefPtr<DbEntry> entry = mDb[aHandle];
|
||||
|
||||
int64_t fileSize = 0;
|
||||
aFile->mFile->GetFileSize(&fileSize);
|
||||
entry->mObjectSize = fileSize;
|
||||
aFile->mFile->GetLastModifiedTime(&entry->mDateCreated);
|
||||
entry->mDateModified = entry->mDateCreated;
|
||||
MTP_DBG("UpdateEntry (0x%08x file %s)", entry->mHandle, entry->mPath.get());
|
||||
}
|
||||
|
||||
|
||||
class FileWatcherNotifyRunnable MOZ_FINAL : public nsRunnable
|
||||
{
|
||||
public:
|
||||
@ -304,13 +328,16 @@ MozMtpDatabase::FileWatcherUpdate(RefCountedMtpServer* aMtpServer,
|
||||
if (aEventType.EqualsLiteral("modified")) {
|
||||
// To update the file information to the newest, we remove the entry for
|
||||
// the existing file, then re-add the entry for the file.
|
||||
if (entryHandle != 0) {
|
||||
MTP_LOG("About to call sendObjectRemoved Handle 0x%08x file %s", entryHandle, filePath.get());
|
||||
RemoveEntryAndNotify(entryHandle, aMtpServer);
|
||||
}
|
||||
|
||||
// create entry for the file and tell MTP.
|
||||
CreateEntryForFileAndNotify(filePath, aFile, aMtpServer);
|
||||
if (entryHandle != 0) {
|
||||
// Update entry for the file and tell MTP.
|
||||
MTP_LOG("About to update handle 0x%08x file %s", entryHandle, filePath.get());
|
||||
UpdateEntryAndNotify(entryHandle, aFile, aMtpServer);
|
||||
}
|
||||
else {
|
||||
// Create entry for the file and tell MTP.
|
||||
CreateEntryForFileAndNotify(filePath, aFile, aMtpServer);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -238,6 +238,9 @@ private:
|
||||
mozilla::TemporaryRef<DbEntry> GetEntry(MtpObjectHandle aHandle);
|
||||
void RemoveEntry(MtpObjectHandle aHandle);
|
||||
void RemoveEntryAndNotify(MtpObjectHandle aHandle, RefCountedMtpServer* aMtpServer);
|
||||
void UpdateEntry(MtpObjectHandle aHandle, DeviceStorageFile* aFile);
|
||||
void UpdateEntryAndNotify(MtpObjectHandle aHandle, DeviceStorageFile* aFile,
|
||||
RefCountedMtpServer* aMtpServer);
|
||||
void QueryEntries(MatchType aMatchType, uint32_t aMatchField1,
|
||||
uint32_t aMatchField2, UnprotectedDbArray& aResult);
|
||||
|
||||
|
@ -152,7 +152,10 @@ BufObject.prototype = {
|
||||
* original main thread message object that led to the RIL request.
|
||||
*/
|
||||
newParcel: function(type, options) {
|
||||
if (DEBUG) this.context.debug("New outgoing parcel of type " + type);
|
||||
if (DEBUG) {
|
||||
this.context.debug("New outgoing parcel of type " + type +
|
||||
", token " + this.mToken);
|
||||
}
|
||||
|
||||
// We're going to leave room for the parcel size at the beginning.
|
||||
this.outgoingIndex = this.PARCEL_SIZE_SIZE;
|
||||
@ -10736,7 +10739,12 @@ ICCPDUHelperObject.prototype = {
|
||||
let numLen = this.context.GsmPDUHelper.readHexOctet();
|
||||
if (numLen != 0xff) {
|
||||
if (numLen > ADN_MAX_BCD_NUMBER_BYTES) {
|
||||
throw new Error("invalid length of BCD number/SSC contents - " + numLen);
|
||||
if (DEBUG) {
|
||||
this.context.debug(
|
||||
"Error: invalid length of BCD number/SSC contents - " + numLen);
|
||||
}
|
||||
Buf.seekIncoming(ADN_MAX_BCD_NUMBER_BYTES * Buf.PDU_HEX_OCTET_SIZE);
|
||||
return "";
|
||||
}
|
||||
|
||||
number = this.readDiallingNumber(numLen);
|
||||
|
@ -458,18 +458,44 @@ add_test(function test_read_number_with_length() {
|
||||
let context = worker.ContextPool._contexts[0];
|
||||
let helper = context.GsmPDUHelper;
|
||||
let iccHelper = context.ICCPDUHelper;
|
||||
let number = "123456789";
|
||||
|
||||
iccHelper.readDiallingNumber = function(numLen) {
|
||||
return number.substring(0, numLen);
|
||||
let numbers = [
|
||||
{
|
||||
number: "123456789",
|
||||
epectedNumber: "123456789"
|
||||
},
|
||||
{
|
||||
number: null,
|
||||
epectedNumber: null
|
||||
},
|
||||
// Invalid length of BCD number/SSC contents
|
||||
{
|
||||
number: "12345678901234567890123",
|
||||
epectedNumber: ""
|
||||
},
|
||||
];
|
||||
|
||||
// To avoid obtaining wrong buffer content.
|
||||
context.Buf.seekIncoming = function(offset) {
|
||||
};
|
||||
|
||||
helper.writeHexOctet(number.length + 1);
|
||||
helper.writeHexOctet(PDU_TOA_ISDN);
|
||||
do_check_eq(iccHelper.readNumberWithLength(), number);
|
||||
function do_test(aNumber, aExpectedNumber) {
|
||||
iccHelper.readDiallingNumber = function(numLen) {
|
||||
return aNumber.substring(0, numLen);
|
||||
};
|
||||
|
||||
helper.writeHexOctet(0xff);
|
||||
do_check_eq(iccHelper.readNumberWithLength(), null);
|
||||
if (aNumber != null) {
|
||||
helper.writeHexOctet(aNumber.length + 1);
|
||||
} else {
|
||||
helper.writeHexOctet(0xff);
|
||||
}
|
||||
|
||||
equal(iccHelper.readNumberWithLength(), aExpectedNumber);
|
||||
}
|
||||
|
||||
for (let i = 0; i < numbers.length; i++) {
|
||||
do_test(numbers[i].number, numbers[i].epectedNumber);
|
||||
}
|
||||
|
||||
run_next_test();
|
||||
});
|
||||
|
@ -585,28 +585,43 @@ TelephonyService.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
// Before we dial, we have to hold the active call first.
|
||||
// If there is no active call, we can dial a new call directly.
|
||||
let activeCall = this._getOneActiveCall(aClientId);
|
||||
if (!activeCall) {
|
||||
this._sendDialCallRequest(aClientId, aOptions, aCallback);
|
||||
} else {
|
||||
if (DEBUG) debug("There is an active call. Hold it first before dial.");
|
||||
return;
|
||||
}
|
||||
|
||||
this._cachedDialRequest = {
|
||||
clientId: aClientId,
|
||||
options: aOptions,
|
||||
callback: aCallback
|
||||
};
|
||||
// Otherwise, we should hold the active call before dialing another one.
|
||||
if (DEBUG) debug("There is an active call. Hold it first before dial.");
|
||||
|
||||
if (activeCall.isConference) {
|
||||
this.holdConference(aClientId,
|
||||
{ notifySuccess: function () {},
|
||||
notifyError: function (errorMsg) {} });
|
||||
} else {
|
||||
this.holdCall(aClientId, activeCall.callIndex,
|
||||
{ notifySuccess: function () {},
|
||||
notifyError: function (errorMsg) {} });
|
||||
if (this._cachedDialRequest) {
|
||||
if (DEBUG) debug("Error: There already is a pending dial request.");
|
||||
aCallback.notifyError(DIAL_ERROR_INVALID_STATE_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
let autoHoldCallback = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsITelephonyCallback]),
|
||||
|
||||
notifySuccess: () => {
|
||||
this._cachedDialRequest = {
|
||||
clientId: aClientId,
|
||||
options: aOptions,
|
||||
callback: aCallback
|
||||
};
|
||||
},
|
||||
|
||||
notifyError: (aErrorMsg) => {
|
||||
if (DEBUG) debug("Error: Fail to automatically hold the active call.");
|
||||
aCallback.notifyError(aErrorMsg);
|
||||
}
|
||||
};
|
||||
|
||||
if (activeCall.isConference) {
|
||||
this.holdConference(aClientId, autoHoldCallback);
|
||||
} else {
|
||||
this.holdCall(aClientId, activeCall.callIndex, autoHoldCallback);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -5,16 +5,21 @@ MARIONETTE_TIMEOUT = 60000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
function testAutoHoldCall() {
|
||||
log('= testAutoHoldCall =');
|
||||
|
||||
let outCall1;
|
||||
let outCall2;
|
||||
const callNumber1 = "0900000001";
|
||||
const callNumber2 = "0900000002";
|
||||
|
||||
return gDial("0900000001")
|
||||
return Promise.resolve()
|
||||
.then(() => gDial(callNumber1))
|
||||
.then(call => { outCall1 = call; })
|
||||
.then(() => gRemoteAnswer(outCall1))
|
||||
.then(() => {
|
||||
is(outCall1.state, "connected");
|
||||
})
|
||||
.then(() => gDial("0900000002"))
|
||||
.then(() => gDial(callNumber2))
|
||||
.then(call => { outCall2 = call; })
|
||||
.then(() => {
|
||||
is(outCall1.state, "held");
|
||||
@ -22,17 +27,50 @@ function testAutoHoldCall() {
|
||||
.then(() => gRemoteHangUpCalls([outCall1, outCall2]));
|
||||
}
|
||||
|
||||
|
||||
function testAutoHoldCallFailed() {
|
||||
log('= testAutoHoldCallFailed =');
|
||||
|
||||
let outCall1;
|
||||
let outCall2;
|
||||
const callNumber1 = "0900000011";
|
||||
const callNumber2 = "0900000012";
|
||||
|
||||
return Promise.resolve()
|
||||
.then(() => emulator.runCmd("gsm disable hold"))
|
||||
.then(() => gDial(callNumber1))
|
||||
.then(call => { outCall1 = call; })
|
||||
.then(() => gRemoteAnswer(outCall1))
|
||||
.then(() => {
|
||||
is(outCall1.state, "connected");
|
||||
})
|
||||
.then(() => gDial(callNumber2))
|
||||
.then(call => {
|
||||
ok(false, "The second |dial()| should be rejected.");
|
||||
outCall2 = call;
|
||||
return gRemoteHangUpCalls([outCall2]);
|
||||
}, () => log("The second |dial()| is rejected as expected."))
|
||||
.then(() => gRemoteHangUpCalls([outCall1]))
|
||||
.then(() => emulator.runCmd("gsm enable hold"));
|
||||
}
|
||||
|
||||
function testAutoHoldConferenceCall() {
|
||||
log('= testAutoHoldConferenceCall =');
|
||||
|
||||
let subCall1;
|
||||
let subCall2;
|
||||
let outCall;
|
||||
const subNumber1 = "0900000021";
|
||||
const subNumber2 = "0900000022";
|
||||
const outNumber = "0900000023";
|
||||
|
||||
return gSetupConference(["0900000001", "0900000002"])
|
||||
return Promise.resolve()
|
||||
.then(() => gSetupConference([subNumber1, subNumber2]))
|
||||
.then(calls => {
|
||||
[subCall1, subCall2] = calls;
|
||||
is(conference.state, "connected");
|
||||
})
|
||||
.then(() => gDial("0900000003"))
|
||||
.then(() => gDial(outNumber))
|
||||
.then(call => { outCall = call; })
|
||||
.then(() => {
|
||||
is(subCall1.state, "held");
|
||||
@ -43,8 +81,13 @@ function testAutoHoldConferenceCall() {
|
||||
}
|
||||
|
||||
startTest(function() {
|
||||
testAutoHoldCall()
|
||||
Promise.resolve()
|
||||
.then(() => testAutoHoldCall())
|
||||
.then(() => testAutoHoldCallFailed())
|
||||
.then(() => testAutoHoldConferenceCall())
|
||||
.catch(error => ok(false, "Promise reject: " + error))
|
||||
.catch(error => {
|
||||
ok(false, "Promise reject: " + error);
|
||||
emulator.runCmd("gsm enable hold");
|
||||
})
|
||||
.then(finish);
|
||||
});
|
||||
|
@ -72,12 +72,12 @@ interface BluetoothAdapter : EventTarget {
|
||||
* Several onattributechanged events would be triggered during processing the
|
||||
* request, and the last one indicates adapter.state becomes enabled/disabled.
|
||||
*/
|
||||
[NewObject]
|
||||
[NewObject, AvailableIn=CertifiedApps]
|
||||
Promise<void> enable();
|
||||
[NewObject]
|
||||
[NewObject, AvailableIn=CertifiedApps]
|
||||
Promise<void> disable();
|
||||
|
||||
[NewObject]
|
||||
[NewObject, AvailableIn=CertifiedApps]
|
||||
Promise<void> setName(DOMString aName);
|
||||
[NewObject]
|
||||
Promise<void> setDiscoverable(boolean aDiscoverable);
|
||||
|
@ -102,7 +102,8 @@ interface MozNFC : EventTarget {
|
||||
|
||||
/**
|
||||
* This event will be fired when NFCPeer, earlier detected in onpeerready
|
||||
* or onpeerfound, moves out of range.
|
||||
* or onpeerfound, moves out of range, or if the application has been switched
|
||||
* to the background (decided by System app).
|
||||
*/
|
||||
attribute EventHandler onpeerlost;
|
||||
|
||||
@ -121,7 +122,9 @@ interface MozNFC : EventTarget {
|
||||
attribute EventHandler ontagfound;
|
||||
|
||||
/**
|
||||
* This event will be fired if the tag detected in ontagfound has been removed.
|
||||
* This event will be fired if the tag detected in ontagfound has been
|
||||
* removed, or if the application has been switched to the background (decided
|
||||
* by System app).
|
||||
*/
|
||||
attribute EventHandler ontaglost;
|
||||
};
|
||||
|
@ -3735,10 +3735,6 @@ already_AddRefed<Layer>
|
||||
nsDisplayOpacity::BuildLayer(nsDisplayListBuilder* aBuilder,
|
||||
LayerManager* aManager,
|
||||
const ContainerLayerParameters& aContainerParameters) {
|
||||
if (mOpacity == 0 && mFrame->GetContent() &&
|
||||
!nsLayoutUtils::HasAnimations(mFrame->GetContent(), eCSSProperty_opacity)) {
|
||||
return nullptr;
|
||||
}
|
||||
nsRefPtr<Layer> container = aManager->GetLayerBuilder()->
|
||||
BuildContainerLayerFor(aBuilder, aManager, mFrame, this, &mList,
|
||||
aContainerParameters, nullptr);
|
||||
|
@ -1952,10 +1952,13 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
// we're painting, and we're not animating opacity. Don't do this
|
||||
// if we're going to compute plugin geometry, since opacity-0 plugins
|
||||
// need to have display items built for them.
|
||||
bool needEventRegions = aBuilder->IsBuildingLayerEventRegions() &&
|
||||
StyleVisibility()->GetEffectivePointerEvents(this) != NS_STYLE_POINTER_EVENTS_NONE;
|
||||
if (disp->mOpacity == 0.0 && aBuilder->IsForPainting() &&
|
||||
!aBuilder->WillComputePluginGeometry() &&
|
||||
!(disp->mWillChangeBitField & NS_STYLE_WILL_CHANGE_OPACITY) &&
|
||||
!nsLayoutUtils::HasAnimations(mContent, eCSSProperty_opacity)) {
|
||||
!nsLayoutUtils::HasAnimations(mContent, eCSSProperty_opacity) &&
|
||||
!needEventRegions) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -210,27 +210,39 @@ Migrator.prototype = {
|
||||
|
||||
// Must be ready to perform the actual migration.
|
||||
this.log.info("Performing final sync migration steps");
|
||||
// Do the actual migration.
|
||||
// Do the actual migration. We setup one observer for when the new identity
|
||||
// is about to be initialized so we can reset some key preferences - but
|
||||
// there's no promise associated with this.
|
||||
let observeStartOverIdentity;
|
||||
Services.obs.addObserver(observeStartOverIdentity = () => {
|
||||
this.log.info("observed that startOver is about to re-initialize the identity");
|
||||
Services.obs.removeObserver(observeStartOverIdentity, "weave:service:start-over:init-identity");
|
||||
// We've now reset all sync prefs - set the engine related prefs back to
|
||||
// what they were.
|
||||
for (let [prefName, prefType, prefVal] of enginePrefs) {
|
||||
this.log.debug("Restoring pref ${prefName} (type=${prefType}) to ${prefVal}",
|
||||
{prefName, prefType, prefVal});
|
||||
switch (prefType) {
|
||||
case Services.prefs.PREF_BOOL:
|
||||
Services.prefs.setBoolPref(prefName, prefVal);
|
||||
break;
|
||||
case Services.prefs.PREF_STRING:
|
||||
Services.prefs.setCharPref(prefName, prefVal);
|
||||
break;
|
||||
default:
|
||||
// _getEngineEnabledPrefs doesn't return any other type...
|
||||
Cu.reportError("unknown engine pref type for " + prefName + ": " + prefType);
|
||||
}
|
||||
}
|
||||
}, "weave:service:start-over:init-identity", false);
|
||||
|
||||
// And another observer for the startOver being fully complete - the only
|
||||
// reason for this is so we can wait until everything is fully reset.
|
||||
let startOverComplete = new Promise((resolve, reject) => {
|
||||
let observe;
|
||||
Services.obs.addObserver(observe = () => {
|
||||
this.log.info("observed that startOver is complete");
|
||||
Services.obs.removeObserver(observe, "weave:service:start-over:finish");
|
||||
// We've now reset all sync prefs - set the engine related prefs back to
|
||||
// what they were.
|
||||
for (let [prefName, prefType, prefVal] of enginePrefs) {
|
||||
switch (prefType) {
|
||||
case Services.prefs.PREF_BOOL:
|
||||
Services.prefs.setBoolPref(prefName, prefVal);
|
||||
break;
|
||||
case Services.prefs.PREF_STRING:
|
||||
Services.prefs.setCharPref(prefName, prefVal);
|
||||
break;
|
||||
default:
|
||||
// _getEngineEnabledPrefs doesn't return any other type...
|
||||
Cu.reportError("unknown engine pref type for " + prefName + ": " + prefType);
|
||||
}
|
||||
}
|
||||
resolve();
|
||||
}, "weave:service:start-over:finish", false);
|
||||
});
|
||||
@ -240,6 +252,8 @@ Migrator.prototype = {
|
||||
yield startOverComplete;
|
||||
// observer fired, now kick things off with the FxA user.
|
||||
this.log.info("scheduling initial FxA sync.");
|
||||
// Note we technically don't need to unblockSync as by now all sync prefs
|
||||
// have been reset - but it doesn't hurt.
|
||||
this._unblockSync();
|
||||
Weave.Service.scheduler.scheduleNextSync(0);
|
||||
|
||||
|
@ -47,7 +47,7 @@ const OBSERVER_TOPICS = [
|
||||
fxAccountsCommon.ONLOGOUT_NOTIFICATION,
|
||||
];
|
||||
|
||||
const PREF_SYNC_SHOW_CUSTOMIZATION = "services.sync.ui.showCustomizationDialog";
|
||||
const PREF_SYNC_SHOW_CUSTOMIZATION = "services.sync-setup.ui.showCustomizationDialog";
|
||||
|
||||
function deriveKeyBundle(kB) {
|
||||
let out = CryptoUtils.hkdf(kB, undefined,
|
||||
|
@ -592,8 +592,10 @@ ErrorHandler.prototype = {
|
||||
fapp.level = Log.Level[Svc.Prefs.get("log.appender.file.level")];
|
||||
root.addAppender(fapp);
|
||||
|
||||
// Arrange for the FxA, Hawk and TokenServer logs to also go to our appenders.
|
||||
for (let extra of ["FirefoxAccounts", "Hawk", "Common.TokenServerClient"]) {
|
||||
// Arrange for a number of other sync-related logs to also go to our
|
||||
// appenders.
|
||||
for (let extra of ["FirefoxAccounts", "Hawk", "Common.TokenServerClient",
|
||||
"Sync.SyncMigration"]) {
|
||||
let log = Log.repository.getLogger(extra);
|
||||
for (let appender of [fapp, dapp, capp]) {
|
||||
log.addAppender(appender);
|
||||
|
@ -926,6 +926,9 @@ Sync11Service.prototype = {
|
||||
|
||||
this.identity.finalize().then(
|
||||
() => {
|
||||
// an observer so the FxA migration code can take some action before
|
||||
// the new identity is created.
|
||||
Svc.Obs.notify("weave:service:start-over:init-identity");
|
||||
this.identity.username = "";
|
||||
this.status.__authManager = null;
|
||||
this.identity = Status._authManager;
|
||||
|
Loading…
Reference in New Issue
Block a user