mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge m-c to fx-team, a=merge
This commit is contained in:
commit
20a008ea08
@ -552,7 +552,7 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
|
||||
NSScreen* mainView = [[NSScreen screens] objectAtIndex:0];
|
||||
NSPoint tmpPoint = NSMakePoint(point.x,
|
||||
[mainView frame].size.height - point.y);
|
||||
nsIntPoint geckoPoint = nsCocoaUtils::
|
||||
LayoutDeviceIntPoint geckoPoint = nsCocoaUtils::
|
||||
CocoaPointsToDevPixels(tmpPoint, nsCocoaUtils::GetBackingScaleFactor(mainView));
|
||||
|
||||
mozAccessible* nativeChild = nil;
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cb4604d5a578efd027277059ce3e0f6e3af59bd1"/>
|
||||
|
@ -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="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="f80d4c8bcb2f5a08015100048b3ae54c0d7999bd"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
@ -129,7 +129,7 @@
|
||||
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="72ffdf71c68a96309212eb13d63560d66db14c9e"/>
|
||||
<project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="58800ecb50e4e41cfb0a36cb43c82b73fb3612e5"/>
|
||||
<project name="platform_bionic" path="bionic" remote="b2g" revision="3e85c4683c121530c1c3a48c696a569bf5f587e2"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="5a50f96a1d7c788817abb7c57acbb75172c1f48d"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="b2f83825411be614e8f7ec75fc731fc9c67a7078"/>
|
||||
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="f37bd545063039e30a92f2550ae78c0e6e4e2d08"/>
|
||||
<project name="platform_external_wpa_supplicant_8" path="external/wpa_supplicant_8" remote="b2g" revision="0c6a6547cd1fd302fa2b0f6e375654df36bf0ec4"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="29cbaa03a380ab69d47c476dd433059f7680837c"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cb4604d5a578efd027277059ce3e0f6e3af59bd1"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"git": {
|
||||
"git_revision": "ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf",
|
||||
"git_revision": "94a821b49f4dca3f9321cd80e13c44c4a6696952",
|
||||
"remote": "https://git.mozilla.org/releases/gaia.git",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "38edf6a5a770747986828cae0e7316b90794dc19",
|
||||
"revision": "1f6ce210fb439cf48b7fd29dcf2e46914177aba9",
|
||||
"repo_path": "integration/gaia-central"
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
|
||||
|
@ -18,7 +18,7 @@
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="f80d4c8bcb2f5a08015100048b3ae54c0d7999bd"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
|
||||
|
@ -53,7 +53,7 @@ dnl ========================================================
|
||||
MOZJPEG=62
|
||||
MOZPNG=10617
|
||||
NSPR_VERSION=4
|
||||
NSPR_MINVER=4.10.10
|
||||
NSPR_MINVER=4.11
|
||||
NSS_VERSION=3
|
||||
|
||||
dnl Set the minimum version of toolkit libs used by mozilla
|
||||
|
@ -548,6 +548,44 @@ Animation::GetCurrentOrPendingStartTime() const
|
||||
return result;
|
||||
}
|
||||
|
||||
TimeStamp
|
||||
Animation::AnimationTimeToTimeStamp(const StickyTimeDuration& aTime) const
|
||||
{
|
||||
// Initializes to null. Return the same object every time to benefit from
|
||||
// return-value-optimization.
|
||||
TimeStamp result;
|
||||
|
||||
// We *don't* check for mTimeline->TracksWallclockTime() here because that
|
||||
// method only tells us if the timeline times can be converted to
|
||||
// TimeStamps that can be compared to TimeStamp::Now() or not, *not*
|
||||
// whether the timelines can be converted to TimeStamp values at all.
|
||||
//
|
||||
// Furthermore, we want to be able to use this method when the refresh driver
|
||||
// is under test control (in which case TracksWallclockTime() will return
|
||||
// false).
|
||||
//
|
||||
// Once we introduce timelines that are not time-based we will need to
|
||||
// differentiate between them here and determine how to sort their events.
|
||||
if (!mTimeline) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// Check the time is convertible to a timestamp
|
||||
if (aTime == TimeDuration::Forever() ||
|
||||
mPlaybackRate == 0.0 ||
|
||||
mStartTime.IsNull()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// Invert the standard relation:
|
||||
// animation time = (timeline time - start time) * playback rate
|
||||
TimeDuration timelineTime =
|
||||
TimeDuration(aTime).MultDouble(1.0 / mPlaybackRate) + mStartTime.Value();
|
||||
|
||||
result = mTimeline->ToTimeStamp(timelineTime);
|
||||
return result;
|
||||
}
|
||||
|
||||
// https://w3c.github.io/web-animations/#silently-set-the-current-time
|
||||
void
|
||||
Animation::SilentlySetCurrentTime(const TimeDuration& aSeekTime)
|
||||
@ -1129,46 +1167,6 @@ Animation::EffectEnd() const
|
||||
+ mEffect->GetComputedTiming().mActiveDuration;
|
||||
}
|
||||
|
||||
TimeStamp
|
||||
Animation::AnimationTimeToTimeStamp(const StickyTimeDuration& aTime) const
|
||||
{
|
||||
// Initializes to null. Return the same object every time to benefit from
|
||||
// return-value-optimization.
|
||||
TimeStamp result;
|
||||
|
||||
// We *don't* check for mTimeline->TracksWallclockTime() here because that
|
||||
// method only tells us if the timeline times can be converted to
|
||||
// TimeStamps that can be compared to TimeStamp::Now() or not, *not*
|
||||
// whether the timelines can be converted to TimeStamp values at all.
|
||||
//
|
||||
// Since we never compare the result of this method with TimeStamp::Now()
|
||||
// it is ok to return values even if mTimeline->TracksWallclockTime() is
|
||||
// false. Furthermore, we want to be able to use this method when the
|
||||
// refresh driver is under test control (in which case TracksWallclockTime()
|
||||
// will return false).
|
||||
//
|
||||
// Once we introduce timelines that are not time-based we will need to
|
||||
// differentiate between them here and determine how to sort their events.
|
||||
if (!mTimeline) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// Check the time is convertible to a timestamp
|
||||
if (aTime == TimeDuration::Forever() ||
|
||||
mPlaybackRate == 0.0 ||
|
||||
mStartTime.IsNull()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// Invert the standard relation:
|
||||
// animation time = (timeline time - start time) * playback rate
|
||||
TimeDuration timelineTime =
|
||||
TimeDuration(aTime).MultDouble(1.0 / mPlaybackRate) + mStartTime.Value();
|
||||
|
||||
result = mTimeline->ToTimeStamp(timelineTime);
|
||||
return result;
|
||||
}
|
||||
|
||||
nsIDocument*
|
||||
Animation::GetRenderedDocument() const
|
||||
{
|
||||
|
@ -232,6 +232,15 @@ public:
|
||||
*/
|
||||
Nullable<TimeDuration> GetCurrentOrPendingStartTime() const;
|
||||
|
||||
/**
|
||||
* Converts a time in the timescale of this Animation's currentTime, to a
|
||||
* TimeStamp. Returns a null TimeStamp if the conversion cannot be performed
|
||||
* because of the current state of this Animation (e.g. it has no timeline, a
|
||||
* zero playbackRate, an unresolved start time etc.) or the value of the time
|
||||
* passed-in (e.g. an infinite time).
|
||||
*/
|
||||
TimeStamp AnimationTimeToTimeStamp(const StickyTimeDuration& aTime) const;
|
||||
|
||||
bool IsPausedOrPausing() const
|
||||
{
|
||||
return PlayState() == AnimationPlayState::Paused ||
|
||||
@ -354,7 +363,6 @@ protected:
|
||||
|
||||
bool IsPossiblyOrphanedPendingAnimation() const;
|
||||
StickyTimeDuration EffectEnd() const;
|
||||
TimeStamp AnimationTimeToTimeStamp(const StickyTimeDuration& aTime) const;
|
||||
|
||||
nsIDocument* GetRenderedDocument() const;
|
||||
nsPresContext* GetPresContext() const;
|
||||
|
@ -3786,9 +3786,11 @@ nsDOMWindowUtils::SetNextPaintSyncId(int32_t aSyncId)
|
||||
if (lm && lm->GetBackendType() == LayersBackend::LAYERS_CLIENT) {
|
||||
ClientLayerManager* clm = static_cast<ClientLayerManager*>(lm.get());
|
||||
clm->SetNextPaintSyncId(aSyncId);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
NS_WARNING("Paint sync id could not be set on the ClientLayerManager");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "nsDOMNavigationTiming.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsGlobalWindow.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsILoadInfo.h"
|
||||
#include "nsIURI.h"
|
||||
@ -29,6 +30,8 @@
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/IntegerPrintfMacros.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "SharedWorker.h"
|
||||
#include "ServiceWorker.h"
|
||||
#include "js/HeapAPI.h"
|
||||
#include "GeckoProfiler.h"
|
||||
#include "WorkerPrivate.h"
|
||||
@ -500,12 +503,7 @@ nsPerformance::Navigation()
|
||||
DOMHighResTimeStamp
|
||||
nsPerformance::Now() const
|
||||
{
|
||||
double nowTimeMs = GetDOMTiming()->TimeStampToDOMHighRes(TimeStamp::Now());
|
||||
// Round down to the nearest 5us, because if the timer is too accurate people
|
||||
// can do nasty timing attacks with it. See similar code in the worker
|
||||
// Performance implementation.
|
||||
const double maxResolutionMs = 0.005;
|
||||
return floor(nowTimeMs / maxResolutionMs) * maxResolutionMs;
|
||||
return RoundTime(GetDOMTiming()->TimeStampToDOMHighRes(TimeStamp::Now()));
|
||||
}
|
||||
|
||||
JSObject*
|
||||
@ -802,15 +800,16 @@ nsPerformance::InsertUserEntry(PerformanceEntry* aEntry)
|
||||
PerformanceBase::InsertUserEntry(aEntry);
|
||||
}
|
||||
|
||||
DOMHighResTimeStamp
|
||||
nsPerformance::DeltaFromNavigationStart(DOMHighResTimeStamp aTime)
|
||||
TimeStamp
|
||||
nsPerformance::CreationTimeStamp() const
|
||||
{
|
||||
// If the time we're trying to convert is equal to zero, it hasn't been set
|
||||
// yet so just return 0.
|
||||
if (aTime == 0) {
|
||||
return 0;
|
||||
}
|
||||
return aTime - GetDOMTiming()->GetNavigationStart();
|
||||
return GetDOMTiming()->GetNavigationStartTimeStamp();
|
||||
}
|
||||
|
||||
DOMHighResTimeStamp
|
||||
nsPerformance::CreationTime() const
|
||||
{
|
||||
return GetDOMTiming()->GetNavigationStart();
|
||||
}
|
||||
|
||||
// PerformanceBase
|
||||
@ -922,6 +921,48 @@ PerformanceBase::ClearResourceTimings()
|
||||
mResourceEntries.Clear();
|
||||
}
|
||||
|
||||
DOMHighResTimeStamp
|
||||
PerformanceBase::TranslateTime(DOMHighResTimeStamp aTime,
|
||||
const WindowOrWorkerOrSharedWorkerOrServiceWorker& aTimeSource,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
TimeStamp otherCreationTimeStamp;
|
||||
|
||||
if (aTimeSource.IsWindow()) {
|
||||
RefPtr<nsPerformance> performance = aTimeSource.GetAsWindow().GetPerformance();
|
||||
if (NS_WARN_IF(!performance)) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
}
|
||||
otherCreationTimeStamp = performance->CreationTimeStamp();
|
||||
} else if (aTimeSource.IsWorker()) {
|
||||
otherCreationTimeStamp = aTimeSource.GetAsWorker().NowBaseTimeStamp();
|
||||
} else if (aTimeSource.IsSharedWorker()) {
|
||||
SharedWorker& sharedWorker = aTimeSource.GetAsSharedWorker();
|
||||
WorkerPrivate* workerPrivate = sharedWorker.GetWorkerPrivate();
|
||||
otherCreationTimeStamp = workerPrivate->NowBaseTimeStamp();
|
||||
} else if (aTimeSource.IsServiceWorker()) {
|
||||
ServiceWorker& serviceWorker = aTimeSource.GetAsServiceWorker();
|
||||
WorkerPrivate* workerPrivate = serviceWorker.GetWorkerPrivate();
|
||||
otherCreationTimeStamp = workerPrivate->NowBaseTimeStamp();
|
||||
} else {
|
||||
MOZ_CRASH("This should not be possible.");
|
||||
}
|
||||
|
||||
return RoundTime(
|
||||
aTime + (otherCreationTimeStamp - CreationTimeStamp()).ToMilliseconds());
|
||||
}
|
||||
|
||||
DOMHighResTimeStamp
|
||||
PerformanceBase::RoundTime(double aTime) const
|
||||
{
|
||||
// Round down to the nearest 5us, because if the timer is too accurate people
|
||||
// can do nasty timing attacks with it. See similar code in the worker
|
||||
// Performance implementation.
|
||||
const double maxResolutionMs = 0.005;
|
||||
return floor(aTime / maxResolutionMs) * maxResolutionMs;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PerformanceBase::Mark(const nsAString& aName, ErrorResult& aRv)
|
||||
{
|
||||
@ -976,7 +1017,7 @@ PerformanceBase::ResolveTimestampFromName(const nsAString& aName,
|
||||
return 0;
|
||||
}
|
||||
|
||||
return DeltaFromNavigationStart(ts);
|
||||
return ts - CreationTime();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -23,10 +23,15 @@ class nsPerformance;
|
||||
class nsIHttpChannel;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class ErrorResult;
|
||||
|
||||
namespace dom {
|
||||
class PerformanceEntry;
|
||||
class PerformanceObserver;
|
||||
|
||||
class PerformanceEntry;
|
||||
class PerformanceObserver;
|
||||
class WindowOrWorkerOrSharedWorkerOrServiceWorker;
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
@ -313,6 +318,11 @@ public:
|
||||
|
||||
virtual DOMHighResTimeStamp Now() const = 0;
|
||||
|
||||
DOMHighResTimeStamp
|
||||
TranslateTime(DOMHighResTimeStamp aTime,
|
||||
const mozilla::dom::WindowOrWorkerOrSharedWorkerOrServiceWorker& aTimeSource,
|
||||
mozilla::ErrorResult& aRv);
|
||||
|
||||
void Mark(const nsAString& aName, mozilla::ErrorResult& aRv);
|
||||
void ClearMarks(const mozilla::dom::Optional<nsAString>& aName);
|
||||
void Measure(const nsAString& aName,
|
||||
@ -344,8 +354,9 @@ protected:
|
||||
|
||||
virtual void DispatchBufferFullEvent() = 0;
|
||||
|
||||
virtual DOMHighResTimeStamp
|
||||
DeltaFromNavigationStart(DOMHighResTimeStamp aTime) = 0;
|
||||
virtual mozilla::TimeStamp CreationTimeStamp() const = 0;
|
||||
|
||||
virtual DOMHighResTimeStamp CreationTime() const = 0;
|
||||
|
||||
virtual bool IsPerformanceTimingAttribute(const nsAString& aName) = 0;
|
||||
|
||||
@ -363,6 +374,8 @@ protected:
|
||||
void RunNotificationObserversTask();
|
||||
void QueueEntry(PerformanceEntry* aEntry);
|
||||
|
||||
DOMHighResTimeStamp RoundTime(double aTime) const;
|
||||
|
||||
nsTObserverArray<PerformanceObserver*> mObservers;
|
||||
|
||||
private:
|
||||
@ -433,7 +446,11 @@ public:
|
||||
|
||||
IMPL_EVENT_HANDLER(resourcetimingbufferfull)
|
||||
|
||||
private:
|
||||
mozilla::TimeStamp CreationTimeStamp() const override;
|
||||
|
||||
DOMHighResTimeStamp CreationTime() const override;
|
||||
|
||||
protected:
|
||||
~nsPerformance();
|
||||
|
||||
nsISupports* GetAsISupports() override
|
||||
@ -445,9 +462,6 @@ private:
|
||||
|
||||
bool IsPerformanceTimingAttribute(const nsAString& aName) override;
|
||||
|
||||
DOMHighResTimeStamp
|
||||
DeltaFromNavigationStart(DOMHighResTimeStamp aTime) override;
|
||||
|
||||
DOMHighResTimeStamp
|
||||
GetPerformanceTimingFromString(const nsAString& aTimingName) override;
|
||||
|
||||
|
1
dom/base/test/empty_worker.js
Normal file
1
dom/base/test/empty_worker.js
Normal file
@ -0,0 +1 @@
|
||||
/* nothing here */
|
@ -256,6 +256,7 @@ support-files =
|
||||
file_explicit_user_agent.sjs
|
||||
referrer_change_server.sjs
|
||||
file_change_policy_redirect.html
|
||||
empty_worker.js
|
||||
|
||||
[test_anonymousContent_api.html]
|
||||
[test_anonymousContent_append_after_reflow.html]
|
||||
@ -725,7 +726,7 @@ support-files = referrerHelper.js
|
||||
[test_classList.html]
|
||||
# This test fails on the Mac for some reason
|
||||
[test_copyimage.html]
|
||||
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || (toolkit != 'cocoa' && toolkit != 'gonk' && toolkit != 'gtk2' && toolkit != 'gtk3' && toolkit != 'windows') || e10s #b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
|
||||
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || (toolkit != 'cocoa' && toolkit != 'gonk' && toolkit != 'gtk2' && toolkit != 'gtk3' && toolkit != 'windows') #b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
|
||||
[test_copypaste.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #bug 904183 # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined)
|
||||
[test_copypaste.xhtml]
|
||||
@ -775,15 +776,15 @@ skip-if = buildapp == 'b2g' || e10s # b2g(bug 901385, showmodaldialog) b2g-debug
|
||||
[test_object.html]
|
||||
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(needs plugin support) b2g-debug(needs plugin support) b2g-desktop(needs plugin support)
|
||||
[test_plugin_freezing.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #CLICK_TO_PLAY
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' #CLICK_TO_PLAY
|
||||
[test_processing_instruction_update_stylesheet.xhtml]
|
||||
[test_progress_events_for_gzip_data.html]
|
||||
[test_range_bounds.html]
|
||||
skip-if = toolkit == 'android' || e10s
|
||||
skip-if = toolkit == 'android'
|
||||
[test_reentrant_flush.html]
|
||||
skip-if = toolkit == 'android' || e10s #RANDOM
|
||||
skip-if = toolkit == 'android'
|
||||
[test_sync_xhr_timer.xhtml]
|
||||
skip-if = toolkit == 'android' || e10s #RANDOM
|
||||
skip-if = toolkit == 'android'
|
||||
[test_text_wholeText.html]
|
||||
[test_textnode_normalize_in_selection.html]
|
||||
[test_textnode_split_in_selection.html]
|
||||
@ -855,3 +856,4 @@ skip-if = e10s || os != 'linux' || buildapp != 'browser'
|
||||
[test_change_policy.html]
|
||||
skip-if = buildapp == 'b2g' #no ssl support
|
||||
[test_document.all_iteration.html]
|
||||
[test_performance_translate.html]
|
||||
|
75
dom/base/test/test_performance_translate.html
Normal file
75
dom/base/test/test_performance_translate.html
Normal file
@ -0,0 +1,75 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for performance.translate()</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="test_performance_user_timing.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
function testBasic() {
|
||||
ok("translateTime" in performance, "Performance.translateTime exists.");
|
||||
try {
|
||||
performance.translateTime(0, null);
|
||||
ok(false, "Wrong use of performance.translateTime.");
|
||||
} catch(e) {
|
||||
ok(true, "Wrong use of performance.translateTime.");
|
||||
}
|
||||
|
||||
next();
|
||||
}
|
||||
|
||||
function testWindow() {
|
||||
is(performance.translateTime(42, this), 42, "translating time with the same window.");
|
||||
|
||||
var now = performance.now();
|
||||
|
||||
var ifr = document.createElement('iframe');
|
||||
ifr.src = 'file_empty.html';
|
||||
document.body.appendChild(ifr);
|
||||
|
||||
ifr.onload = function() {
|
||||
var a = performance.translateTime(0, ifr.contentWindow);
|
||||
ok (a >= now, "Time has been translated from a window that started loading later than we did");
|
||||
next();
|
||||
}
|
||||
}
|
||||
|
||||
function testWorker() {
|
||||
var now = performance.now();
|
||||
|
||||
var w = new Worker('empty_worker.js');
|
||||
var a = performance.translateTime(0, w);
|
||||
// bug 1226147
|
||||
todo (a >= now, "Time has been translated from a Worker that started loading later than we did");
|
||||
next();
|
||||
}
|
||||
|
||||
function testSharedWorker() {
|
||||
var now = performance.now();
|
||||
|
||||
var w = new SharedWorker('empty_worker.js');
|
||||
var a = performance.translateTime(0, w);
|
||||
ok (a >= now, "Time has been translated from a SharedWorker that started loading later than we did");
|
||||
next();
|
||||
}
|
||||
|
||||
var tests = [ testBasic, testWindow, testWorker, testSharedWorker ];
|
||||
function next() {
|
||||
if (!tests.length) {
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
|
||||
var test = tests.shift();
|
||||
test();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(next);
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -17,21 +17,16 @@ using namespace mozilla::ipc;
|
||||
|
||||
const int BluetoothDaemonCoreModule::MAX_NUM_CLIENTS = 1;
|
||||
|
||||
BluetoothNotificationHandler* BluetoothDaemonCoreModule::sNotificationHandler;
|
||||
BluetoothCoreNotificationHandler*
|
||||
BluetoothDaemonCoreModule::sNotificationHandler;
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::SetNotificationHandler(
|
||||
BluetoothNotificationHandler* aNotificationHandler)
|
||||
BluetoothCoreNotificationHandler* aNotificationHandler)
|
||||
{
|
||||
sNotificationHandler = aNotificationHandler;
|
||||
}
|
||||
|
||||
BluetoothNotificationHandler*
|
||||
BluetoothDaemonCoreModule::GetNotificationHandler()
|
||||
{
|
||||
return sNotificationHandler;
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::HandleSvc(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
@ -53,7 +48,7 @@ BluetoothDaemonCoreModule::HandleSvc(const DaemonSocketPDUHeader& aHeader,
|
||||
//
|
||||
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::EnableCmd(BluetoothResultHandler* aRes)
|
||||
BluetoothDaemonCoreModule::EnableCmd(BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -70,7 +65,7 @@ BluetoothDaemonCoreModule::EnableCmd(BluetoothResultHandler* aRes)
|
||||
}
|
||||
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::DisableCmd(BluetoothResultHandler* aRes)
|
||||
BluetoothDaemonCoreModule::DisableCmd(BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -88,7 +83,7 @@ BluetoothDaemonCoreModule::DisableCmd(BluetoothResultHandler* aRes)
|
||||
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::GetAdapterPropertiesCmd(
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -105,8 +100,8 @@ BluetoothDaemonCoreModule::GetAdapterPropertiesCmd(
|
||||
}
|
||||
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::GetAdapterPropertyCmd(BluetoothPropertyType aType,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothDaemonCoreModule::GetAdapterPropertyCmd(
|
||||
BluetoothPropertyType aType, BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -128,7 +123,7 @@ BluetoothDaemonCoreModule::GetAdapterPropertyCmd(BluetoothPropertyType aType,
|
||||
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::SetAdapterPropertyCmd(
|
||||
const BluetoothProperty& aProperty, BluetoothResultHandler* aRes)
|
||||
const BluetoothProperty& aProperty, BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -150,7 +145,7 @@ BluetoothDaemonCoreModule::SetAdapterPropertyCmd(
|
||||
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::GetRemoteDevicePropertiesCmd(
|
||||
const BluetoothAddress& aRemoteAddr, BluetoothResultHandler* aRes)
|
||||
const BluetoothAddress& aRemoteAddr, BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -174,7 +169,7 @@ nsresult
|
||||
BluetoothDaemonCoreModule::GetRemoteDevicePropertyCmd(
|
||||
const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothPropertyType aType,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -198,7 +193,7 @@ nsresult
|
||||
BluetoothDaemonCoreModule::SetRemoteDevicePropertyCmd(
|
||||
const BluetoothAddress& aRemoteAddr,
|
||||
const BluetoothProperty& aProperty,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -221,7 +216,7 @@ BluetoothDaemonCoreModule::SetRemoteDevicePropertyCmd(
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::GetRemoteServiceRecordCmd(
|
||||
const BluetoothAddress& aRemoteAddr, const BluetoothUuid& aUuid,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -243,7 +238,7 @@ BluetoothDaemonCoreModule::GetRemoteServiceRecordCmd(
|
||||
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::GetRemoteServicesCmd(
|
||||
const BluetoothAddress& aRemoteAddr, BluetoothResultHandler* aRes)
|
||||
const BluetoothAddress& aRemoteAddr, BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -263,7 +258,7 @@ BluetoothDaemonCoreModule::GetRemoteServicesCmd(
|
||||
}
|
||||
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::StartDiscoveryCmd(BluetoothResultHandler* aRes)
|
||||
BluetoothDaemonCoreModule::StartDiscoveryCmd(BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -280,7 +275,7 @@ BluetoothDaemonCoreModule::StartDiscoveryCmd(BluetoothResultHandler* aRes)
|
||||
}
|
||||
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::CancelDiscoveryCmd(BluetoothResultHandler* aRes)
|
||||
BluetoothDaemonCoreModule::CancelDiscoveryCmd(BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -299,7 +294,7 @@ BluetoothDaemonCoreModule::CancelDiscoveryCmd(BluetoothResultHandler* aRes)
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::CreateBondCmd(const BluetoothAddress& aBdAddr,
|
||||
BluetoothTransport aTransport,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -325,7 +320,7 @@ BluetoothDaemonCoreModule::CreateBondCmd(const BluetoothAddress& aBdAddr,
|
||||
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::RemoveBondCmd(const BluetoothAddress& aBdAddr,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -347,7 +342,7 @@ BluetoothDaemonCoreModule::RemoveBondCmd(const BluetoothAddress& aBdAddr,
|
||||
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::CancelBondCmd(const BluetoothAddress& aBdAddr,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -371,7 +366,7 @@ nsresult
|
||||
BluetoothDaemonCoreModule::PinReplyCmd(const BluetoothAddress& aBdAddr,
|
||||
bool aAccept,
|
||||
const BluetoothPinCode& aPinCode,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -395,7 +390,7 @@ nsresult
|
||||
BluetoothDaemonCoreModule::SspReplyCmd(const BluetoothAddress& aBdAddr,
|
||||
BluetoothSspVariant aVariant,
|
||||
bool aAccept, uint32_t aPasskey,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -416,8 +411,8 @@ BluetoothDaemonCoreModule::SspReplyCmd(const BluetoothAddress& aBdAddr,
|
||||
}
|
||||
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::DutModeConfigureCmd(bool aEnable,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothDaemonCoreModule::DutModeConfigureCmd(
|
||||
bool aEnable, BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -440,7 +435,7 @@ BluetoothDaemonCoreModule::DutModeConfigureCmd(bool aEnable,
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::DutModeSendCmd(uint16_t aOpcode,
|
||||
uint8_t* aBuf, uint8_t aLen,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -464,7 +459,7 @@ BluetoothDaemonCoreModule::DutModeSendCmd(uint16_t aOpcode,
|
||||
nsresult
|
||||
BluetoothDaemonCoreModule::LeTestModeCmd(uint16_t aOpcode,
|
||||
uint8_t* aBuf, uint8_t aLen,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -491,207 +486,207 @@ BluetoothDaemonCoreModule::LeTestModeCmd(uint16_t aOpcode,
|
||||
void
|
||||
BluetoothDaemonCoreModule::ErrorRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ErrorRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::OnError, UnpackPDUInitOp(aPDU));
|
||||
aRes, &BluetoothCoreResultHandler::OnError, UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::EnableRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::Enable, UnpackPDUInitOp(aPDU));
|
||||
aRes, &BluetoothCoreResultHandler::Enable, UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::DisableRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::Disable, UnpackPDUInitOp(aPDU));
|
||||
aRes, &BluetoothCoreResultHandler::Disable, UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::GetAdapterPropertiesRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::GetAdapterProperties,
|
||||
aRes, &BluetoothCoreResultHandler::GetAdapterProperties,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::GetAdapterPropertyRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::GetAdapterProperty,
|
||||
aRes, &BluetoothCoreResultHandler::GetAdapterProperty,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::SetAdapterPropertyRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::SetAdapterProperty,
|
||||
aRes, &BluetoothCoreResultHandler::SetAdapterProperty,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::GetRemoteDevicePropertiesRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::GetRemoteDeviceProperties,
|
||||
aRes, &BluetoothCoreResultHandler::GetRemoteDeviceProperties,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::GetRemoteDevicePropertyRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::GetRemoteDeviceProperty,
|
||||
aRes, &BluetoothCoreResultHandler::GetRemoteDeviceProperty,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::SetRemoteDevicePropertyRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::SetRemoteDeviceProperty,
|
||||
aRes, &BluetoothCoreResultHandler::SetRemoteDeviceProperty,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::GetRemoteServiceRecordRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::GetRemoteServiceRecord,
|
||||
aRes, &BluetoothCoreResultHandler::GetRemoteServiceRecord,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::GetRemoteServicesRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::GetRemoteServices,
|
||||
aRes, &BluetoothCoreResultHandler::GetRemoteServices,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::StartDiscoveryRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::StartDiscovery,
|
||||
aRes, &BluetoothCoreResultHandler::StartDiscovery,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::CancelDiscoveryRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::CancelDiscovery,
|
||||
aRes, &BluetoothCoreResultHandler::CancelDiscovery,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::CreateBondRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::CreateBond,
|
||||
aRes, &BluetoothCoreResultHandler::CreateBond,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::RemoveBondRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::RemoveBond,
|
||||
aRes, &BluetoothCoreResultHandler::RemoveBond,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::CancelBondRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::CancelBond,
|
||||
aRes, &BluetoothCoreResultHandler::CancelBond,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::PinReplyRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::PinReply,
|
||||
aRes, &BluetoothCoreResultHandler::PinReply,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::SspReplyRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::SspReply,
|
||||
aRes, &BluetoothCoreResultHandler::SspReply,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::DutModeConfigureRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::DutModeConfigure,
|
||||
aRes, &BluetoothCoreResultHandler::DutModeConfigure,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::DutModeSendRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::DutModeSend,
|
||||
aRes, &BluetoothCoreResultHandler::DutModeSend,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreModule::LeTestModeRsp(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes)
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
ResultRunnable::Dispatch(
|
||||
aRes, &BluetoothResultHandler::LeTestMode,
|
||||
aRes, &BluetoothCoreResultHandler::LeTestMode,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
@ -703,7 +698,7 @@ BluetoothDaemonCoreModule::HandleRsp(
|
||||
static void (BluetoothDaemonCoreModule::* const HandleRsp[])(
|
||||
const DaemonSocketPDUHeader&,
|
||||
DaemonSocketPDU&,
|
||||
BluetoothResultHandler*) = {
|
||||
BluetoothCoreResultHandler*) = {
|
||||
[OPCODE_ERROR] =
|
||||
&BluetoothDaemonCoreModule::ErrorRsp,
|
||||
[OPCODE_ENABLE] =
|
||||
@ -755,8 +750,8 @@ BluetoothDaemonCoreModule::HandleRsp(
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<BluetoothResultHandler> res =
|
||||
static_cast<BluetoothResultHandler*>(aRes);
|
||||
RefPtr<BluetoothCoreResultHandler> res =
|
||||
static_cast<BluetoothCoreResultHandler*>(aRes);
|
||||
|
||||
if (!res) {
|
||||
return; // Return early if no result handler has been set for response
|
||||
@ -771,7 +766,7 @@ BluetoothDaemonCoreModule::HandleRsp(
|
||||
class BluetoothDaemonCoreModule::NotificationHandlerWrapper final
|
||||
{
|
||||
public:
|
||||
typedef BluetoothNotificationHandler ObjectType;
|
||||
typedef BluetoothCoreNotificationHandler ObjectType;
|
||||
|
||||
static ObjectType* GetInstance()
|
||||
{
|
||||
@ -786,7 +781,7 @@ BluetoothDaemonCoreModule::AdapterStateChangedNtf(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
|
||||
{
|
||||
AdapterStateChangedNotification::Dispatch(
|
||||
&BluetoothNotificationHandler::AdapterStateChangedNotification,
|
||||
&BluetoothCoreNotificationHandler::AdapterStateChangedNotification,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
@ -835,7 +830,7 @@ BluetoothDaemonCoreModule::AdapterPropertiesNtf(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
|
||||
{
|
||||
AdapterPropertiesNotification::Dispatch(
|
||||
&BluetoothNotificationHandler::AdapterPropertiesNotification,
|
||||
&BluetoothCoreNotificationHandler::AdapterPropertiesNotification,
|
||||
AdapterPropertiesInitOp(aPDU));
|
||||
}
|
||||
|
||||
@ -890,7 +885,7 @@ BluetoothDaemonCoreModule::RemoteDevicePropertiesNtf(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
|
||||
{
|
||||
RemoteDevicePropertiesNotification::Dispatch(
|
||||
&BluetoothNotificationHandler::RemoteDevicePropertiesNotification,
|
||||
&BluetoothCoreNotificationHandler::RemoteDevicePropertiesNotification,
|
||||
RemoteDevicePropertiesInitOp(aPDU));
|
||||
}
|
||||
|
||||
@ -932,7 +927,7 @@ BluetoothDaemonCoreModule::DeviceFoundNtf(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
|
||||
{
|
||||
DeviceFoundNotification::Dispatch(
|
||||
&BluetoothNotificationHandler::DeviceFoundNotification,
|
||||
&BluetoothCoreNotificationHandler::DeviceFoundNotification,
|
||||
DeviceFoundInitOp(aPDU));
|
||||
}
|
||||
|
||||
@ -941,7 +936,7 @@ BluetoothDaemonCoreModule::DiscoveryStateChangedNtf(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
|
||||
{
|
||||
DiscoveryStateChangedNotification::Dispatch(
|
||||
&BluetoothNotificationHandler::DiscoveryStateChangedNotification,
|
||||
&BluetoothCoreNotificationHandler::DiscoveryStateChangedNotification,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
@ -950,7 +945,7 @@ BluetoothDaemonCoreModule::PinRequestNtf(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
|
||||
{
|
||||
PinRequestNotification::Dispatch(
|
||||
&BluetoothNotificationHandler::PinRequestNotification,
|
||||
&BluetoothCoreNotificationHandler::PinRequestNotification,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
@ -959,7 +954,7 @@ BluetoothDaemonCoreModule::SspRequestNtf(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
|
||||
{
|
||||
SspRequestNotification::Dispatch(
|
||||
&BluetoothNotificationHandler::SspRequestNotification,
|
||||
&BluetoothCoreNotificationHandler::SspRequestNotification,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
@ -968,7 +963,7 @@ BluetoothDaemonCoreModule::BondStateChangedNtf(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
|
||||
{
|
||||
BondStateChangedNotification::Dispatch(
|
||||
&BluetoothNotificationHandler::BondStateChangedNotification,
|
||||
&BluetoothCoreNotificationHandler::BondStateChangedNotification,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
@ -977,7 +972,7 @@ BluetoothDaemonCoreModule::AclStateChangedNtf(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
|
||||
{
|
||||
AclStateChangedNotification::Dispatch(
|
||||
&BluetoothNotificationHandler::AclStateChangedNotification,
|
||||
&BluetoothCoreNotificationHandler::AclStateChangedNotification,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
@ -1023,7 +1018,7 @@ BluetoothDaemonCoreModule::DutModeRecvNtf(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
|
||||
{
|
||||
DutModeRecvNotification::Dispatch(
|
||||
&BluetoothNotificationHandler::DutModeRecvNotification,
|
||||
&BluetoothCoreNotificationHandler::DutModeRecvNotification,
|
||||
DutModeRecvInitOp(aPDU));
|
||||
}
|
||||
|
||||
@ -1032,7 +1027,7 @@ BluetoothDaemonCoreModule::LeTestModeNtf(
|
||||
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
|
||||
{
|
||||
LeTestModeNotification::Dispatch(
|
||||
&BluetoothNotificationHandler::LeTestModeNotification,
|
||||
&BluetoothCoreNotificationHandler::LeTestModeNotification,
|
||||
UnpackPDUInitOp(aPDU));
|
||||
}
|
||||
|
||||
@ -1068,4 +1063,294 @@ BluetoothDaemonCoreModule::HandleNtf(
|
||||
(this->*(HandleNtf[index]))(aHeader, aPDU);
|
||||
}
|
||||
|
||||
//
|
||||
// Core interface
|
||||
//
|
||||
|
||||
BluetoothDaemonCoreInterface::BluetoothDaemonCoreInterface(
|
||||
BluetoothDaemonCoreModule* aModule)
|
||||
: mModule(aModule)
|
||||
{ }
|
||||
|
||||
BluetoothDaemonCoreInterface::~BluetoothDaemonCoreInterface()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::SetNotificationHandler(
|
||||
BluetoothCoreNotificationHandler* aNotificationHandler)
|
||||
{
|
||||
MOZ_ASSERT(mModule);
|
||||
|
||||
mModule->SetNotificationHandler(aNotificationHandler);
|
||||
}
|
||||
|
||||
/* Enable / Disable */
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::Enable(BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->EnableCmd(aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::Disable(BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->DisableCmd(aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Adapter Properties */
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::GetAdapterProperties(
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->GetAdapterPropertiesCmd(aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::GetAdapterProperty(
|
||||
BluetoothPropertyType aType, BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->GetAdapterPropertyCmd(aType, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::SetAdapterProperty(
|
||||
const BluetoothProperty& aProperty, BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->SetAdapterPropertyCmd(aProperty, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Remote Device Properties */
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::GetRemoteDeviceProperties(
|
||||
const BluetoothAddress& aRemoteAddr, BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->GetRemoteDevicePropertiesCmd(aRemoteAddr, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::GetRemoteDeviceProperty(
|
||||
const BluetoothAddress& aRemoteAddr, BluetoothPropertyType aType,
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->GetRemoteDevicePropertyCmd(aRemoteAddr, aType, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::SetRemoteDeviceProperty(
|
||||
const BluetoothAddress& aRemoteAddr, const BluetoothProperty& aProperty,
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->SetRemoteDevicePropertyCmd(aRemoteAddr,
|
||||
aProperty,
|
||||
aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Remote Services */
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::GetRemoteServiceRecord(
|
||||
const BluetoothAddress& aRemoteAddr, const BluetoothUuid& aUuid,
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->GetRemoteServiceRecordCmd(aRemoteAddr, aUuid, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::GetRemoteServices(
|
||||
const BluetoothAddress& aRemoteAddr, BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->GetRemoteServicesCmd(aRemoteAddr, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Discovery */
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::StartDiscovery(BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->StartDiscoveryCmd(aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::CancelDiscovery(BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->CancelDiscoveryCmd(aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Bonds */
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::CreateBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothTransport aTransport,
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->CreateBondCmd(aBdAddr, aTransport, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::RemoveBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->RemoveBondCmd(aBdAddr, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::CancelBond(
|
||||
const BluetoothAddress& aBdAddr, BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->CancelBondCmd(aBdAddr, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Connection */
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::GetConnectionState(
|
||||
const BluetoothAddress& aBdAddr, BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
// NO-OP: no corresponding interface of current BlueZ
|
||||
}
|
||||
|
||||
/* Authentication */
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::PinReply(const BluetoothAddress& aBdAddr,
|
||||
bool aAccept,
|
||||
const BluetoothPinCode& aPinCode,
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->PinReplyCmd(aBdAddr, aAccept, aPinCode, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::SspReply(const BluetoothAddress& aBdAddr,
|
||||
BluetoothSspVariant aVariant,
|
||||
bool aAccept, uint32_t aPasskey,
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->SspReplyCmd(aBdAddr, aVariant, aAccept, aPasskey,
|
||||
aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* DUT Mode */
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::DutModeConfigure(
|
||||
bool aEnable, BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->DutModeConfigureCmd(aEnable, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::DutModeSend(uint16_t aOpcode,
|
||||
uint8_t* aBuf,
|
||||
uint8_t aLen,
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->DutModeSendCmd(aOpcode, aBuf, aLen, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* LE Mode */
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::LeTestMode(uint16_t aOpcode,
|
||||
uint8_t* aBuf,
|
||||
uint8_t aLen,
|
||||
BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = mModule->LeTestModeCmd(aOpcode, aBuf, aLen, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Energy Information */
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::ReadEnergyInfo(BluetoothCoreResultHandler* aRes)
|
||||
{
|
||||
// NO-OP: no corresponding interface of current BlueZ
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::DispatchError(BluetoothCoreResultHandler* aRes,
|
||||
BluetoothStatus aStatus)
|
||||
{
|
||||
DaemonResultRunnable1<
|
||||
BluetoothCoreResultHandler, void,
|
||||
BluetoothStatus, BluetoothStatus>::Dispatch(
|
||||
aRes, &BluetoothCoreResultHandler::OnError,
|
||||
ConstantInitOp1<BluetoothStatus>(aStatus));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonCoreInterface::DispatchError(BluetoothCoreResultHandler* aRes,
|
||||
nsresult aRv)
|
||||
{
|
||||
BluetoothStatus status;
|
||||
|
||||
if (NS_WARN_IF(NS_FAILED(Convert(aRv, status)))) {
|
||||
status = STATUS_FAIL;
|
||||
}
|
||||
DispatchError(aRes, status);
|
||||
}
|
||||
|
||||
END_BLUETOOTH_NAMESPACE
|
||||
|
@ -65,74 +65,73 @@ public:
|
||||
DaemonSocketResultHandler* aRes) = 0;
|
||||
|
||||
void SetNotificationHandler(
|
||||
BluetoothNotificationHandler* aNotificationHandler);
|
||||
|
||||
BluetoothNotificationHandler* GetNotificationHandler();
|
||||
BluetoothCoreNotificationHandler* aNotificationHandler);
|
||||
|
||||
//
|
||||
// Commands
|
||||
//
|
||||
|
||||
nsresult EnableCmd(BluetoothResultHandler* aRes);
|
||||
nsresult EnableCmd(BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult DisableCmd(BluetoothResultHandler* aRes);
|
||||
nsresult DisableCmd(BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult GetAdapterPropertiesCmd(BluetoothResultHandler* aRes);
|
||||
nsresult GetAdapterPropertiesCmd(BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult GetAdapterPropertyCmd(BluetoothPropertyType aType,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult SetAdapterPropertyCmd(const BluetoothProperty& aProperty,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult GetRemoteDevicePropertiesCmd(const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult GetRemoteDevicePropertyCmd(const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothPropertyType aType,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult SetRemoteDevicePropertyCmd(const BluetoothAddress& aRemoteAddr,
|
||||
const BluetoothProperty& aProperty,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult GetRemoteServiceRecordCmd(const BluetoothAddress& aRemoteAddr,
|
||||
const BluetoothUuid& aUuid,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult GetRemoteServicesCmd(const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult StartDiscoveryCmd(BluetoothResultHandler* aRes);
|
||||
nsresult StartDiscoveryCmd(BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult CancelDiscoveryCmd(BluetoothResultHandler* aRes);
|
||||
nsresult CancelDiscoveryCmd(BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult CreateBondCmd(const BluetoothAddress& aBdAddr,
|
||||
BluetoothTransport aTransport,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult RemoveBondCmd(const BluetoothAddress& aBdAddr,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult CancelBondCmd(const BluetoothAddress& aBdAddr,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult PinReplyCmd(const BluetoothAddress& aBdAddr, bool aAccept,
|
||||
const BluetoothPinCode& aPinCode,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult SspReplyCmd(const BluetoothAddress& aBdAddr,
|
||||
BluetoothSspVariant aVariant,
|
||||
bool aAccept, uint32_t aPasskey,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult DutModeConfigureCmd(bool aEnable, BluetoothResultHandler* aRes);
|
||||
nsresult DutModeConfigureCmd(bool aEnable,
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult DutModeSendCmd(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
nsresult LeTestModeCmd(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
protected:
|
||||
void HandleSvc(const DaemonSocketPDUHeader& aHeader,
|
||||
@ -145,91 +144,90 @@ private:
|
||||
//
|
||||
|
||||
typedef mozilla::ipc::DaemonResultRunnable0<
|
||||
BluetoothResultHandler, void>
|
||||
BluetoothCoreResultHandler, void>
|
||||
ResultRunnable;
|
||||
|
||||
typedef mozilla::ipc::DaemonResultRunnable1<
|
||||
BluetoothResultHandler, void, BluetoothStatus, BluetoothStatus>
|
||||
BluetoothCoreResultHandler, void, BluetoothStatus, BluetoothStatus>
|
||||
ErrorRunnable;
|
||||
|
||||
void ErrorRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
void EnableRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
void DisableRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
void GetAdapterPropertiesRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
void GetAdapterPropertyRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
void SetAdapterPropertyRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
void GetRemoteDevicePropertiesRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
void
|
||||
GetRemoteDevicePropertyRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
void GetRemoteDevicePropertyRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
void SetRemoteDevicePropertyRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
void GetRemoteServiceRecordRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
void GetRemoteServicesRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
void StartDiscoveryRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
void CancelDiscoveryRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
void CreateBondRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
void RemoveBondRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
void CancelBondRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
void PinReplyRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
void SspReplyRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
void DutModeConfigureRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
void DutModeSendRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
void LeTestModeRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU,
|
||||
BluetoothResultHandler* aRes);
|
||||
BluetoothCoreResultHandler* aRes);
|
||||
|
||||
void HandleRsp(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU, DaemonSocketResultHandler* aRes);
|
||||
@ -339,7 +337,104 @@ private:
|
||||
void HandleNtf(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU, DaemonSocketResultHandler* aRes);
|
||||
|
||||
static BluetoothNotificationHandler* sNotificationHandler;
|
||||
static BluetoothCoreNotificationHandler* sNotificationHandler;
|
||||
};
|
||||
|
||||
class BluetoothDaemonCoreInterface final
|
||||
: public BluetoothCoreInterface
|
||||
{
|
||||
public:
|
||||
BluetoothDaemonCoreInterface(BluetoothDaemonCoreModule* aModule);
|
||||
~BluetoothDaemonCoreInterface();
|
||||
|
||||
void SetNotificationHandler(
|
||||
BluetoothCoreNotificationHandler* aNotificationHandler) override;
|
||||
|
||||
/* Enable / Disable */
|
||||
|
||||
void Enable(BluetoothCoreResultHandler* aRes) override;
|
||||
void Disable(BluetoothCoreResultHandler* aRes) override;
|
||||
|
||||
/* Adapter Properties */
|
||||
|
||||
void GetAdapterProperties(BluetoothCoreResultHandler* aRes) override;
|
||||
void GetAdapterProperty(BluetoothPropertyType aType,
|
||||
BluetoothCoreResultHandler* aRes) override;
|
||||
void SetAdapterProperty(const BluetoothProperty& aProperty,
|
||||
BluetoothCoreResultHandler* aRes) override;
|
||||
|
||||
/* Remote Device Properties */
|
||||
|
||||
void GetRemoteDeviceProperties(const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothCoreResultHandler* aRes) override;
|
||||
void GetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothPropertyType aType,
|
||||
BluetoothCoreResultHandler* aRes) override;
|
||||
void SetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
|
||||
const BluetoothProperty& aProperty,
|
||||
BluetoothCoreResultHandler* aRes) override;
|
||||
|
||||
/* Remote Services */
|
||||
|
||||
void GetRemoteServiceRecord(const BluetoothAddress& aRemoteAddr,
|
||||
const BluetoothUuid& aUuid,
|
||||
BluetoothCoreResultHandler* aRes) override;
|
||||
void GetRemoteServices(const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothCoreResultHandler* aRes) override;
|
||||
|
||||
/* Discovery */
|
||||
|
||||
void StartDiscovery(BluetoothCoreResultHandler* aRes) override;
|
||||
void CancelDiscovery(BluetoothCoreResultHandler* aRes) override;
|
||||
|
||||
/* Bonds */
|
||||
|
||||
void CreateBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothTransport aTransport,
|
||||
BluetoothCoreResultHandler* aRes) override;
|
||||
void RemoveBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothCoreResultHandler* aRes) override;
|
||||
void CancelBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothCoreResultHandler* aRes) override;
|
||||
|
||||
/* Connection */
|
||||
|
||||
void GetConnectionState(const BluetoothAddress& aBdAddr,
|
||||
BluetoothCoreResultHandler* aRes) override;
|
||||
|
||||
/* Authentication */
|
||||
|
||||
void PinReply(const BluetoothAddress& aBdAddr, bool aAccept,
|
||||
const BluetoothPinCode& aPinCode,
|
||||
BluetoothCoreResultHandler* aRes) override;
|
||||
|
||||
void SspReply(const BluetoothAddress& aBdAddr,
|
||||
BluetoothSspVariant aVariant,
|
||||
bool aAccept, uint32_t aPasskey,
|
||||
BluetoothCoreResultHandler* aRes) override;
|
||||
|
||||
/* DUT Mode */
|
||||
|
||||
void DutModeConfigure(bool aEnable, BluetoothCoreResultHandler* aRes);
|
||||
void DutModeSend(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
|
||||
BluetoothCoreResultHandler* aRes) override;
|
||||
|
||||
/* LE Mode */
|
||||
|
||||
void LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
|
||||
BluetoothCoreResultHandler* aRes) override;
|
||||
|
||||
/* Energy Information */
|
||||
|
||||
void ReadEnergyInfo(BluetoothCoreResultHandler* aRes) override;
|
||||
|
||||
private:
|
||||
void DispatchError(BluetoothCoreResultHandler* aRes,
|
||||
BluetoothStatus aStatus);
|
||||
void DispatchError(BluetoothCoreResultHandler* aRes,
|
||||
nsresult aRv);
|
||||
|
||||
BluetoothDaemonCoreModule* mModule;
|
||||
};
|
||||
|
||||
END_BLUETOOTH_NAMESPACE
|
||||
|
@ -28,6 +28,9 @@ using namespace mozilla::ipc;
|
||||
|
||||
static const int sRetryInterval = 100; // ms
|
||||
|
||||
BluetoothNotificationHandler*
|
||||
BluetoothDaemonInterface::sNotificationHandler;
|
||||
|
||||
//
|
||||
// Protocol handling
|
||||
//
|
||||
@ -435,6 +438,10 @@ BluetoothDaemonInterface::Init(
|
||||
#define BASE_SOCKET_NAME "bluetoothd"
|
||||
static unsigned long POSTFIX_LENGTH = 16;
|
||||
|
||||
// First of all, we set the notification handler. Backend crashes
|
||||
// will be reported this way.
|
||||
sNotificationHandler = aNotificationHandler;
|
||||
|
||||
// If we could not cleanup properly before and an old
|
||||
// instance of the daemon is still running, we kill it
|
||||
// here.
|
||||
@ -445,8 +452,6 @@ BluetoothDaemonInterface::Init(
|
||||
if (!mProtocol) {
|
||||
mProtocol = new BluetoothDaemonProtocol();
|
||||
}
|
||||
static_cast<BluetoothDaemonCoreModule*>(mProtocol)->SetNotificationHandler(
|
||||
aNotificationHandler);
|
||||
|
||||
if (!mListenSocket) {
|
||||
mListenSocket = new ListenSocket(this, LISTEN_SOCKET);
|
||||
@ -556,8 +561,7 @@ private:
|
||||
void
|
||||
BluetoothDaemonInterface::Cleanup(BluetoothResultHandler* aRes)
|
||||
{
|
||||
static_cast<BluetoothDaemonCoreModule*>(mProtocol)->SetNotificationHandler(
|
||||
nullptr);
|
||||
sNotificationHandler = nullptr;
|
||||
|
||||
// Cleanup, step 1: Unregister Socket module
|
||||
nsresult rv = mProtocol->UnregisterModuleCmd(
|
||||
@ -570,264 +574,6 @@ BluetoothDaemonInterface::Cleanup(BluetoothResultHandler* aRes)
|
||||
mResultHandlerQ.AppendElement(aRes);
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::Enable(BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv =
|
||||
static_cast<BluetoothDaemonCoreModule*>(mProtocol)->EnableCmd(aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::Disable(BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv =
|
||||
static_cast<BluetoothDaemonCoreModule*>(mProtocol)->DisableCmd(aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Adapter Properties */
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::GetAdapterProperties(BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->GetAdapterPropertiesCmd(aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::GetAdapterProperty(BluetoothPropertyType aType,
|
||||
BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->GetAdapterPropertyCmd(aType, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::SetAdapterProperty(
|
||||
const BluetoothProperty& aProperty, BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->SetAdapterPropertyCmd(aProperty, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Remote Device Properties */
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::GetRemoteDeviceProperties(
|
||||
const BluetoothAddress& aRemoteAddr, BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->GetRemoteDevicePropertiesCmd(aRemoteAddr, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::GetRemoteDeviceProperty(
|
||||
const BluetoothAddress& aRemoteAddr, BluetoothPropertyType aType,
|
||||
BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->GetRemoteDevicePropertyCmd(aRemoteAddr, aType, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::SetRemoteDeviceProperty(
|
||||
const BluetoothAddress& aRemoteAddr, const BluetoothProperty& aProperty,
|
||||
BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->SetRemoteDevicePropertyCmd(aRemoteAddr, aProperty, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Remote Services */
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::GetRemoteServiceRecord(
|
||||
const BluetoothAddress& aRemoteAddr, const BluetoothUuid& aUuid,
|
||||
BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->GetRemoteServiceRecordCmd(aRemoteAddr, aUuid, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::GetRemoteServices(
|
||||
const BluetoothAddress& aRemoteAddr, BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->GetRemoteServicesCmd(aRemoteAddr, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Discovery */
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::StartDiscovery(BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->StartDiscoveryCmd(aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::CancelDiscovery(BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->CancelDiscoveryCmd(aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Bonds */
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::CreateBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothTransport aTransport,
|
||||
BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->CreateBondCmd(aBdAddr, aTransport, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::RemoveBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->RemoveBondCmd(aBdAddr, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::CancelBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->CancelBondCmd(aBdAddr, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Connection */
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::GetConnectionState(const BluetoothAddress& aBdAddr,
|
||||
BluetoothResultHandler* aRes)
|
||||
{
|
||||
// NO-OP: no corresponding interface of current BlueZ
|
||||
}
|
||||
|
||||
/* Authentication */
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::PinReply(const BluetoothAddress& aBdAddr,
|
||||
bool aAccept,
|
||||
const BluetoothPinCode& aPinCode,
|
||||
BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->PinReplyCmd(aBdAddr, aAccept, aPinCode, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::SspReply(const BluetoothAddress& aBdAddr,
|
||||
BluetoothSspVariant aVariant,
|
||||
bool aAccept, uint32_t aPasskey,
|
||||
BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->SspReplyCmd(aBdAddr, aVariant, aAccept, aPasskey, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* DUT Mode */
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::DutModeConfigure(bool aEnable,
|
||||
BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->DutModeConfigureCmd(aEnable, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::DutModeSend(uint16_t aOpcode, uint8_t* aBuf,
|
||||
uint8_t aLen,
|
||||
BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->DutModeSendCmd(aOpcode, aBuf, aLen, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* LE Mode */
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::LeTestMode(uint16_t aOpcode, uint8_t* aBuf,
|
||||
uint8_t aLen,
|
||||
BluetoothResultHandler* aRes)
|
||||
{
|
||||
nsresult rv = static_cast<BluetoothDaemonCoreModule*>
|
||||
(mProtocol)->LeTestModeCmd(aOpcode, aBuf, aLen, aRes);
|
||||
if (NS_FAILED(rv)) {
|
||||
DispatchError(aRes, rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Energy Information */
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::ReadEnergyInfo(BluetoothResultHandler* aRes)
|
||||
{
|
||||
// NO-OP: no corresponding interface of current BlueZ
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonInterface::DispatchError(BluetoothResultHandler* aRes,
|
||||
BluetoothStatus aStatus)
|
||||
@ -865,6 +611,18 @@ BluetoothDaemonInterface::GetBluetoothSetupInterface()
|
||||
return mSetupInterface;
|
||||
}
|
||||
|
||||
BluetoothCoreInterface*
|
||||
BluetoothDaemonInterface::GetBluetoothCoreInterface()
|
||||
{
|
||||
if (mCoreInterface) {
|
||||
return mCoreInterface;
|
||||
}
|
||||
|
||||
mCoreInterface = new BluetoothDaemonCoreInterface(mProtocol);
|
||||
|
||||
return mCoreInterface;
|
||||
}
|
||||
|
||||
BluetoothSocketInterface*
|
||||
BluetoothDaemonInterface::GetBluetoothSocketInterface()
|
||||
{
|
||||
@ -1057,22 +815,17 @@ BluetoothDaemonInterface::OnDisconnect(int aIndex)
|
||||
break;
|
||||
}
|
||||
|
||||
BluetoothNotificationHandler* notificationHandler =
|
||||
static_cast<BluetoothDaemonCoreModule*>(mProtocol)->
|
||||
GetNotificationHandler();
|
||||
|
||||
/* For recovery make sure all sockets disconnected, in order to avoid
|
||||
* the remaining disconnects interfere with the restart procedure.
|
||||
*/
|
||||
if (notificationHandler && mResultHandlerQ.IsEmpty()) {
|
||||
if (sNotificationHandler && mResultHandlerQ.IsEmpty()) {
|
||||
if (mListenSocket->GetConnectionStatus() == SOCKET_DISCONNECTED &&
|
||||
mCmdChannel->GetConnectionStatus() == SOCKET_DISCONNECTED &&
|
||||
mNtfChannel->GetConnectionStatus() == SOCKET_DISCONNECTED) {
|
||||
// Assume daemon crashed during regular service; notify
|
||||
// BluetoothServiceBluedroid to prepare restart-daemon procedure
|
||||
notificationHandler->BackendErrorNotification(true);
|
||||
static_cast<BluetoothDaemonCoreModule*>(mProtocol)->
|
||||
SetNotificationHandler(nullptr);
|
||||
sNotificationHandler->BackendErrorNotification(true);
|
||||
sNotificationHandler = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ BEGIN_BLUETOOTH_NAMESPACE
|
||||
|
||||
class BluetoothDaemonA2dpInterface;
|
||||
class BluetoothDaemonAvrcpInterface;
|
||||
class BluetoothDaemonCoreInterface;
|
||||
class BluetoothDaemonGattInterface;
|
||||
class BluetoothDaemonHandsfreeInterface;
|
||||
class BluetoothDaemonProtocol;
|
||||
@ -50,85 +51,10 @@ public:
|
||||
BluetoothResultHandler* aRes) override;
|
||||
void Cleanup(BluetoothResultHandler* aRes) override;
|
||||
|
||||
void Enable(BluetoothResultHandler* aRes) override;
|
||||
void Disable(BluetoothResultHandler* aRes) override;
|
||||
|
||||
/* Adapter Properties */
|
||||
|
||||
void GetAdapterProperties(BluetoothResultHandler* aRes) override;
|
||||
void GetAdapterProperty(BluetoothPropertyType aType,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
void SetAdapterProperty(const BluetoothProperty& aProperty,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
|
||||
/* Remote Device Properties */
|
||||
|
||||
void GetRemoteDeviceProperties(const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
void GetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothPropertyType aType,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
void SetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
|
||||
const BluetoothProperty& aProperty,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
|
||||
/* Remote Services */
|
||||
|
||||
void GetRemoteServiceRecord(const BluetoothAddress& aRemoteAddr,
|
||||
const BluetoothUuid& aUuid,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
void GetRemoteServices(const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
|
||||
/* Discovery */
|
||||
|
||||
void StartDiscovery(BluetoothResultHandler* aRes) override;
|
||||
void CancelDiscovery(BluetoothResultHandler* aRes) override;
|
||||
|
||||
/* Bonds */
|
||||
|
||||
void CreateBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothTransport aTransport,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
void RemoveBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
void CancelBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
|
||||
/* Connection */
|
||||
|
||||
void GetConnectionState(const BluetoothAddress& aBdAddr,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
|
||||
/* Authentication */
|
||||
|
||||
void PinReply(const BluetoothAddress& aBdAddr, bool aAccept,
|
||||
const BluetoothPinCode& aPinCode,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
|
||||
void SspReply(const BluetoothAddress& aBdAddr,
|
||||
BluetoothSspVariant aVariant,
|
||||
bool aAccept, uint32_t aPasskey,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
|
||||
/* DUT Mode */
|
||||
|
||||
void DutModeConfigure(bool aEnable, BluetoothResultHandler* aRes);
|
||||
void DutModeSend(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
|
||||
/* LE Mode */
|
||||
|
||||
void LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
|
||||
BluetoothResultHandler* aRes) override;
|
||||
|
||||
/* Energy Information */
|
||||
|
||||
void ReadEnergyInfo(BluetoothResultHandler* aRes) override;
|
||||
|
||||
/* Service Interfaces */
|
||||
|
||||
BluetoothSetupInterface* GetBluetoothSetupInterface() override;
|
||||
BluetoothCoreInterface* GetBluetoothCoreInterface() override;
|
||||
BluetoothSocketInterface* GetBluetoothSocketInterface() override;
|
||||
BluetoothHandsfreeInterface* GetBluetoothHandsfreeInterface() override;
|
||||
BluetoothA2dpInterface* GetBluetoothA2dpInterface() override;
|
||||
@ -156,6 +82,8 @@ private:
|
||||
void DispatchError(BluetoothResultHandler* aRes, BluetoothStatus aStatus);
|
||||
void DispatchError(BluetoothResultHandler* aRes, nsresult aRv);
|
||||
|
||||
static BluetoothNotificationHandler* sNotificationHandler;
|
||||
|
||||
nsCString mListenSocketName;
|
||||
RefPtr<mozilla::ipc::ListenSocket> mListenSocket;
|
||||
RefPtr<mozilla::ipc::DaemonSocket> mCmdChannel;
|
||||
@ -165,6 +93,7 @@ private:
|
||||
nsTArray<RefPtr<BluetoothResultHandler> > mResultHandlerQ;
|
||||
|
||||
nsAutoPtr<BluetoothDaemonSetupInterface> mSetupInterface;
|
||||
nsAutoPtr<BluetoothDaemonCoreInterface> mCoreInterface;
|
||||
nsAutoPtr<BluetoothDaemonSocketInterface> mSocketInterface;
|
||||
nsAutoPtr<BluetoothDaemonHandsfreeInterface> mHandsfreeInterface;
|
||||
nsAutoPtr<BluetoothDaemonA2dpInterface> mA2dpInterface;
|
||||
|
@ -348,8 +348,8 @@ BluetoothMapSmsManager::MasDataHandler(UnixSocketBuffer* aMessage)
|
||||
* ObexResponseCode::Success
|
||||
*/
|
||||
if (mDataStream) {
|
||||
nsAutoArrayPtr<uint8_t> res(new uint8_t[mRemoteMaxPacketLength]);
|
||||
if (!ReplyToGetWithHeaderBody(res.get(), kObexRespHeaderSize)) {
|
||||
auto res = MakeUnique<uint8_t[]>(mRemoteMaxPacketLength);
|
||||
if (!ReplyToGetWithHeaderBody(Move(res), kObexRespHeaderSize)) {
|
||||
BT_LOGR("Failed to reply to MAP GET request.");
|
||||
SendReply(ObexResponseCode::InternalServerError);
|
||||
}
|
||||
@ -565,7 +565,7 @@ BluetoothMapSmsManager::ReplyToSetPath()
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothMapSmsManager::ReplyToGetWithHeaderBody(uint8_t* aResponse,
|
||||
BluetoothMapSmsManager::ReplyToGetWithHeaderBody(UniquePtr<uint8_t[]> aResponse,
|
||||
unsigned int aIndex)
|
||||
{
|
||||
if (!mMasConnected) {
|
||||
@ -634,7 +634,7 @@ BluetoothMapSmsManager::ReplyToGetWithHeaderBody(uint8_t* aResponse,
|
||||
opcode = ObexResponseCode::Continue;
|
||||
}
|
||||
|
||||
SendMasObexData(aResponse, opcode, aIndex);
|
||||
SendMasObexData(Move(aResponse), opcode, aIndex);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -695,7 +695,7 @@ BluetoothMapSmsManager::ReplyToMessagesListing(Blob* aBlob, long aMasId,
|
||||
// ---- Part 1: [response code:1][length:2] ---- //
|
||||
// [response code:1][length:2] will be set in |SendObexData|.
|
||||
// Reserve index here
|
||||
nsAutoArrayPtr<uint8_t> res(new uint8_t[mRemoteMaxPacketLength]);
|
||||
auto res = MakeUnique<uint8_t[]>(mRemoteMaxPacketLength);
|
||||
unsigned int index = kObexRespHeaderSize;
|
||||
|
||||
// ---- Part 2: headerId:1][length:2][appParam:var] ---- //
|
||||
@ -729,7 +729,7 @@ BluetoothMapSmsManager::ReplyToMessagesListing(Blob* aBlob, long aMasId,
|
||||
msgListingSize,
|
||||
sizeof(msgListingSize));
|
||||
|
||||
index += AppendHeaderAppParameters(res + index,
|
||||
index += AppendHeaderAppParameters(&res[index],
|
||||
mRemoteMaxPacketLength,
|
||||
appParameters,
|
||||
len + 9);
|
||||
@ -742,11 +742,11 @@ BluetoothMapSmsManager::ReplyToMessagesListing(Blob* aBlob, long aMasId,
|
||||
}
|
||||
|
||||
// ---- Part 3: [headerId:1][length:2][Body:var] ---- //
|
||||
ReplyToGetWithHeaderBody(res, index);
|
||||
ReplyToGetWithHeaderBody(Move(res), index);
|
||||
// Reset flag
|
||||
mBodyRequired = false;
|
||||
} else {
|
||||
SendMasObexData(res, ObexResponseCode::Success, index);
|
||||
SendMasObexData(Move(res), ObexResponseCode::Success, index);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -783,7 +783,7 @@ BluetoothMapSmsManager::ReplyToGetMessage(Blob* aBlob, long aMasId)
|
||||
// ---- Part 1: [response code:1][length:2] ---- //
|
||||
// [response code:1][length:2] will be set in |SendObexData|.
|
||||
// Reserve index here
|
||||
nsAutoArrayPtr<uint8_t> res (new uint8_t[mRemoteMaxPacketLength]);
|
||||
auto res = MakeUnique<uint8_t[]>(mRemoteMaxPacketLength);
|
||||
unsigned int index = kObexRespHeaderSize;
|
||||
|
||||
if (mFractionDeliverRequired) {
|
||||
@ -797,7 +797,7 @@ BluetoothMapSmsManager::ReplyToGetMessage(Blob* aBlob, long aMasId)
|
||||
&fractionDeliver,
|
||||
sizeof(fractionDeliver));
|
||||
|
||||
index += AppendHeaderAppParameters(res + index,
|
||||
index += AppendHeaderAppParameters(&res[index],
|
||||
mRemoteMaxPacketLength,
|
||||
appParameters,
|
||||
sizeof(appParameters));
|
||||
@ -805,7 +805,7 @@ BluetoothMapSmsManager::ReplyToGetMessage(Blob* aBlob, long aMasId)
|
||||
|
||||
// TODO: Support bMessage encoding in bug 1166652.
|
||||
// ---- Part 3: [headerId:1][length:2][Body:var] ---- //
|
||||
ReplyToGetWithHeaderBody(res.get(), index);
|
||||
ReplyToGetWithHeaderBody(Move(res), index);
|
||||
mFractionDeliverRequired = false;
|
||||
|
||||
return true;
|
||||
@ -838,11 +838,11 @@ BluetoothMapSmsManager::ReplyToSendMessage(
|
||||
*(handleId + (len * 2)) = 0x00;
|
||||
*(handleId + (len * 2 + 1)) = 0x00;
|
||||
|
||||
nsAutoArrayPtr<uint8_t> res(new uint8_t[mRemoteMaxPacketLength]);
|
||||
auto res = MakeUnique<uint8_t[]>(mRemoteMaxPacketLength);
|
||||
int index = kObexRespHeaderSize;
|
||||
index += AppendHeaderName(res + index, mRemoteMaxPacketLength - index,
|
||||
index += AppendHeaderName(&res[index], mRemoteMaxPacketLength - index,
|
||||
handleId, (len + 1) * 2);
|
||||
SendMasObexData(res.get(), ObexResponseCode::Success, index);
|
||||
SendMasObexData(Move(res), ObexResponseCode::Success, index);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1455,6 +1455,14 @@ BluetoothMapSmsManager::SendMasObexData(uint8_t* aData, uint8_t aOpcode,
|
||||
mMasSocket->SendSocketData(new UnixSocketRawData(aData, aSize));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothMapSmsManager::SendMasObexData(UniquePtr<uint8_t[]> aData,
|
||||
uint8_t aOpcode, int aSize)
|
||||
{
|
||||
SetObexPacketInfo(aData.get(), aOpcode, aSize);
|
||||
mMasSocket->SendSocketData(new UnixSocketRawData(Move(aData), aSize));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothMapSmsManager::SendMnsObexData(uint8_t* aData, uint8_t aOpcode,
|
||||
int aSize)
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "BluetoothProfileManagerBase.h"
|
||||
#include "BluetoothSocketObserver.h"
|
||||
#include "mozilla/ipc/SocketBase.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
|
||||
class nsIInputStream;
|
||||
|
||||
@ -205,7 +206,7 @@ private:
|
||||
* packet. If the operation requires multiple response packets to complete
|
||||
* after the Final bit is set in the request.
|
||||
*/
|
||||
bool ReplyToGetWithHeaderBody(uint8_t* aResponse, unsigned int aIndex);
|
||||
bool ReplyToGetWithHeaderBody(UniquePtr<uint8_t[]> aResponse, unsigned int aIndex);
|
||||
void ReplyToSetPath();
|
||||
void ReplyToPut();
|
||||
void SendReply(uint8_t aResponse);
|
||||
@ -222,6 +223,7 @@ private:
|
||||
InfallibleTArray<BluetoothNamedValue>& aValues,
|
||||
const Map::AppParametersTagId aTagId);
|
||||
void SendMasObexData(uint8_t* aData, uint8_t aOpcode, int aSize);
|
||||
void SendMasObexData(UniquePtr<uint8_t[]> aData, uint8_t aOpcode, int aSize);
|
||||
void SendMnsObexData(uint8_t* aData, uint8_t aOpcode, int aSize);
|
||||
bool StatusResponse(bool aStatus);
|
||||
|
||||
|
@ -68,10 +68,11 @@ using namespace mozilla::ipc;
|
||||
USING_BLUETOOTH_NAMESPACE
|
||||
|
||||
static BluetoothInterface* sBtInterface;
|
||||
static BluetoothCoreInterface* sBtCoreInterface;
|
||||
static nsTArray<RefPtr<BluetoothProfileController> > sControllerArray;
|
||||
|
||||
class BluetoothServiceBluedroid::EnableResultHandler final
|
||||
: public BluetoothResultHandler
|
||||
: public BluetoothCoreResultHandler
|
||||
{
|
||||
public:
|
||||
void OnError(BluetoothStatus aStatus) override
|
||||
@ -115,7 +116,16 @@ public:
|
||||
private:
|
||||
void Proceed() const
|
||||
{
|
||||
sBtInterface->Enable(new EnableResultHandler());
|
||||
BluetoothService* bs = BluetoothService::Get();
|
||||
NS_ENSURE_TRUE_VOID(bs);
|
||||
|
||||
sBtCoreInterface = sBtInterface->GetBluetoothCoreInterface();
|
||||
NS_ENSURE_TRUE_VOID(sBtCoreInterface);
|
||||
|
||||
sBtCoreInterface->SetNotificationHandler(
|
||||
reinterpret_cast<BluetoothServiceBluedroid*>(bs));
|
||||
|
||||
sBtCoreInterface->Enable(new EnableResultHandler());
|
||||
}
|
||||
|
||||
unsigned char mNumProfiles;
|
||||
@ -182,7 +192,7 @@ BluetoothServiceBluedroid::StartGonkBluetooth()
|
||||
}
|
||||
|
||||
class BluetoothServiceBluedroid::DisableResultHandler final
|
||||
: public BluetoothResultHandler
|
||||
: public BluetoothCoreResultHandler
|
||||
{
|
||||
public:
|
||||
void OnError(BluetoothStatus aStatus) override
|
||||
@ -212,7 +222,7 @@ BluetoothServiceBluedroid::StopGonkBluetooth()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
sBtInterface->Disable(new DisableResultHandler());
|
||||
sBtCoreInterface->Disable(new DisableResultHandler());
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -816,9 +826,8 @@ public:
|
||||
RefPtr<BluetoothReplyRunnable> mRunnable;
|
||||
};
|
||||
|
||||
class BluetoothServiceBluedroid::GetRemoteDevicePropertiesResultHandler
|
||||
final
|
||||
: public BluetoothResultHandler
|
||||
class BluetoothServiceBluedroid::GetRemoteDevicePropertiesResultHandler final
|
||||
: public BluetoothCoreResultHandler
|
||||
{
|
||||
public:
|
||||
GetRemoteDevicePropertiesResultHandler(
|
||||
@ -883,7 +892,7 @@ BluetoothServiceBluedroid::GetConnectedDevicePropertiesInternal(
|
||||
GetDeviceRequest request(1, aRunnable);
|
||||
mGetDeviceRequests.AppendElement(request);
|
||||
|
||||
sBtInterface->GetRemoteDeviceProperties(address,
|
||||
sBtCoreInterface->GetRemoteDeviceProperties(address,
|
||||
new GetRemoteDevicePropertiesResultHandler(mGetDeviceRequests, address));
|
||||
|
||||
return NS_OK;
|
||||
@ -909,7 +918,7 @@ BluetoothServiceBluedroid::GetPairedDevicePropertiesInternal(
|
||||
|
||||
for (uint8_t i = 0; i < aDeviceAddress.Length(); i++) {
|
||||
// Retrieve all properties of devices
|
||||
sBtInterface->GetRemoteDeviceProperties(aDeviceAddress[i],
|
||||
sBtCoreInterface->GetRemoteDeviceProperties(aDeviceAddress[i],
|
||||
new GetRemoteDevicePropertiesResultHandler(mGetDeviceRequests,
|
||||
aDeviceAddress[i]));
|
||||
}
|
||||
@ -918,7 +927,7 @@ BluetoothServiceBluedroid::GetPairedDevicePropertiesInternal(
|
||||
}
|
||||
|
||||
class BluetoothServiceBluedroid::DispatchReplyErrorResultHandler final
|
||||
: public BluetoothResultHandler
|
||||
: public BluetoothCoreResultHandler
|
||||
{
|
||||
public:
|
||||
DispatchReplyErrorResultHandler(
|
||||
@ -951,7 +960,7 @@ BluetoothServiceBluedroid::StartDiscoveryInternal(
|
||||
ENSURE_BLUETOOTH_IS_READY_VOID(aRunnable);
|
||||
|
||||
mChangeDiscoveryRunnables.AppendElement(aRunnable);
|
||||
sBtInterface->StartDiscovery(
|
||||
sBtCoreInterface->StartDiscovery(
|
||||
new DispatchReplyErrorResultHandler(mChangeDiscoveryRunnables, aRunnable));
|
||||
}
|
||||
|
||||
@ -972,7 +981,7 @@ BluetoothServiceBluedroid::FetchUuidsInternal(
|
||||
}
|
||||
|
||||
mFetchUuidsRunnables.AppendElement(aRunnable);
|
||||
sBtInterface->GetRemoteServices(aDeviceAddress,
|
||||
sBtCoreInterface->GetRemoteServices(aDeviceAddress,
|
||||
new DispatchReplyErrorResultHandler(mFetchUuidsRunnables, aRunnable));
|
||||
|
||||
return NS_OK;
|
||||
@ -987,7 +996,7 @@ BluetoothServiceBluedroid::StopDiscoveryInternal(
|
||||
ENSURE_BLUETOOTH_IS_READY_VOID(aRunnable);
|
||||
|
||||
mChangeDiscoveryRunnables.AppendElement(aRunnable);
|
||||
sBtInterface->CancelDiscovery(
|
||||
sBtCoreInterface->CancelDiscovery(
|
||||
new DispatchReplyErrorResultHandler(mChangeDiscoveryRunnables, aRunnable));
|
||||
}
|
||||
|
||||
@ -1008,7 +1017,7 @@ BluetoothServiceBluedroid::SetProperty(BluetoothObjectType aType,
|
||||
}
|
||||
|
||||
mSetAdapterPropertyRunnables.AppendElement(aRunnable);
|
||||
sBtInterface->SetAdapterProperty(
|
||||
sBtCoreInterface->SetAdapterProperty(
|
||||
property,
|
||||
new DispatchReplyErrorResultHandler(mSetAdapterPropertyRunnables,
|
||||
aRunnable));
|
||||
@ -1034,7 +1043,7 @@ struct BluetoothServiceBluedroid::GetRemoteServiceRecordRequest final
|
||||
};
|
||||
|
||||
class BluetoothServiceBluedroid::GetRemoteServiceRecordResultHandler final
|
||||
: public BluetoothResultHandler
|
||||
: public BluetoothCoreResultHandler
|
||||
{
|
||||
public:
|
||||
GetRemoteServiceRecordResultHandler(
|
||||
@ -1067,7 +1076,7 @@ public:
|
||||
void CancelDiscovery() override
|
||||
{
|
||||
// Disabled discovery mode, now perform SDP operation.
|
||||
sBtInterface->GetRemoteServiceRecord(mDeviceAddress, mUuid, this);
|
||||
sBtCoreInterface->GetRemoteServiceRecord(mDeviceAddress, mUuid, this);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -1097,7 +1106,7 @@ BluetoothServiceBluedroid::GetServiceChannel(
|
||||
mGetRemoteServiceRecordArray.AppendElement(
|
||||
GetRemoteServiceRecordRequest(aDeviceAddress, aServiceUuid, aManager));
|
||||
|
||||
RefPtr<BluetoothResultHandler> res =
|
||||
RefPtr<BluetoothCoreResultHandler> res =
|
||||
new GetRemoteServiceRecordResultHandler(mGetRemoteServiceRecordArray,
|
||||
aDeviceAddress, aServiceUuid);
|
||||
|
||||
@ -1105,9 +1114,9 @@ BluetoothServiceBluedroid::GetServiceChannel(
|
||||
* won't be performed while the adapter is in discovery mode.
|
||||
*/
|
||||
if (mDiscovering) {
|
||||
sBtInterface->CancelDiscovery(res);
|
||||
sBtCoreInterface->CancelDiscovery(res);
|
||||
} else {
|
||||
sBtInterface->GetRemoteServiceRecord(aDeviceAddress, aServiceUuid, res);
|
||||
sBtCoreInterface->GetRemoteServiceRecord(aDeviceAddress, aServiceUuid, res);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@ -1128,7 +1137,7 @@ struct BluetoothServiceBluedroid::GetRemoteServicesRequest final
|
||||
};
|
||||
|
||||
class BluetoothServiceBluedroid::GetRemoteServicesResultHandler final
|
||||
: public BluetoothResultHandler
|
||||
: public BluetoothCoreResultHandler
|
||||
{
|
||||
public:
|
||||
GetRemoteServicesResultHandler(
|
||||
@ -1161,7 +1170,7 @@ public:
|
||||
void CancelDiscovery() override
|
||||
{
|
||||
// Disabled discovery mode, now perform SDP operation.
|
||||
sBtInterface->GetRemoteServices(mDeviceAddress, this);
|
||||
sBtCoreInterface->GetRemoteServices(mDeviceAddress, this);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -1190,7 +1199,7 @@ BluetoothServiceBluedroid::UpdateSdpRecords(
|
||||
mGetRemoteServicesArray.AppendElement(
|
||||
GetRemoteServicesRequest(aDeviceAddress, aManager));
|
||||
|
||||
RefPtr<BluetoothResultHandler> res =
|
||||
RefPtr<BluetoothCoreResultHandler> res =
|
||||
new GetRemoteServicesResultHandler(mGetRemoteServicesArray,
|
||||
aDeviceAddress, aManager);
|
||||
|
||||
@ -1198,9 +1207,9 @@ BluetoothServiceBluedroid::UpdateSdpRecords(
|
||||
* won't be performed while the adapter is in discovery mode.
|
||||
*/
|
||||
if (mDiscovering) {
|
||||
sBtInterface->CancelDiscovery(res);
|
||||
sBtCoreInterface->CancelDiscovery(res);
|
||||
} else {
|
||||
sBtInterface->GetRemoteServices(aDeviceAddress, res);
|
||||
sBtCoreInterface->GetRemoteServices(aDeviceAddress, res);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -1216,7 +1225,7 @@ BluetoothServiceBluedroid::CreatePairedDeviceInternal(
|
||||
ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
|
||||
|
||||
mCreateBondRunnables.AppendElement(aRunnable);
|
||||
sBtInterface->CreateBond(aDeviceAddress, TRANSPORT_AUTO,
|
||||
sBtCoreInterface->CreateBond(aDeviceAddress, TRANSPORT_AUTO,
|
||||
new DispatchReplyErrorResultHandler(mCreateBondRunnables, aRunnable));
|
||||
|
||||
return NS_OK;
|
||||
@ -1231,14 +1240,14 @@ BluetoothServiceBluedroid::RemoveDeviceInternal(
|
||||
ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
|
||||
|
||||
mRemoveBondRunnables.AppendElement(aRunnable);
|
||||
sBtInterface->RemoveBond(aDeviceAddress,
|
||||
sBtCoreInterface->RemoveBond(aDeviceAddress,
|
||||
new DispatchReplyErrorResultHandler(mRemoveBondRunnables, aRunnable));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
class BluetoothServiceBluedroid::PinReplyResultHandler final
|
||||
: public BluetoothResultHandler
|
||||
: public BluetoothCoreResultHandler
|
||||
{
|
||||
public:
|
||||
PinReplyResultHandler(BluetoothReplyRunnable* aRunnable)
|
||||
@ -1268,8 +1277,8 @@ BluetoothServiceBluedroid::PinReplyInternal(
|
||||
|
||||
ENSURE_BLUETOOTH_IS_READY_VOID(aRunnable);
|
||||
|
||||
sBtInterface->PinReply(aDeviceAddress, aAccept, aPinCode,
|
||||
new PinReplyResultHandler(aRunnable));
|
||||
sBtCoreInterface->PinReply(aDeviceAddress, aAccept, aPinCode,
|
||||
new PinReplyResultHandler(aRunnable));
|
||||
}
|
||||
|
||||
void
|
||||
@ -1289,7 +1298,7 @@ BluetoothServiceBluedroid::SetPasskeyInternal(
|
||||
}
|
||||
|
||||
class BluetoothServiceBluedroid::SspReplyResultHandler final
|
||||
: public BluetoothResultHandler
|
||||
: public BluetoothCoreResultHandler
|
||||
{
|
||||
public:
|
||||
SspReplyResultHandler(BluetoothReplyRunnable* aRunnable)
|
||||
@ -1319,8 +1328,9 @@ BluetoothServiceBluedroid::SspReplyInternal(
|
||||
|
||||
ENSURE_BLUETOOTH_IS_READY_VOID(aRunnable);
|
||||
|
||||
sBtInterface->SspReply(aDeviceAddress, aVariant, aAccept, 0 /* passkey */,
|
||||
new SspReplyResultHandler(aRunnable));
|
||||
sBtCoreInterface->SspReply(aDeviceAddress, aVariant, aAccept,
|
||||
0 /* passkey */,
|
||||
new SspReplyResultHandler(aRunnable));
|
||||
}
|
||||
|
||||
void
|
||||
@ -1926,6 +1936,7 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
sBtCoreInterface = nullptr;
|
||||
sBtInterface->Cleanup(new CleanupResultHandler());
|
||||
}
|
||||
|
||||
@ -1935,7 +1946,7 @@ private:
|
||||
|
||||
class BluetoothServiceBluedroid::SetAdapterPropertyDiscoverableResultHandler
|
||||
final
|
||||
: public BluetoothResultHandler
|
||||
: public BluetoothCoreResultHandler
|
||||
{
|
||||
public:
|
||||
void OnError(BluetoothStatus aStatus) override
|
||||
@ -2027,8 +2038,9 @@ BluetoothServiceBluedroid::AdapterStateChangedNotification(bool aState)
|
||||
|
||||
// Bluetooth scan mode is SCAN_MODE_CONNECTABLE by default, i.e., it should
|
||||
// be connectable and non-discoverable.
|
||||
NS_ENSURE_TRUE_VOID(sBtInterface);
|
||||
sBtInterface->SetAdapterProperty(
|
||||
NS_ENSURE_TRUE_VOID(sBtCoreInterface);
|
||||
|
||||
sBtCoreInterface->SetAdapterProperty(
|
||||
BluetoothProperty(PROPERTY_ADAPTER_SCAN_MODE, SCAN_MODE_CONNECTABLE),
|
||||
new SetAdapterPropertyDiscoverableResultHandler());
|
||||
|
||||
|
@ -15,8 +15,10 @@
|
||||
|
||||
BEGIN_BLUETOOTH_NAMESPACE
|
||||
|
||||
class BluetoothServiceBluedroid : public BluetoothService
|
||||
, public BluetoothNotificationHandler
|
||||
class BluetoothServiceBluedroid
|
||||
: public BluetoothService
|
||||
, public BluetoothCoreNotificationHandler
|
||||
, public BluetoothNotificationHandler
|
||||
{
|
||||
class CleanupResultHandler;
|
||||
class DisableResultHandler;
|
||||
|
@ -45,6 +45,193 @@ BluetoothSetupResultHandler::Configuration()
|
||||
BluetoothSetupInterface::~BluetoothSetupInterface()
|
||||
{ }
|
||||
|
||||
//
|
||||
// Bluetooth Core Interface
|
||||
//
|
||||
|
||||
// Notification handling
|
||||
//
|
||||
|
||||
BluetoothCoreNotificationHandler::BluetoothCoreNotificationHandler()
|
||||
{ }
|
||||
|
||||
BluetoothCoreNotificationHandler::~BluetoothCoreNotificationHandler()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreNotificationHandler::AdapterStateChangedNotification(bool aState)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreNotificationHandler::AdapterPropertiesNotification(
|
||||
BluetoothStatus aStatus,int aNumProperties,
|
||||
const BluetoothProperty* aProperties)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreNotificationHandler::RemoteDevicePropertiesNotification(
|
||||
BluetoothStatus aStatus, const BluetoothAddress& aBdAddr,
|
||||
int aNumProperties, const BluetoothProperty* aProperties)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreNotificationHandler::DeviceFoundNotification(
|
||||
int aNumProperties, const BluetoothProperty* aProperties)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreNotificationHandler::DiscoveryStateChangedNotification(
|
||||
bool aState)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreNotificationHandler::PinRequestNotification(
|
||||
const BluetoothAddress& aRemoteBdAddr, const BluetoothRemoteName& aBdName,
|
||||
uint32_t aCod)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreNotificationHandler::SspRequestNotification(
|
||||
const BluetoothAddress& aRemoteBdAddr, const BluetoothRemoteName& aBdName,
|
||||
uint32_t aCod, BluetoothSspVariant aPairingVariant, uint32_t aPassKey)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreNotificationHandler::BondStateChangedNotification(
|
||||
BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
|
||||
BluetoothBondState aState)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreNotificationHandler::AclStateChangedNotification(
|
||||
BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
|
||||
BluetoothAclState aState)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreNotificationHandler::DutModeRecvNotification(
|
||||
uint16_t aOpcode,
|
||||
const uint8_t* aBuf,
|
||||
uint8_t aLen)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreNotificationHandler::LeTestModeNotification(
|
||||
BluetoothStatus aStatus,
|
||||
uint16_t aNumPackets)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreNotificationHandler::EnergyInfoNotification(
|
||||
const BluetoothActivityEnergyInfo& aInfo)
|
||||
{ }
|
||||
|
||||
// Result handling
|
||||
//
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::OnError(BluetoothStatus aStatus)
|
||||
{
|
||||
BT_LOGR("Received error code %d", aStatus);
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::Enable()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::Disable()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::GetAdapterProperties()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::GetAdapterProperty()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::SetAdapterProperty()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::GetRemoteDeviceProperties()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::GetRemoteDeviceProperty()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::SetRemoteDeviceProperty()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::GetRemoteServiceRecord()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::GetRemoteServices()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::StartDiscovery()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::CancelDiscovery()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::CreateBond()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::RemoveBond()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::CancelBond()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::GetConnectionState()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::PinReply()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::SspReply()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::DutModeConfigure()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::DutModeSend()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::LeTestMode()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothCoreResultHandler::ReadEnergyInfo()
|
||||
{ }
|
||||
|
||||
// Interface
|
||||
//
|
||||
|
||||
BluetoothCoreInterface::BluetoothCoreInterface()
|
||||
{ }
|
||||
|
||||
BluetoothCoreInterface::~BluetoothCoreInterface()
|
||||
{ }
|
||||
|
||||
//
|
||||
// Socket Interface
|
||||
//
|
||||
@ -811,7 +998,7 @@ BluetoothGattInterface::~BluetoothGattInterface()
|
||||
{ }
|
||||
|
||||
//
|
||||
// Bluetooth Core Interface
|
||||
// Bluetooth Interface
|
||||
//
|
||||
|
||||
// Notification handling
|
||||
@ -823,71 +1010,6 @@ BluetoothNotificationHandler::BluetoothNotificationHandler()
|
||||
BluetoothNotificationHandler::~BluetoothNotificationHandler()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothNotificationHandler::AdapterStateChangedNotification(bool aState)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothNotificationHandler::AdapterPropertiesNotification(
|
||||
BluetoothStatus aStatus,int aNumProperties,
|
||||
const BluetoothProperty* aProperties)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothNotificationHandler::RemoteDevicePropertiesNotification(
|
||||
BluetoothStatus aStatus, const BluetoothAddress& aBdAddr,
|
||||
int aNumProperties, const BluetoothProperty* aProperties)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothNotificationHandler::DeviceFoundNotification(
|
||||
int aNumProperties, const BluetoothProperty* aProperties)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothNotificationHandler::DiscoveryStateChangedNotification(bool aState)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothNotificationHandler::PinRequestNotification(
|
||||
const BluetoothAddress& aRemoteBdAddr, const BluetoothRemoteName& aBdName,
|
||||
uint32_t aCod)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothNotificationHandler::SspRequestNotification(
|
||||
const BluetoothAddress& aRemoteBdAddr, const BluetoothRemoteName& aBdName,
|
||||
uint32_t aCod, BluetoothSspVariant aPairingVariant, uint32_t aPassKey)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothNotificationHandler::BondStateChangedNotification(
|
||||
BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
|
||||
BluetoothBondState aState)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothNotificationHandler::AclStateChangedNotification(
|
||||
BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
|
||||
BluetoothAclState aState)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothNotificationHandler::DutModeRecvNotification(uint16_t aOpcode,
|
||||
const uint8_t* aBuf,
|
||||
uint8_t aLen)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothNotificationHandler::LeTestModeNotification(BluetoothStatus aStatus,
|
||||
uint16_t aNumPackets)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothNotificationHandler::EnergyInfoNotification(
|
||||
const BluetoothActivityEnergyInfo& aInfo)
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothNotificationHandler::BackendErrorNotification(bool aCrashed)
|
||||
{ }
|
||||
@ -909,94 +1031,6 @@ void
|
||||
BluetoothResultHandler::Cleanup()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::Enable()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::Disable()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::GetAdapterProperties()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::GetAdapterProperty()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::SetAdapterProperty()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::GetRemoteDeviceProperties()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::GetRemoteDeviceProperty()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::SetRemoteDeviceProperty()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::GetRemoteServiceRecord()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::GetRemoteServices()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::StartDiscovery()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::CancelDiscovery()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::CreateBond()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::RemoveBond()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::CancelBond()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::GetConnectionState()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::PinReply()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::SspReply()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::DutModeConfigure()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::DutModeSend()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::LeTestMode()
|
||||
{ }
|
||||
|
||||
void
|
||||
BluetoothResultHandler::ReadEnergyInfo()
|
||||
{ }
|
||||
|
||||
// Interface
|
||||
//
|
||||
|
||||
|
@ -49,6 +49,188 @@ protected:
|
||||
virtual ~BluetoothSetupInterface();
|
||||
};
|
||||
|
||||
//
|
||||
// Bluetooth Core Interface
|
||||
//
|
||||
|
||||
class BluetoothCoreNotificationHandler
|
||||
{
|
||||
public:
|
||||
virtual void AdapterStateChangedNotification(bool aState);
|
||||
virtual void AdapterPropertiesNotification(
|
||||
BluetoothStatus aStatus, int aNumProperties,
|
||||
const BluetoothProperty* aProperties);
|
||||
|
||||
virtual void RemoteDevicePropertiesNotification(
|
||||
BluetoothStatus aStatus, const BluetoothAddress& aBdAddr,
|
||||
int aNumProperties, const BluetoothProperty* aProperties);
|
||||
|
||||
virtual void DeviceFoundNotification(
|
||||
int aNumProperties, const BluetoothProperty* aProperties);
|
||||
|
||||
virtual void DiscoveryStateChangedNotification(bool aState);
|
||||
|
||||
virtual void PinRequestNotification(const BluetoothAddress& aRemoteBdAddr,
|
||||
const BluetoothRemoteName& aBdName,
|
||||
uint32_t aCod);
|
||||
virtual void SspRequestNotification(const BluetoothAddress& aRemoteBdAddr,
|
||||
const BluetoothRemoteName& aBdName,
|
||||
uint32_t aCod,
|
||||
BluetoothSspVariant aPairingVariant,
|
||||
uint32_t aPassKey);
|
||||
|
||||
virtual void BondStateChangedNotification(
|
||||
BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
|
||||
BluetoothBondState aState);
|
||||
virtual void AclStateChangedNotification(
|
||||
BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
|
||||
BluetoothAclState aState);
|
||||
|
||||
virtual void DutModeRecvNotification(uint16_t aOpcode,
|
||||
const uint8_t* aBuf, uint8_t aLen);
|
||||
virtual void LeTestModeNotification(BluetoothStatus aStatus,
|
||||
uint16_t aNumPackets);
|
||||
|
||||
virtual void EnergyInfoNotification(const BluetoothActivityEnergyInfo& aInfo);
|
||||
|
||||
protected:
|
||||
BluetoothCoreNotificationHandler();
|
||||
virtual ~BluetoothCoreNotificationHandler();
|
||||
};
|
||||
|
||||
class BluetoothCoreResultHandler
|
||||
: public mozilla::ipc::DaemonSocketResultHandler
|
||||
{
|
||||
public:
|
||||
virtual void OnError(BluetoothStatus aStatus);
|
||||
|
||||
virtual void Enable();
|
||||
virtual void Disable();
|
||||
|
||||
virtual void GetAdapterProperties();
|
||||
virtual void GetAdapterProperty();
|
||||
virtual void SetAdapterProperty();
|
||||
|
||||
virtual void GetRemoteDeviceProperties();
|
||||
virtual void GetRemoteDeviceProperty();
|
||||
virtual void SetRemoteDeviceProperty();
|
||||
|
||||
virtual void GetRemoteServiceRecord();
|
||||
virtual void GetRemoteServices();
|
||||
|
||||
virtual void StartDiscovery();
|
||||
virtual void CancelDiscovery();
|
||||
|
||||
virtual void CreateBond();
|
||||
virtual void RemoveBond();
|
||||
virtual void CancelBond();
|
||||
|
||||
virtual void GetConnectionState();
|
||||
|
||||
virtual void PinReply();
|
||||
virtual void SspReply();
|
||||
|
||||
virtual void DutModeConfigure();
|
||||
virtual void DutModeSend();
|
||||
|
||||
virtual void LeTestMode();
|
||||
|
||||
virtual void ReadEnergyInfo();
|
||||
|
||||
protected:
|
||||
virtual ~BluetoothCoreResultHandler() { }
|
||||
};
|
||||
|
||||
class BluetoothCoreInterface
|
||||
{
|
||||
public:
|
||||
virtual void SetNotificationHandler(
|
||||
BluetoothCoreNotificationHandler* aNotificationHandler) = 0;
|
||||
|
||||
/* Enable/Disable */
|
||||
|
||||
virtual void Enable(BluetoothCoreResultHandler* aRes) = 0;
|
||||
virtual void Disable(BluetoothCoreResultHandler* aRes) = 0;
|
||||
|
||||
/* Adapter Properties */
|
||||
|
||||
virtual void GetAdapterProperties(BluetoothCoreResultHandler* aRes) = 0;
|
||||
virtual void GetAdapterProperty(BluetoothPropertyType,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
virtual void SetAdapterProperty(const BluetoothProperty& aProperty,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
|
||||
/* Remote Device Properties */
|
||||
|
||||
virtual void GetRemoteDeviceProperties(const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
virtual void GetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothPropertyType aType,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
virtual void SetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
|
||||
const BluetoothProperty& aProperty,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
|
||||
/* Remote Services */
|
||||
|
||||
virtual void GetRemoteServiceRecord(const BluetoothAddress& aRemoteAddr,
|
||||
const BluetoothUuid& aUuid,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
virtual void GetRemoteServices(const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
|
||||
/* Discovery */
|
||||
|
||||
virtual void StartDiscovery(BluetoothCoreResultHandler* aRes) = 0;
|
||||
virtual void CancelDiscovery(BluetoothCoreResultHandler* aRes) = 0;
|
||||
|
||||
/* Bonds */
|
||||
|
||||
virtual void CreateBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothTransport aTransport,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
virtual void RemoveBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
virtual void CancelBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
|
||||
/* Connection */
|
||||
|
||||
virtual void GetConnectionState(const BluetoothAddress& aBdAddr,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
|
||||
/* Authentication */
|
||||
|
||||
virtual void PinReply(const BluetoothAddress& aBdAddr, bool aAccept,
|
||||
const BluetoothPinCode& aPinCode,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
|
||||
virtual void SspReply(const BluetoothAddress& aBdAddr,
|
||||
BluetoothSspVariant aVariant,
|
||||
bool aAccept, uint32_t aPasskey,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
|
||||
/* DUT Mode */
|
||||
|
||||
virtual void DutModeConfigure(bool aEnable,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
virtual void DutModeSend(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
|
||||
/* LE Mode */
|
||||
|
||||
virtual void LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
|
||||
BluetoothCoreResultHandler* aRes) = 0;
|
||||
|
||||
/* Energy Info */
|
||||
|
||||
virtual void ReadEnergyInfo(BluetoothCoreResultHandler* aRes) = 0;
|
||||
|
||||
protected:
|
||||
BluetoothCoreInterface();
|
||||
virtual ~BluetoothCoreInterface();
|
||||
};
|
||||
|
||||
//
|
||||
// Socket Interface
|
||||
//
|
||||
@ -931,49 +1113,12 @@ protected:
|
||||
};
|
||||
|
||||
//
|
||||
// Bluetooth Core Interface
|
||||
// Bluetooth Interface
|
||||
//
|
||||
|
||||
class BluetoothNotificationHandler
|
||||
{
|
||||
public:
|
||||
virtual void AdapterStateChangedNotification(bool aState);
|
||||
virtual void AdapterPropertiesNotification(
|
||||
BluetoothStatus aStatus, int aNumProperties,
|
||||
const BluetoothProperty* aProperties);
|
||||
|
||||
virtual void RemoteDevicePropertiesNotification(
|
||||
BluetoothStatus aStatus, const BluetoothAddress& aBdAddr,
|
||||
int aNumProperties, const BluetoothProperty* aProperties);
|
||||
|
||||
virtual void DeviceFoundNotification(
|
||||
int aNumProperties, const BluetoothProperty* aProperties);
|
||||
|
||||
virtual void DiscoveryStateChangedNotification(bool aState);
|
||||
|
||||
virtual void PinRequestNotification(const BluetoothAddress& aRemoteBdAddr,
|
||||
const BluetoothRemoteName& aBdName,
|
||||
uint32_t aCod);
|
||||
virtual void SspRequestNotification(const BluetoothAddress& aRemoteBdAddr,
|
||||
const BluetoothRemoteName& aBdName,
|
||||
uint32_t aCod,
|
||||
BluetoothSspVariant aPairingVariant,
|
||||
uint32_t aPassKey);
|
||||
|
||||
virtual void BondStateChangedNotification(
|
||||
BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
|
||||
BluetoothBondState aState);
|
||||
virtual void AclStateChangedNotification(
|
||||
BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
|
||||
BluetoothAclState aState);
|
||||
|
||||
virtual void DutModeRecvNotification(uint16_t aOpcode,
|
||||
const uint8_t* aBuf, uint8_t aLen);
|
||||
virtual void LeTestModeNotification(BluetoothStatus aStatus,
|
||||
uint16_t aNumPackets);
|
||||
|
||||
virtual void EnergyInfoNotification(const BluetoothActivityEnergyInfo& aInfo);
|
||||
|
||||
virtual void BackendErrorNotification(bool aCrashed);
|
||||
|
||||
protected:
|
||||
@ -989,38 +1134,6 @@ public:
|
||||
|
||||
virtual void Init();
|
||||
virtual void Cleanup();
|
||||
virtual void Enable();
|
||||
virtual void Disable();
|
||||
|
||||
virtual void GetAdapterProperties();
|
||||
virtual void GetAdapterProperty();
|
||||
virtual void SetAdapterProperty();
|
||||
|
||||
virtual void GetRemoteDeviceProperties();
|
||||
virtual void GetRemoteDeviceProperty();
|
||||
virtual void SetRemoteDeviceProperty();
|
||||
|
||||
virtual void GetRemoteServiceRecord();
|
||||
virtual void GetRemoteServices();
|
||||
|
||||
virtual void StartDiscovery();
|
||||
virtual void CancelDiscovery();
|
||||
|
||||
virtual void CreateBond();
|
||||
virtual void RemoveBond();
|
||||
virtual void CancelBond();
|
||||
|
||||
virtual void GetConnectionState();
|
||||
|
||||
virtual void PinReply();
|
||||
virtual void SspReply();
|
||||
|
||||
virtual void DutModeConfigure();
|
||||
virtual void DutModeSend();
|
||||
|
||||
virtual void LeTestMode();
|
||||
|
||||
virtual void ReadEnergyInfo();
|
||||
|
||||
protected:
|
||||
virtual ~BluetoothResultHandler() { }
|
||||
@ -1035,86 +1148,10 @@ public:
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
virtual void Cleanup(BluetoothResultHandler* aRes) = 0;
|
||||
|
||||
virtual void Enable(BluetoothResultHandler* aRes) = 0;
|
||||
virtual void Disable(BluetoothResultHandler* aRes) = 0;
|
||||
|
||||
/* Adapter Properties */
|
||||
|
||||
virtual void GetAdapterProperties(BluetoothResultHandler* aRes) = 0;
|
||||
virtual void GetAdapterProperty(BluetoothPropertyType,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
virtual void SetAdapterProperty(const BluetoothProperty& aProperty,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
|
||||
/* Remote Device Properties */
|
||||
|
||||
virtual void GetRemoteDeviceProperties(const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
virtual void GetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothPropertyType aType,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
virtual void SetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
|
||||
const BluetoothProperty& aProperty,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
|
||||
/* Remote Services */
|
||||
|
||||
virtual void GetRemoteServiceRecord(const BluetoothAddress& aRemoteAddr,
|
||||
const BluetoothUuid& aUuid,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
virtual void GetRemoteServices(const BluetoothAddress& aRemoteAddr,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
|
||||
/* Discovery */
|
||||
|
||||
virtual void StartDiscovery(BluetoothResultHandler* aRes) = 0;
|
||||
virtual void CancelDiscovery(BluetoothResultHandler* aRes) = 0;
|
||||
|
||||
/* Bonds */
|
||||
|
||||
virtual void CreateBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothTransport aTransport,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
virtual void RemoveBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
virtual void CancelBond(const BluetoothAddress& aBdAddr,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
|
||||
/* Connection */
|
||||
|
||||
virtual void GetConnectionState(const BluetoothAddress& aBdAddr,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
|
||||
/* Authentication */
|
||||
|
||||
virtual void PinReply(const BluetoothAddress& aBdAddr, bool aAccept,
|
||||
const BluetoothPinCode& aPinCode,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
|
||||
virtual void SspReply(const BluetoothAddress& aBdAddr,
|
||||
BluetoothSspVariant aVariant,
|
||||
bool aAccept, uint32_t aPasskey,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
|
||||
/* DUT Mode */
|
||||
|
||||
virtual void DutModeConfigure(bool aEnable,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
virtual void DutModeSend(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
|
||||
/* LE Mode */
|
||||
|
||||
virtual void LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
|
||||
BluetoothResultHandler* aRes) = 0;
|
||||
|
||||
/* Energy Info */
|
||||
|
||||
virtual void ReadEnergyInfo(BluetoothResultHandler* aRes) = 0;
|
||||
|
||||
/* Profile Interfaces */
|
||||
|
||||
virtual BluetoothSetupInterface* GetBluetoothSetupInterface() = 0;
|
||||
virtual BluetoothCoreInterface* GetBluetoothCoreInterface() = 0;
|
||||
virtual BluetoothSocketInterface* GetBluetoothSocketInterface() = 0;
|
||||
virtual BluetoothHandsfreeInterface* GetBluetoothHandsfreeInterface() = 0;
|
||||
virtual BluetoothA2dpInterface* GetBluetoothA2dpInterface() = 0;
|
||||
|
@ -1896,7 +1896,7 @@ CanvasRenderingContext2D::SetMozCurrentTransform(JSContext* cx,
|
||||
}
|
||||
|
||||
Matrix newCTM;
|
||||
if (ObjectToMatrix(cx, currentTransform, newCTM, error)) {
|
||||
if (ObjectToMatrix(cx, currentTransform, newCTM, error) && newCTM.IsFinite()) {
|
||||
mTarget->SetTransform(newCTM);
|
||||
}
|
||||
}
|
||||
@ -1924,7 +1924,7 @@ CanvasRenderingContext2D::SetMozCurrentTransformInverse(JSContext* cx,
|
||||
Matrix newCTMInverse;
|
||||
if (ObjectToMatrix(cx, currentTransform, newCTMInverse, error)) {
|
||||
// XXX ERRMSG we need to report an error to developers here! (bug 329026)
|
||||
if (newCTMInverse.Invert()) {
|
||||
if (newCTMInverse.Invert() && newCTMInverse.IsFinite()) {
|
||||
mTarget->SetTransform(newCTMInverse);
|
||||
}
|
||||
}
|
||||
|
17
dom/canvas/crashtests/1225381-1.html
Normal file
17
dom/canvas/crashtests/1225381-1.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<script>
|
||||
|
||||
function boom() {
|
||||
var canvas = document.createElement('canvas');
|
||||
var ctx = canvas.getContext('2d');
|
||||
ctx.mozCurrentTransformInverse = [32, -1, 0.8320478957221024, 1.7976931348623157e+308, 512, 0.9012573524148337];
|
||||
ctx.fillText("A", 0 ,0);
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body onload="boom();"></body>
|
||||
</html>
|
@ -23,4 +23,5 @@ load 1099143-1.html
|
||||
load 1161277-1.html
|
||||
load 1183363.html
|
||||
load 1190705.html
|
||||
load 1225381-1.html
|
||||
load texImage2D.html
|
||||
|
@ -46,10 +46,10 @@
|
||||
== dir_auto-pre-N-EN.html dir_auto-pre-N-EN-ref.html
|
||||
== dir_auto-R.html dir_auto-R-ref.html
|
||||
== dir_auto-textarea-mixed.html dir_auto-textarea-mixed-ref.html
|
||||
fails-if(B2G||Mulet) == dir_auto-textarea-N-between-Rs.html dir_auto-textarea-N-between-Rs-ref.html # B2G scrollbar on opposite side
|
||||
fails-if(B2G||Mulet||(Android&&asyncPan)) == dir_auto-textarea-N-between-Rs.html dir_auto-textarea-N-between-Rs-ref.html # B2G scrollbar on opposite side
|
||||
== dir_auto-textarea-N-EN.html dir_auto-textarea-N-EN-ref.html
|
||||
== dir_auto-textarea-script-mixed.html dir_auto-textarea-script-mixed-ref.html
|
||||
fails-if(B2G||Mulet) == dir_auto-textarea-script-N-between-Rs.html dir_auto-textarea-script-N-between-Rs-ref.html # B2G scrollbar on reference only
|
||||
fails-if(B2G||Mulet||(Android&&asyncPan)) == dir_auto-textarea-script-N-between-Rs.html dir_auto-textarea-script-N-between-Rs-ref.html # B2G scrollbar on reference only
|
||||
== dir_auto-textarea-script-N-EN.html dir_auto-textarea-script-N-EN-ref.html
|
||||
== lang-xyzzy.html lang-xyzzy-ref.html
|
||||
== lang-xmllang-01.html lang-xmllang-01-ref.html
|
||||
|
@ -171,3 +171,4 @@ PEExpectedVariableNameEOF=identifier for variable name
|
||||
PEExpectedVariableName=Expected identifier for variable name but found '%1$S'.
|
||||
PEExpectedVariableFallback=Expected variable reference fallback after ','.
|
||||
PEExpectedVariableCommaOrCloseParen=Expected ',' or ')' after variable name in variable reference but found '%1$S'.
|
||||
PESubgridNotSupported=Support for the 'subgrid' keyword of CSS Grid is not enabled.
|
||||
|
@ -142,6 +142,8 @@ VorbisTrackEncoder::GetEncodedFrames(EncodedFrameContainer& aData)
|
||||
VORBISLOG("vorbis_analysis_blockout block size %d", oggPacket.bytes);
|
||||
EncodedFrame* audiodata = new EncodedFrame();
|
||||
audiodata->SetFrameType(EncodedFrame::VORBIS_AUDIO_FRAME);
|
||||
audiodata->SetTimeStamp(oggPacket.granulepos * PR_USEC_PER_SEC
|
||||
/ mSamplingRate);
|
||||
nsTArray<uint8_t> frameData;
|
||||
frameData.AppendElements(oggPacket.packet, oggPacket.bytes);
|
||||
audiodata->SwapInFrameData(frameData);
|
||||
|
@ -14,6 +14,7 @@
|
||||
var test;
|
||||
runNetworkTest(function (options) {
|
||||
test = new PeerConnectionTest(options);
|
||||
var firstNegotiationSize = test.chain.commands.length;
|
||||
addRenegotiation(test.chain,
|
||||
[
|
||||
function PC_LOCAL_ADD_SECOND_STREAM(test) {
|
||||
@ -42,6 +43,8 @@
|
||||
},
|
||||
|
||||
function PC_LOCAL_ROLLBACK(test) {
|
||||
// We haven't negotiated the new stream yet.
|
||||
test.pcLocal.expectNegotiationNeeded();
|
||||
return test.setLocalDescription(
|
||||
test.pcLocal,
|
||||
new RTCSessionDescription({ type: "rollback", sdp: ""}),
|
||||
@ -53,7 +56,7 @@
|
||||
return test.pcLocal.endOfTrickleIce;
|
||||
},
|
||||
],
|
||||
1 // Second PC_REMOTE_SET_REMOTE_DESCRIPTION
|
||||
firstNegotiationSize // Second PC_REMOTE_SET_REMOTE_DESCRIPTION
|
||||
);
|
||||
test.chain.append(commandsPeerConnectionOfferAnswer);
|
||||
test.setMediaConstraints([{audio: true}], [{audio: true}]);
|
||||
|
@ -18,6 +18,8 @@
|
||||
test.chain.removeAfter('PC_REMOTE_SET_REMOTE_DESCRIPTION');
|
||||
test.chain.append([
|
||||
function PC_REMOTE_ROLLBACK(test) {
|
||||
// We still haven't negotiated the tracks
|
||||
test.pcRemote.expectNegotiationNeeded();
|
||||
return test.setRemoteDescription(
|
||||
test.pcRemote,
|
||||
new RTCSessionDescription({ type: "rollback" }),
|
||||
@ -25,6 +27,8 @@
|
||||
},
|
||||
|
||||
function PC_LOCAL_ROLLBACK(test) {
|
||||
// We still haven't negotiated the tracks
|
||||
test.pcLocal.expectNegotiationNeeded();
|
||||
return test.setLocalDescription(
|
||||
test.pcLocal,
|
||||
new RTCSessionDescription({ type: "rollback", sdp: ""}),
|
||||
|
@ -112,7 +112,9 @@ EbmlComposer::WriteSimpleBlock(EncodedFrame* aFrame)
|
||||
EbmlGlobal ebml;
|
||||
ebml.offset = 0;
|
||||
|
||||
if (aFrame->GetFrameType() == EncodedFrame::FrameType::VP8_I_FRAME) {
|
||||
auto frameType = aFrame->GetFrameType();
|
||||
bool isVP8IFrame = (frameType == EncodedFrame::FrameType::VP8_I_FRAME);
|
||||
if (isVP8IFrame) {
|
||||
FinishCluster();
|
||||
}
|
||||
|
||||
@ -120,7 +122,7 @@ EbmlComposer::WriteSimpleBlock(EncodedFrame* aFrame)
|
||||
block->SetLength(aFrame->GetFrameData().Length() + DEFAULT_HEADER_SIZE);
|
||||
ebml.buf = block->Elements();
|
||||
|
||||
if (aFrame->GetFrameType() == EncodedFrame::FrameType::VP8_I_FRAME) {
|
||||
if (isVP8IFrame) {
|
||||
EbmlLoc ebmlLoc;
|
||||
Ebml_StartSubElement(&ebml, &ebmlLoc, Cluster);
|
||||
MOZ_ASSERT(mClusterBuffs.Length() > 0);
|
||||
@ -132,18 +134,11 @@ EbmlComposer::WriteSimpleBlock(EncodedFrame* aFrame)
|
||||
mFlushState |= FLUSH_CLUSTER;
|
||||
}
|
||||
|
||||
if (aFrame->GetFrameType() != EncodedFrame::FrameType::VORBIS_AUDIO_FRAME) {
|
||||
short timeCode = aFrame->GetTimeStamp() / PR_USEC_PER_MSEC
|
||||
- mClusterTimecode;
|
||||
writeSimpleBlock(&ebml, 0x1, timeCode, aFrame->GetFrameType() ==
|
||||
EncodedFrame::FrameType::VP8_I_FRAME,
|
||||
0, 0, (unsigned char*)aFrame->GetFrameData().Elements(),
|
||||
aFrame->GetFrameData().Length());
|
||||
} else {
|
||||
writeSimpleBlock(&ebml, 0x2, 0, false,
|
||||
0, 0, (unsigned char*)aFrame->GetFrameData().Elements(),
|
||||
aFrame->GetFrameData().Length());
|
||||
}
|
||||
bool isVorbis = (frameType == EncodedFrame::FrameType::VORBIS_AUDIO_FRAME);
|
||||
short timeCode = aFrame->GetTimeStamp() / PR_USEC_PER_MSEC - mClusterTimecode;
|
||||
writeSimpleBlock(&ebml, isVorbis ? 0x2 : 0x1, timeCode, isVP8IFrame,
|
||||
0, 0, (unsigned char*)aFrame->GetFrameData().Elements(),
|
||||
aFrame->GetFrameData().Length());
|
||||
MOZ_ASSERT(ebml.offset <= DEFAULT_HEADER_SIZE +
|
||||
aFrame->GetFrameData().Length(),
|
||||
"write more data > EBML_BUFFER_SIZE");
|
||||
|
@ -140,8 +140,7 @@ function setAndFireTechLostHandler() {
|
||||
|
||||
var tests = [
|
||||
testNfcNotEnabledError,
|
||||
// This testcase is temporarily removed due to Bug 1055959, will reopen when it is fixed
|
||||
// testNfcBadSessionIdError
|
||||
testNfcBadSessionIdError,
|
||||
testNoErrorInTechMsg
|
||||
];
|
||||
|
||||
|
@ -21,4 +21,4 @@ support-files =
|
||||
iframe_differentDOM.html
|
||||
|
||||
[test_pointerlock-api.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s || os == 'linux' || os == 'win' # B2G - window.open focus issues using fullscreen. (For Linux & Win) Bug1180351
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || os == 'linux' || os == 'win' # B2G - window.open focus issues using fullscreen. (For Linux & Win) Bug1180351
|
||||
|
@ -4,10 +4,10 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://www.w3.org/TR/hr-time/
|
||||
* http://w3c.github.io/hr-time/
|
||||
*
|
||||
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
* Copyright © 2015 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
* W3C liability, trademark and document use rules apply.
|
||||
*/
|
||||
|
||||
typedef double DOMHighResTimeStamp;
|
||||
@ -17,6 +17,9 @@ typedef sequence <PerformanceEntry> PerformanceEntryList;
|
||||
interface Performance {
|
||||
[DependsOn=DeviceState, Affects=Nothing]
|
||||
DOMHighResTimeStamp now();
|
||||
|
||||
[Throws]
|
||||
DOMHighResTimeStamp translateTime(DOMHighResTimeStamp time, (Window or Worker or SharedWorker or ServiceWorker) timeSource);
|
||||
};
|
||||
|
||||
[Exposed=Window]
|
||||
|
@ -79,14 +79,16 @@ Performance::InsertUserEntry(PerformanceEntry* aEntry)
|
||||
PerformanceBase::InsertUserEntry(aEntry);
|
||||
}
|
||||
|
||||
DOMHighResTimeStamp
|
||||
Performance::DeltaFromNavigationStart(DOMHighResTimeStamp aTime)
|
||||
TimeStamp
|
||||
Performance::CreationTimeStamp() const
|
||||
{
|
||||
if (aTime == 0) {
|
||||
return 0;
|
||||
}
|
||||
return mWorkerPrivate->NowBaseTimeStamp();
|
||||
}
|
||||
|
||||
return aTime - mWorkerPrivate->NowBaseTimeHighRes();
|
||||
DOMHighResTimeStamp
|
||||
Performance::CreationTime() const
|
||||
{
|
||||
return mWorkerPrivate->NowBaseTimeHighRes();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -55,8 +55,9 @@ private:
|
||||
DOMHighResTimeStamp
|
||||
GetPerformanceTimingFromString(const nsAString& aTimingName) override;
|
||||
|
||||
DOMHighResTimeStamp
|
||||
DeltaFromNavigationStart(DOMHighResTimeStamp aTime) override;
|
||||
TimeStamp CreationTimeStamp() const override;
|
||||
|
||||
DOMHighResTimeStamp CreationTime() const override;
|
||||
};
|
||||
|
||||
END_WORKERS_NAMESPACE
|
||||
|
@ -101,6 +101,13 @@ ServiceWorker::PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
|
||||
aRv = workerPrivate->SendMessageEvent(aCx, aMessage, aTransferable, Move(clientInfo));
|
||||
}
|
||||
|
||||
WorkerPrivate*
|
||||
ServiceWorker::GetWorkerPrivate() const
|
||||
{
|
||||
ServiceWorkerPrivate* workerPrivate = mInfo->WorkerPrivate();
|
||||
return workerPrivate->GetWorkerPrivate();
|
||||
}
|
||||
|
||||
} // namespace workers
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -67,6 +67,9 @@ public:
|
||||
const Optional<Sequence<JS::Value>>& aTransferable,
|
||||
ErrorResult& aRv);
|
||||
|
||||
WorkerPrivate*
|
||||
GetWorkerPrivate() const;
|
||||
|
||||
private:
|
||||
// This class can only be created from the ServiceWorkerManager.
|
||||
ServiceWorker(nsPIDOMWindow* aWindow, ServiceWorkerInfo* aInfo);
|
||||
|
@ -128,6 +128,12 @@ public:
|
||||
void
|
||||
NoteStoppedControllingDocuments();
|
||||
|
||||
WorkerPrivate*
|
||||
GetWorkerPrivate() const
|
||||
{
|
||||
return mWorkerPrivate;
|
||||
}
|
||||
|
||||
private:
|
||||
enum WakeUpReason {
|
||||
FetchEvent = 0,
|
||||
|
@ -1,3 +1,6 @@
|
||||
This directory contains the Graphite2 library release 1.3.4 from
|
||||
https://github.com/silnrsi/graphite/releases/download/1.3.4/graphite2-minimal-1.3.4.tgz
|
||||
See ./gfx/graphite2/moz-gr-update.sh for update procedure.
|
||||
|
||||
Bug 1223002: Updated to upstream commit 6106dcbd5bc4df2e6ef6a7c632c69ca71ba2b518
|
||||
to fix recently-discovered fuzzbugs.
|
||||
|
@ -120,6 +120,7 @@ private:
|
||||
analysis _analysis;
|
||||
enum passtype _passtype;
|
||||
int _stack_depth;
|
||||
bool _in_ctxt_item;
|
||||
};
|
||||
|
||||
|
||||
@ -139,7 +140,8 @@ inline Machine::Code::decoder::decoder(limits & lims, Code &code, enum passtype
|
||||
_pre_context(code._constraint ? 0 : lims.pre_context),
|
||||
_rule_length(code._constraint ? 1 : lims.rule_length),
|
||||
_instr(code._code), _data(code._data), _max(lims), _passtype(pt),
|
||||
_stack_depth(0)
|
||||
_stack_depth(0),
|
||||
_in_ctxt_item(false)
|
||||
{ }
|
||||
|
||||
|
||||
@ -356,8 +358,8 @@ opcode Machine::Code::decoder::fetch_opcode(const byte * bc)
|
||||
break;
|
||||
case CNTXT_ITEM :
|
||||
valid_upto(_max.rule_length, _max.pre_context + int8(bc[0]));
|
||||
if (bc + 2 + bc[1] >= _max.bytecode) failure(jump_past_end);
|
||||
if (_pre_context != 0) failure(nested_context_item);
|
||||
if (bc + 2 + bc[1] >= _max.bytecode) failure(jump_past_end);
|
||||
if (_in_ctxt_item) failure(nested_context_item);
|
||||
break;
|
||||
case ATTR_SET :
|
||||
case ATTR_ADD :
|
||||
@ -578,6 +580,7 @@ bool Machine::Code::decoder::emit_opcode(opcode opc, const byte * & bc)
|
||||
if (opc == CNTXT_ITEM)
|
||||
{
|
||||
assert(_pre_context == 0);
|
||||
_in_ctxt_item = true;
|
||||
_pre_context = _max.pre_context + int8(_data[-2]);
|
||||
_rule_length = _max.rule_length;
|
||||
|
||||
@ -596,6 +599,7 @@ bool Machine::Code::decoder::emit_opcode(opcode opc, const byte * & bc)
|
||||
|
||||
_rule_length = 1;
|
||||
_pre_context = 0;
|
||||
_in_ctxt_item = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -195,7 +195,6 @@ bool Face::runGraphite(Segment *seg, const Silf *aSilf) const
|
||||
<< "output" << json::array;
|
||||
for(Slot * s = seg->first(); s; s = s->next())
|
||||
*dbgout << dslot(seg, s);
|
||||
seg->finalise(0); // Call this here to fix up charinfo back indexes.
|
||||
*dbgout << json::close
|
||||
<< "advance" << seg->advance()
|
||||
<< "chars" << json::array;
|
||||
|
@ -952,7 +952,7 @@ gid16 CmapSubtable4Lookup(const void * pCmapSubtabel4, unsigned int nUnicodeId,
|
||||
uint16 nSeg = be::swap(pTable->seg_count_x2) >> 1;
|
||||
|
||||
uint16 n;
|
||||
const uint16 * pLeft, * pMid;
|
||||
const uint16 * pLeft, * pMid;
|
||||
uint16 cMid, chStart, chEnd;
|
||||
|
||||
if (rangeKey)
|
||||
|
@ -2547,6 +2547,8 @@ void AsyncPanZoomController::CancelAnimation(CancelAnimationFlags aFlags) {
|
||||
bool repaint = !IsZero(GetVelocityVector());
|
||||
mX.SetVelocity(0);
|
||||
mY.SetVelocity(0);
|
||||
mX.SetAxisLocked(false);
|
||||
mY.SetAxisLocked(false);
|
||||
// Setting the state to nothing and cancelling the animation can
|
||||
// preempt normal mechanisms for relieving overscroll, so we need to clear
|
||||
// overscroll here.
|
||||
|
@ -382,6 +382,7 @@ void Axis::EndTouch(uint32_t aTimestampMs) {
|
||||
// mVelocityQueue is controller-thread only
|
||||
APZThreadUtils::AssertOnControllerThread();
|
||||
|
||||
mAxisLocked = false;
|
||||
mVelocity = 0;
|
||||
int count = 0;
|
||||
while (!mVelocityQueue.IsEmpty()) {
|
||||
|
@ -40,6 +40,7 @@
|
||||
#endif
|
||||
#include "GeckoProfiler.h"
|
||||
#include "FrameUniformityData.h"
|
||||
#include "TreeTraversal.h"
|
||||
|
||||
struct nsCSSValueSharedList;
|
||||
|
||||
@ -734,6 +735,40 @@ ExpandRootClipRect(Layer* aLayer, const ScreenMargin& aFixedLayerMargins)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MOZ_ANDROID_APZ
|
||||
static void
|
||||
MoveScrollbarForLayerMargin(Layer* aRoot, FrameMetrics::ViewID aRootScrollId,
|
||||
const ScreenMargin& aFixedLayerMargins)
|
||||
{
|
||||
// See bug 1223928 comment 9 - once we can detect the RCD with just the
|
||||
// isRootContent flag on the metrics, we can probably move this code into
|
||||
// ApplyAsyncTransformToScrollbar rather than having it as a separate
|
||||
// adjustment on the layer tree.
|
||||
Layer* scrollbar = BreadthFirstSearch(aRoot,
|
||||
[aRootScrollId](Layer* aNode) {
|
||||
return (aNode->GetScrollbarDirection() == Layer::HORIZONTAL &&
|
||||
aNode->GetScrollbarTargetContainerId() == aRootScrollId);
|
||||
});
|
||||
if (scrollbar) {
|
||||
// Shift the horizontal scrollbar down into the new space exposed by the
|
||||
// dynamic toolbar hiding. Technically we should also scale the vertical
|
||||
// scrollbar a bit to expand into the new space but it's not as noticeable
|
||||
// and it would add a lot more complexity, so we're going with the "it's not
|
||||
// worth it" justification.
|
||||
TranslateShadowLayer(scrollbar, gfxPoint(0, -aFixedLayerMargins.bottom), true);
|
||||
if (scrollbar->GetParent()) {
|
||||
// The layer that has the HORIZONTAL direction sits inside another
|
||||
// ContainerLayer. This ContainerLayer also has a clip rect that causes
|
||||
// the scrollbar to get clipped. We need to expand that clip rect to
|
||||
// prevent that from happening. This is kind of ugly in that we're
|
||||
// assuming a particular layer tree structure but short of adding more
|
||||
// flags to the layer there doesn't appear to be a good way to do this.
|
||||
ExpandRootClipRect(scrollbar->GetParent(), aFixedLayerMargins);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer,
|
||||
bool* aOutFoundRoot)
|
||||
@ -805,6 +840,7 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer,
|
||||
(aLayer->GetParent() == nullptr && /* rootmost metrics */
|
||||
i + 1 >= aLayer->GetFrameMetricsCount());
|
||||
if (*aOutFoundRoot) {
|
||||
mRootScrollableId = metrics.GetScrollId();
|
||||
CSSToLayerScale geckoZoom = metrics.LayersPixelsPerCSSPixel().ToScaleFactor();
|
||||
if (mIsFirstPaint) {
|
||||
LayerIntPoint scrollOffsetLayerPixels = RoundedToInt(metrics.GetScrollOffset() * geckoZoom);
|
||||
@ -822,6 +858,7 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer,
|
||||
geckoZoom * asyncTransformWithoutOverscroll.mScale,
|
||||
metrics.GetScrollableRect(), displayPort, geckoZoom, mLayersUpdated,
|
||||
mPaintSyncId, fixedLayerMargins);
|
||||
mFixedLayerMargins = fixedLayerMargins;
|
||||
mLayersUpdated = false;
|
||||
}
|
||||
mIsFirstPaint = false;
|
||||
@ -1312,6 +1349,9 @@ AsyncCompositionManager::TransformShadowTree(TimeStamp aCurrentFrame,
|
||||
if (ApplyAsyncContentTransformToTree(root, &foundRoot)) {
|
||||
#if defined(MOZ_ANDROID_APZ)
|
||||
MOZ_ASSERT(foundRoot);
|
||||
if (foundRoot && mFixedLayerMargins != ScreenMargin()) {
|
||||
MoveScrollbarForLayerMargin(root, mRootScrollableId, mFixedLayerMargins);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
nsAutoTArray<Layer*,1> scrollableLayers;
|
||||
|
@ -227,6 +227,14 @@ private:
|
||||
|
||||
gfx::Matrix mWorldTransform;
|
||||
LayerTransformRecorder mLayerTransformRecorder;
|
||||
|
||||
#ifdef MOZ_ANDROID_APZ
|
||||
// The following two fields are only needed on Fennec with C++ APZ, because
|
||||
// then we need to reposition the gecko scrollbar to deal with the
|
||||
// dynamic toolbar shifting content around.
|
||||
FrameMetrics::ViewID mRootScrollableId;
|
||||
ScreenMargin mFixedLayerMargins;
|
||||
#endif
|
||||
};
|
||||
|
||||
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(AsyncCompositionManager::TransformsToSkip)
|
||||
|
@ -810,10 +810,9 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion)
|
||||
}
|
||||
|
||||
// Allow widget to render a custom foreground.
|
||||
mCompositor->GetWidget()->DrawWindowOverlay(this, IntRect(actualBounds.x,
|
||||
actualBounds.y,
|
||||
actualBounds.width,
|
||||
actualBounds.height));
|
||||
mCompositor->GetWidget()->DrawWindowOverlay(
|
||||
this, LayoutDeviceIntRect(actualBounds.x, actualBounds.y,
|
||||
actualBounds.width, actualBounds.height));
|
||||
|
||||
// Debugging
|
||||
RenderDebugOverlay(actualBounds);
|
||||
|
@ -405,7 +405,7 @@ if CONFIG['MOZ_ENABLE_D3D10_LAYER']:
|
||||
DEFINES['MOZ_ENABLE_D3D10_LAYER'] = True
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
|
||||
if CONFIG['ANDROID_VERSION'] > '17':
|
||||
if CONFIG['ANDROID_VERSION'] >= '17':
|
||||
includes = [
|
||||
'frameworks/av/include/media/stagefright',
|
||||
'frameworks/native/include/media/openmax',
|
||||
|
22
js/src/jit-test/tests/ion/dense-elem-write-barrier.js
Normal file
22
js/src/jit-test/tests/ion/dense-elem-write-barrier.js
Normal file
@ -0,0 +1,22 @@
|
||||
var arr = [];
|
||||
for (var i=0; i<20; i++) {
|
||||
arr.push(new Int32Array(2000));
|
||||
}
|
||||
arr.push([null, null]);
|
||||
|
||||
function test(o, x) {
|
||||
assertEq(o[0], x);
|
||||
}
|
||||
|
||||
function f() {
|
||||
for (var i=0; i<3100; i++) {
|
||||
var o = arr[i % arr.length];
|
||||
if (o.length > 10 || i > 2000) {
|
||||
var val = (i > 3000 ? 1 : null);
|
||||
o[0] = val;
|
||||
if (o.length < 5)
|
||||
test(o, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
f();
|
@ -921,10 +921,7 @@ BaselineScript::initTraceLogger(JSRuntime* runtime, JSScript* script)
|
||||
#endif
|
||||
|
||||
TraceLoggerThread* logger = TraceLoggerForMainThread(runtime);
|
||||
if (TraceLogTextIdEnabled(TraceLogger_Scripts))
|
||||
traceLoggerScriptEvent_ = TraceLoggerEvent(logger, TraceLogger_Scripts, script);
|
||||
else
|
||||
traceLoggerScriptEvent_ = TraceLoggerEvent(logger, TraceLogger_Scripts);
|
||||
traceLoggerScriptEvent_ = TraceLoggerEvent(logger, TraceLogger_Scripts, script);
|
||||
|
||||
if (TraceLogTextIdEnabled(TraceLogger_Engine) || TraceLogTextIdEnabled(TraceLogger_Scripts)) {
|
||||
CodeLocationLabel enter(method_, CodeOffsetLabel(traceLoggerEnterToggleOffset_));
|
||||
|
@ -9863,17 +9863,11 @@ IonBuilder::setElemTryCache(bool* emitted, MDefinition* object,
|
||||
|
||||
bool barrier = true;
|
||||
|
||||
if (index->mightBeType(MIRType_Int32)) {
|
||||
// Bail if we might have a barriered write to a dense element, as the
|
||||
// dense element stub doesn't support this yet.
|
||||
if (PropertyWriteNeedsTypeBarrier(alloc(), constraints(), current,
|
||||
&object, nullptr, &value, /* canModify = */ true))
|
||||
{
|
||||
trackOptimizationOutcome(TrackedOutcome::NeedsTypeBarrier);
|
||||
return true;
|
||||
}
|
||||
if (index->type() == MIRType_Int32)
|
||||
barrier = false;
|
||||
if (index->type() == MIRType_Int32 &&
|
||||
!PropertyWriteNeedsTypeBarrier(alloc(), constraints(), current,
|
||||
&object, nullptr, &value, /* canModify = */ true))
|
||||
{
|
||||
barrier = false;
|
||||
}
|
||||
|
||||
// We can avoid worrying about holes in the IC if we know a priori we are safe
|
||||
@ -9890,7 +9884,7 @@ IonBuilder::setElemTryCache(bool* emitted, MDefinition* object,
|
||||
if (NeedsPostBarrier(info(), value))
|
||||
current->add(MPostWriteBarrier::New(alloc(), object, value));
|
||||
|
||||
// Emit SetElementCache.
|
||||
// Emit SetPropertyCache.
|
||||
bool strict = JSOp(*pc) == JSOP_STRICTSETELEM;
|
||||
MSetPropertyCache* ins =
|
||||
MSetPropertyCache::New(alloc(), object, index, value, strict, barrier, guardHoles);
|
||||
|
@ -2251,8 +2251,8 @@ CheckTypeSetForWrite(MacroAssembler& masm, JSObject* obj, jsid id,
|
||||
{
|
||||
TypedOrValueRegister valReg = value.reg();
|
||||
ObjectGroup* group = obj->group();
|
||||
if (group->unknownProperties())
|
||||
return;
|
||||
MOZ_ASSERT(!group->unknownProperties());
|
||||
|
||||
HeapTypeSet* propTypes = group->maybeGetProperty(id);
|
||||
MOZ_ASSERT(propTypes);
|
||||
|
||||
@ -2272,11 +2272,9 @@ GenerateSetSlot(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher& att
|
||||
|
||||
// Guard that the incoming value is in the type set for the property
|
||||
// if a type barrier is required.
|
||||
if (needsTypeBarrier) {
|
||||
// We can't do anything that would change the HeapTypeSet, so
|
||||
// just guard that it's already there.
|
||||
if (checkTypeset)
|
||||
CheckTypeSetForWrite(masm, obj, shape->propid(), tempReg, value, failures);
|
||||
if (checkTypeset) {
|
||||
MOZ_ASSERT(needsTypeBarrier);
|
||||
CheckTypeSetForWrite(masm, obj, shape->propid(), tempReg, value, failures);
|
||||
}
|
||||
|
||||
NativeObject::slotsSizeMustNotOverflow();
|
||||
@ -3131,8 +3129,9 @@ IsPropertySetInlineable(NativeObject* obj, HandleId id, MutableHandleShape pshap
|
||||
if (!pshape->writable())
|
||||
return false;
|
||||
|
||||
if (needsTypeBarrier)
|
||||
return CanInlineSetPropTypeCheck(obj, id, val, checkTypeset);
|
||||
*checkTypeset = false;
|
||||
if (needsTypeBarrier && !CanInlineSetPropTypeCheck(obj, id, val, checkTypeset))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -3199,10 +3198,10 @@ IsPropertyAddInlineable(JSContext* cx, NativeObject* obj, HandleId id, ConstantO
|
||||
if (obj->group()->newScript() && !obj->group()->newScript()->analyzed())
|
||||
return false;
|
||||
|
||||
if (needsTypeBarrier)
|
||||
return CanInlineSetPropTypeCheck(obj, id, val, checkTypeset);
|
||||
|
||||
*checkTypeset = false;
|
||||
if (needsTypeBarrier && !CanInlineSetPropTypeCheck(obj, id, val, checkTypeset))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3289,6 +3288,7 @@ CanAttachSetUnboxed(JSContext* cx, HandleObject obj, HandleId id, ConstantOrRegi
|
||||
|
||||
const UnboxedLayout::Property* property = obj->as<UnboxedPlainObject>().layout().lookup(id);
|
||||
if (property) {
|
||||
*checkTypeset = false;
|
||||
if (needsTypeBarrier && !CanInlineSetPropTypeCheck(obj, id, val, checkTypeset))
|
||||
return false;
|
||||
*unboxedOffset = property->offset;
|
||||
@ -3314,6 +3314,7 @@ CanAttachSetUnboxedExpando(JSContext* cx, HandleObject obj, HandleId id, Constan
|
||||
if (!shape || !shape->hasDefaultSetter() || !shape->hasSlot() || !shape->writable())
|
||||
return false;
|
||||
|
||||
*checkTypeset = false;
|
||||
if (needsTypeBarrier && !CanInlineSetPropTypeCheck(obj, id, val, checkTypeset))
|
||||
return false;
|
||||
|
||||
@ -3342,6 +3343,7 @@ CanAttachAddUnboxedExpando(JSContext* cx, HandleObject obj, HandleShape oldShape
|
||||
if (PrototypeChainShadowsPropertyAdd(cx, obj, id))
|
||||
return false;
|
||||
|
||||
*checkTypeset = false;
|
||||
if (needsTypeBarrier && !CanInlineSetPropTypeCheck(obj, id, val, checkTypeset))
|
||||
return false;
|
||||
|
||||
@ -3426,7 +3428,7 @@ SetPropertyIC::tryAttachNative(JSContext* cx, HandleScript outerScript, IonScrip
|
||||
|
||||
RootedShape shape(cx);
|
||||
RootedObject holder(cx);
|
||||
bool checkTypeset;
|
||||
bool checkTypeset = false;
|
||||
NativeSetPropCacheability canCache = CanAttachNativeSetProp(cx, obj, id, value(), needsTypeBarrier(),
|
||||
&holder, &shape, &checkTypeset);
|
||||
switch (canCache) {
|
||||
@ -3927,7 +3929,7 @@ static void
|
||||
GenerateGetTypedOrUnboxedArrayElement(JSContext* cx, MacroAssembler& masm,
|
||||
IonCache::StubAttacher& attacher,
|
||||
HandleObject array, const Value& idval, Register object,
|
||||
TypedOrValueRegister index, TypedOrValueRegister output,
|
||||
ConstantOrRegister index, TypedOrValueRegister output,
|
||||
bool allowDoubleResult)
|
||||
{
|
||||
MOZ_ASSERT(GetPropertyIC::canAttachTypedOrUnboxedArrayElement(array, idval, output));
|
||||
@ -3943,49 +3945,54 @@ GenerateGetTypedOrUnboxedArrayElement(JSContext* cx, MacroAssembler& masm,
|
||||
if (idval.isString()) {
|
||||
MOZ_ASSERT(GetIndexFromString(idval.toString()) != UINT32_MAX);
|
||||
|
||||
// Part 1: Get the string into a register
|
||||
Register str;
|
||||
if (index.hasValue()) {
|
||||
ValueOperand val = index.valueReg();
|
||||
masm.branchTestString(Assembler::NotEqual, val, &failures);
|
||||
|
||||
str = masm.extractString(val, indexReg);
|
||||
if (index.constant()) {
|
||||
MOZ_ASSERT(idval == index.value());
|
||||
masm.move32(Imm32(GetIndexFromString(idval.toString())), indexReg);
|
||||
} else {
|
||||
MOZ_ASSERT(!index.typedReg().isFloat());
|
||||
str = index.typedReg().gpr();
|
||||
// Part 1: Get the string into a register
|
||||
Register str;
|
||||
if (index.reg().hasValue()) {
|
||||
ValueOperand val = index.reg().valueReg();
|
||||
masm.branchTestString(Assembler::NotEqual, val, &failures);
|
||||
|
||||
str = masm.extractString(val, indexReg);
|
||||
} else {
|
||||
MOZ_ASSERT(!index.reg().typedReg().isFloat());
|
||||
str = index.reg().typedReg().gpr();
|
||||
}
|
||||
|
||||
// Part 2: Call to translate the str into index
|
||||
AllocatableRegisterSet regs(RegisterSet::Volatile());
|
||||
LiveRegisterSet save(regs.asLiveSet());
|
||||
masm.PushRegsInMask(save);
|
||||
regs.takeUnchecked(str);
|
||||
|
||||
Register temp = regs.takeAnyGeneral();
|
||||
|
||||
masm.setupUnalignedABICall(temp);
|
||||
masm.passABIArg(str);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, GetIndexFromString));
|
||||
masm.mov(ReturnReg, indexReg);
|
||||
|
||||
LiveRegisterSet ignore;
|
||||
ignore.add(indexReg);
|
||||
masm.PopRegsInMaskIgnore(save, ignore);
|
||||
|
||||
masm.branch32(Assembler::Equal, indexReg, Imm32(UINT32_MAX), &failures);
|
||||
}
|
||||
|
||||
// Part 2: Call to translate the str into index
|
||||
AllocatableRegisterSet regs(RegisterSet::Volatile());
|
||||
LiveRegisterSet save(regs.asLiveSet());
|
||||
masm.PushRegsInMask(save);
|
||||
regs.takeUnchecked(str);
|
||||
|
||||
Register temp = regs.takeAnyGeneral();
|
||||
|
||||
masm.setupUnalignedABICall(temp);
|
||||
masm.passABIArg(str);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, GetIndexFromString));
|
||||
masm.mov(ReturnReg, indexReg);
|
||||
|
||||
LiveRegisterSet ignore;
|
||||
ignore.add(indexReg);
|
||||
masm.PopRegsInMaskIgnore(save, ignore);
|
||||
|
||||
masm.branch32(Assembler::Equal, indexReg, Imm32(UINT32_MAX), &failures);
|
||||
|
||||
} else {
|
||||
MOZ_ASSERT(idval.isInt32());
|
||||
MOZ_ASSERT(!index.constant());
|
||||
|
||||
if (index.hasValue()) {
|
||||
ValueOperand val = index.valueReg();
|
||||
if (index.reg().hasValue()) {
|
||||
ValueOperand val = index.reg().valueReg();
|
||||
masm.branchTestInt32(Assembler::NotEqual, val, &failures);
|
||||
|
||||
// Unbox the index.
|
||||
masm.unboxInt32(val, indexReg);
|
||||
} else {
|
||||
MOZ_ASSERT(!index.typedReg().isFloat());
|
||||
indexReg = index.typedReg().gpr();
|
||||
MOZ_ASSERT(!index.reg().typedReg().isFloat());
|
||||
indexReg = index.reg().typedReg().gpr();
|
||||
}
|
||||
}
|
||||
|
||||
@ -4059,7 +4066,7 @@ GetPropertyIC::tryAttachTypedOrUnboxedArrayElement(JSContext* cx, HandleScript o
|
||||
|
||||
MacroAssembler masm(cx, ion, outerScript, profilerLeavePc_);
|
||||
StubAttacher attacher(*this);
|
||||
GenerateGetTypedOrUnboxedArrayElement(cx, masm, attacher, obj, idval, object(), id().reg(),
|
||||
GenerateGetTypedOrUnboxedArrayElement(cx, masm, attacher, obj, idval, object(), id(),
|
||||
output(), allowDoubleResult_);
|
||||
return linkAndAttachStub(cx, masm, attacher, ion, "typed array",
|
||||
JS::TrackedOutcome::ICGetElemStub_TypedArray);
|
||||
@ -4180,7 +4187,8 @@ GetPropertyIC::tryAttachArgumentsElement(JSContext* cx, HandleScript outerScript
|
||||
}
|
||||
|
||||
static bool
|
||||
IsDenseElementSetInlineable(JSObject* obj, const Value& idval)
|
||||
IsDenseElementSetInlineable(JSObject* obj, const Value& idval, ConstantOrRegister val,
|
||||
bool needsTypeBarrier, bool* checkTypeset)
|
||||
{
|
||||
if (!obj->is<ArrayObject>())
|
||||
return false;
|
||||
@ -4208,6 +4216,10 @@ IsDenseElementSetInlineable(JSObject* obj, const Value& idval)
|
||||
curObj = curObj->getProto();
|
||||
}
|
||||
|
||||
*checkTypeset = false;
|
||||
if (needsTypeBarrier && !CanInlineSetPropTypeCheck(obj, JSID_VOID, val, checkTypeset))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -4277,7 +4289,7 @@ static bool
|
||||
GenerateSetDenseElement(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher& attacher,
|
||||
JSObject* obj, const Value& idval, bool guardHoles, Register object,
|
||||
TypedOrValueRegister index, ConstantOrRegister value, Register tempToUnboxIndex,
|
||||
Register temp)
|
||||
Register temp, bool needsTypeBarrier, bool checkTypeset)
|
||||
{
|
||||
MOZ_ASSERT(obj->isNative());
|
||||
MOZ_ASSERT(idval.isInt32());
|
||||
@ -4290,6 +4302,14 @@ GenerateSetDenseElement(JSContext* cx, MacroAssembler& masm, IonCache::StubAttac
|
||||
return false;
|
||||
masm.branchTestObjShape(Assembler::NotEqual, object, shape, &failures);
|
||||
|
||||
// Guard that the incoming value is in the type set for the property
|
||||
// if a type barrier is required.
|
||||
if (needsTypeBarrier) {
|
||||
masm.branchTestObjGroup(Assembler::NotEqual, object, obj->group(), &failures);
|
||||
if (checkTypeset)
|
||||
CheckTypeSetForWrite(masm, obj, JSID_VOID, temp, value, &failures);
|
||||
}
|
||||
|
||||
// Ensure the index is an int32 value.
|
||||
Register indexReg;
|
||||
if (index.hasValue()) {
|
||||
@ -4377,7 +4397,11 @@ SetPropertyIC::tryAttachDenseElement(JSContext* cx, HandleScript outerScript, Io
|
||||
MOZ_ASSERT(!*emitted);
|
||||
MOZ_ASSERT(canAttachStub());
|
||||
|
||||
if (hasDenseStub() || !IsDenseElementSetInlineable(obj, idval))
|
||||
if (hasDenseStub())
|
||||
return true;
|
||||
|
||||
bool checkTypeset = false;
|
||||
if (!IsDenseElementSetInlineable(obj, idval, value(), needsTypeBarrier(), &checkTypeset))
|
||||
return true;
|
||||
|
||||
*emitted = true;
|
||||
@ -4386,7 +4410,8 @@ SetPropertyIC::tryAttachDenseElement(JSContext* cx, HandleScript outerScript, Io
|
||||
StubAttacher attacher(*this);
|
||||
if (!GenerateSetDenseElement(cx, masm, attacher, obj, idval,
|
||||
guardHoles(), object(), id().reg(),
|
||||
value(), tempToUnboxIndex(), temp()))
|
||||
value(), tempToUnboxIndex(), temp(),
|
||||
needsTypeBarrier(), checkTypeset))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -495,7 +495,7 @@ TraceLoggerThread::startEvent(uint32_t id)
|
||||
if (!traceLoggerState->isTextIdEnabled(id))
|
||||
return;
|
||||
|
||||
logTimestamp(id);
|
||||
log(id);
|
||||
}
|
||||
|
||||
void
|
||||
@ -520,7 +520,7 @@ TraceLoggerThread::stopEvent(uint32_t id)
|
||||
if (!traceLoggerState->isTextIdEnabled(id))
|
||||
return;
|
||||
|
||||
logTimestamp(TraceLogger_Stop);
|
||||
log(TraceLogger_Stop);
|
||||
}
|
||||
|
||||
void
|
||||
@ -531,6 +531,13 @@ TraceLoggerThread::logTimestamp(TraceLoggerTextId id)
|
||||
|
||||
void
|
||||
TraceLoggerThread::logTimestamp(uint32_t id)
|
||||
{
|
||||
MOZ_ASSERT(id > TraceLogger_LastTreeItem && id < TraceLogger_Last);
|
||||
log(id);
|
||||
}
|
||||
|
||||
void
|
||||
TraceLoggerThread::log(uint32_t id)
|
||||
{
|
||||
if (enabled == 0)
|
||||
return;
|
||||
|
@ -205,11 +205,11 @@ class TraceLoggerThread
|
||||
EventEntry* getEventsStartingAt(uint32_t* lastIteration, uint32_t* lastEntryId, size_t* num) {
|
||||
EventEntry* start;
|
||||
if (iteration_ == *lastIteration) {
|
||||
MOZ_ASSERT(events.lastEntryId() >= *lastEntryId);
|
||||
MOZ_ASSERT(*lastEntryId < events.size());
|
||||
*num = events.lastEntryId() - *lastEntryId;
|
||||
start = events.data() + *lastEntryId + 1;
|
||||
} else {
|
||||
*num = events.lastEntryId() + 1;
|
||||
*num = events.size();
|
||||
start = events.data();
|
||||
}
|
||||
|
||||
@ -227,7 +227,7 @@ class TraceLoggerThread
|
||||
bool lostEvents(uint32_t lastIteration, uint32_t lastEntryId) {
|
||||
// If still logging in the same iteration, there are no lost events.
|
||||
if (lastIteration == iteration_) {
|
||||
MOZ_ASSERT(lastEntryId <= events.lastEntryId());
|
||||
MOZ_ASSERT(lastEntryId < events.size());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -272,6 +272,7 @@ class TraceLoggerThread
|
||||
void stopEvent(uint32_t id);
|
||||
private:
|
||||
void stopEvent();
|
||||
void log(uint32_t id);
|
||||
|
||||
public:
|
||||
static unsigned offsetOfEnabled() {
|
||||
|
@ -21,7 +21,6 @@
|
||||
_(Internal) \
|
||||
_(Interpreter) \
|
||||
_(InlinedScripts) \
|
||||
_(Invalidation) \
|
||||
_(IonCompilation) \
|
||||
_(IonCompilationPaused) \
|
||||
_(IonLinking) \
|
||||
@ -66,6 +65,7 @@
|
||||
|
||||
#define TRACELOGGER_LOG_ITEMS(_) \
|
||||
_(Bailout) \
|
||||
_(Invalidation) \
|
||||
_(Disable) \
|
||||
_(Enable) \
|
||||
_(Stop)
|
||||
|
@ -294,7 +294,7 @@ load 469861-1.xhtml
|
||||
load 469861-2.xhtml
|
||||
load 470851-1.xhtml
|
||||
load 471594-1.xhtml
|
||||
asserts-if(Android,2) load 473042.xhtml # bug 1034369 (may also cause a few assertions to be registered on the next test)
|
||||
asserts-if(Android&&!asyncPan,2) load 473042.xhtml # bug 1034369 (may also cause a few assertions to be registered on the next test)
|
||||
asserts(0-5) load 474075.html # bug 847368
|
||||
load 477333-1.xhtml
|
||||
load 477731-1.html
|
||||
@ -456,7 +456,7 @@ load 866588.html
|
||||
load 876092.html
|
||||
load 876221.html
|
||||
load 897852.html
|
||||
asserts-if(Android,2) asserts-if(!Android,4-6) load 898913.html # bug 847368
|
||||
asserts(4-6) asserts-if(Android&&!asyncPan,2) load 898913.html # bug 847368
|
||||
pref(layers.acceleration.disabled,true) pref(layers.force-active,true) load 919434.html
|
||||
load 926728.html
|
||||
load 930381.html
|
||||
|
@ -377,8 +377,8 @@ AddAnimationForProperty(nsIFrame* aFrame, const AnimationProperty& aProperty,
|
||||
Nullable<TimeDuration> startTime = aAnimation->GetCurrentOrPendingStartTime();
|
||||
animation->startTime() = startTime.IsNull()
|
||||
? TimeStamp()
|
||||
: aAnimation->GetTimeline()->ToTimeStamp(
|
||||
startTime.Value() + timing.mDelay);
|
||||
: aAnimation->AnimationTimeToTimeStamp(
|
||||
StickyTimeDuration(timing.mDelay));
|
||||
animation->initialCurrentTime() = aAnimation->GetCurrentTime().Value()
|
||||
- timing.mDelay;
|
||||
animation->duration() = timing.mIterationDuration;
|
||||
|
@ -131,6 +131,7 @@ using namespace mozilla::layout;
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
#define GRID_ENABLED_PREF_NAME "layout.css.grid.enabled"
|
||||
#define GRID_TEMPLATE_SUBGRID_ENABLED_PREF_NAME "layout.css.grid-template-subgrid-value.enabled"
|
||||
#define RUBY_ENABLED_PREF_NAME "layout.css.ruby.enabled"
|
||||
#define STICKY_ENABLED_PREF_NAME "layout.css.sticky.enabled"
|
||||
#define DISPLAY_CONTENTS_ENABLED_PREF_NAME "layout.css.display-contents.enabled"
|
||||
@ -730,6 +731,22 @@ nsLayoutUtils::UnsetValueEnabled()
|
||||
return sUnsetValueEnabled;
|
||||
}
|
||||
|
||||
bool
|
||||
nsLayoutUtils::IsGridTemplateSubgridValueEnabled()
|
||||
{
|
||||
static bool sGridTemplateSubgridValueEnabled;
|
||||
static bool sGridTemplateSubgridValueEnabledPrefCached = false;
|
||||
|
||||
if (!sGridTemplateSubgridValueEnabledPrefCached) {
|
||||
sGridTemplateSubgridValueEnabledPrefCached = true;
|
||||
Preferences::AddBoolVarCache(&sGridTemplateSubgridValueEnabled,
|
||||
GRID_TEMPLATE_SUBGRID_ENABLED_PREF_NAME,
|
||||
false);
|
||||
}
|
||||
|
||||
return sGridTemplateSubgridValueEnabled;
|
||||
}
|
||||
|
||||
bool
|
||||
nsLayoutUtils::IsTextAlignTrueValueEnabled()
|
||||
{
|
||||
|
@ -2308,6 +2308,12 @@ public:
|
||||
*/
|
||||
static bool UnsetValueEnabled();
|
||||
|
||||
/**
|
||||
* Checks whether support for the CSS grid-template-{columns,rows} 'subgrid X'
|
||||
* value is enabled.
|
||||
*/
|
||||
static bool IsGridTemplateSubgridValueEnabled();
|
||||
|
||||
/**
|
||||
* Checks whether support for the CSS text-align (and -moz-text-align-last)
|
||||
* 'true' value is enabled.
|
||||
|
@ -25,7 +25,7 @@ load 321224.xul
|
||||
load 322780-1.xul
|
||||
load 323381-1.html
|
||||
load 323381-2.html
|
||||
asserts-if(gtkWidget,1) load 323386-1.html # Bug 718883
|
||||
asserts-if(gtkWidget,1) asserts-if(Android&&asyncPan,1) load 323386-1.html # Bug 718883
|
||||
load 323389-1.html
|
||||
load 323389-2.html
|
||||
load 323493-1.html
|
||||
@ -529,7 +529,7 @@ load 842166.html
|
||||
load 844529-1.html
|
||||
load 847130.xhtml
|
||||
load 847208.html
|
||||
asserts-if(Android,2) asserts-if(!Android,4) load 847209.html # bug 847368
|
||||
asserts-if(Android,2) asserts-if(Android&&asyncPan,4) asserts-if(!Android,4) load 847209.html # bug 847368
|
||||
load 847211-1.html
|
||||
load 849603.html
|
||||
asserts(0-12) load 850931.html # bug 569193
|
||||
|
@ -4954,7 +4954,7 @@ ScrollFrameHelper::AdjustScrollbarRectForResizer(
|
||||
else {
|
||||
nsPoint offset;
|
||||
nsIWidget* widget = aFrame->GetNearestWidget(offset);
|
||||
nsIntRect widgetRect;
|
||||
LayoutDeviceIntRect widgetRect;
|
||||
if (!widget || !widget->ShowsResizeIndicator(&widgetRect))
|
||||
return;
|
||||
|
||||
|
@ -173,18 +173,18 @@ skip-if(B2G||Mulet) == 192767-26.xul 192767-36.xul # Initial mulet triage: parit
|
||||
skip-if(B2G||Mulet) == 192767-27.xul 192767-37.xul # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if((B2G&&browserIsRemote)||Mulet) != 192767-01.xul 192767-21.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if((B2G&&browserIsRemote)||Mulet) != 192767-02.xul 192767-22.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
fails-if(Android) skip-if(B2G||Mulet) != 192767-03.xul 192767-23.xul # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
fails-if(Android&&!asyncPan) skip-if(B2G||Mulet) != 192767-03.xul 192767-23.xul # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if((B2G&&browserIsRemote)||Mulet) != 192767-04.xul 192767-24.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if((B2G&&browserIsRemote)||Mulet) != 192767-05.xul 192767-25.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
fails-if(Android) skip-if(B2G||Mulet) != 192767-06.xul 192767-26.xul # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
fails-if(Android) skip-if(B2G||Mulet) != 192767-07.xul 192767-27.xul # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
fails-if(Android&&!asyncPan) skip-if(B2G||Mulet) != 192767-06.xul 192767-26.xul # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
fails-if(Android&&!asyncPan) skip-if(B2G||Mulet) != 192767-07.xul 192767-27.xul # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if((B2G&&browserIsRemote)||Mulet) != 192767-11.xul 192767-31.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if((B2G&&browserIsRemote)||Mulet) != 192767-12.xul 192767-32.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
fails-if(Android) skip-if(B2G||Mulet) != 192767-13.xul 192767-33.xul # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
fails-if(Android&&!asyncPan) skip-if(B2G||Mulet) != 192767-13.xul 192767-33.xul # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if((B2G&&browserIsRemote)||Mulet) != 192767-14.xul 192767-34.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if((B2G&&browserIsRemote)||Mulet) != 192767-15.xul 192767-35.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
fails-if(Android) skip-if(B2G||Mulet) != 192767-16.xul 192767-36.xul # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
fails-if(Android) skip-if(B2G||Mulet) != 192767-17.xul 192767-37.xul # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
fails-if(Android&&!asyncPan) skip-if(B2G||Mulet) != 192767-16.xul 192767-36.xul # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
fails-if(Android&&!asyncPan) skip-if(B2G||Mulet) != 192767-17.xul 192767-37.xul # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
!= 200774-1.html about:blank
|
||||
== 201215-1.html 201215-1-ref.html
|
||||
== 201293-1a.html 201293-1-ref.html
|
||||
@ -247,7 +247,7 @@ skip-if(B2G||Mulet) == 240933-1.html 240933-1-ref.html # Initial mulet triage: p
|
||||
skip-if(Android||B2G||Mulet) == 240933-2.html 240933-2-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
== 243266-1.html 243266-1-ref.html
|
||||
== 243302-1.html 243302-1-ref.html
|
||||
skip-if(B2G||Mulet) == 243519-1.html 243519-1-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if(B2G||Mulet||(Android&&asyncPan)) == 243519-1.html 243519-1-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
== 243519-2.html 243519-2-ref.html
|
||||
== 243519-3.html 243519-3-ref.html
|
||||
== 243519-4a.html 243519-4-ref.html
|
||||
@ -578,7 +578,7 @@ skip-if((B2G&&browserIsRemote)||Mulet) == 366616-1.xul 366616-1-ref.xul # bug 97
|
||||
== 367247-s-hidden.html 367247-s-auto.html
|
||||
skip-if(B2G||Mulet) fails-if(Android) != 367247-s-auto.html 367247-s-scroll.html # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
!= 367247-l-visible.html 367247-l-hidden.html
|
||||
skip-if(B2G||Mulet) fails-if(Android) != 367247-l-hidden.html 367247-l-scroll.html # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if(B2G||Mulet) fails-if(Android&&!asyncPan) != 367247-l-hidden.html 367247-l-scroll.html # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if(B2G||Mulet) == 367247-l-scroll.html 367247-l-auto.html # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
== 367332-1a.html 367332-1-ref.html
|
||||
== 367332-1b.html 367332-1-ref.html
|
||||
@ -644,7 +644,7 @@ skip-if(B2G||Mulet) == 370629-2.html 370629-2-ref.html # Initial mulet triage: p
|
||||
== 371043-1.html 371043-1-ref.html
|
||||
== 371354-1.html 371354-1-ref.html
|
||||
== 371483-1.html about:blank # assertion test
|
||||
fails-if(Android) == 371561-1.html 371561-1-ref.html
|
||||
fails-if(Android&&!asyncPan) == 371561-1.html 371561-1-ref.html
|
||||
skip-if((B2G&&browserIsRemote)||Mulet) != 371681-1.xhtml about:blank # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
== 371925-1a.html 371925-1-ref.html
|
||||
== 371925-1b.html 371925-1-ref.html
|
||||
@ -704,7 +704,7 @@ skip-if(B2G||Mulet) fuzzy-if(Android,2,140) == 379349-3b.xhtml 379349-3-ref.xhtm
|
||||
== 379461-1.xhtml 379461-1.html
|
||||
== 379461-2.xhtml 379461-2.html
|
||||
skip-if(B2G||Mulet) == 379461-3-container-xhtml.html 379461-3-container-html.html # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if(B2G||Mulet) fails-if(Android) != 379461-3-container-xhtml.html 379461-3-container-blank.html # there is a scrollbar # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if(B2G||Mulet) fails-if(Android&&!asyncPan) != 379461-3-container-xhtml.html 379461-3-container-blank.html # there is a scrollbar # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
== 380004-1.html 380004-1-ref.html
|
||||
== 380227-1.html 380227-1-ref.html
|
||||
== 380825-1.html 380825-1-ref.html
|
||||
@ -1425,7 +1425,7 @@ skip-if(B2G||Mulet) fuzzy-if(Android,5,1656) == 512410.html 512410-ref.html # In
|
||||
== 513153-2a.html 513153-2-ref.html
|
||||
== 513153-2b.html 513153-2-ref.html
|
||||
skip-if((B2G&&browserIsRemote)||Mulet) == 513318-1.xul 513318-1-ref.xul # bug 974780 # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if(B2G||Mulet) fails-if(Android) != 513318-2.xul 513318-2-ref.xul # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if(B2G||Mulet) fails-if(Android&&(!asyncPan||AndroidVersion>=15)) != 513318-2.xul 513318-2-ref.xul # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
== 514917-1.html 514917-1-ref.html
|
||||
HTTP(..) == 518172-1a.html 518172-a-ref.html
|
||||
HTTP(..) == 518172-1b.html 518172-b-ref.html
|
||||
|
@ -7,7 +7,7 @@ HTTP(..) == download-2.html download-2-ref.html
|
||||
HTTP(..) != download-2.html about:blank
|
||||
random-if(winWidget) HTTP(..) == download-2-big.html download-2-big-otf.html # bug 470713
|
||||
HTTP(..) != download-2-big-otf.html about:blank
|
||||
asserts-if(Android,4-8) skip-if(Android&&AndroidVersion==17) HTTP(..) != download-3-notref.html download-3.html # bug 1019192, bug 936226
|
||||
asserts-if(Android&&!asyncPan,4-8) skip-if(Android&&AndroidVersion==17) HTTP(..) != download-3-notref.html download-3.html # bug 1019192, bug 936226
|
||||
asserts-if(Android,0-8) HTTP(..) == download-3-ref.html download-3.html # same bugs as above
|
||||
asserts-if(Android,0-8) HTTP(..) == fallback-to-system-1.html fallback-to-system-1-ref.html # just delayed assertions from above tests
|
||||
HTTP(..) == name-override-simple-1.html name-override-simple-1-ref.html
|
||||
|
@ -20,7 +20,7 @@
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: italic 300% test, serif; }
|
||||
p { margin: 0; font: italic 600% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -20,7 +20,7 @@
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: italic 300% test, serif; }
|
||||
p { margin: 0; font: italic 600% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -26,7 +26,7 @@
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: italic 300% test, serif; }
|
||||
p { margin: 0; font: italic 600% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -26,7 +26,7 @@
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: italic 300% test, serif; }
|
||||
p { margin: 0; font: italic 600% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -26,7 +26,7 @@
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: oblique 300% test, serif; }
|
||||
p { margin: 0; font: oblique 600% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -26,7 +26,7 @@
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: oblique 300% test, serif; }
|
||||
p { margin: 0; font: oblique 600% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -26,7 +26,7 @@
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: oblique 300% test, serif; }
|
||||
p { margin: 0; font: oblique 600% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -32,7 +32,7 @@
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: oblique 300% test1, test2, test3, serif; }
|
||||
p { margin: 0; font: oblique 600% test1, test2, test3, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -32,7 +32,7 @@
|
||||
}
|
||||
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: oblique 300% test1, test2, test3, serif; }
|
||||
p { margin: 0; font: oblique 600% test1, test2, test3, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -13,7 +13,7 @@
|
||||
src: url(../fonts/markA.woff);
|
||||
}
|
||||
body { margin: 30px }
|
||||
p { margin: 0; font: 300% test, serif; }
|
||||
p { margin: 0; font: 600% test, serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -102,12 +102,12 @@ skip-if(!cocoaWidget) HTTP(..) != apple-symbols-1.html apple-symbols-1-notref.ht
|
||||
# distinguish between italic and oblique
|
||||
== simple-oblique.html simple-oblique-ref.html
|
||||
== italic-oblique-1.html italic-oblique-ref.html
|
||||
fuzzy-if(Mulet,103,144) == italic-oblique-2.html italic-oblique-ref.html
|
||||
== italic-oblique-2.html italic-oblique-ref.html
|
||||
== italic-oblique-3.html italic-oblique-ref.html
|
||||
== italic-oblique-4.html italic-oblique-ref.html
|
||||
== italic-oblique-5.html italic-oblique-ref.html
|
||||
fuzzy-if(Mulet,103,144) == italic-oblique-6.html italic-oblique-ref.html
|
||||
== italic-oblique-6.html italic-oblique-ref.html
|
||||
== italic-oblique-7.html italic-oblique-ref.html
|
||||
fuzzy-if(Mulet,103,144) == italic-oblique-8.html italic-oblique-ref.html
|
||||
fuzzy-if(Mulet,103,144) == italic-oblique-9.html italic-oblique-ref.html
|
||||
== italic-oblique-8.html italic-oblique-ref.html
|
||||
== italic-oblique-9.html italic-oblique-ref.html
|
||||
!= italic-oblique-kinnari.html italic-oblique-kinnari-ref.html
|
||||
|
@ -17,7 +17,7 @@
|
||||
== placeholder-4.html placeholder-overridden-ref.html
|
||||
== placeholder-5.html placeholder-visible-ref.html
|
||||
fuzzy-if(winWidget,160,10) fuzzy-if(Android,1,1) fuzzy-if(asyncPan&&!layersGPUAccelerated,146,299) == placeholder-6.html placeholder-overflow-ref.html
|
||||
skip-if(B2G||Mulet) == placeholder-6-textarea.html placeholder-overflow-textarea-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
skip-if(B2G||Mulet||(Android&&asyncPan)) == placeholder-6-textarea.html placeholder-overflow-textarea-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
|
||||
# needs-focus == placeholder-7.html placeholder-focus-ref.html
|
||||
# needs-focus == placeholder-8.html placeholder-focus-ref.html
|
||||
# needs-focus == placeholder-9.html placeholder-focus-ref.html
|
||||
|
@ -39,7 +39,7 @@ skip-if(!winWidget) != 403458-winmenu-ltr.xul 403458-winmenu-rtl.xul
|
||||
== 492155-1.html about:blank
|
||||
== 492155-2.html about:blank
|
||||
== 492155-3.html about:blank
|
||||
fails-if(Android) != 492155-4.html about:blank
|
||||
fails-if(Android&&!asyncPan) != 492155-4.html about:blank
|
||||
|
||||
!= box-shadow-input.html box-shadow-input-ref.html
|
||||
!= box-shadow-button.html box-shadow-button-ref.html
|
||||
|
@ -4,7 +4,7 @@
|
||||
== stacking-context-perspective.html stacking-context-yes.html
|
||||
== stacking-context-backface-visibility.html stacking-context-no.html
|
||||
|
||||
fails-if(Android) != overlayscrollbar-sorting-ref-visible.html overlayscrollbar-sorting-ref-hidden.html
|
||||
fails-if(Android&&!asyncPan) != overlayscrollbar-sorting-ref-visible.html overlayscrollbar-sorting-ref-hidden.html
|
||||
random-if(transparentScrollbars) == overlayscrollbar-sorting-1.html overlayscrollbar-sorting-ref-visible.html
|
||||
== overlayscrollbar-sorting-2.html overlayscrollbar-sorting-ref-visible.html
|
||||
== overlayscrollbar-sorting-3.html overlayscrollbar-sorting-ref-hidden.html
|
||||
|
@ -8775,6 +8775,10 @@ CSSParserImpl::ParseGridTemplateColumnsRows(nsCSSProperty aPropID)
|
||||
nsSubstring* ident = NextIdent();
|
||||
if (ident) {
|
||||
if (ident->LowerCaseEqualsLiteral("subgrid")) {
|
||||
if (!nsLayoutUtils::IsGridTemplateSubgridValueEnabled()) {
|
||||
REPORT_UNEXPECTED(PESubgridNotSupported);
|
||||
return false;
|
||||
}
|
||||
if (!ParseOptionalLineNameListAfterSubgrid(value)) {
|
||||
return false;
|
||||
}
|
||||
@ -8946,6 +8950,10 @@ CSSParserImpl::ParseGridTemplate()
|
||||
nsSubstring* ident = NextIdent();
|
||||
if (ident) {
|
||||
if (ident->LowerCaseEqualsLiteral("subgrid")) {
|
||||
if (!nsLayoutUtils::IsGridTemplateSubgridValueEnabled()) {
|
||||
REPORT_UNEXPECTED(PESubgridNotSupported);
|
||||
return false;
|
||||
}
|
||||
if (!ParseOptionalLineNameListAfterSubgrid(value)) {
|
||||
return false;
|
||||
}
|
||||
@ -9019,6 +9027,10 @@ CSSParserImpl::ParseGridTemplateAfterSlash(bool aColumnsIsTrackList)
|
||||
nsSubstring* ident = NextIdent();
|
||||
if (ident) {
|
||||
if (ident->LowerCaseEqualsLiteral("subgrid")) {
|
||||
if (!nsLayoutUtils::IsGridTemplateSubgridValueEnabled()) {
|
||||
REPORT_UNEXPECTED(PESubgridNotSupported);
|
||||
return false;
|
||||
}
|
||||
if (!ParseOptionalLineNameListAfterSubgrid(rowsValue)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -67,6 +67,36 @@ addAsyncAnimTest(function *() {
|
||||
|
||||
done_div();
|
||||
});
|
||||
|
||||
addAsyncAnimTest(function *() {
|
||||
var [ div, cs ] = new_div("animation: anim 10s 1s");
|
||||
var animation = div.getAnimations()[0];
|
||||
animation.playbackRate = 0.5;
|
||||
|
||||
advance_clock(2000); // 1s * (1 / playbackRate)
|
||||
|
||||
yield waitForPaints();
|
||||
omta_is(div, "transform", { tx: 0 }, RunningOn.Compositor,
|
||||
"animation with positive delay and playbackRate > 1 should " +
|
||||
"start from the initial position at the beginning of the " +
|
||||
"active duration");
|
||||
done_div();
|
||||
});
|
||||
|
||||
addAsyncAnimTest(function *() {
|
||||
var [ div, cs ] = new_div("animation: anim 10s 1s");
|
||||
var animation = div.getAnimations()[0];
|
||||
animation.playbackRate = 2.0;
|
||||
|
||||
advance_clock(500); // 1s * (1 / playbackRate)
|
||||
|
||||
yield waitForPaints();
|
||||
omta_is(div, "transform", { tx: 0 }, RunningOn.Compositor,
|
||||
"animation with positive delay and playbackRate < 1 should " +
|
||||
"start from the initial position at the beginning of the " +
|
||||
"active duration");
|
||||
done_div();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -5703,6 +5703,9 @@ if (IsCSSPropertyPrefEnabled("layout.css.ruby.enabled")) {
|
||||
}
|
||||
|
||||
if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) {
|
||||
var isGridTemplateSubgridValueEnabled =
|
||||
IsCSSPropertyPrefEnabled("layout.css.grid-template-subgrid-value.enabled");
|
||||
|
||||
gCSSProperties["display"].other_values.push("grid", "inline-grid");
|
||||
gCSSProperties["grid-auto-flow"] = {
|
||||
domProp: "gridAutoFlow",
|
||||
@ -5797,15 +5800,7 @@ if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) {
|
||||
"[a] 2.5fr [z] Repeat(4, [a] 20px [] auto [b c]) [d]",
|
||||
"[a] 2.5fr [z] Repeat(4, [a] 20px [] auto) [d]",
|
||||
"[a] 2.5fr [z] Repeat(4, 20px [b c] auto [b c]) [d]",
|
||||
"[a] 2.5fr [z] Repeat(4, 20px auto) [d]",
|
||||
|
||||
// See https://bugzilla.mozilla.org/show_bug.cgi?id=981300
|
||||
"[none auto subgrid min-content max-content foo] 40px",
|
||||
|
||||
"subgrid",
|
||||
"subgrid [] [foo bar]",
|
||||
"subgrid repeat(1, [])",
|
||||
"subgrid Repeat(4, [a] [b c] [] [d])",
|
||||
"[a] 2.5fr [z] Repeat(4, 20px auto) [d]"
|
||||
],
|
||||
invalid_values: [
|
||||
"",
|
||||
@ -5842,6 +5837,23 @@ if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) {
|
||||
"repeat(2.5, 20px)",
|
||||
"repeat(2, (foo))",
|
||||
"repeat(2, foo)",
|
||||
"40px calc(0px + rubbish)"
|
||||
],
|
||||
unbalanced_values: [
|
||||
"(foo] 40px",
|
||||
]
|
||||
};
|
||||
if (isGridTemplateSubgridValueEnabled) {
|
||||
gCSSProperties["grid-template-columns"].other_values.push(
|
||||
// See https://bugzilla.mozilla.org/show_bug.cgi?id=981300
|
||||
"[none auto subgrid min-content max-content foo] 40px",
|
||||
|
||||
"subgrid",
|
||||
"subgrid [] [foo bar]",
|
||||
"subgrid repeat(1, [])",
|
||||
"subgrid Repeat(4, [a] [b c] [] [d])"
|
||||
);
|
||||
gCSSProperties["grid-template-columns"].invalid_values.push(
|
||||
"subgrid (foo) 40px",
|
||||
"subgrid (foo 40px)",
|
||||
"(foo) subgrid",
|
||||
@ -5854,13 +5866,9 @@ if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) {
|
||||
"subgrid repeat(1)",
|
||||
"subgrid repeat(1, )",
|
||||
"subgrid repeat(2, (40px))",
|
||||
"subgrid repeat(2, foo)",
|
||||
"40px calc(0px + rubbish)",
|
||||
],
|
||||
unbalanced_values: [
|
||||
"(foo] 40px",
|
||||
]
|
||||
};
|
||||
"subgrid repeat(2, foo)"
|
||||
);
|
||||
}
|
||||
gCSSProperties["grid-template-rows"] = {
|
||||
domProp: "gridTemplateRows",
|
||||
inherited: false,
|
||||
@ -5910,18 +5918,11 @@ if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) {
|
||||
"none / none",
|
||||
],
|
||||
other_values: [
|
||||
"subgrid",
|
||||
// <'grid-template-columns'> / <'grid-template-rows'>
|
||||
"40px / 100px",
|
||||
"[foo] 40px [bar] / [baz] 100px [fizz]",
|
||||
" none/100px",
|
||||
"40px/none",
|
||||
"subgrid/40px 20px",
|
||||
"subgrid [foo] [] [bar baz] / 40px 20px",
|
||||
"40px 20px/subgrid",
|
||||
"40px 20px/subgrid [foo] [] repeat(3, [a] [b]) [bar baz]",
|
||||
"subgrid/subgrid",
|
||||
"subgrid [foo] [] [bar baz]/subgrid [foo] [] [bar baz]",
|
||||
// [ <track-list> / ]? [ <line-names>? <string> <track-size>? <line-names>? ]+
|
||||
"'fizz'",
|
||||
"[bar] 'fizz'",
|
||||
@ -5933,15 +5934,28 @@ if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) {
|
||||
"[foo] 40px / [bar] 'fizz' 100px [buzz] \n [a] '.' 200px [b]",
|
||||
],
|
||||
invalid_values: [
|
||||
"subgrid []",
|
||||
"subgrid [] / 'fizz'",
|
||||
"subgrid / 'fizz'",
|
||||
"[foo] [bar] 40px / 100px",
|
||||
"40px / [fizz] [buzz] 100px",
|
||||
"40px / [fizz] [buzz] 'foo'",
|
||||
"none / 'foo'"
|
||||
]
|
||||
};
|
||||
if (isGridTemplateSubgridValueEnabled) {
|
||||
gCSSProperties["grid-template"].other_values.push(
|
||||
"subgrid",
|
||||
"subgrid/40px 20px",
|
||||
"subgrid [foo] [] [bar baz] / 40px 20px",
|
||||
"40px 20px/subgrid",
|
||||
"40px 20px/subgrid [foo] [] repeat(3, [a] [b]) [bar baz]",
|
||||
"subgrid/subgrid",
|
||||
"subgrid [foo] [] [bar baz]/subgrid [foo] [] [bar baz]"
|
||||
);
|
||||
gCSSProperties["grid-template"].invalid_values.push(
|
||||
"subgrid []",
|
||||
"subgrid [] / 'fizz'",
|
||||
"subgrid / 'fizz'"
|
||||
);
|
||||
}
|
||||
|
||||
gCSSProperties["grid"] = {
|
||||
domProp: "grid",
|
||||
|
@ -12,6 +12,9 @@
|
||||
|
||||
<script>
|
||||
|
||||
var isGridTemplateSubgridValueEnabled =
|
||||
SpecialPowers.getBoolPref("layout.css.grid-template-subgrid-value.enabled");
|
||||
|
||||
var initial_values = {
|
||||
gridTemplateAreas: "none",
|
||||
gridTemplateColumns: "none",
|
||||
@ -139,37 +142,39 @@ var grid_template_test_cases = [
|
||||
},
|
||||
{
|
||||
specified: "subgrid",
|
||||
gridTemplateColumns: "subgrid",
|
||||
gridTemplateRows: "subgrid",
|
||||
gridTemplateColumns: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
|
||||
gridTemplateRows: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
|
||||
},
|
||||
{
|
||||
specified: "subgrid / subgrid",
|
||||
gridTemplateColumns: "subgrid",
|
||||
gridTemplateRows: "subgrid",
|
||||
gridTemplateColumns: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
|
||||
gridTemplateRows: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
|
||||
},
|
||||
{
|
||||
specified: "subgrid / subgrid [foo]",
|
||||
gridTemplateColumns: "subgrid",
|
||||
gridTemplateRows: "subgrid [foo]",
|
||||
gridTemplateColumns: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
|
||||
gridTemplateRows: isGridTemplateSubgridValueEnabled ? "subgrid [foo]" : "none",
|
||||
},
|
||||
{
|
||||
specified: "subgrid / subgrid [foo] repeat(3, [] [a b] [c])",
|
||||
gridTemplateColumns: "subgrid",
|
||||
gridTemplateRows: "subgrid [foo] [] [a b] [c] [] [a b] [c] [] [a b] [c]",
|
||||
gridTemplateColumns: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
|
||||
gridTemplateRows: isGridTemplateSubgridValueEnabled ?
|
||||
"subgrid [foo] [] [a b] [c] [] [a b] [c] [] [a b] [c]" : "none",
|
||||
},
|
||||
{
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=978478#c1
|
||||
// The number of repetitions is clamped to
|
||||
// #define GRID_TEMPLATE_MAX_REPETITIONS 10000
|
||||
specified: "subgrid / subgrid [foo] repeat(999999999, [a])",
|
||||
gridTemplateColumns: "subgrid",
|
||||
gridTemplateColumns: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
|
||||
// Array(n + 1).join(s) is a hack for the non-standard s.repeat(n)
|
||||
gridTemplateRows: "subgrid [foo]" + Array(10000 + 1).join(" [a]"),
|
||||
gridTemplateRows: isGridTemplateSubgridValueEnabled ?
|
||||
"subgrid [foo]" + Array(10000 + 1).join(" [a]") : "none",
|
||||
},
|
||||
{
|
||||
specified: "subgrid [] [foo]/ subgrid [bar",
|
||||
gridTemplateColumns: "subgrid [] [foo]",
|
||||
gridTemplateRows: "subgrid [bar]",
|
||||
gridTemplateColumns: isGridTemplateSubgridValueEnabled ? "subgrid [] [foo]" : "none",
|
||||
gridTemplateRows: isGridTemplateSubgridValueEnabled ? "subgrid [bar]" : "none",
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -12,6 +12,9 @@
|
||||
|
||||
<script>
|
||||
|
||||
var isGridTemplateSubgridValueEnabled =
|
||||
SpecialPowers.getBoolPref("layout.css.grid-template-subgrid-value.enabled");
|
||||
|
||||
var initial_values = {
|
||||
gridTemplateAreas: "none",
|
||||
gridTemplateColumns: "none",
|
||||
@ -37,7 +40,7 @@ var grid_template_test_cases = [
|
||||
{
|
||||
gridTemplateColumns: "40px",
|
||||
gridTemplateRows: "subgrid",
|
||||
shorthand: "40px / subgrid",
|
||||
shorthand: isGridTemplateSubgridValueEnabled ? "40px / subgrid" : "",
|
||||
},
|
||||
{
|
||||
gridTemplateColumns: "[foo] 40px [bar]",
|
||||
|
@ -32,7 +32,7 @@ load 360642-1.xul
|
||||
load 365151.xul
|
||||
load 366112-1.xul
|
||||
asserts(0-50) load 366203-1.xul # bug 1217984
|
||||
asserts(24) asserts-if(Android,9) load 367185-1.xhtml # bug 1220345
|
||||
asserts(24) asserts-if(Android&&!asyncPan,9) load 367185-1.xhtml # bug 1220345
|
||||
load 369942-1.xhtml
|
||||
load 374102-1.xul
|
||||
load 376137-1.html
|
||||
@ -77,7 +77,7 @@ load 434458-1.xul
|
||||
load 452185.html
|
||||
load 460900-1.xul
|
||||
load 464149-1.xul
|
||||
asserts-if(winWidget,1) load 464407-1.xhtml # Bug 450974
|
||||
asserts-if(winWidget,1) asserts-if(Android&&asyncPan,1) load 464407-1.xhtml # Bug 450974 on win, Bug 1217984 on android
|
||||
load 467080.xul
|
||||
load 467481-1.xul
|
||||
load 470063-1.html
|
||||
|
@ -393,7 +393,7 @@ PeerConnectionImpl::PeerConnectionImpl(const GlobalObject* aGlobal)
|
||||
, mHaveDataStream(false)
|
||||
, mAddCandidateErrorCount(0)
|
||||
, mTrickle(true) // TODO(ekr@rtfm.com): Use pref
|
||||
, mShouldSuppressNegotiationNeeded(false)
|
||||
, mNegotiationNeeded(false)
|
||||
{
|
||||
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
@ -2619,8 +2619,10 @@ PeerConnectionImpl::SetSignalingState_m(PCImplSignalingState aSignalingState,
|
||||
mSignalingState = aSignalingState;
|
||||
|
||||
bool fireNegotiationNeeded = false;
|
||||
|
||||
if (mSignalingState == PCImplSignalingState::SignalingStable) {
|
||||
// Either negotiation is done, or we've rolled back. In either case, we
|
||||
// need to re-evaluate whether further negotiation is required.
|
||||
mNegotiationNeeded = false;
|
||||
// If we're rolling back a local offer, we might need to remove some
|
||||
// transports, but nothing further needs to be done.
|
||||
mMedia->ActivateOrRemoveTransports(*mJsepSession);
|
||||
@ -2628,16 +2630,16 @@ PeerConnectionImpl::SetSignalingState_m(PCImplSignalingState aSignalingState,
|
||||
mMedia->UpdateMediaPipelines(*mJsepSession);
|
||||
InitializeDataChannel();
|
||||
mMedia->StartIceChecks(*mJsepSession);
|
||||
mShouldSuppressNegotiationNeeded = false;
|
||||
if (!mJsepSession->AllLocalTracksAreAssigned()) {
|
||||
CSFLogInfo(logTag, "Not all local tracks were assigned to an "
|
||||
"m-section, either because the offerer did not offer"
|
||||
" to receive enough tracks, or because tracks were "
|
||||
"added after CreateOffer/Answer, but before "
|
||||
"offer/answer completed. This requires "
|
||||
"renegotiation.");
|
||||
fireNegotiationNeeded = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!mJsepSession->AllLocalTracksAreAssigned()) {
|
||||
CSFLogInfo(logTag, "Not all local tracks were assigned to an "
|
||||
"m-section, either because the offerer did not offer"
|
||||
" to receive enough tracks, or because tracks were "
|
||||
"added after CreateOffer/Answer, but before "
|
||||
"offer/answer completed. This requires "
|
||||
"renegotiation.");
|
||||
fireNegotiationNeeded = true;
|
||||
}
|
||||
|
||||
// Telemetry: record info on the current state of streams/renegotiations/etc
|
||||
@ -2655,9 +2657,6 @@ PeerConnectionImpl::SetSignalingState_m(PCImplSignalingState aSignalingState,
|
||||
mMaxSending[i] = sending[i];
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
mShouldSuppressNegotiationNeeded = true;
|
||||
}
|
||||
|
||||
if (mSignalingState == PCImplSignalingState::SignalingClosed) {
|
||||
@ -2672,6 +2671,8 @@ PeerConnectionImpl::SetSignalingState_m(PCImplSignalingState aSignalingState,
|
||||
pco->OnStateChange(PCObserverStateType::SignalingState, rv);
|
||||
|
||||
if (fireNegotiationNeeded) {
|
||||
// We don't use MaybeFireNegotiationNeeded here, since content might have
|
||||
// already cased a transition from stable.
|
||||
OnNegotiationNeeded();
|
||||
}
|
||||
}
|
||||
@ -3480,11 +3481,41 @@ PeerConnectionImpl::RecordLongtermICEStatistics() {
|
||||
void
|
||||
PeerConnectionImpl::OnNegotiationNeeded()
|
||||
{
|
||||
if (mShouldSuppressNegotiationNeeded) {
|
||||
if (mSignalingState != PCImplSignalingState::SignalingStable) {
|
||||
// We will check whether we need to renegotiate when we reach stable again
|
||||
return;
|
||||
}
|
||||
|
||||
mShouldSuppressNegotiationNeeded = true;
|
||||
if (mNegotiationNeeded) {
|
||||
return;
|
||||
}
|
||||
|
||||
mNegotiationNeeded = true;
|
||||
|
||||
RUN_ON_THREAD(mThread,
|
||||
WrapRunnableNM(&MaybeFireNegotiationNeeded_static, mHandle),
|
||||
NS_DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
/* static */
|
||||
void
|
||||
PeerConnectionImpl::MaybeFireNegotiationNeeded_static(
|
||||
const std::string& pcHandle)
|
||||
{
|
||||
PeerConnectionWrapper wrapper(pcHandle);
|
||||
if (!wrapper.impl()) {
|
||||
return;
|
||||
}
|
||||
|
||||
wrapper.impl()->MaybeFireNegotiationNeeded();
|
||||
}
|
||||
|
||||
void
|
||||
PeerConnectionImpl::MaybeFireNegotiationNeeded()
|
||||
{
|
||||
if (!mNegotiationNeeded) {
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<PeerConnectionObserver> pco = do_QueryObjectReferent(mPCObserver);
|
||||
if (!pco) {
|
||||
|
@ -705,6 +705,8 @@ private:
|
||||
void RecordLongtermICEStatistics();
|
||||
|
||||
void OnNegotiationNeeded();
|
||||
static void MaybeFireNegotiationNeeded_static(const std::string& pcHandle);
|
||||
void MaybeFireNegotiationNeeded();
|
||||
|
||||
// Timecard used to measure processing time. This should be the first class
|
||||
// attribute so that we accurately measure the time required to instantiate
|
||||
@ -797,7 +799,7 @@ private:
|
||||
|
||||
bool mTrickle;
|
||||
|
||||
bool mShouldSuppressNegotiationNeeded;
|
||||
bool mNegotiationNeeded;
|
||||
|
||||
// storage for Telemetry data
|
||||
uint16_t mMaxReceiving[SdpMediaSection::kMediaTypes];
|
||||
|
@ -17,7 +17,6 @@
|
||||
|
||||
#include "webrtc/system_wrappers/interface/event_wrapper.h"
|
||||
#include "webrtc/system_wrappers/interface/sleep.h"
|
||||
#include "webrtc/system_wrappers/interface/thread_wrapper.h"
|
||||
#include "webrtc/system_wrappers/interface/trace.h"
|
||||
|
||||
#include "Latency.h"
|
||||
@ -688,7 +687,6 @@ int32_t AudioDeviceSndio::InitRecording()
|
||||
|
||||
int32_t AudioDeviceSndio::StartRecording()
|
||||
{
|
||||
unsigned int unused_thread_id;
|
||||
const char* threadName = "webrtc_audio_module_capture_thread";
|
||||
|
||||
if (_recHandle == NULL)
|
||||
@ -703,7 +701,6 @@ int32_t AudioDeviceSndio::StartRecording()
|
||||
|
||||
_ptrThreadRec = ThreadWrapper::CreateThread(RecThreadFunc,
|
||||
this,
|
||||
kRealtimePriority,
|
||||
threadName);
|
||||
if (_ptrThreadRec == NULL)
|
||||
{
|
||||
@ -721,21 +718,19 @@ int32_t AudioDeviceSndio::StartRecording()
|
||||
{
|
||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||
" couldn't start recording");
|
||||
delete _ptrThreadRec;
|
||||
_ptrThreadRec = NULL;
|
||||
_ptrThreadRec.reset();
|
||||
delete [] _recordingBuffer;
|
||||
_recordingBuffer = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!_ptrThreadRec->Start(unused_thread_id))
|
||||
if (!_ptrThreadRec->Start())
|
||||
{
|
||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||
" failed to start the rec audio thread");
|
||||
_recording = false;
|
||||
sio_stop(_recHandle);
|
||||
delete _ptrThreadRec;
|
||||
_ptrThreadRec = NULL;
|
||||
_ptrThreadRec.reset();
|
||||
delete [] _recordingBuffer;
|
||||
_recordingBuffer = NULL;
|
||||
return -1;
|
||||
@ -758,8 +753,10 @@ int32_t AudioDeviceSndio::StopRecording()
|
||||
_recording = false;
|
||||
}
|
||||
|
||||
if (_ptrThreadRec && !_ptrThreadRec->Stop())
|
||||
if (_ptrThreadRec)
|
||||
{
|
||||
_ptrThreadRec->Stop();
|
||||
_ptrThreadRec.reset();
|
||||
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
|
||||
" failed to stop the rec audio thread");
|
||||
return -1;
|
||||
@ -767,8 +764,6 @@ int32_t AudioDeviceSndio::StopRecording()
|
||||
|
||||
sio_stop(_recHandle);
|
||||
|
||||
delete _ptrThreadRec;
|
||||
_ptrThreadRec = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -789,7 +784,6 @@ bool AudioDeviceSndio::PlayoutIsInitialized() const
|
||||
|
||||
int32_t AudioDeviceSndio::StartPlayout()
|
||||
{
|
||||
unsigned int unused_thread_id;
|
||||
const char* threadName = "webrtc_audio_module_play_thread";
|
||||
|
||||
if (_playHandle == NULL)
|
||||
@ -804,7 +798,6 @@ int32_t AudioDeviceSndio::StartPlayout()
|
||||
|
||||
_ptrThreadPlay = ThreadWrapper::CreateThread(PlayThreadFunc,
|
||||
this,
|
||||
kRealtimePriority,
|
||||
threadName);
|
||||
if (_ptrThreadPlay == NULL)
|
||||
{
|
||||
@ -819,19 +812,18 @@ int32_t AudioDeviceSndio::StartPlayout()
|
||||
if (!sio_start(_playHandle)) {
|
||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||
" failed to start audio playback");
|
||||
delete _ptrThreadPlay;
|
||||
_ptrThreadPlay = NULL;
|
||||
_ptrThreadPlay.reset();
|
||||
delete [] _playoutBuffer;
|
||||
_playoutBuffer = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!_ptrThreadPlay->Start(unused_thread_id))
|
||||
if (!_ptrThreadPlay->Start())
|
||||
{
|
||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||
" failed to start the play audio thread");
|
||||
sio_stop(_playHandle);
|
||||
delete _ptrThreadPlay;
|
||||
_ptrThreadPlay.reset();
|
||||
_ptrThreadPlay = NULL;
|
||||
delete [] _playoutBuffer;
|
||||
_playoutBuffer = NULL;
|
||||
@ -853,14 +845,10 @@ int32_t AudioDeviceSndio::StopPlayout()
|
||||
_playing = false;
|
||||
}
|
||||
|
||||
if (_ptrThreadPlay && !_ptrThreadPlay->Stop())
|
||||
if (_ptrThreadPlay)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
|
||||
" failed to stop the play audio thread");
|
||||
return -1;
|
||||
} else {
|
||||
delete _ptrThreadPlay;
|
||||
_ptrThreadPlay = NULL;
|
||||
_ptrThreadPlay->Stop();
|
||||
_ptrThreadPlay.reset();
|
||||
}
|
||||
|
||||
sio_stop(_playHandle);
|
||||
@ -869,8 +857,6 @@ int32_t AudioDeviceSndio::StopPlayout()
|
||||
|
||||
delete [] _playoutBuffer;
|
||||
_playoutBuffer = NULL;
|
||||
delete _ptrThreadPlay;
|
||||
_ptrThreadPlay = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -27,128 +27,128 @@ public:
|
||||
|
||||
// Retrieve the currently utilized audio layer
|
||||
virtual int32_t ActiveAudioLayer(
|
||||
AudioDeviceModule::AudioLayer& audioLayer) const OVERRIDE;
|
||||
AudioDeviceModule::AudioLayer& audioLayer) const override;
|
||||
|
||||
// Main initializaton and termination
|
||||
virtual int32_t Init() OVERRIDE;
|
||||
virtual int32_t Terminate() OVERRIDE;
|
||||
virtual bool Initialized() const OVERRIDE;
|
||||
virtual int32_t Init() override;
|
||||
virtual int32_t Terminate() override;
|
||||
virtual bool Initialized() const override;
|
||||
|
||||
// Device enumeration
|
||||
virtual int16_t PlayoutDevices() OVERRIDE;
|
||||
virtual int16_t RecordingDevices() OVERRIDE;
|
||||
virtual int16_t PlayoutDevices() override;
|
||||
virtual int16_t RecordingDevices() override;
|
||||
virtual int32_t PlayoutDeviceName(
|
||||
uint16_t index,
|
||||
char name[kAdmMaxDeviceNameSize],
|
||||
char guid[kAdmMaxGuidSize]) OVERRIDE;
|
||||
char guid[kAdmMaxGuidSize]) override;
|
||||
virtual int32_t RecordingDeviceName(
|
||||
uint16_t index,
|
||||
char name[kAdmMaxDeviceNameSize],
|
||||
char guid[kAdmMaxGuidSize]) OVERRIDE;
|
||||
char guid[kAdmMaxGuidSize]) override;
|
||||
|
||||
// Device selection
|
||||
virtual int32_t SetPlayoutDevice(uint16_t index) OVERRIDE;
|
||||
virtual int32_t SetPlayoutDevice(uint16_t index) override;
|
||||
virtual int32_t SetPlayoutDevice(
|
||||
AudioDeviceModule::WindowsDeviceType device) OVERRIDE;
|
||||
virtual int32_t SetRecordingDevice(uint16_t index) OVERRIDE;
|
||||
AudioDeviceModule::WindowsDeviceType device) override;
|
||||
virtual int32_t SetRecordingDevice(uint16_t index) override;
|
||||
virtual int32_t SetRecordingDevice(
|
||||
AudioDeviceModule::WindowsDeviceType device) OVERRIDE;
|
||||
AudioDeviceModule::WindowsDeviceType device) override;
|
||||
|
||||
// Audio transport initialization
|
||||
virtual int32_t PlayoutIsAvailable(bool& available) OVERRIDE;
|
||||
virtual int32_t InitPlayout() OVERRIDE;
|
||||
virtual bool PlayoutIsInitialized() const OVERRIDE;
|
||||
virtual int32_t RecordingIsAvailable(bool& available) OVERRIDE;
|
||||
virtual int32_t InitRecording() OVERRIDE;
|
||||
virtual bool RecordingIsInitialized() const OVERRIDE;
|
||||
virtual int32_t PlayoutIsAvailable(bool& available) override;
|
||||
virtual int32_t InitPlayout() override;
|
||||
virtual bool PlayoutIsInitialized() const override;
|
||||
virtual int32_t RecordingIsAvailable(bool& available) override;
|
||||
virtual int32_t InitRecording() override;
|
||||
virtual bool RecordingIsInitialized() const override;
|
||||
|
||||
// Audio transport control
|
||||
virtual int32_t StartPlayout() OVERRIDE;
|
||||
virtual int32_t StopPlayout() OVERRIDE;
|
||||
virtual bool Playing() const OVERRIDE;
|
||||
virtual int32_t StartRecording() OVERRIDE;
|
||||
virtual int32_t StopRecording() OVERRIDE;
|
||||
virtual bool Recording() const OVERRIDE;
|
||||
virtual int32_t StartPlayout() override;
|
||||
virtual int32_t StopPlayout() override;
|
||||
virtual bool Playing() const override;
|
||||
virtual int32_t StartRecording() override;
|
||||
virtual int32_t StopRecording() override;
|
||||
virtual bool Recording() const override;
|
||||
|
||||
// Microphone Automatic Gain Control (AGC)
|
||||
virtual int32_t SetAGC(bool enable) OVERRIDE;
|
||||
virtual bool AGC() const OVERRIDE;
|
||||
virtual int32_t SetAGC(bool enable) override;
|
||||
virtual bool AGC() const override;
|
||||
|
||||
// Volume control based on the Windows Wave API (Windows only)
|
||||
virtual int32_t SetWaveOutVolume(uint16_t volumeLeft,
|
||||
uint16_t volumeRight) OVERRIDE;
|
||||
uint16_t volumeRight) override;
|
||||
virtual int32_t WaveOutVolume(uint16_t& volumeLeft,
|
||||
uint16_t& volumeRight) const OVERRIDE;
|
||||
uint16_t& volumeRight) const override;
|
||||
|
||||
// Audio mixer initialization
|
||||
virtual int32_t InitSpeaker() OVERRIDE;
|
||||
virtual bool SpeakerIsInitialized() const OVERRIDE;
|
||||
virtual int32_t InitMicrophone() OVERRIDE;
|
||||
virtual bool MicrophoneIsInitialized() const OVERRIDE;
|
||||
virtual int32_t InitSpeaker() override;
|
||||
virtual bool SpeakerIsInitialized() const override;
|
||||
virtual int32_t InitMicrophone() override;
|
||||
virtual bool MicrophoneIsInitialized() const override;
|
||||
|
||||
// Speaker volume controls
|
||||
virtual int32_t SpeakerVolumeIsAvailable(bool& available) OVERRIDE;
|
||||
virtual int32_t SetSpeakerVolume(uint32_t volume) OVERRIDE;
|
||||
virtual int32_t SpeakerVolume(uint32_t& volume) const OVERRIDE;
|
||||
virtual int32_t MaxSpeakerVolume(uint32_t& maxVolume) const OVERRIDE;
|
||||
virtual int32_t MinSpeakerVolume(uint32_t& minVolume) const OVERRIDE;
|
||||
virtual int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const OVERRIDE;
|
||||
virtual int32_t SpeakerVolumeIsAvailable(bool& available) override;
|
||||
virtual int32_t SetSpeakerVolume(uint32_t volume) override;
|
||||
virtual int32_t SpeakerVolume(uint32_t& volume) const override;
|
||||
virtual int32_t MaxSpeakerVolume(uint32_t& maxVolume) const override;
|
||||
virtual int32_t MinSpeakerVolume(uint32_t& minVolume) const override;
|
||||
virtual int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const override;
|
||||
|
||||
// Microphone volume controls
|
||||
virtual int32_t MicrophoneVolumeIsAvailable(bool& available) OVERRIDE;
|
||||
virtual int32_t SetMicrophoneVolume(uint32_t volume) OVERRIDE;
|
||||
virtual int32_t MicrophoneVolume(uint32_t& volume) const OVERRIDE;
|
||||
virtual int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const OVERRIDE;
|
||||
virtual int32_t MinMicrophoneVolume(uint32_t& minVolume) const OVERRIDE;
|
||||
virtual int32_t MicrophoneVolumeIsAvailable(bool& available) override;
|
||||
virtual int32_t SetMicrophoneVolume(uint32_t volume) override;
|
||||
virtual int32_t MicrophoneVolume(uint32_t& volume) const override;
|
||||
virtual int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const override;
|
||||
virtual int32_t MinMicrophoneVolume(uint32_t& minVolume) const override;
|
||||
virtual int32_t MicrophoneVolumeStepSize(
|
||||
uint16_t& stepSize) const OVERRIDE;
|
||||
uint16_t& stepSize) const override;
|
||||
|
||||
// Speaker mute control
|
||||
virtual int32_t SpeakerMuteIsAvailable(bool& available) OVERRIDE;
|
||||
virtual int32_t SetSpeakerMute(bool enable) OVERRIDE;
|
||||
virtual int32_t SpeakerMute(bool& enabled) const OVERRIDE;
|
||||
virtual int32_t SpeakerMuteIsAvailable(bool& available) override;
|
||||
virtual int32_t SetSpeakerMute(bool enable) override;
|
||||
virtual int32_t SpeakerMute(bool& enabled) const override;
|
||||
|
||||
// Microphone mute control
|
||||
virtual int32_t MicrophoneMuteIsAvailable(bool& available) OVERRIDE;
|
||||
virtual int32_t SetMicrophoneMute(bool enable) OVERRIDE;
|
||||
virtual int32_t MicrophoneMute(bool& enabled) const OVERRIDE;
|
||||
virtual int32_t MicrophoneMuteIsAvailable(bool& available) override;
|
||||
virtual int32_t SetMicrophoneMute(bool enable) override;
|
||||
virtual int32_t MicrophoneMute(bool& enabled) const override;
|
||||
|
||||
// Microphone boost control
|
||||
virtual int32_t MicrophoneBoostIsAvailable(bool& available) OVERRIDE;
|
||||
virtual int32_t SetMicrophoneBoost(bool enable) OVERRIDE;
|
||||
virtual int32_t MicrophoneBoost(bool& enabled) const OVERRIDE;
|
||||
virtual int32_t MicrophoneBoostIsAvailable(bool& available) override;
|
||||
virtual int32_t SetMicrophoneBoost(bool enable) override;
|
||||
virtual int32_t MicrophoneBoost(bool& enabled) const override;
|
||||
|
||||
// Stereo support
|
||||
virtual int32_t StereoPlayoutIsAvailable(bool& available) OVERRIDE;
|
||||
virtual int32_t SetStereoPlayout(bool enable) OVERRIDE;
|
||||
virtual int32_t StereoPlayout(bool& enabled) const OVERRIDE;
|
||||
virtual int32_t StereoRecordingIsAvailable(bool& available) OVERRIDE;
|
||||
virtual int32_t SetStereoRecording(bool enable) OVERRIDE;
|
||||
virtual int32_t StereoRecording(bool& enabled) const OVERRIDE;
|
||||
virtual int32_t StereoPlayoutIsAvailable(bool& available) override;
|
||||
virtual int32_t SetStereoPlayout(bool enable) override;
|
||||
virtual int32_t StereoPlayout(bool& enabled) const override;
|
||||
virtual int32_t StereoRecordingIsAvailable(bool& available) override;
|
||||
virtual int32_t SetStereoRecording(bool enable) override;
|
||||
virtual int32_t StereoRecording(bool& enabled) const override;
|
||||
|
||||
// Delay information and control
|
||||
virtual int32_t SetPlayoutBuffer(
|
||||
const AudioDeviceModule::BufferType type,
|
||||
uint16_t sizeMS) OVERRIDE;
|
||||
uint16_t sizeMS) override;
|
||||
virtual int32_t PlayoutBuffer(
|
||||
AudioDeviceModule::BufferType& type,
|
||||
uint16_t& sizeMS) const OVERRIDE;
|
||||
virtual int32_t PlayoutDelay(uint16_t& delayMS) const OVERRIDE;
|
||||
virtual int32_t RecordingDelay(uint16_t& delayMS) const OVERRIDE;
|
||||
uint16_t& sizeMS) const override;
|
||||
virtual int32_t PlayoutDelay(uint16_t& delayMS) const override;
|
||||
virtual int32_t RecordingDelay(uint16_t& delayMS) const override;
|
||||
|
||||
virtual int32_t CPULoad(uint16_t& load) const OVERRIDE;
|
||||
virtual int32_t CPULoad(uint16_t& load) const override;
|
||||
|
||||
public:
|
||||
virtual bool PlayoutWarning() const OVERRIDE;
|
||||
virtual bool PlayoutError() const OVERRIDE;
|
||||
virtual bool RecordingWarning() const OVERRIDE;
|
||||
virtual bool RecordingError() const OVERRIDE;
|
||||
virtual void ClearPlayoutWarning() OVERRIDE;
|
||||
virtual void ClearPlayoutError() OVERRIDE;
|
||||
virtual void ClearRecordingWarning() OVERRIDE;
|
||||
virtual void ClearRecordingError() OVERRIDE;
|
||||
virtual bool PlayoutWarning() const override;
|
||||
virtual bool PlayoutError() const override;
|
||||
virtual bool RecordingWarning() const override;
|
||||
virtual bool RecordingError() const override;
|
||||
virtual void ClearPlayoutWarning() override;
|
||||
virtual void ClearPlayoutError() override;
|
||||
virtual void ClearRecordingWarning() override;
|
||||
virtual void ClearRecordingError() override;
|
||||
|
||||
virtual void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) OVERRIDE;
|
||||
virtual void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) override;
|
||||
|
||||
// needs to be public because playOnmove/recOnmove are extern "C" ?
|
||||
int _recDelay, _playDelay;
|
||||
@ -169,8 +169,8 @@ private:
|
||||
|
||||
CriticalSectionWrapper& _critSect;
|
||||
|
||||
ThreadWrapper* _ptrThreadRec;
|
||||
ThreadWrapper* _ptrThreadPlay;
|
||||
rtc::scoped_ptr<ThreadWrapper> _ptrThreadRec;
|
||||
rtc::scoped_ptr<ThreadWrapper> _ptrThreadPlay;
|
||||
|
||||
int32_t _id;
|
||||
|
||||
|
@ -24,7 +24,7 @@ public:
|
||||
AudioDeviceUtilitySndio(const int32_t id);
|
||||
virtual ~AudioDeviceUtilitySndio();
|
||||
|
||||
virtual int32_t Init() OVERRIDE;
|
||||
virtual int32_t Init() override;
|
||||
|
||||
private:
|
||||
CriticalSectionWrapper& _critSect;
|
||||
|
@ -44,8 +44,13 @@ pref("browser.viewport.desktopWidth", 980);
|
||||
// the value is divided by 1000 and clamped to hard-coded min/max scale values.
|
||||
pref("browser.viewport.defaultZoom", -1);
|
||||
|
||||
/* allow scrollbars to float above chrome ui */
|
||||
pref("ui.scrollbarsCanOverlapContent", 1);
|
||||
#ifdef MOZ_ANDROID_APZ
|
||||
// Show/Hide scrollbars when active/inactive
|
||||
pref("ui.showHideScrollbars", 1);
|
||||
pref("ui.useOverlayScrollbars", 1);
|
||||
pref("ui.scrollbarFadeBeginDelay", 450);
|
||||
pref("ui.scrollbarFadeDuration", 0);
|
||||
#endif
|
||||
|
||||
/* turn off the caret blink after 10 cycles */
|
||||
pref("ui.caretBlinkCount", 10);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user