зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to fx-team
This commit is contained in:
Коммит
f2915b700e
|
@ -1245,6 +1245,7 @@ AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
|
|||
}
|
||||
|
||||
case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
|
||||
case nsIAccessibleEvent::EVENT_TEXT_VALUE_CHANGE:
|
||||
if (accessible->HasNumericValue()) {
|
||||
// Make sure this is a numeric value. Don't fire for string value changes
|
||||
// (e.g. text editing) ATK values are always numeric.
|
||||
|
@ -1475,6 +1476,9 @@ a11y::ProxyEvent(ProxyAccessible* aTarget, uint32_t aEventType)
|
|||
// A hack using state change showing events as alert events.
|
||||
atk_object_notify_state_change(wrapper, ATK_STATE_SHOWING, true);
|
||||
break;
|
||||
case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
|
||||
g_object_notify((GObject*)wrapper, "accessible-value");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -384,7 +384,8 @@ static const char kEventTypeNames[][40] = {
|
|||
"hypertext changed", // EVENT_HYPERTEXT_CHANGED
|
||||
"hypertext links count changed", // EVENT_HYPERTEXT_NLINKS_CHANGED
|
||||
"object attribute changed", // EVENT_OBJECT_ATTRIBUTE_CHANGED
|
||||
"virtual cursor changed" // EVENT_VIRTUALCURSOR_CHANGED
|
||||
"virtual cursor changed", // EVENT_VIRTUALCURSOR_CHANGED
|
||||
"text value change", // EVENT_TEXT_VALUE_CHANGE
|
||||
};
|
||||
|
||||
#endif /* __nsIAccessibilityService_h__ */
|
||||
|
|
|
@ -150,7 +150,7 @@ nsCoreUtils::DispatchTouchEvent(EventMessage aMessage, int32_t aX, int32_t aY,
|
|||
|
||||
// XXX: Touch has an identifier of -1 to hint that it is synthesized.
|
||||
RefPtr<dom::Touch> t = new dom::Touch(-1, LayoutDeviceIntPoint(aX, aY),
|
||||
nsIntPoint(1, 1), 0.0f, 1.0f);
|
||||
LayoutDeviceIntPoint(1, 1), 0.0f, 1.0f);
|
||||
t->SetTarget(aContent);
|
||||
event.touches.AppendElement(t);
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
|
|
|
@ -535,7 +535,7 @@ Accessible::ChildAtPoint(int32_t aX, int32_t aY,
|
|||
nsIWidget* rootWidget = rootFrame->GetView()->GetNearestWidget(nullptr);
|
||||
NS_ENSURE_TRUE(rootWidget, nullptr);
|
||||
|
||||
nsIntRect rootRect;
|
||||
LayoutDeviceIntRect rootRect;
|
||||
rootWidget->GetScreenBounds(rootRect);
|
||||
|
||||
WidgetMouseEvent dummyEvent(true, eMouseMove, rootWidget,
|
||||
|
|
|
@ -124,7 +124,7 @@ DocAccessible::MaybeNotifyOfValueChange(Accessible* aAccessible)
|
|||
{
|
||||
a11y::role role = aAccessible->Role();
|
||||
if (role == roles::ENTRY || role == roles::COMBOBOX)
|
||||
FireDelayedEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE, aAccessible);
|
||||
FireDelayedEvent(nsIAccessibleEvent::EVENT_TEXT_VALUE_CHANGE, aAccessible);
|
||||
}
|
||||
|
||||
inline Accessible*
|
||||
|
|
|
@ -1039,13 +1039,18 @@ DocAccessible::ARIAAttributeChanged(Accessible* aAccessible, nsIAtom* aAttribute
|
|||
return;
|
||||
}
|
||||
|
||||
// Fire value change event whenever aria-valuetext is changed, or
|
||||
// when aria-valuenow is changed and aria-valuetext is empty
|
||||
if (aAttribute == nsGkAtoms::aria_valuetext ||
|
||||
(aAttribute == nsGkAtoms::aria_valuenow &&
|
||||
(!elm->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_valuetext) ||
|
||||
elm->AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_valuetext,
|
||||
nsGkAtoms::_empty, eCaseMatters)))) {
|
||||
// Fire text value change event whenever aria-valuetext is changed.
|
||||
if (aAttribute == nsGkAtoms::aria_valuetext) {
|
||||
FireDelayedEvent(nsIAccessibleEvent::EVENT_TEXT_VALUE_CHANGE, aAccessible);
|
||||
return;
|
||||
}
|
||||
|
||||
// Fire numeric value change event when aria-valuenow is changed and
|
||||
// aria-valuetext is empty
|
||||
if (aAttribute == nsGkAtoms::aria_valuenow &&
|
||||
(!elm->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_valuetext) ||
|
||||
elm->AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_valuetext,
|
||||
nsGkAtoms::_empty, eCaseMatters))) {
|
||||
FireDelayedEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE, aAccessible);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -452,8 +452,10 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
|
|||
}
|
||||
else if (accessible->NeedsDOMUIEvent() &&
|
||||
eventType.EqualsLiteral("ValueChange")) {
|
||||
targetDocument->FireDelayedEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE,
|
||||
accessible);
|
||||
uint32_t event = accessible->HasNumericValue()
|
||||
? nsIAccessibleEvent::EVENT_VALUE_CHANGE
|
||||
: nsIAccessibleEvent::EVENT_TEXT_VALUE_CHANGE;
|
||||
targetDocument->FireDelayedEvent(event, accessible);
|
||||
}
|
||||
#ifdef DEBUG_DRAGDROPSTART
|
||||
else if (eventType.EqualsLiteral("mouseover")) {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
/**
|
||||
* Fired when the caret changes position in text.
|
||||
*/
|
||||
[scriptable, builtinclass, uuid(5675c486-a230-4d85-a4bd-33670826d5ff)]
|
||||
[scriptable, builtinclass, uuid(ed1982e4-57d7-41a8-8cd8-9023f809383e)]
|
||||
interface nsIAccessibleCaretMoveEvent: nsIAccessibleEvent
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -25,7 +25,7 @@ interface nsIDOMNode;
|
|||
* if (NS_SUCCEEDED(rv))
|
||||
* rv = observerService->AddObserver(this, "accessible-event", PR_TRUE);
|
||||
*/
|
||||
[scriptable, builtinclass, uuid(7f66a33a-9ed7-4fd4-87a8-e431b0f43368)]
|
||||
[scriptable, builtinclass, uuid(20c69a40-6c2c-42a3-a578-6f4473aab9dd)]
|
||||
interface nsIAccessibleEvent : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -75,7 +75,7 @@ interface nsIAccessibleEvent : nsISupports
|
|||
const unsigned long EVENT_DESCRIPTION_CHANGE = 0x0009;
|
||||
|
||||
/**
|
||||
* An object's Value property has changed.
|
||||
* An object's numeric Value has changed.
|
||||
*/
|
||||
const unsigned long EVENT_VALUE_CHANGE = 0x000A;
|
||||
|
||||
|
@ -412,10 +412,15 @@ interface nsIAccessibleEvent : nsISupports
|
|||
*/
|
||||
const unsigned long EVENT_VIRTUALCURSOR_CHANGED = 0x0056;
|
||||
|
||||
/**
|
||||
* An object's text Value has changed.
|
||||
*/
|
||||
const unsigned long EVENT_TEXT_VALUE_CHANGE = 0x0057;
|
||||
|
||||
/**
|
||||
* Help make sure event map does not get out-of-line.
|
||||
*/
|
||||
const unsigned long EVENT_LAST_ENTRY = 0x0057;
|
||||
const unsigned long EVENT_LAST_ENTRY = 0x0058;
|
||||
|
||||
/**
|
||||
* The type of event, based on the enumerated event values
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
/**
|
||||
* Fired when a accessible and its subtree are removed from the tree.
|
||||
*/
|
||||
[scriptable, builtinclass, uuid(a2bd2eca-3afa-489b-afb2-f93ef32ad99c)]
|
||||
[scriptable, builtinclass, uuid(2051709a-4e0d-4be5-873d-b49d1dee35fa)]
|
||||
interface nsIAccessibleHideEvent: nsIAccessibleEvent
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -11,7 +11,7 @@ interface nsIAtom;
|
|||
/**
|
||||
* Fired when an attribute of an accessible changes.
|
||||
*/
|
||||
[scriptable, builtinclass, uuid(4CA96609-23C8-4771-86E7-77C8B651CA24)]
|
||||
[scriptable, builtinclass, uuid(ce41add2-096e-4606-b1ca-7408c6d5b4c3)]
|
||||
interface nsIAccessibleObjectAttributeChangedEvent : nsIAccessibleEvent
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
/**
|
||||
* Fired when a state of an accessible changes.
|
||||
*/
|
||||
[scriptable, builtinclass, uuid(0d2d77c5-7b16-4a15-8b20-c484ceb5ac0d)]
|
||||
[scriptable, builtinclass, uuid(58b74954-1835-46ed-9ccd-c906490106f6)]
|
||||
interface nsIAccessibleStateChangeEvent : nsIAccessibleEvent
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "nsIAccessibleEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(df517997-ed52-4ea2-b310-2f8e0fe64572)]
|
||||
[scriptable, builtinclass, uuid(9fb3a8a4-d254-43d3-80a5-20e171d52b21)]
|
||||
interface nsIAccessibleTableChangeEvent: nsIAccessibleEvent
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
/**
|
||||
* Fired when an accessible's text changes.
|
||||
*/
|
||||
[scriptable, builtinclass, uuid(21e0f8bd-5638-4964-870b-3c8e944ac4c4)]
|
||||
[scriptable, builtinclass, uuid(1fcc0dfa-93e6-48f4-bbd4-f80eb1d9f2e6)]
|
||||
interface nsIAccessibleTextChangeEvent : nsIAccessibleEvent
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
* An interface for virtual cursor changed events.
|
||||
* Passes previous cursor position and text offsets.
|
||||
*/
|
||||
[scriptable, builtinclass, uuid(370e8b9b-2bbc-4bff-a9c7-16ddc54aea21)]
|
||||
[scriptable, builtinclass, uuid(a58693b1-009e-4cc9-ae93-9c7d8f85cfdf)]
|
||||
interface nsIAccessibleVirtualCursorChangeEvent : nsIAccessibleEvent
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -302,6 +302,7 @@ this.EventManager.prototype = {
|
|||
break;
|
||||
}
|
||||
case Events.VALUE_CHANGE:
|
||||
case Events.TEXT_VALUE_CHANGE:
|
||||
{
|
||||
let position = this.contentControl.vc.position;
|
||||
let target = aEvent.accessible;
|
||||
|
|
|
@ -114,6 +114,7 @@ AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
|
|||
// and document load complete events for now.
|
||||
if (eventType != nsIAccessibleEvent::EVENT_FOCUS &&
|
||||
eventType != nsIAccessibleEvent::EVENT_VALUE_CHANGE &&
|
||||
eventType != nsIAccessibleEvent::EVENT_TEXT_VALUE_CHANGE &&
|
||||
eventType != nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED &&
|
||||
eventType != nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED &&
|
||||
eventType != nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE)
|
||||
|
@ -248,6 +249,7 @@ a11y::FireNativeEvent(mozAccessible* aNativeAcc, uint32_t aEventType)
|
|||
[aNativeAcc didReceiveFocus];
|
||||
break;
|
||||
case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
|
||||
case nsIAccessibleEvent::EVENT_TEXT_VALUE_CHANGE:
|
||||
[aNativeAcc valueDidChange];
|
||||
break;
|
||||
case nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED:
|
||||
|
|
|
@ -72,6 +72,7 @@ ProxyEvent(ProxyAccessible* aProxy, uint32_t aEventType)
|
|||
// events for now.
|
||||
if (aEventType != nsIAccessibleEvent::EVENT_FOCUS &&
|
||||
aEventType != nsIAccessibleEvent::EVENT_VALUE_CHANGE &&
|
||||
aEventType != nsIAccessibleEvent::EVENT_TEXT_VALUE_CHANGE &&
|
||||
aEventType != nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED &&
|
||||
aEventType != nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED)
|
||||
return;
|
||||
|
|
|
@ -28,6 +28,7 @@ const EVENT_TEXT_INSERTED = nsIAccessibleEvent.EVENT_TEXT_INSERTED;
|
|||
const EVENT_TEXT_REMOVED = nsIAccessibleEvent.EVENT_TEXT_REMOVED;
|
||||
const EVENT_TEXT_SELECTION_CHANGED = nsIAccessibleEvent.EVENT_TEXT_SELECTION_CHANGED;
|
||||
const EVENT_VALUE_CHANGE = nsIAccessibleEvent.EVENT_VALUE_CHANGE;
|
||||
const EVENT_TEXT_VALUE_CHANGE = nsIAccessibleEvent.EVENT_TEXT_VALUE_CHANGE;
|
||||
const EVENT_VIRTUALCURSOR_CHANGED = nsIAccessibleEvent.EVENT_VIRTUALCURSOR_CHANGED;
|
||||
|
||||
const kNotFromUserInput = 0;
|
||||
|
|
|
@ -180,7 +180,8 @@
|
|||
{
|
||||
this.__proto__ = new textRemoveInvoker(aID, aStart, aEnd, aText);
|
||||
|
||||
this.eventSeq.push(new invokerChecker(EVENT_VALUE_CHANGE, this.DOMNode));
|
||||
this.eventSeq.push(new invokerChecker(EVENT_TEXT_VALUE_CHANGE,
|
||||
this.DOMNode));
|
||||
|
||||
this.invoke = function removeTextFromInput_invoke()
|
||||
{
|
||||
|
@ -207,7 +208,8 @@
|
|||
{
|
||||
this.__proto__ = new textInsertInvoker(aID, aStart, aEnd, aText);
|
||||
|
||||
this.eventSeq.push(new invokerChecker(EVENT_VALUE_CHANGE, this.DOMNode));
|
||||
this.eventSeq.push(new invokerChecker(EVENT_TEXT_VALUE_CHANGE,
|
||||
this.DOMNode));
|
||||
|
||||
this.invoke = function insertTextIntoInput_invoke()
|
||||
{
|
||||
|
|
|
@ -31,6 +31,10 @@
|
|||
function changeARIAValue(aNodeOrID, aValuenow, aValuetext)
|
||||
{
|
||||
this.DOMNode = getNode(aNodeOrID);
|
||||
this.eventSeq = [ new invokerChecker(aValuetext ?
|
||||
EVENT_TEXT_VALUE_CHANGE :
|
||||
EVENT_VALUE_CHANGE, this.DOMNode)
|
||||
];
|
||||
|
||||
this.invoke = function changeARIAValue_invoke() {
|
||||
|
||||
|
@ -63,6 +67,9 @@
|
|||
function changeValue(aID, aValue)
|
||||
{
|
||||
this.DOMNode = getNode(aID);
|
||||
this.eventSeq = [new invokerChecker(EVENT_TEXT_VALUE_CHANGE,
|
||||
this.DOMNode)
|
||||
];
|
||||
|
||||
this.invoke = function changeValue_invoke()
|
||||
{
|
||||
|
@ -84,6 +91,7 @@
|
|||
function changeProgressValue(aID, aValue)
|
||||
{
|
||||
this.DOMNode = getNode(aID);
|
||||
this.eventSeq = [new invokerChecker(EVENT_VALUE_CHANGE, this.DOMNode)];
|
||||
|
||||
this.invoke = function changeProgressValue_invoke()
|
||||
{
|
||||
|
@ -105,6 +113,7 @@
|
|||
function changeRangeValue(aID)
|
||||
{
|
||||
this.DOMNode = getNode(aID);
|
||||
this.eventSeq = [new invokerChecker(EVENT_VALUE_CHANGE, this.DOMNode)];
|
||||
|
||||
this.invoke = function changeRangeValue_invoke()
|
||||
{
|
||||
|
@ -134,7 +143,7 @@
|
|||
testValue("range", "6", 6, 0, 10, 1);
|
||||
|
||||
// Test value change events
|
||||
gQueue = new eventQueue(nsIAccessibleEvent.EVENT_VALUE_CHANGE);
|
||||
gQueue = new eventQueue();
|
||||
|
||||
gQueue.push(new changeARIAValue("slider_vn", "6", undefined));
|
||||
gQueue.push(new changeARIAValue("slider_vt", undefined, "hey!"));
|
||||
|
|
|
@ -97,6 +97,7 @@ static const uint32_t gWinEventMap[] = {
|
|||
IA2_EVENT_HYPERTEXT_CHANGED, // nsIAccessibleEvent::EVENT_HYPERTEXT_CHANGED
|
||||
IA2_EVENT_HYPERTEXT_NLINKS_CHANGED, // nsIAccessibleEvent::EVENT_HYPERTEXT_NLINKS_CHANGED
|
||||
IA2_EVENT_OBJECT_ATTRIBUTE_CHANGED, // nsIAccessibleEvent::EVENT_OBJECT_ATTRIBUTE_CHANGED
|
||||
kEVENT_WIN_UNKNOWN // nsIAccessibleEvent::EVENT_VIRTUALCURSOR_CHANGED
|
||||
kEVENT_WIN_UNKNOWN, // nsIAccessibleEvent::EVENT_VIRTUALCURSOR_CHANGED
|
||||
EVENT_OBJECT_VALUECHANGE // nsIAccessibleEvent::EVENT_TEXT_VALUE_CHANGE
|
||||
};
|
||||
|
||||
|
|
|
@ -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="c0482775b1526add626b170dd53a72d10bcaf07c"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="22f8023b112dfae83531b0a075ab9eb9a5444dfa"/>
|
||||
<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="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e76ff4b6b6357cf5c54dfafefbef8d1f2692db85"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="f009c98ba697582c857c5788e5cdf0640e287ae6"/>
|
||||
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
|
||||
<!-- Stock Android things -->
|
||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
|
||||
|
@ -106,7 +106,7 @@
|
|||
<project name="platform/libcore" path="libcore" revision="baf7d8068dd501cfa338d3a8b1b87216d6ce0571"/>
|
||||
<project name="platform/libnativehelper" path="libnativehelper" revision="50c4430e32849530ced32680fd6ee98963b3f7ac"/>
|
||||
<project name="platform/ndk" path="ndk" revision="e58ef003be4306bb53a8c11331146f39e4eab31f"/>
|
||||
<project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="88fe75533255e99261c96cb497dcbd99820b7a3a"/>
|
||||
<project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="c739cffa6394c06e099ea48879a20341b6163338"/>
|
||||
<project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="c792f0bd9fff7aea2887c60bbb3a9bbdb534ffa3"/>
|
||||
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="69d524e80cdf3981006627c65ac85f3a871238a3"/>
|
||||
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="5a48c04c4bb5f079bc757e29864a42427378e051"/>
|
||||
|
|
|
@ -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="c0482775b1526add626b170dd53a72d10bcaf07c"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="22f8023b112dfae83531b0a075ab9eb9a5444dfa"/>
|
||||
<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="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e76ff4b6b6357cf5c54dfafefbef8d1f2692db85"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="f009c98ba697582c857c5788e5cdf0640e287ae6"/>
|
||||
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
|
||||
<!-- Stock Android things -->
|
||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
|
||||
|
@ -112,7 +112,7 @@
|
|||
<project name="platform/libcore" path="libcore" revision="e195beab082c09217318fc19250caeaf4c1bd800"/>
|
||||
<project name="platform/libnativehelper" path="libnativehelper" revision="feeb36c2bd4adfe285f98f5de92e0f3771b2c115"/>
|
||||
<project name="platform/ndk" path="ndk" revision="e58ef003be4306bb53a8c11331146f39e4eab31f"/>
|
||||
<project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="88fe75533255e99261c96cb497dcbd99820b7a3a"/>
|
||||
<project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="c739cffa6394c06e099ea48879a20341b6163338"/>
|
||||
<project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="c792f0bd9fff7aea2887c60bbb3a9bbdb534ffa3"/>
|
||||
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="cfcef469537869947abb9aa1d656774cc2678d4c"/>
|
||||
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="5a48c04c4bb5f079bc757e29864a42427378e051"/>
|
||||
|
|
|
@ -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="c0482775b1526add626b170dd53a72d10bcaf07c"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="22f8023b112dfae83531b0a075ab9eb9a5444dfa"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
</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="c0482775b1526add626b170dd53a72d10bcaf07c"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="22f8023b112dfae83531b0a075ab9eb9a5444dfa"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="aa5b7b7f6ed207ea1adc4df11d1d8bdaeabadd85"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e76ff4b6b6357cf5c54dfafefbef8d1f2692db85"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="f009c98ba697582c857c5788e5cdf0640e287ae6"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
|
||||
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
|
||||
|
|
|
@ -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="c0482775b1526add626b170dd53a72d10bcaf07c"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="22f8023b112dfae83531b0a075ab9eb9a5444dfa"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -23,7 +23,7 @@
|
|||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e76ff4b6b6357cf5c54dfafefbef8d1f2692db85"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="f009c98ba697582c857c5788e5cdf0640e287ae6"/>
|
||||
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
|
||||
<!-- Stock Android things -->
|
||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
|
||||
|
@ -110,7 +110,7 @@
|
|||
<project name="platform/libcore" path="libcore" revision="9877ade9617bb0db6e59aa2a54719a9bc92600f3"/>
|
||||
<project name="platform/libnativehelper" path="libnativehelper" revision="46c96ace65eb1ccab05bf15b9bf8e53e443039af"/>
|
||||
<project name="platform/ndk" path="ndk" revision="cb5519af32ae7b4a9c334913a612462ecd04c5d0"/>
|
||||
<project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="88fe75533255e99261c96cb497dcbd99820b7a3a"/>
|
||||
<project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="c739cffa6394c06e099ea48879a20341b6163338"/>
|
||||
<project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="6aa61f8557a22039a30b42b7f283996381fd625d"/>
|
||||
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="b562b01c93de9578d5db537b6a602a38e1aaa0ce"/>
|
||||
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="387f03e815f57d536dd922706db1622bddba8d81"/>
|
||||
|
|
|
@ -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="c0482775b1526add626b170dd53a72d10bcaf07c"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="22f8023b112dfae83531b0a075ab9eb9a5444dfa"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -23,7 +23,7 @@
|
|||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e76ff4b6b6357cf5c54dfafefbef8d1f2692db85"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="f009c98ba697582c857c5788e5cdf0640e287ae6"/>
|
||||
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
|
||||
<!-- Stock Android things -->
|
||||
<project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="ffc05a232799fe8fcb3e47b7440b52b1fb4244c0"/>
|
||||
|
@ -122,7 +122,7 @@
|
|||
<project name="platform/libcore" path="libcore" revision="bdec7d684c083760bef7bc4ba2429cceccaaf7d0"/>
|
||||
<project name="platform/libnativehelper" path="libnativehelper" revision="27bcc086236cedd31c056303e255c6d0ea3d4a50"/>
|
||||
<project name="platform/ndk" path="ndk" revision="42e85f81cc6c74af145056ee80b06e520cccb9a7"/>
|
||||
<project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="f105a2d852c988fb1aa16a1e758ca7f93dd54fe9"/>
|
||||
<project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="179d485578c6907c0daf343a3bd7bc53b5e137a1"/>
|
||||
<project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="1d080491f26dfdfd76d5bbc3e6b40c660e8565af"/>
|
||||
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="61a10cbd19d6b7fc052a8cb92dfa1b37b93754f3"/>
|
||||
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="9e892a67a01671f312c76b0880dedaa6ba478148"/>
|
||||
|
|
|
@ -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="c0482775b1526add626b170dd53a72d10bcaf07c"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="22f8023b112dfae83531b0a075ab9eb9a5444dfa"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>
|
||||
|
|
|
@ -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="c0482775b1526add626b170dd53a72d10bcaf07c"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="22f8023b112dfae83531b0a075ab9eb9a5444dfa"/>
|
||||
<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="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e76ff4b6b6357cf5c54dfafefbef8d1f2692db85"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="f009c98ba697582c857c5788e5cdf0640e287ae6"/>
|
||||
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
|
||||
<!-- Stock Android things -->
|
||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
|
||||
|
@ -105,7 +105,7 @@
|
|||
<project name="platform/libcore" path="libcore" revision="baf7d8068dd501cfa338d3a8b1b87216d6ce0571"/>
|
||||
<project name="platform/libnativehelper" path="libnativehelper" revision="50c4430e32849530ced32680fd6ee98963b3f7ac"/>
|
||||
<project name="platform/ndk" path="ndk" revision="e58ef003be4306bb53a8c11331146f39e4eab31f"/>
|
||||
<project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="88fe75533255e99261c96cb497dcbd99820b7a3a"/>
|
||||
<project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="c739cffa6394c06e099ea48879a20341b6163338"/>
|
||||
<project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="c792f0bd9fff7aea2887c60bbb3a9bbdb534ffa3"/>
|
||||
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="69d524e80cdf3981006627c65ac85f3a871238a3"/>
|
||||
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="5a48c04c4bb5f079bc757e29864a42427378e051"/>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"git": {
|
||||
"git_revision": "c0482775b1526add626b170dd53a72d10bcaf07c",
|
||||
"git_revision": "22f8023b112dfae83531b0a075ab9eb9a5444dfa",
|
||||
"remote": "https://git.mozilla.org/releases/gaia.git",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "da79a53a3e7b627176e3a933387f0eaa7ff379fa",
|
||||
"revision": "fbb1b70ce9fdf934ff09885898d9ce5fa9f87b57",
|
||||
"repo_path": "integration/gaia-central"
|
||||
}
|
||||
|
|
|
@ -11,14 +11,16 @@
|
|||
"upload_files": [
|
||||
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
|
||||
"{objdir}/dist/b2g-*.tar.gz",
|
||||
"{workdir}/sources.xml"
|
||||
"{workdir}/sources.xml",
|
||||
"{workdir}/out/target/product/nexus-4-kk/fota-*-update-*.mar"
|
||||
],
|
||||
"public_upload_files": [
|
||||
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
|
||||
"{objdir}/dist/b2g-*.tar.gz",
|
||||
"{workdir}/sources.xml",
|
||||
"{objdir}/dist/b2g-update/*.mar",
|
||||
"{workdir}/mako.zip"
|
||||
"{workdir}/mako.zip",
|
||||
"{workdir}/out/target/product/nexus-4-kk/fota-*-update.mar"
|
||||
],
|
||||
"zip_files": [
|
||||
["{workdir}/out/target/product/mako/*.img", "out/target/product/mako/"],
|
||||
|
|
|
@ -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="c0482775b1526add626b170dd53a72d10bcaf07c"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="22f8023b112dfae83531b0a075ab9eb9a5444dfa"/>
|
||||
<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="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e76ff4b6b6357cf5c54dfafefbef8d1f2692db85"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="f009c98ba697582c857c5788e5cdf0640e287ae6"/>
|
||||
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
|
||||
<!-- Stock Android things -->
|
||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
|
||||
|
@ -112,7 +112,7 @@
|
|||
<project name="platform/libcore" path="libcore" revision="9877ade9617bb0db6e59aa2a54719a9bc92600f3"/>
|
||||
<project name="platform/libnativehelper" path="libnativehelper" revision="46c96ace65eb1ccab05bf15b9bf8e53e443039af"/>
|
||||
<project name="platform/ndk" path="ndk" revision="cb5519af32ae7b4a9c334913a612462ecd04c5d0"/>
|
||||
<project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="88fe75533255e99261c96cb497dcbd99820b7a3a"/>
|
||||
<project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="c739cffa6394c06e099ea48879a20341b6163338"/>
|
||||
<project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="6aa61f8557a22039a30b42b7f283996381fd625d"/>
|
||||
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="b562b01c93de9578d5db537b6a602a38e1aaa0ce"/>
|
||||
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="387f03e815f57d536dd922706db1622bddba8d81"/>
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
<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="c0482775b1526add626b170dd53a72d10bcaf07c"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="22f8023b112dfae83531b0a075ab9eb9a5444dfa"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="aa5b7b7f6ed207ea1adc4df11d1d8bdaeabadd85"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e76ff4b6b6357cf5c54dfafefbef8d1f2692db85"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="f009c98ba697582c857c5788e5cdf0640e287ae6"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
|
||||
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
|
||||
|
|
|
@ -11,14 +11,16 @@
|
|||
"upload_files": [
|
||||
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
|
||||
"{objdir}/dist/b2g-*.tar.gz",
|
||||
"{workdir}/sources.xml"
|
||||
"{workdir}/sources.xml",
|
||||
"{workdir}/out/target/product/nexus-5-l/fota-*-update-*.mar"
|
||||
],
|
||||
"public_upload_files": [
|
||||
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
|
||||
"{objdir}/dist/b2g-*.tar.gz",
|
||||
"{workdir}/sources.xml",
|
||||
"{objdir}/dist/b2g-update/*.mar",
|
||||
"{workdir}/hammerhead.zip"
|
||||
"{workdir}/hammerhead.zip",
|
||||
"{workdir}/out/target/product/nexus-5-l/fota-*-update.mar"
|
||||
],
|
||||
"zip_files": [
|
||||
["{workdir}/out/target/product/hammerhead/*.img", "out/target/product/hammerhead/"],
|
||||
|
|
|
@ -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="c0482775b1526add626b170dd53a72d10bcaf07c"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="22f8023b112dfae83531b0a075ab9eb9a5444dfa"/>
|
||||
<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="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e76ff4b6b6357cf5c54dfafefbef8d1f2692db85"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="f009c98ba697582c857c5788e5cdf0640e287ae6"/>
|
||||
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
|
||||
<!-- Stock Android things -->
|
||||
<project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="ffc05a232799fe8fcb3e47b7440b52b1fb4244c0"/>
|
||||
|
@ -123,7 +123,7 @@
|
|||
<project name="platform/libcore" path="libcore" revision="bdec7d684c083760bef7bc4ba2429cceccaaf7d0"/>
|
||||
<project name="platform/libnativehelper" path="libnativehelper" revision="27bcc086236cedd31c056303e255c6d0ea3d4a50"/>
|
||||
<project name="platform/ndk" path="ndk" revision="42e85f81cc6c74af145056ee80b06e520cccb9a7"/>
|
||||
<project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="f105a2d852c988fb1aa16a1e758ca7f93dd54fe9"/>
|
||||
<project name="platform_prebuilts_misc" path="prebuilts/misc" remote="b2g" revision="179d485578c6907c0daf343a3bd7bc53b5e137a1"/>
|
||||
<project name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="1d080491f26dfdfd76d5bbc3e6b40c660e8565af"/>
|
||||
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="61a10cbd19d6b7fc052a8cb92dfa1b37b93754f3"/>
|
||||
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="9e892a67a01671f312c76b0880dedaa6ba478148"/>
|
||||
|
|
|
@ -403,7 +403,6 @@ run-if = e10s
|
|||
[browser_star_hsts.js]
|
||||
[browser_subframe_favicons_not_used.js]
|
||||
[browser_syncui.js]
|
||||
skip-if = os == "mac" && debug # Bug 1217332
|
||||
[browser_tabDrop.js]
|
||||
skip-if = buildapp == 'mulet' || e10s
|
||||
[browser_tabReorder.js]
|
||||
|
|
|
@ -397,6 +397,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|||
try {
|
||||
openUILinkIn(url, "current", {
|
||||
allowThirdPartyFixup: true,
|
||||
indicateErrorPageLoad: true,
|
||||
disallowInheritPrincipal: !mayInheritPrincipal,
|
||||
allowPinnedTabHostChange: true,
|
||||
postData: postData,
|
||||
|
@ -405,7 +406,9 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|||
} catch (ex) {
|
||||
// This load can throw an exception in certain cases, which means
|
||||
// we'll want to replace the URL with the loaded URL:
|
||||
this.handleRevert();
|
||||
if (ex.result != Cr.NS_ERROR_LOAD_SHOWED_ERRORPAGE) {
|
||||
this.handleRevert();
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure the start of the URL is visible for UX reasons:
|
||||
|
|
|
@ -219,6 +219,7 @@ function openLinkIn(url, where, params) {
|
|||
var aNoReferrer = params.noReferrer;
|
||||
var aAllowPopups = !!params.allowPopups;
|
||||
var aUserContextId = params.userContextId;
|
||||
var aIndicateErrorPageLoad = params.indicateErrorPageLoad;
|
||||
|
||||
if (where == "save") {
|
||||
if (!aInitiatingDoc) {
|
||||
|
@ -338,6 +339,9 @@ function openLinkIn(url, where, params) {
|
|||
if (aAllowPopups) {
|
||||
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_POPUPS;
|
||||
}
|
||||
if (aIndicateErrorPageLoad) {
|
||||
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ERROR_LOAD_CHANGES_RV;
|
||||
}
|
||||
|
||||
w.gBrowser.loadURIWithFlags(url, {
|
||||
flags: flags,
|
||||
|
|
|
@ -24,10 +24,11 @@ AC_DEFUN([MOZ_RUST_SUPPORT], [
|
|||
See http://www.rust-lang.org/ for more information.])
|
||||
fi
|
||||
if test -n "$MOZ_RUST" && test -z "$_RUSTC_MAJOR_VERSION" -o \
|
||||
"$_RUSTC_MAJOR_VERSION" -lt 1; then
|
||||
"$_RUSTC_MAJOR_VERSION" -lt 1 -o \
|
||||
\( "$_RUSTC_MAJOR_VERSION" -eq 1 -a "$_RUSTC_MINOR_VERSION" -lt 4 \); then
|
||||
AC_MSG_ERROR([Rust compiler ${RUSTC_VERSION} is too old.
|
||||
To compile Rust language sources please install at least
|
||||
version 1.0 of the 'rustc' toolchain and make sure it is
|
||||
version 1.4 of the 'rustc' toolchain and make sure it is
|
||||
first in your path.
|
||||
You can verify this by typing 'rustc --version'.])
|
||||
fi
|
||||
|
|
|
@ -76,6 +76,7 @@ included_inclnames_to_ignore = set([
|
|||
'prthread.h', # NSPR
|
||||
'prtypes.h', # NSPR
|
||||
'selfhosted.out.h', # generated in $OBJDIR
|
||||
'shellmoduleloader.out.h', # generated in $OBJDIR
|
||||
'unicode/locid.h', # ICU
|
||||
'unicode/numsys.h', # ICU
|
||||
'unicode/timezone.h', # ICU
|
||||
|
|
|
@ -412,8 +412,8 @@ OS_COMPILE_CMMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch
|
|||
endif
|
||||
endif
|
||||
|
||||
COMPILE_CFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_CPPFLAGS) $(OS_COMPILE_CFLAGS) $(CFLAGS) $(MOZBUILD_CFLAGS)
|
||||
COMPILE_CXXFLAGS = $(if $(DISABLE_STL_WRAPPING),,$(STL_FLAGS)) $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_CPPFLAGS) $(OS_COMPILE_CXXFLAGS) $(CXXFLAGS) $(MOZBUILD_CXXFLAGS)
|
||||
COMPILE_CFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CFLAGS) $(CFLAGS) $(MOZBUILD_CFLAGS)
|
||||
COMPILE_CXXFLAGS = $(if $(DISABLE_STL_WRAPPING),,$(STL_FLAGS)) $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CXXFLAGS) $(CXXFLAGS) $(MOZBUILD_CXXFLAGS)
|
||||
COMPILE_CMFLAGS = $(OS_COMPILE_CMFLAGS) $(MOZBUILD_CMFLAGS)
|
||||
COMPILE_CMMFLAGS = $(OS_COMPILE_CMMFLAGS) $(MOZBUILD_CMMFLAGS)
|
||||
ASFLAGS += $(MOZBUILD_ASFLAGS)
|
||||
|
|
|
@ -4019,8 +4019,6 @@ fi
|
|||
case "$MOZ_BUILD_APP" in
|
||||
browser)
|
||||
AC_DEFINE(MOZ_PHOENIX)
|
||||
|
||||
BUILD_BACKENDS="$BUILD_BACKENDS FasterMake"
|
||||
;;
|
||||
|
||||
xulrunner)
|
||||
|
@ -4028,6 +4026,8 @@ xulrunner)
|
|||
;;
|
||||
esac
|
||||
|
||||
BUILD_BACKENDS="$BUILD_BACKENDS FasterMake"
|
||||
|
||||
if test -n "$MOZ_B2G"; then
|
||||
AC_DEFINE(MOZ_B2G)
|
||||
fi
|
||||
|
|
|
@ -4656,7 +4656,10 @@ nsDocShell::LoadURIWithOptions(const char16_t* aURI,
|
|||
// what happens
|
||||
|
||||
if (NS_ERROR_MALFORMED_URI == rv) {
|
||||
DisplayLoadError(rv, uri, aURI, nullptr);
|
||||
if (DisplayLoadError(rv, uri, aURI, nullptr) &&
|
||||
(aLoadFlags & LOAD_FLAGS_ERROR_LOAD_CHANGES_RV) != 0) {
|
||||
return NS_ERROR_LOAD_SHOWED_ERRORPAGE;
|
||||
}
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv) || !uri) {
|
||||
|
@ -4721,8 +4724,10 @@ nsDocShell::LoadURIWithOptions(const char16_t* aURI,
|
|||
NS_IMETHODIMP
|
||||
nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
|
||||
const char16_t* aURL,
|
||||
nsIChannel* aFailedChannel)
|
||||
nsIChannel* aFailedChannel,
|
||||
bool* aDisplayedErrorPage)
|
||||
{
|
||||
*aDisplayedErrorPage = false;
|
||||
// Get prompt and string bundle servcies
|
||||
nsCOMPtr<nsIPrompt> prompter;
|
||||
nsCOMPtr<nsIStringBundle> stringBundle;
|
||||
|
@ -5100,8 +5105,10 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
|
|||
|
||||
if (UseErrorPages()) {
|
||||
// Display an error page
|
||||
LoadErrorPage(aURI, aURL, errorPage.get(), error.get(),
|
||||
messageStr.get(), cssClass.get(), aFailedChannel);
|
||||
nsresult loadedPage = LoadErrorPage(aURI, aURL, errorPage.get(),
|
||||
error.get(), messageStr.get(),
|
||||
cssClass.get(), aFailedChannel);
|
||||
*aDisplayedErrorPage = NS_SUCCEEDED(loadedPage);
|
||||
} else {
|
||||
// The prompter reqires that our private window has a document (or it
|
||||
// asserts). Satisfy that assertion now since GetDoc will force
|
||||
|
@ -5781,7 +5788,7 @@ nsDocShell::GetPositionAndSize(int32_t* aX, int32_t* aY, int32_t* aWidth,
|
|||
{
|
||||
if (mParentWidget) {
|
||||
// ensure size is up-to-date if window has changed resolution
|
||||
nsIntRect r;
|
||||
LayoutDeviceIntRect r;
|
||||
mParentWidget->GetClientBounds(r);
|
||||
SetPositionAndSize(mBounds.x, mBounds.y, r.width, r.height, false);
|
||||
}
|
||||
|
@ -10276,7 +10283,10 @@ nsDocShell::InternalLoad(nsIURI* aURI,
|
|||
|
||||
if (NS_FAILED(rv)) {
|
||||
nsCOMPtr<nsIChannel> chan(do_QueryInterface(req));
|
||||
DisplayLoadError(rv, aURI, nullptr, chan);
|
||||
if (DisplayLoadError(rv, aURI, nullptr, chan) &&
|
||||
(aFlags & LOAD_FLAGS_ERROR_LOAD_CHANGES_RV) != 0) {
|
||||
return NS_ERROR_LOAD_SHOWED_ERRORPAGE;
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -728,6 +728,14 @@ protected:
|
|||
*/
|
||||
void MaybeInitTiming();
|
||||
|
||||
bool DisplayLoadError(nsresult aError, nsIURI* aURI, const char16_t* aURL,
|
||||
nsIChannel* aFailedChannel)
|
||||
{
|
||||
bool didDisplayLoadError = false;
|
||||
DisplayLoadError(aError, aURI, aURL, aFailedChannel, &didDisplayLoadError);
|
||||
return didDisplayLoadError;
|
||||
}
|
||||
|
||||
public:
|
||||
// Event type dispatched by RestorePresentation
|
||||
class RestorePresentationEvent : public nsRunnable
|
||||
|
|
|
@ -43,7 +43,7 @@ interface nsITabParent;
|
|||
|
||||
typedef unsigned long nsLoadFlags;
|
||||
|
||||
[scriptable, builtinclass, uuid(9f2babc4-4c2a-4cf7-929f-a1efc325b0df)]
|
||||
[scriptable, builtinclass, uuid(b1df6e41-c8dd-45c2-bc18-dd330d986214)]
|
||||
interface nsIDocShell : nsIDocShellTreeItem
|
||||
{
|
||||
/**
|
||||
|
@ -460,11 +460,14 @@ interface nsIDocShell : nsIDocShellTreeItem
|
|||
* @param aURI nsIURI of the page where the error happened
|
||||
* @param aURL wstring of the page where the error happened
|
||||
* @param aFailedChannel The channel related to this error
|
||||
*
|
||||
* Returns whether or not we displayed an error page (note: will always
|
||||
* return false if in-content error pages are disabled!)
|
||||
*/
|
||||
void displayLoadError(in nsresult aError,
|
||||
in nsIURI aURI,
|
||||
in wstring aURL,
|
||||
[optional] in nsIChannel aFailedChannel);
|
||||
boolean displayLoadError(in nsresult aError,
|
||||
in nsIURI aURI,
|
||||
in wstring aURL,
|
||||
[optional] in nsIChannel aFailedChannel);
|
||||
|
||||
/**
|
||||
* The channel that failed to load and resulted in an error page.
|
||||
|
|
|
@ -16,7 +16,7 @@ interface nsIURI;
|
|||
* location, stop or restart an in process load, or determine where the object
|
||||
* has previously gone.
|
||||
*/
|
||||
[scriptable, uuid(0e92d522-53a5-4af6-9a24-4eccdcbf4f91)]
|
||||
[scriptable, uuid(3ade79d4-8cb9-4952-b18d-4f9b63ca0d31)]
|
||||
interface nsIWebNavigation : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -184,6 +184,12 @@ interface nsIWebNavigation : nsISupports
|
|||
*/
|
||||
const unsigned long LOAD_FLAGS_DISALLOW_INHERIT_OWNER = 0x40000;
|
||||
|
||||
/**
|
||||
* Overwrite the returned error code with a specific result code
|
||||
* when an error page is displayed.
|
||||
*/
|
||||
const unsigned long LOAD_FLAGS_ERROR_LOAD_CHANGES_RV = 0x80000;
|
||||
|
||||
/**
|
||||
* This flag specifies that the URI may be submitted to a third-party
|
||||
* server for correction. This should only be applied to non-sensitive
|
||||
|
@ -196,8 +202,6 @@ interface nsIWebNavigation : nsISupports
|
|||
*/
|
||||
const unsigned long LOAD_FLAGS_FIXUP_SCHEME_TYPOS = 0x200000;
|
||||
|
||||
/* Note that flag 0x80000 is available. */
|
||||
|
||||
/**
|
||||
* Loads a given URI. This will give priority to loading the requested URI
|
||||
* in the object implementing this interface. If it can't be loaded here
|
||||
|
|
|
@ -36,9 +36,10 @@ ActivityRequestHandler.prototype = {
|
|||
this._window = aWindow;
|
||||
},
|
||||
|
||||
__init: function arh___init(aId, aOptions) {
|
||||
__init: function arh___init(aId, aOptions, aReturnValue) {
|
||||
this._id = aId;
|
||||
this._options = aOptions;
|
||||
this._returnValue = aReturnValue;
|
||||
},
|
||||
|
||||
get source() {
|
||||
|
@ -49,11 +50,16 @@ ActivityRequestHandler.prototype = {
|
|||
},
|
||||
|
||||
postResult: function arh_postResult(aResult) {
|
||||
cpmm.sendAsyncMessage("Activity:PostResult", {
|
||||
"id": this._id,
|
||||
"result": aResult
|
||||
});
|
||||
Services.obs.notifyObservers(null, "activity-success", this._id);
|
||||
if (this._returnValue) {
|
||||
cpmm.sendAsyncMessage("Activity:PostResult", {
|
||||
"id": this._id,
|
||||
"result": aResult
|
||||
});
|
||||
Services.obs.notifyObservers(null, "activity-success", this._id);
|
||||
} else {
|
||||
Cu.reportError("postResult() can't be called when 'returnValue': 'true' isn't declared in manifest.webapp");
|
||||
throw new Error("postResult() can't be called when 'returnValue': 'true' isn't declared in manifest.webapp");
|
||||
}
|
||||
},
|
||||
|
||||
postError: function arh_postError(aError) {
|
||||
|
|
|
@ -37,7 +37,10 @@ ActivityWrapper.prototype = {
|
|||
// Activity workflow.
|
||||
cpmm.sendAsyncMessage("Activity:Ready", { id: aMessage.id });
|
||||
|
||||
let handler = new aWindow.ActivityRequestHandler(aMessage.id, aMessage.payload);
|
||||
// Gecko should ignore |postResult| calls for WebActivities with no returnValue
|
||||
// We need to pass returnValue to ActivityRequestHandler constructor to then properly
|
||||
// decide if should call postResult or not
|
||||
let handler = new aWindow.ActivityRequestHandler(aMessage.id, aMessage.payload, aMessage.target.returnValue);
|
||||
|
||||
// When the activity window is closed, fire an error to notify the activity
|
||||
// caller of the situation.
|
||||
|
|
|
@ -116,6 +116,11 @@ this.PermissionsTable = { geolocation: {
|
|||
privileged: DENY_ACTION,
|
||||
certified: ALLOW_ACTION
|
||||
},
|
||||
"speech-recognition": {
|
||||
app: DENY_ACTION,
|
||||
privileged: ALLOW_ACTION,
|
||||
certified: ALLOW_ACTION
|
||||
},
|
||||
telephony: {
|
||||
app: DENY_ACTION,
|
||||
privileged: DENY_ACTION,
|
||||
|
|
|
@ -124,8 +124,8 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
|
|||
nsContentPolicyType externalTypeOrScript =
|
||||
nsContentUtils::InternalContentPolicyTypeToExternalOrScript(contentType);
|
||||
|
||||
nsContentPolicyType externalTypeOrPreload =
|
||||
nsContentUtils::InternalContentPolicyTypeToExternalOrPreload(contentType);
|
||||
nsContentPolicyType externalTypeOrCSPInternal =
|
||||
nsContentUtils::InternalContentPolicyTypeToExternalOrCSPInternal(contentType);
|
||||
|
||||
nsCOMPtr<nsIContentPolicy> mixedContentBlocker =
|
||||
do_GetService(NS_MIXEDCONTENTBLOCKER_CONTRACTID);
|
||||
|
@ -152,13 +152,16 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
|
|||
type = externalTypeOrScript;
|
||||
}
|
||||
// Send the internal content policy type for CSP which needs to
|
||||
// know about preloads, in particular:
|
||||
// know about preloads and workers, in particular:
|
||||
// * TYPE_INTERNAL_SCRIPT_PRELOAD
|
||||
// * TYPE_INTERNAL_IMAGE_PRELOAD
|
||||
// * TYPE_INTERNAL_STYLESHEET_PRELOAD
|
||||
// * TYPE_INTERNAL_WORKER
|
||||
// * TYPE_INTERNAL_SHARED_WORKER
|
||||
// * TYPE_INTERNAL_SERVICE_WORKER
|
||||
bool isCSP = cspService == entries[i];
|
||||
if (isCSP) {
|
||||
type = externalTypeOrPreload;
|
||||
type = externalTypeOrCSPInternal;
|
||||
}
|
||||
rv = (entries[i]->*policyMethod)(type, contentLocation,
|
||||
requestingLocation, requestingContext,
|
||||
|
|
|
@ -8044,6 +8044,33 @@ nsContentUtils::InternalContentPolicyTypeToExternalOrPreload(nsContentPolicyType
|
|||
return InternalContentPolicyTypeToExternal(aType);
|
||||
}
|
||||
|
||||
|
||||
/* static */
|
||||
nsContentPolicyType
|
||||
nsContentUtils::InternalContentPolicyTypeToExternalOrWorker(nsContentPolicyType aType)
|
||||
{
|
||||
switch (aType) {
|
||||
case nsIContentPolicy::TYPE_INTERNAL_WORKER:
|
||||
case nsIContentPolicy::TYPE_INTERNAL_SHARED_WORKER:
|
||||
case nsIContentPolicy::TYPE_INTERNAL_SERVICE_WORKER:
|
||||
return aType;
|
||||
|
||||
default:
|
||||
return InternalContentPolicyTypeToExternal(aType);
|
||||
}
|
||||
}
|
||||
|
||||
/* static */
|
||||
nsContentPolicyType
|
||||
nsContentUtils::InternalContentPolicyTypeToExternalOrCSPInternal(nsContentPolicyType aType)
|
||||
{
|
||||
if (aType == InternalContentPolicyTypeToExternalOrWorker(aType) ||
|
||||
aType == InternalContentPolicyTypeToExternalOrPreload(aType)) {
|
||||
return aType;
|
||||
}
|
||||
return InternalContentPolicyTypeToExternal(aType);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsContentUtils::SetFetchReferrerURIWithPolicy(nsIPrincipal* aPrincipal,
|
||||
nsIDocument* aDoc,
|
||||
|
|
|
@ -1013,6 +1013,29 @@ public:
|
|||
*/
|
||||
static nsContentPolicyType InternalContentPolicyTypeToExternalOrPreload(nsContentPolicyType aType);
|
||||
|
||||
/**
|
||||
* Map internal content policy types to external ones, worker, or preload types:
|
||||
* * TYPE_INTERNAL_WORKER
|
||||
* * TYPE_INTERNAL_SHARED_WORKER
|
||||
* * TYPE_INTERNAL_SERVICE_WORKER
|
||||
* * TYPE_INTERNAL_SCRIPT_PRELOAD
|
||||
* * TYPE_INTERNAL_IMAGE_PRELOAD
|
||||
* * TYPE_INTERNAL_STYLESHEET_PRELOAD
|
||||
*
|
||||
* Note: DO NOT call this function unless you know what you're doing!
|
||||
*/
|
||||
static nsContentPolicyType InternalContentPolicyTypeToExternalOrCSPInternal(nsContentPolicyType aType);
|
||||
|
||||
/**
|
||||
* Map internal content policy types to external ones, worker, or preload types:
|
||||
* * TYPE_INTERNAL_WORKER
|
||||
* * TYPE_INTERNAL_SHARED_WORKER
|
||||
* * TYPE_INTERNAL_SERVICE_WORKER
|
||||
*
|
||||
* Note: DO NOT call this function unless you know what you're doing!
|
||||
*/
|
||||
static nsContentPolicyType InternalContentPolicyTypeToExternalOrWorker(nsContentPolicyType aType);
|
||||
|
||||
/**
|
||||
* Quick helper to determine whether there are any mutation listeners
|
||||
* of a given type that apply to this content or any of its ancestors.
|
||||
|
|
|
@ -124,22 +124,13 @@ NS_INTERFACE_MAP_END
|
|||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMAttributeMap)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMAttributeMap)
|
||||
|
||||
PLDHashOperator
|
||||
SetOwnerDocumentFunc(nsAttrHashKey::KeyType aKey,
|
||||
RefPtr<Attr>& aData,
|
||||
void* aUserArg)
|
||||
{
|
||||
nsresult rv = aData->SetOwnerDocument(static_cast<nsIDocument*>(aUserArg));
|
||||
|
||||
return NS_FAILED(rv) ? PL_DHASH_STOP : PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDOMAttributeMap::SetOwnerDocument(nsIDocument* aDocument)
|
||||
{
|
||||
uint32_t n = mAttributeCache.Enumerate(SetOwnerDocumentFunc, aDocument);
|
||||
NS_ENSURE_TRUE(n == mAttributeCache.Count(), NS_ERROR_FAILURE);
|
||||
|
||||
for (auto iter = mAttributeCache.Iter(); !iter.Done(); iter.Next()) {
|
||||
nsresult rv = iter.Data()->SetOwnerDocument(aDocument);
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -951,11 +951,14 @@ nsDOMWindowUtils::SendTouchEventCommon(const nsAString& aType,
|
|||
for (uint32_t i = 0; i < aCount; ++i) {
|
||||
LayoutDeviceIntPoint pt =
|
||||
nsContentUtils::ToWidgetPoint(CSSPoint(aXs[i], aYs[i]), offset, presContext);
|
||||
RefPtr<Touch> t = new Touch(aIdentifiers[i],
|
||||
pt,
|
||||
nsIntPoint(aRxs[i], aRys[i]),
|
||||
aRotationAngles[i],
|
||||
aForces[i]);
|
||||
LayoutDeviceIntPoint radius =
|
||||
LayoutDeviceIntPoint::FromAppUnitsRounded(
|
||||
CSSPoint::ToAppUnits(CSSPoint(aRxs[i], aRys[i])),
|
||||
presContext->AppUnitsPerDevPixel());
|
||||
|
||||
RefPtr<Touch> t =
|
||||
new Touch(aIdentifiers[i], pt, radius, aRotationAngles[i], aForces[i]);
|
||||
|
||||
event.touches.AppendElement(t);
|
||||
}
|
||||
|
||||
|
@ -1856,16 +1859,14 @@ nsDOMWindowUtils::SendQueryContentEvent(uint32_t aType,
|
|||
nsIFrame* popupFrame =
|
||||
nsLayoutUtils::GetPopupFrameForEventCoordinates(presContext->GetRootPresContext(), &dummyEvent);
|
||||
|
||||
nsIntRect widgetBounds;
|
||||
LayoutDeviceIntRect widgetBounds;
|
||||
nsresult rv = widget->GetClientBounds(widgetBounds);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
widgetBounds.MoveTo(0, 0);
|
||||
|
||||
// There is no popup frame at the point and the point isn't in our widget,
|
||||
// we cannot process this request.
|
||||
NS_ENSURE_TRUE(popupFrame ||
|
||||
widgetBounds.Contains(LayoutDeviceIntPoint::ToUntyped(pt)),
|
||||
NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(popupFrame || widgetBounds.Contains(pt), NS_ERROR_FAILURE);
|
||||
|
||||
// Fire the event on the widget at the point
|
||||
if (popupFrame) {
|
||||
|
|
|
@ -10602,13 +10602,13 @@ nsIDocument::CreateTouch(nsIDOMWindow* aView,
|
|||
float aForce)
|
||||
{
|
||||
RefPtr<Touch> touch = new Touch(aTarget,
|
||||
aIdentifier,
|
||||
aPageX, aPageY,
|
||||
aScreenX, aScreenY,
|
||||
aClientX, aClientY,
|
||||
aRadiusX, aRadiusY,
|
||||
aRotationAngle,
|
||||
aForce);
|
||||
aIdentifier,
|
||||
aPageX, aPageY,
|
||||
aScreenX, aScreenY,
|
||||
aClientX, aClientY,
|
||||
aRadiusX, aRadiusY,
|
||||
aRotationAngle,
|
||||
aForce);
|
||||
return touch.forget();
|
||||
}
|
||||
|
||||
|
|
|
@ -844,6 +844,7 @@ GK_ATOM(onmapmessageupdatereq, "onmapmessageupdatereq")
|
|||
GK_ATOM(onnewrdsgroup, "onnewrdsgroup")
|
||||
GK_ATOM(onnotificationclick, "onnotificationclick")
|
||||
GK_ATOM(onnoupdate, "onnoupdate")
|
||||
GK_ATOM(onobexpasswordreq, "onobexpasswordreq")
|
||||
GK_ATOM(onobsolete, "onobsolete")
|
||||
GK_ATOM(ononline, "ononline")
|
||||
GK_ATOM(onoffline, "onoffline")
|
||||
|
|
|
@ -13327,7 +13327,7 @@ nsGlobalWindow::NotifyDefaultButtonLoaded(Element& aDefaultButton,
|
|||
return;
|
||||
}
|
||||
nsIntRect widgetRect;
|
||||
aError = widget->GetScreenBounds(widgetRect);
|
||||
aError = widget->GetScreenBoundsUntyped(widgetRect);
|
||||
if (aError.Failed()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -291,7 +291,7 @@ skip-if = buildapp == 'mulet'
|
|||
[test_constructor-assignment.html]
|
||||
[test_constructor.html]
|
||||
[test_dialogArguments.html]
|
||||
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e10s
|
||||
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e10s # showmodaldialog
|
||||
[test_document.all_unqualified.html]
|
||||
[test_domcursor.html]
|
||||
[test_domrequest.html]
|
||||
|
@ -339,7 +339,7 @@ skip-if = toolkit != 'gonk'
|
|||
[test_setting_opener.html]
|
||||
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
|
||||
[test_simplecontentpolicy.html]
|
||||
skip-if = e10s || buildapp == 'b2g'
|
||||
skip-if = e10s || buildapp == 'b2g' # Bug 1156489.
|
||||
[test_url.html]
|
||||
[test_url_data.html]
|
||||
[test_url_empty_port.html]
|
||||
|
@ -372,7 +372,7 @@ skip-if = toolkit != 'gonk'
|
|||
[test_XHRDocURI.html]
|
||||
[test_XHRResponseURL.html]
|
||||
[test_XHRSendData.html]
|
||||
skip-if = buildapp == 'b2g' || e10s # b2g(seems to stall) b2g-debug(seems to stall) b2g-desktop(seems to stall)
|
||||
skip-if = buildapp == 'b2g' || e10s # b2g(seems to stall) b2g-debug(seems to stall) b2g-desktop(seems to stall) e10s(Bug 1220304 - Creates a file)
|
||||
[test_XHR_anon.html]
|
||||
[test_XHR_header.html]
|
||||
[test_XHR_onuploadprogress.html]
|
||||
|
|
|
@ -194,6 +194,10 @@ DOMInterfaces = {
|
|||
'nativeType': 'mozilla::dom::bluetooth::BluetoothManager',
|
||||
},
|
||||
|
||||
'BluetoothObexAuthHandle': {
|
||||
'nativeType': 'mozilla::dom::bluetooth::BluetoothObexAuthHandle',
|
||||
},
|
||||
|
||||
'BluetoothPairingHandle': {
|
||||
'nativeType': 'mozilla::dom::bluetooth::BluetoothPairingHandle',
|
||||
},
|
||||
|
@ -489,6 +493,11 @@ DOMInterfaces = {
|
|||
'nativeType': 'mozilla::dom::workers::ExtendableEvent',
|
||||
},
|
||||
|
||||
'ExtendableMessageEvent': {
|
||||
'headerFile': 'mozilla/dom/ServiceWorkerEvents.h',
|
||||
'nativeType': 'mozilla::dom::workers::ExtendableMessageEvent',
|
||||
},
|
||||
|
||||
'FetchEvent': {
|
||||
'headerFile': 'ServiceWorkerEvents.h',
|
||||
'nativeType': 'mozilla::dom::workers::FetchEvent',
|
||||
|
|
|
@ -87,9 +87,12 @@ BluetoothMapSmsManager::HandleShutdown()
|
|||
sMapSmsManager = nullptr;
|
||||
}
|
||||
|
||||
BluetoothMapSmsManager::BluetoothMapSmsManager() : mMasConnected(false),
|
||||
mMnsConnected(false),
|
||||
mNtfRequired(false)
|
||||
BluetoothMapSmsManager::BluetoothMapSmsManager()
|
||||
: mBodyRequired(false)
|
||||
, mFractionDeliverRequired(false)
|
||||
, mMasConnected(false)
|
||||
, mMnsConnected(false)
|
||||
, mNtfRequired(false)
|
||||
{
|
||||
BuildDefaultFolderStructure();
|
||||
}
|
||||
|
@ -241,7 +244,7 @@ BluetoothMapSmsManager::MasDataHandler(UnixSocketBuffer* aMessage)
|
|||
*/
|
||||
int receivedLength = aMessage->GetSize();
|
||||
if (receivedLength < 1 || receivedLength > MAX_PACKET_LENGTH) {
|
||||
ReplyError(ObexResponseCode::BadRequest);
|
||||
SendReply(ObexResponseCode::BadRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -256,23 +259,23 @@ BluetoothMapSmsManager::MasDataHandler(UnixSocketBuffer* aMessage)
|
|||
// [Headers:var]
|
||||
if (receivedLength < 7 ||
|
||||
!ParseHeaders(&data[7], receivedLength - 7, &pktHeaders)) {
|
||||
ReplyError(ObexResponseCode::BadRequest);
|
||||
SendReply(ObexResponseCode::BadRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
// "Establishing an OBEX Session"
|
||||
// The OBEX header target shall equal to MAS obex target UUID.
|
||||
if (!CompareHeaderTarget(pktHeaders)) {
|
||||
ReplyError(ObexResponseCode::BadRequest);
|
||||
SendReply(ObexResponseCode::BadRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
mRemoteMaxPacketLength = BigEndian::readUint16(&data[5]);
|
||||
|
||||
if (mRemoteMaxPacketLength < 255) {
|
||||
if (mRemoteMaxPacketLength < kObexLeastMaxSize) {
|
||||
BT_LOGR("Remote maximum packet length %d", mRemoteMaxPacketLength);
|
||||
mRemoteMaxPacketLength = 0;
|
||||
ReplyError(ObexResponseCode::BadRequest);
|
||||
SendReply(ObexResponseCode::BadRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -286,7 +289,7 @@ BluetoothMapSmsManager::MasDataHandler(UnixSocketBuffer* aMessage)
|
|||
// [opcode:1][length:2][Headers:var]
|
||||
if (receivedLength < 3 ||
|
||||
!ParseHeaders(&data[3], receivedLength - 3, &pktHeaders)) {
|
||||
ReplyError(ObexResponseCode::BadRequest);
|
||||
SendReply(ObexResponseCode::BadRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -298,13 +301,13 @@ BluetoothMapSmsManager::MasDataHandler(UnixSocketBuffer* aMessage)
|
|||
// [opcode:1][length:2][flags:1][contants:1][Headers:var]
|
||||
if (receivedLength < 5 ||
|
||||
!ParseHeaders(&data[5], receivedLength - 5, &pktHeaders)) {
|
||||
ReplyError(ObexResponseCode::BadRequest);
|
||||
SendReply(ObexResponseCode::BadRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t response = SetPath(data[3], pktHeaders);
|
||||
if (response != ObexResponseCode::Success) {
|
||||
ReplyError(response);
|
||||
SendReply(response);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -317,7 +320,7 @@ BluetoothMapSmsManager::MasDataHandler(UnixSocketBuffer* aMessage)
|
|||
// [opcode:1][length:2][Headers:var]
|
||||
if (receivedLength < 3 ||
|
||||
!ParseHeaders(&data[3], receivedLength - 3, &pktHeaders)) {
|
||||
ReplyError(ObexResponseCode::BadRequest);
|
||||
SendReply(ObexResponseCode::BadRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -339,27 +342,42 @@ BluetoothMapSmsManager::MasDataHandler(UnixSocketBuffer* aMessage)
|
|||
break;
|
||||
case ObexRequestCode::Get:
|
||||
case ObexRequestCode::GetFinal: {
|
||||
// [opcode:1][length:2][Headers:var]
|
||||
if (receivedLength < 3 ||
|
||||
/* When |mDataStream| requires multiple response packets to complete,
|
||||
* the client should continue to issue GET requests until the final body
|
||||
* information (i.e., End-of-Body header) arrives, along with
|
||||
* ObexResponseCode::Success
|
||||
*/
|
||||
if (mDataStream) {
|
||||
nsAutoArrayPtr<uint8_t> res(new uint8_t[mRemoteMaxPacketLength]);
|
||||
if (!ReplyToGetWithHeaderBody(res.get(), kObexRespHeaderSize)) {
|
||||
BT_LOGR("Failed to reply to MAP GET request.");
|
||||
SendReply(ObexResponseCode::InternalServerError);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// [opcode:1][length:2][Headers:var]
|
||||
if (receivedLength < 3 ||
|
||||
!ParseHeaders(&data[3], receivedLength - 3, &pktHeaders)) {
|
||||
ReplyError(ObexResponseCode::BadRequest);
|
||||
return;
|
||||
}
|
||||
pktHeaders.GetContentType(type);
|
||||
if (type.EqualsLiteral("x-obex/folder-listing")) {
|
||||
HandleSmsMmsFolderListing(pktHeaders);
|
||||
} else if (type.EqualsLiteral("x-bt/MAP-msg-listing")) {
|
||||
HandleSmsMmsMsgListing(pktHeaders);
|
||||
} else if (type.EqualsLiteral("x-bt/message")) {
|
||||
HandleSmsMmsGetMessage(pktHeaders);
|
||||
} else {
|
||||
BT_LOGR("Unknown MAP request type: %s",
|
||||
NS_ConvertUTF16toUTF8(type).get());
|
||||
}
|
||||
SendReply(ObexResponseCode::BadRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
pktHeaders.GetContentType(type);
|
||||
if (type.EqualsLiteral("x-obex/folder-listing")) {
|
||||
HandleSmsMmsFolderListing(pktHeaders);
|
||||
} else if (type.EqualsLiteral("x-bt/MAP-msg-listing")) {
|
||||
HandleSmsMmsMsgListing(pktHeaders);
|
||||
} else if (type.EqualsLiteral("x-bt/message")) {
|
||||
HandleSmsMmsGetMessage(pktHeaders);
|
||||
} else {
|
||||
BT_LOGR("Unknown MAP request type: %s",
|
||||
NS_ConvertUTF16toUTF8(type).get());
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ReplyError(ObexResponseCode::NotImplemented);
|
||||
SendReply(ObexResponseCode::NotImplemented);
|
||||
BT_LOGR("Unrecognized ObexRequestCode %x", opCode);
|
||||
break;
|
||||
}
|
||||
|
@ -471,6 +489,9 @@ void
|
|||
BluetoothMapSmsManager::AfterMapSmsDisconnected()
|
||||
{
|
||||
mMasConnected = false;
|
||||
mBodyRequired = false;
|
||||
mFractionDeliverRequired = false;
|
||||
|
||||
// To ensure we close MNS connection
|
||||
DestroyMnsObexConnection();
|
||||
}
|
||||
|
@ -543,6 +564,81 @@ BluetoothMapSmsManager::ReplyToSetPath()
|
|||
SendMasObexData(req, ObexResponseCode::Success, index);
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothMapSmsManager::ReplyToGetWithHeaderBody(uint8_t* aResponse,
|
||||
unsigned int aIndex)
|
||||
{
|
||||
if (!mMasConnected) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This response consists of following parts:
|
||||
* - Part 1: [response code:1][length:2]
|
||||
* - Part 2a: [headerId:1][length:2][EndOfBody:0]
|
||||
* or
|
||||
* - Part 2b: [headerId:1][length:2][Body:var]
|
||||
*/
|
||||
// ---- Part 1: [response code:1][length:2] ---- //
|
||||
// [response code:1][length:2] will be set in |SendObexData|.
|
||||
// Reserve index for them here
|
||||
uint64_t bytesAvailable = 0;
|
||||
nsresult rv = mDataStream->Available(&bytesAvailable);
|
||||
if (NS_FAILED(rv)) {
|
||||
BT_LOGR("Failed to get available bytes from input stream. rv=0x%x",
|
||||
static_cast<uint32_t>(rv));
|
||||
return false;
|
||||
}
|
||||
|
||||
/* In practice, some platforms can only handle zero length End-of-Body
|
||||
* header separately with Body header.
|
||||
* Thus, append End-of-Body only if the data stream had been sent out,
|
||||
* otherwise, send 'Continue' to request for next GET request.
|
||||
*/
|
||||
unsigned int opcode;
|
||||
if (!bytesAvailable) {
|
||||
// ---- Part 2a: [headerId:1][length:2][EndOfBody:0] ---- //
|
||||
aIndex += AppendHeaderEndOfBody(&aResponse[aIndex]);
|
||||
|
||||
// Close input stream
|
||||
mDataStream->Close();
|
||||
mDataStream = nullptr;
|
||||
|
||||
opcode = ObexResponseCode::Success;
|
||||
} else {
|
||||
// ---- Part 2b: [headerId:1][length:2][Body:var] ---- //
|
||||
MOZ_ASSERT(mDataStream);
|
||||
|
||||
// Compute remaining packet size to append Body, excluding Body's header
|
||||
uint32_t remainingPacketSize =
|
||||
mRemoteMaxPacketLength - kObexBodyHeaderSize - aIndex;
|
||||
|
||||
// Read blob data from input stream
|
||||
uint32_t numRead = 0;
|
||||
nsAutoArrayPtr<char> buf(new char[remainingPacketSize]);
|
||||
nsresult rv = mDataStream->Read(buf, remainingPacketSize, &numRead);
|
||||
if (NS_FAILED(rv)) {
|
||||
BT_LOGR("Failed to read from input stream. rv=0x%x",
|
||||
static_cast<uint32_t>(rv));
|
||||
return false;
|
||||
}
|
||||
|
||||
// |numRead| must be non-zero
|
||||
MOZ_ASSERT(numRead);
|
||||
|
||||
aIndex += AppendHeaderBody(&aResponse[aIndex],
|
||||
remainingPacketSize,
|
||||
reinterpret_cast<uint8_t*>(buf.get()),
|
||||
numRead);
|
||||
|
||||
opcode = ObexResponseCode::Continue;
|
||||
}
|
||||
|
||||
SendMasObexData(aResponse, opcode, aIndex);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothMapSmsManager::ReplyToPut()
|
||||
{
|
||||
|
@ -568,10 +664,10 @@ BluetoothMapSmsManager::ReplyToFolderListing(long aMasId,
|
|||
|
||||
bool
|
||||
BluetoothMapSmsManager::ReplyToMessagesListing(BlobParent* aActor,
|
||||
long aMasId,
|
||||
bool aNewMessage,
|
||||
const nsAString& aTimestamp,
|
||||
int aSize)
|
||||
long aMasId,
|
||||
bool aNewMessage,
|
||||
const nsAString& aTimestamp,
|
||||
int aSize)
|
||||
{
|
||||
RefPtr<BlobImpl> impl = aActor->GetBlobImpl();
|
||||
RefPtr<Blob> blob = Blob::Create(nullptr, impl);
|
||||
|
@ -586,8 +682,74 @@ BluetoothMapSmsManager::ReplyToMessagesListing(Blob* aBlob, long aMasId,
|
|||
const nsAString& aTimestamp,
|
||||
int aSize)
|
||||
{
|
||||
// TODO: Implement in Bug 1211769
|
||||
return false;
|
||||
/* If the response code is 0x90 or 0xA0, response consists of following parts:
|
||||
* - Part 1: [response code:1][length:2]
|
||||
* - Part 2: [headerId:1][length:2][appParam:var]
|
||||
* where [appParam:var] includes:
|
||||
* [NewMessage:3] = [tagId:1][length:1][value:1]
|
||||
* [MseTime:var] = [tagId:1][length:1][value:var]
|
||||
* [MessageListingSize:4] = [tagId:1][length:1][value:2]
|
||||
* If mBodyRequired is true,
|
||||
* - Part 3: [headerId:1][length:2][Body:var]
|
||||
*/
|
||||
// ---- 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]);
|
||||
unsigned int index = kObexRespHeaderSize;
|
||||
|
||||
// ---- Part 2: headerId:1][length:2][appParam:var] ---- //
|
||||
// MSETime - String with the current time basis and UTC-offset of the MSE
|
||||
nsCString timestampStr = NS_ConvertUTF16toUTF8(aTimestamp);
|
||||
const uint8_t* str = reinterpret_cast<const uint8_t*>(timestampStr.get());
|
||||
uint8_t len = timestampStr.Length();
|
||||
|
||||
// Total length: [NewMessage:3] + [MseTime:var] + [MessageListingSize:4]
|
||||
nsAutoArrayPtr<uint8_t> appParameters(new uint8_t[len + 9]);
|
||||
uint8_t newMessage = aNewMessage ? 1 : 0;
|
||||
|
||||
AppendAppParameter(appParameters,
|
||||
3,
|
||||
(uint8_t) Map::AppParametersTagId::NewMessage,
|
||||
&newMessage,
|
||||
sizeof(newMessage));
|
||||
|
||||
AppendAppParameter(appParameters + 3,
|
||||
len + 2,
|
||||
(uint8_t) Map::AppParametersTagId::MSETime,
|
||||
str,
|
||||
len);
|
||||
|
||||
uint8_t msgListingSize[2];
|
||||
BigEndian::writeUint16(&msgListingSize[0], aSize);
|
||||
|
||||
AppendAppParameter(appParameters + 5 + len,
|
||||
4,
|
||||
(uint8_t) Map::AppParametersTagId::MessagesListingSize,
|
||||
msgListingSize,
|
||||
sizeof(msgListingSize));
|
||||
|
||||
index += AppendHeaderAppParameters(res + index,
|
||||
mRemoteMaxPacketLength,
|
||||
appParameters,
|
||||
len + 9);
|
||||
|
||||
if (mBodyRequired) {
|
||||
// Open input stream only if |mBodyRequired| is true
|
||||
if (!GetInputStreamFromBlob(aBlob)) {
|
||||
SendReply(ObexResponseCode::InternalServerError);
|
||||
return false;
|
||||
}
|
||||
|
||||
// ---- Part 3: [headerId:1][length:2][Body:var] ---- //
|
||||
ReplyToGetWithHeaderBody(res, index);
|
||||
// Reset flag
|
||||
mBodyRequired = false;
|
||||
} else {
|
||||
SendMasObexData(res, ObexResponseCode::Success, index);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -602,29 +764,103 @@ BluetoothMapSmsManager::ReplyToGetMessage(BlobParent* aActor, long aMasId)
|
|||
bool
|
||||
BluetoothMapSmsManager::ReplyToGetMessage(Blob* aBlob, long aMasId)
|
||||
{
|
||||
// TODO: Implement in Bug 1211769
|
||||
return false;
|
||||
if (!GetInputStreamFromBlob(aBlob)) {
|
||||
SendReply(ObexResponseCode::InternalServerError);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the response code is 0x90 or 0xA0, response consists of following parts:
|
||||
* - Part 1: [response code:1][length:2]
|
||||
* If mFractionDeliverRequired is true,
|
||||
* - Part 2: [headerId:1][length:2][appParameters:3]
|
||||
* - Part 3: [headerId:1][length:2][Body:var]
|
||||
* where [appParameters] includes:
|
||||
* [FractionDeliver:3] = [tagId:1][length:1][value: 1]
|
||||
* otherwise,
|
||||
* - Part 2: [headerId:1][length:2][appParameters:3]
|
||||
*/
|
||||
// ---- 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]);
|
||||
unsigned int index = kObexRespHeaderSize;
|
||||
|
||||
if (mFractionDeliverRequired) {
|
||||
// ---- Part 2: [headerId:1][length:2][appParam:3] ---- //
|
||||
uint8_t appParameters[3];
|
||||
// TODO: Support FractionDeliver, reply "1(last)" now.
|
||||
uint8_t fractionDeliver = 1;
|
||||
AppendAppParameter(appParameters,
|
||||
sizeof(appParameters),
|
||||
(uint8_t) Map::AppParametersTagId::FractionDeliver,
|
||||
&fractionDeliver,
|
||||
sizeof(fractionDeliver));
|
||||
|
||||
index += AppendHeaderAppParameters(res + index,
|
||||
mRemoteMaxPacketLength,
|
||||
appParameters,
|
||||
sizeof(appParameters));
|
||||
}
|
||||
|
||||
// TODO: Support bMessage encoding in bug 1166652.
|
||||
// ---- Part 3: [headerId:1][length:2][Body:var] ---- //
|
||||
ReplyToGetWithHeaderBody(res.get(), index);
|
||||
mFractionDeliverRequired = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothMapSmsManager::ReplyToSendMessage(
|
||||
long aMasId, const nsAString& aHandleId, bool aStatus)
|
||||
{
|
||||
if (!aStatus) {
|
||||
SendReply(ObexResponseCode::InternalServerError);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Handle is mandatory if the response code is success (0x90 or 0xA0).
|
||||
* The Name header shall be used to contain the handle that was assigned by
|
||||
* the MSE device to the message that was pushed by the MCE device.
|
||||
* The handle shall be represented by a null-terminated Unicode text strings
|
||||
* with 16 hexadecimal digits.
|
||||
*/
|
||||
int len = aHandleId.Length();
|
||||
nsAutoArrayPtr<uint8_t> handleId(new uint8_t[(len + 1) * 2]);
|
||||
const char16_t* handleIdPtr = aHandleId.BeginReading();
|
||||
|
||||
for (int i = 0; i < len; i++) {
|
||||
*(handleId + (i * 2)) = (uint8_t)(handleIdPtr[i] >> 8);
|
||||
*(handleId + (i * 2 + 1)) = (uint8_t)handleIdPtr[i];
|
||||
}
|
||||
|
||||
*(handleId + (len * 2)) = 0x00;
|
||||
*(handleId + (len * 2 + 1)) = 0x00;
|
||||
|
||||
nsAutoArrayPtr<uint8_t> res(new uint8_t[mRemoteMaxPacketLength]);
|
||||
int index = kObexRespHeaderSize;
|
||||
index += AppendHeaderName(res + index, mRemoteMaxPacketLength - index,
|
||||
handleId, (len + 1) * 2);
|
||||
SendMasObexData(res.get(), ObexResponseCode::Success, index);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothMapSmsManager::ReplyToSetMessageStatus(long aMasId, bool aStatus)
|
||||
{
|
||||
// TODO: Implement in Bug 1211769
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothMapSmsManager::ReplyToSendMessage(long aMasId, bool aStatus)
|
||||
{
|
||||
// TODO: Implement in Bug 1211769
|
||||
return false;
|
||||
SendReply(aStatus ? ObexResponseCode::Success :
|
||||
ObexResponseCode::InternalServerError);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothMapSmsManager::ReplyToMessageUpdate(long aMasId, bool aStatus)
|
||||
{
|
||||
// TODO: Implement in Bug 1211769
|
||||
return false;
|
||||
SendReply(aStatus ? ObexResponseCode::Success :
|
||||
ObexResponseCode::InternalServerError);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -768,6 +1004,12 @@ BluetoothMapSmsManager::AppendBtNamedValueByTagId(
|
|||
switch (aTagId) {
|
||||
case Map::AppParametersTagId::MaxListCount: {
|
||||
uint16_t maxListCount = BigEndian::readUint16(buf);
|
||||
/* MAP specification 5.4.3.1/5.5.4.1
|
||||
* If MaxListCount = 0, the response shall not contain the Body header.
|
||||
* The MSE shall ignore the request-parameters "ListStartOffset",
|
||||
* "SubjectLength" and "ParameterMask".
|
||||
*/
|
||||
mBodyRequired = (maxListCount != 0);
|
||||
BT_LOGR("max list count: %d", maxListCount);
|
||||
AppendNamedValue(aValues, "maxListCount",
|
||||
static_cast<uint32_t>(maxListCount));
|
||||
|
@ -787,12 +1029,8 @@ BluetoothMapSmsManager::AppendBtNamedValueByTagId(
|
|||
break;
|
||||
}
|
||||
case Map::AppParametersTagId::ParameterMask: {
|
||||
/* Table 6.5, MAP 6.3.1. ParameterMask is Bit 16-31 Reserved for future
|
||||
* use. The reserved bits shall be set to 0 by MCE and discarded by MSE.
|
||||
*/
|
||||
uint32_t parameterMask = BigEndian::readUint32(buf);
|
||||
BT_LOGR("msg parameterMask : %d", parameterMask);
|
||||
AppendNamedValue(aValues, "parameterMask", parameterMask);
|
||||
InfallibleTArray<uint32_t> parameterMask = PackParameterMask(buf, 64);
|
||||
AppendNamedValue(aValues, "parameterMask", BluetoothValue(parameterMask));
|
||||
break;
|
||||
}
|
||||
case Map::AppParametersTagId::FilterMessageType: {
|
||||
|
@ -890,6 +1128,11 @@ BluetoothMapSmsManager::AppendBtNamedValueByTagId(
|
|||
AppendNamedValue(aValues, "charset", filterCharset);
|
||||
break;
|
||||
}
|
||||
case Map::AppParametersTagId::FractionRequest: {
|
||||
mFractionDeliverRequired = true;
|
||||
AppendNamedValue(aValues, "fractionRequest", (buf[0] != 0));
|
||||
break;
|
||||
}
|
||||
case Map::AppParametersTagId::StatusIndicator: {
|
||||
using namespace mozilla::dom::StatusIndicatorsValues;
|
||||
uint32_t filterStatusIndicator =
|
||||
|
@ -925,6 +1168,30 @@ BluetoothMapSmsManager::AppendBtNamedValueByTagId(
|
|||
}
|
||||
}
|
||||
|
||||
InfallibleTArray<uint32_t>
|
||||
BluetoothMapSmsManager::PackParameterMask(uint8_t* aData, int aSize)
|
||||
{
|
||||
InfallibleTArray<uint32_t> parameterMask;
|
||||
|
||||
/* Table 6.5, MAP 6.3.1. ParameterMask is Bit 16-31 Reserved for future
|
||||
* use. The reserved bits shall be set to 0 by MCE and discarded by MSE.
|
||||
* convert big endian to little endian
|
||||
*/
|
||||
uint32_t x = BigEndian::readUint32(aData);
|
||||
|
||||
uint32_t count = 0;
|
||||
while (x) {
|
||||
if (x & 1) {
|
||||
parameterMask.AppendElement(count);
|
||||
}
|
||||
|
||||
++count;
|
||||
x >>= 1;
|
||||
}
|
||||
|
||||
return parameterMask;
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothMapSmsManager::HandleSmsMmsMsgListing(const ObexHeaderSet& aHeader)
|
||||
{
|
||||
|
@ -974,6 +1241,8 @@ BluetoothMapSmsManager::HandleSmsMmsGetMessage(const ObexHeaderSet& aHeader)
|
|||
Map::AppParametersTagId::Attachment);
|
||||
AppendBtNamedValueByTagId(aHeader, data,
|
||||
Map::AppParametersTagId::Charset);
|
||||
AppendBtNamedValueByTagId(aHeader, data,
|
||||
Map::AppParametersTagId::FractionRequest);
|
||||
|
||||
bs->DistributeSignal(NS_LITERAL_STRING(MAP_GET_MESSAGE_REQ_ID),
|
||||
NS_LITERAL_STRING(KEY_ADAPTER),
|
||||
|
@ -1147,17 +1416,35 @@ BluetoothMapSmsManager::HandleSmsMmsPushMessage(const ObexHeaderSet& aHeader)
|
|||
NS_LITERAL_STRING(KEY_ADAPTER), data);
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothMapSmsManager::ReplyError(uint8_t aError)
|
||||
bool
|
||||
BluetoothMapSmsManager::GetInputStreamFromBlob(Blob* aBlob)
|
||||
{
|
||||
BT_LOGR("[0x%x]", aError);
|
||||
if (mDataStream) {
|
||||
mDataStream->Close();
|
||||
mDataStream = nullptr;
|
||||
}
|
||||
|
||||
ErrorResult rv;
|
||||
aBlob->GetInternalStream(getter_AddRefs(mDataStream), rv);
|
||||
if (rv.Failed()) {
|
||||
BT_LOGR("Failed to get internal stream from blob. rv=0x%x",
|
||||
rv.ErrorCodeAsInt());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothMapSmsManager::SendReply(uint8_t aResponseCode)
|
||||
{
|
||||
BT_LOGR("[0x%x]", aResponseCode);
|
||||
|
||||
// Section 3.2 "Response Format", IrOBEX 1.2
|
||||
// [opcode:1][length:2][Headers:var]
|
||||
uint8_t req[255];
|
||||
int index = 3;
|
||||
uint8_t req[3];
|
||||
|
||||
SendMasObexData(req, aError, index);
|
||||
SendMasObexData(req, aResponseCode, 3);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1217,6 +1504,11 @@ BluetoothMapSmsManager::OnSocketDisconnect(BluetoothSocket* aSocket)
|
|||
{
|
||||
MOZ_ASSERT(aSocket);
|
||||
|
||||
if (mDataStream) {
|
||||
mDataStream->Close();
|
||||
mDataStream = nullptr;
|
||||
}
|
||||
|
||||
// MNS socket is disconnected
|
||||
if (aSocket == mMnsSocket) {
|
||||
mMnsConnected = false;
|
||||
|
|
|
@ -168,12 +168,14 @@ public:
|
|||
* Reply to the *in-process* 'sendmessage' request.
|
||||
*
|
||||
* @param aMasId [in] MAS id
|
||||
* @param aHandleId [in] Handle id
|
||||
* @param aStatus [in] success or failure
|
||||
*
|
||||
* @return true if the response packet has been packed correctly and started
|
||||
* to be sent to the remote device; false otherwise.
|
||||
*/
|
||||
bool ReplyToSendMessage(long aMasId, bool aStatus);
|
||||
bool ReplyToSendMessage(
|
||||
long aMasId, const nsAString& aHandleId , bool aStatus);
|
||||
|
||||
/**
|
||||
* Reply to the *in-process* 'messageupdate' request.
|
||||
|
@ -196,9 +198,17 @@ private:
|
|||
|
||||
void ReplyToConnect();
|
||||
void ReplyToDisconnectOrAbort();
|
||||
|
||||
/*
|
||||
* This function replies to Get request with Header Body, in case of a GET
|
||||
* operation returning an object that is too big to fit in one response
|
||||
* 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);
|
||||
void ReplyToSetPath();
|
||||
void ReplyToPut();
|
||||
void ReplyError(uint8_t aError);
|
||||
void SendReply(uint8_t aResponse);
|
||||
|
||||
void HandleNotificationRegistration(const ObexHeaderSet& aHeader);
|
||||
void HandleEventReport(const ObexHeaderSet& aHeader);
|
||||
|
@ -213,6 +223,7 @@ private:
|
|||
const Map::AppParametersTagId aTagId);
|
||||
void SendMasObexData(uint8_t* aData, uint8_t aOpcode, int aSize);
|
||||
void SendMnsObexData(uint8_t* aData, uint8_t aOpcode, int aSize);
|
||||
bool StatusResponse(bool aStatus);
|
||||
|
||||
uint8_t SetPath(uint8_t flags, const ObexHeaderSet& aHeader);
|
||||
bool CompareHeaderTarget(const ObexHeaderSet& aHeader);
|
||||
|
@ -224,6 +235,9 @@ private:
|
|||
void SendMnsDisconnectRequest();
|
||||
void MnsDataHandler(mozilla::ipc::UnixSocketBuffer* aMessage);
|
||||
void MasDataHandler(mozilla::ipc::UnixSocketBuffer* aMessage);
|
||||
bool GetInputStreamFromBlob(Blob* aBlob);
|
||||
InfallibleTArray<uint32_t> PackParameterMask(uint8_t* aData, int aSize);
|
||||
|
||||
/*
|
||||
* Build mandatory folders
|
||||
*/
|
||||
|
@ -238,11 +252,16 @@ private:
|
|||
* Record the last command
|
||||
*/
|
||||
int mLastCommand;
|
||||
// Whether header body is required for the current MessagesListing response.
|
||||
bool mBodyRequired;
|
||||
// Whether FractionDeliver is required for the current GetMessage response
|
||||
bool mFractionDeliverRequired;
|
||||
// MAS OBEX session status. Set when MAS OBEX session is established.
|
||||
bool mMasConnected;
|
||||
// MNS OBEX session status. Set when MNS OBEX session is established.
|
||||
bool mMnsConnected;
|
||||
bool mNtfRequired;
|
||||
|
||||
BluetoothAddress mDeviceAddress;
|
||||
unsigned int mRemoteMaxPacketLength;
|
||||
|
||||
|
@ -261,6 +280,11 @@ private:
|
|||
|
||||
int mBodySegmentLength;
|
||||
nsAutoArrayPtr<uint8_t> mBodySegment;
|
||||
|
||||
/**
|
||||
* The bMessage/message-listing data stream for current processing response
|
||||
*/
|
||||
nsCOMPtr<nsIInputStream> mDataStream;
|
||||
};
|
||||
|
||||
END_BLUETOOTH_NAMESPACE
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "nsIInputStream.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsNetCID.h"
|
||||
|
||||
USING_BLUETOOTH_NAMESPACE
|
||||
using namespace mozilla;
|
||||
|
@ -241,6 +242,18 @@ BluetoothPbapManager::ReceiveSocketData(BluetoothSocket* aSocket,
|
|||
return;
|
||||
}
|
||||
|
||||
// Section 3.5 "Authentication Procedure", IrOBEX 1.2
|
||||
// An user input password is required to reply to authentication
|
||||
// challenge. The OBEX success response will be sent after gaia
|
||||
// replies correct password.
|
||||
if (pktHeaders.Has(ObexHeaderId::AuthChallenge)) {
|
||||
ObexResponseCode response = NotifyPasswordRequest(pktHeaders);
|
||||
if (response != ObexResponseCode::Success) {
|
||||
ReplyError(response);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Save the max packet length from remote information
|
||||
mRemoteMaxPacketLength = BigEndian::readUint16(&data[5]);
|
||||
|
||||
|
@ -499,6 +512,51 @@ BluetoothPbapManager::NotifyPbapRequest(const ObexHeaderSet& aHeader)
|
|||
return ObexResponseCode::Success;
|
||||
}
|
||||
|
||||
ObexResponseCode
|
||||
BluetoothPbapManager::NotifyPasswordRequest(const ObexHeaderSet& aHeader)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(aHeader.Has(ObexHeaderId::AuthChallenge));
|
||||
|
||||
// Get authentication challenge data
|
||||
int dataLength;
|
||||
nsAutoArrayPtr<uint8_t> dataPtr;
|
||||
aHeader.GetAuthChallenge(dataPtr, &dataLength);
|
||||
|
||||
// Get nonce from authentication challenge
|
||||
// Section 3.5.1 "Digest Challenge", IrOBEX spec 1.2
|
||||
// The tag-length-value triplet of nonce is
|
||||
// [tagId:1][length:1][nonce:16]
|
||||
uint8_t offset = 0;
|
||||
do {
|
||||
uint8_t tagId = dataPtr[offset++];
|
||||
uint8_t length = dataPtr[offset++];
|
||||
|
||||
BT_LOGR("AuthChallenge header includes tagId %d", tagId);
|
||||
if (tagId == ObexDigestChallenge::Nonce) {
|
||||
memcpy(mRemoteNonce, &dataPtr[offset], DIGEST_LENGTH);
|
||||
}
|
||||
|
||||
offset += length;
|
||||
} while (offset < dataLength);
|
||||
|
||||
// Ensure bluetooth service is available
|
||||
BluetoothService* bs = BluetoothService::Get();
|
||||
if (!bs) {
|
||||
return ObexResponseCode::PreconditionFailed;
|
||||
}
|
||||
|
||||
// Notify gaia of authentiation challenge
|
||||
// TODO: Append realm if 1) gaia needs to display it and
|
||||
// 2) it's in authenticate challenge header
|
||||
InfallibleTArray<BluetoothNamedValue> props;
|
||||
bs->DistributeSignal(NS_LITERAL_STRING(OBEX_PASSWORD_REQ_ID),
|
||||
NS_LITERAL_STRING(KEY_ADAPTER),
|
||||
props);
|
||||
|
||||
return ObexResponseCode::Success;
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothPbapManager::AppendNamedValueByTagId(
|
||||
const ObexHeaderSet& aHeader,
|
||||
|
@ -660,7 +718,7 @@ BluetoothPbapManager::GetAddress(BluetoothAddress& aDeviceAddress)
|
|||
}
|
||||
|
||||
void
|
||||
BluetoothPbapManager::ReplyToConnect()
|
||||
BluetoothPbapManager::ReplyToConnect(const nsAString& aPassword)
|
||||
{
|
||||
if (mConnected) {
|
||||
return;
|
||||
|
@ -683,9 +741,69 @@ BluetoothPbapManager::ReplyToConnect()
|
|||
kPbapObexTarget.mUuid, sizeof(BluetoothUuid));
|
||||
index += AppendHeaderConnectionId(&res[index], 0x01);
|
||||
|
||||
// Authentication response
|
||||
if (!aPassword.IsEmpty()) {
|
||||
// Section 3.5.2.1 "Request-digest", PBAP 1.2
|
||||
// The request-digest is required and calculated as follows:
|
||||
// H(nonce ":" password)
|
||||
uint32_t hashStringLength = DIGEST_LENGTH + aPassword.Length() + 1;
|
||||
nsAutoArrayPtr<char> hashString(new char[hashStringLength]);
|
||||
|
||||
memcpy(hashString, mRemoteNonce, DIGEST_LENGTH);
|
||||
hashString[DIGEST_LENGTH] = ':';
|
||||
memcpy(&hashString[DIGEST_LENGTH + 1],
|
||||
NS_ConvertUTF16toUTF8(aPassword).get(),
|
||||
aPassword.Length());
|
||||
MD5Hash(hashString, hashStringLength);
|
||||
|
||||
// 2 tag-length-value triplets: <request-digest:16><nonce:16>
|
||||
uint8_t digestResponse[(DIGEST_LENGTH + 2) * 2];
|
||||
int offset = AppendAppParameter(digestResponse, sizeof(digestResponse),
|
||||
ObexDigestResponse::ReqDigest,
|
||||
mHashRes, DIGEST_LENGTH);
|
||||
offset += AppendAppParameter(&digestResponse[offset],
|
||||
sizeof(digestResponse) - offset,
|
||||
ObexDigestResponse::NonceChallenged,
|
||||
mRemoteNonce, DIGEST_LENGTH);
|
||||
|
||||
index += AppendAuthResponse(&res[index], kObexLeastMaxSize - index,
|
||||
digestResponse, offset);
|
||||
}
|
||||
|
||||
SendObexData(res, ObexResponseCode::Success, index);
|
||||
}
|
||||
|
||||
nsresult
|
||||
BluetoothPbapManager::MD5Hash(char *buf, uint32_t len)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
// Cache a reference to the nsICryptoHash instance since we'll be calling
|
||||
// this function frequently.
|
||||
if (!mVerifier) {
|
||||
mVerifier = do_CreateInstance(NS_CRYPTO_HASH_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
BT_LOGR("MD5Hash: no crypto hash!");
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
rv = mVerifier->Init(nsICryptoHash::MD5);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = mVerifier->Update((unsigned char*)buf, len);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsAutoCString hashString;
|
||||
rv = mVerifier->Finish(false, hashString);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
NS_ENSURE_STATE(hashString.Length() == sizeof(mHashRes));
|
||||
memcpy(mHashRes, hashString.get(), hashString.Length());
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothPbapManager::ReplyToDisconnectOrAbort()
|
||||
{
|
||||
|
@ -742,6 +860,18 @@ BluetoothPbapManager::PackPropertiesMask(uint8_t* aData, int aSize)
|
|||
return propSelector;
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothPbapManager::ReplyToAuthChallenge(const nsAString& aPassword)
|
||||
{
|
||||
// Cancel authentication
|
||||
if (aPassword.IsEmpty()) {
|
||||
ReplyError(ObexResponseCode::Unauthorized);
|
||||
}
|
||||
|
||||
ReplyToConnect(aPassword);
|
||||
AfterPbapConnected();
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothPbapManager::ReplyToPullPhonebook(BlobParent* aActor,
|
||||
uint16_t aPhonebookSize)
|
||||
|
|
|
@ -12,8 +12,10 @@
|
|||
#include "BluetoothSocketObserver.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
|
||||
#include "mozilla/ipc/SocketBase.h"
|
||||
#include "nsICryptoHash.h"
|
||||
#include "ObexBase.h"
|
||||
|
||||
class nsICryptoHash;
|
||||
class nsIInputStream;
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -62,26 +64,36 @@ public:
|
|||
}
|
||||
|
||||
static const int MAX_PACKET_LENGTH = 0xFFFE;
|
||||
static const int DIGEST_LENGTH = 16;
|
||||
|
||||
static BluetoothPbapManager* Get();
|
||||
bool Listen();
|
||||
|
||||
/**
|
||||
* Reply vCard object to the *IPC* 'pullphonebook' request.
|
||||
* Reply to OBEX authenticate challenge with password.
|
||||
*
|
||||
* @param aActor [in] a blob actor containing the vCard objects
|
||||
* @param aPhonebookSize [in] the number of vCard indexes in the blob
|
||||
* @param aPassword [in] the password known by only client and server.
|
||||
*
|
||||
* @return true if the response packet has been packed correctly and started
|
||||
* to be sent to the remote device; false otherwise.
|
||||
*/
|
||||
void ReplyToAuthChallenge(const nsAString& aPassword);
|
||||
|
||||
/**
|
||||
* Reply vCard objects to IPC 'pullphonebook' request.
|
||||
*
|
||||
* @param aActor [in] blob actor of the vCard objects
|
||||
* @param aPhonebookSize [in] number of vCard indexes in the blob
|
||||
*
|
||||
* @return true if the response packet has been packed correctly and started
|
||||
* to be sent to the remote device; false otherwise.
|
||||
*/
|
||||
bool ReplyToPullPhonebook(BlobParent* aActor, uint16_t aPhonebookSize);
|
||||
|
||||
/**
|
||||
* Reply vCard object to the *in-process* 'pullphonebook' request.
|
||||
* Reply vCard objects to in-process 'pullphonebook' request.
|
||||
*
|
||||
* @param aBlob [in] a blob contained the vCard objects
|
||||
* @param aPhonebookSize [in] the number of vCard indexes in the blob
|
||||
* @param aBlob [in] blob of the vCard objects
|
||||
* @param aPhonebookSize [in] number of vCard indexes in the blob
|
||||
*
|
||||
* @return true if the response packet has been packed correctly and started
|
||||
* to be sent to the remote device; false otherwise.
|
||||
|
@ -89,21 +101,20 @@ public:
|
|||
bool ReplyToPullPhonebook(Blob* aBlob, uint16_t aPhonebookSize);
|
||||
|
||||
/**
|
||||
* Reply vCard object to the *IPC* 'pullvcardlisting' request.
|
||||
* Reply vCard objects to IPC 'pullvcardlisting' request.
|
||||
*
|
||||
* @param aActor [in] a blob actor containing the vCard objects
|
||||
* @param aPhonebookSize [in] the number of vCard indexes in the blob
|
||||
* @param aActor [in] blob actor of the vCard objects
|
||||
* @param aPhonebookSize [in] number of vCard indexes in the blob
|
||||
*
|
||||
* @return true if the response packet has been packed correctly and started
|
||||
* to be sent to the remote device; false otherwise.
|
||||
*/
|
||||
bool ReplyToPullvCardListing(BlobParent* aActor, uint16_t aPhonebookSize);
|
||||
|
||||
/**
|
||||
* Reply vCard object to the *in-process* 'pullvcardlisting' request.
|
||||
* Reply vCard objects to in-process 'pullvcardlisting' request.
|
||||
*
|
||||
* @param aBlob [in] a blob contained the vCard objects
|
||||
* @param aPhonebookSize [in] the number of vCard indexes in the blob
|
||||
* @param aBlob [in] blob of the vCard objects
|
||||
* @param aPhonebookSize [in] number of vCard indexes in the blob
|
||||
*
|
||||
* @return true if the response packet has been packed correctly and started
|
||||
* to be sent to the remote device; false otherwise.
|
||||
|
@ -111,19 +122,18 @@ public:
|
|||
bool ReplyToPullvCardListing(Blob* aBlob, uint16_t aPhonebookSize);
|
||||
|
||||
/**
|
||||
* Reply vCard object to the *IPC* 'pullvcardentry' request.
|
||||
* Reply vCard object to IPC 'pullvcardentry' request.
|
||||
*
|
||||
* @param aActor [in] a blob actor containing the vCard objects
|
||||
* @param aActor [in] blob actor of the vCard object
|
||||
*
|
||||
* @return true if the response packet has been packed correctly and started
|
||||
* to be sent to the remote device; false otherwise.
|
||||
*/
|
||||
bool ReplyToPullvCardEntry(BlobParent* aActor);
|
||||
|
||||
/**
|
||||
* Reply vCard object to the *in-process* 'pullvcardentry' request.
|
||||
* Reply vCard object to in-process 'pullvcardentry' request.
|
||||
*
|
||||
* @param aBlob [in] a blob contained the vCard objects
|
||||
* @param aBlob [in] blob of the vCard object
|
||||
*
|
||||
* @return true if the response packet has been packed correctly and started
|
||||
* to be sent to the remote device; false otherwise.
|
||||
|
@ -138,7 +148,7 @@ private:
|
|||
bool Init();
|
||||
void HandleShutdown();
|
||||
|
||||
void ReplyToConnect();
|
||||
void ReplyToConnect(const nsAString& aPassword = EmptyString());
|
||||
void ReplyToDisconnectOrAbort();
|
||||
void ReplyToSetPath();
|
||||
bool ReplyToGet(uint16_t aPhonebookSize = 0);
|
||||
|
@ -148,6 +158,7 @@ private:
|
|||
ObexResponseCode SetPhoneBookPath(const ObexHeaderSet& aHeader,
|
||||
uint8_t flags);
|
||||
ObexResponseCode NotifyPbapRequest(const ObexHeaderSet& aHeader);
|
||||
ObexResponseCode NotifyPasswordRequest(const ObexHeaderSet& aHeader);
|
||||
void AppendNamedValueByTagId(const ObexHeaderSet& aHeader,
|
||||
InfallibleTArray<BluetoothNamedValue>& aValues,
|
||||
const AppParameterTag aTagId);
|
||||
|
@ -159,9 +170,18 @@ private:
|
|||
bool GetInputStreamFromBlob(Blob* aBlob);
|
||||
void AfterPbapConnected();
|
||||
void AfterPbapDisconnected();
|
||||
nsresult MD5Hash(char *buf, uint32_t len); // mHashRes stores the result
|
||||
|
||||
/**
|
||||
* Whether 'PhonebookSize' is required for the OBEX response
|
||||
* The nonce for OBEX authentication procedure.
|
||||
* Its value shall differ each time remote OBEX client sends it
|
||||
*/
|
||||
uint8_t mRemoteNonce[DIGEST_LENGTH];
|
||||
uint8_t mHashRes[DIGEST_LENGTH];
|
||||
nsCOMPtr<nsICryptoHash> mVerifier;
|
||||
|
||||
/**
|
||||
* Whether phonebook size is required for OBEX response
|
||||
*/
|
||||
bool mPhonebookSizeRequired;
|
||||
|
||||
|
|
|
@ -1723,6 +1723,44 @@ BluetoothServiceBluedroid::IsScoConnected(BluetoothReplyRunnable* aRunnable)
|
|||
DispatchReplySuccess(aRunnable, BluetoothValue(hfp->IsScoConnected()));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothServiceBluedroid::SetObexPassword(const nsAString& aPassword,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
ENSURE_BLUETOOTH_IS_READY_VOID(aRunnable);
|
||||
|
||||
BluetoothPbapManager* pbap = BluetoothPbapManager::Get();
|
||||
if (!pbap) {
|
||||
DispatchReplyError(aRunnable,
|
||||
NS_LITERAL_STRING("Failed to set OBEX password"));
|
||||
return;
|
||||
}
|
||||
|
||||
pbap->ReplyToAuthChallenge(aPassword);
|
||||
DispatchReplySuccess(aRunnable);
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothServiceBluedroid::RejectObexAuth(
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
ENSURE_BLUETOOTH_IS_READY_VOID(aRunnable);
|
||||
|
||||
BluetoothPbapManager* pbap = BluetoothPbapManager::Get();
|
||||
if (!pbap) {
|
||||
DispatchReplyError(aRunnable,
|
||||
NS_LITERAL_STRING("Failed to reject OBEX authentication request"));
|
||||
return;
|
||||
}
|
||||
|
||||
pbap->ReplyToAuthChallenge(EmptyString());
|
||||
DispatchReplySuccess(aRunnable);
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothServiceBluedroid::ReplyTovCardPulling(
|
||||
BlobParent* aBlobParent,
|
||||
|
@ -1932,6 +1970,7 @@ BluetoothServiceBluedroid:: ReplyToMapSetMessageStatus(
|
|||
void
|
||||
BluetoothServiceBluedroid:: ReplyToMapSendMessage(
|
||||
long aMasId,
|
||||
const nsAString& aHandleId,
|
||||
bool aStatus,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
|
@ -1942,7 +1981,7 @@ BluetoothServiceBluedroid:: ReplyToMapSendMessage(
|
|||
return;
|
||||
}
|
||||
|
||||
map->ReplyToSendMessage(aMasId, aStatus);
|
||||
map->ReplyToSendMessage(aMasId, aHandleId, aStatus);
|
||||
DispatchReplySuccess(aRunnable);
|
||||
}
|
||||
|
||||
|
|
|
@ -147,6 +147,13 @@ public:
|
|||
virtual void
|
||||
IsScoConnected(BluetoothReplyRunnable* aRunnable);
|
||||
|
||||
virtual void
|
||||
SetObexPassword(const nsAString& aPassword,
|
||||
BluetoothReplyRunnable* aRunnable);
|
||||
|
||||
virtual void
|
||||
RejectObexAuth(BluetoothReplyRunnable* aRunnable);
|
||||
|
||||
virtual void
|
||||
ReplyTovCardPulling(BlobParent* aBlobParent,
|
||||
BlobChild* aBlobChild,
|
||||
|
@ -217,8 +224,10 @@ public:
|
|||
BluetoothReplyRunnable* aRunnable);
|
||||
|
||||
virtual void
|
||||
ReplyToMapSendMessage(
|
||||
long aMasId, bool aStatus, BluetoothReplyRunnable* aRunnable);
|
||||
ReplyToMapSendMessage(long aMasId,
|
||||
const nsAString& aHandleId,
|
||||
bool aStatus,
|
||||
BluetoothReplyRunnable* aRunnable);
|
||||
|
||||
virtual void
|
||||
ReplyToMapMessageUpdate(
|
||||
|
|
|
@ -4449,6 +4449,17 @@ BluetoothDBusService::GattClientWriteDescriptorValueInternal(
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDBusService::SetObexPassword(const nsAString& aPassword,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDBusService::RejectObexAuth(BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDBusService::ReplyTovCardPulling(
|
||||
BlobParent* aBlobParent,
|
||||
|
@ -4549,7 +4560,9 @@ BluetoothDBusService::ReplyToMapSetMessageStatus(long aMasId,
|
|||
}
|
||||
|
||||
void
|
||||
BluetoothDBusService::ReplyToMapSendMessage(long aMasId, bool aStatus,
|
||||
BluetoothDBusService::ReplyToMapSendMessage(long aMasId,
|
||||
const nsAString& aHandleId,
|
||||
bool aStatus,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -157,6 +157,13 @@ public:
|
|||
virtual void
|
||||
IsScoConnected(BluetoothReplyRunnable* aRunnable) override;
|
||||
|
||||
virtual void
|
||||
SetObexPassword(const nsAString& aPassword,
|
||||
BluetoothReplyRunnable* aRunnable) override;
|
||||
|
||||
virtual void
|
||||
RejectObexAuth(BluetoothReplyRunnable* aRunnable) override;
|
||||
|
||||
virtual void
|
||||
ReplyTovCardPulling(BlobParent* aBlobParent,
|
||||
BlobChild* aBlobChild,
|
||||
|
@ -226,6 +233,7 @@ public:
|
|||
|
||||
virtual void
|
||||
ReplyToMapSendMessage(long aMasId,
|
||||
const nsAString& aHandleId,
|
||||
bool aStatus,
|
||||
BluetoothReplyRunnable* aRunnable) override;
|
||||
|
||||
|
|
|
@ -243,6 +243,12 @@ extern bool gBluetoothDebugFlag;
|
|||
*/
|
||||
#define REQUEST_MEDIA_PLAYSTATUS_ID "requestmediaplaystatus"
|
||||
|
||||
/**
|
||||
* When receiving an OBEX authenticate challenge request from a remote device,
|
||||
* we'll dispatch an event.
|
||||
*/
|
||||
#define OBEX_PASSWORD_REQ_ID "obexpasswordreq"
|
||||
|
||||
/**
|
||||
* When receiving a PBAP request from a remote device, we'll dispatch an event.
|
||||
*/
|
||||
|
|
|
@ -310,6 +310,13 @@ public:
|
|||
virtual void
|
||||
IsScoConnected(BluetoothReplyRunnable* aRunnable) = 0;
|
||||
|
||||
virtual void
|
||||
SetObexPassword(const nsAString& aPassword,
|
||||
BluetoothReplyRunnable* aRunnable) = 0;
|
||||
|
||||
virtual void
|
||||
RejectObexAuth(BluetoothReplyRunnable* aRunnable) = 0;
|
||||
|
||||
virtual void
|
||||
ReplyTovCardPulling(BlobParent* aBlobParent,
|
||||
BlobChild* aBlobChild,
|
||||
|
@ -381,7 +388,8 @@ public:
|
|||
|
||||
virtual void
|
||||
ReplyToMapSendMessage(
|
||||
long aMasId, bool aStatus, BluetoothReplyRunnable* aRunnable) = 0;
|
||||
long aMasId, const nsAString& aHandleId, bool aStatus,
|
||||
BluetoothReplyRunnable* aRunnable) = 0;
|
||||
|
||||
virtual void
|
||||
ReplyToMapMessageUpdate(
|
||||
|
|
|
@ -77,6 +77,14 @@ AppendHeaderWho(uint8_t* aRetBuf, int aBufferSize, const uint8_t* aWho,
|
|||
aWho, aLength);
|
||||
}
|
||||
|
||||
int
|
||||
AppendAuthResponse(uint8_t* aRetBuf, int aBufferSize, const uint8_t* aDigest,
|
||||
int aLength)
|
||||
{
|
||||
return AppendHeader(ObexHeaderId::AuthResponse, aRetBuf, aBufferSize,
|
||||
aDigest, aLength);
|
||||
}
|
||||
|
||||
int
|
||||
AppendHeaderAppParameters(uint8_t* aRetBuf, int aBufferSize,
|
||||
const uint8_t* aAppParameters, int aLength)
|
||||
|
|
|
@ -124,6 +124,18 @@ enum ObexResponseCode {
|
|||
DatabaseLocked = 0xE1,
|
||||
};
|
||||
|
||||
enum ObexDigestChallenge {
|
||||
Nonce = 0x00,
|
||||
Options = 0x01,
|
||||
Realm = 0x02
|
||||
};
|
||||
|
||||
enum ObexDigestResponse {
|
||||
ReqDigest = 0x00,
|
||||
UserId = 0x01,
|
||||
NonceChallenged = 0x02
|
||||
};
|
||||
|
||||
class ObexHeader
|
||||
{
|
||||
public:
|
||||
|
@ -253,6 +265,21 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void GetAuthChallenge(nsAutoArrayPtr<uint8_t>& aRetData,
|
||||
int* aRetDataLength) const
|
||||
{
|
||||
*aRetDataLength = 0;
|
||||
|
||||
for (uint8_t i = 0; i < mHeaders.Length(); ++i) {
|
||||
if (mHeaders[i]->mId == ObexHeaderId::AuthChallenge) {
|
||||
aRetData = new uint8_t[mHeaders[i]->mDataLength];
|
||||
memcpy(aRetData, mHeaders[i]->mData, mHeaders[i]->mDataLength);
|
||||
*aRetDataLength = mHeaders[i]->mDataLength;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t GetConnectionId() const
|
||||
{
|
||||
int length = mHeaders.Length();
|
||||
|
@ -345,6 +372,8 @@ int AppendHeaderTarget(uint8_t* aRetBuf, int aBufferSize, const uint8_t* aTarget
|
|||
int aLength);
|
||||
int AppendHeaderWho(uint8_t* aRetBuf, int aBufferSize, const uint8_t* aWho,
|
||||
int aLength);
|
||||
int AppendAuthResponse(uint8_t* aRetBuf, int aBufferSize,
|
||||
const uint8_t* aDigest, int aLength);
|
||||
int AppendHeaderAppParameters(uint8_t* aRetBuf, int aBufferSize,
|
||||
const uint8_t* aAppParameters, int aLength);
|
||||
int AppendAppParameter(uint8_t* aRetBuf, int aBufferSize, const uint8_t aTagId,
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "mozilla/dom/BluetoothMapMessageUpdateEvent.h"
|
||||
#include "mozilla/dom/BluetoothMapSetMessageStatusEvent.h"
|
||||
#include "mozilla/dom/BluetoothMapSendMessageEvent.h"
|
||||
|
||||
#include "mozilla/dom/BluetoothObexAuthEvent.h"
|
||||
#include "mozilla/dom/BluetoothPhonebookPullingEvent.h"
|
||||
#include "mozilla/dom/BluetoothStatusChangedEvent.h"
|
||||
#include "mozilla/dom/BluetoothVCardListingEvent.h"
|
||||
|
@ -36,6 +36,7 @@
|
|||
#include "mozilla/dom/bluetooth/BluetoothDevice.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothDiscoveryHandle.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothGattServer.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothObexAuthHandle.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothPairingListener.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothPbapRequestHandle.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
|
||||
|
@ -535,6 +536,8 @@ BluetoothAdapter::Notify(const BluetoothSignal& aData)
|
|||
} else if (aData.name().EqualsLiteral(PAIRING_ABORTED_ID) ||
|
||||
aData.name().EqualsLiteral(REQUEST_MEDIA_PLAYSTATUS_ID)) {
|
||||
DispatchEmptyEvent(aData.name());
|
||||
} else if (aData.name().EqualsLiteral(OBEX_PASSWORD_REQ_ID)) {
|
||||
HandleObexPasswordReq(aData.value());
|
||||
} else if (aData.name().EqualsLiteral(PULL_PHONEBOOK_REQ_ID)) {
|
||||
HandlePullPhonebookReq(aData.value());
|
||||
} else if (aData.name().EqualsLiteral(PULL_VCARD_ENTRY_REQ_ID)) {
|
||||
|
@ -1219,6 +1222,23 @@ BluetoothAdapter::HandleDeviceUnpaired(const BluetoothValue& aValue)
|
|||
DispatchDeviceEvent(NS_LITERAL_STRING(DEVICE_UNPAIRED_ID), init);
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothAdapter::HandleObexPasswordReq(const BluetoothValue& aValue)
|
||||
{
|
||||
MOZ_ASSERT(aValue.type() == BluetoothValue::TArrayOfBluetoothNamedValue);
|
||||
MOZ_ASSERT(aValue.get_ArrayOfBluetoothNamedValue().Length() <= 1);
|
||||
|
||||
BluetoothObexAuthEventInit init;
|
||||
init.mHandle = BluetoothObexAuthHandle::Create(GetOwner());
|
||||
|
||||
// TODO: Retrieve optional userId from aValue and assign into event
|
||||
|
||||
RefPtr<BluetoothObexAuthEvent> event =
|
||||
BluetoothObexAuthEvent::Constructor(this,
|
||||
NS_LITERAL_STRING(OBEX_PASSWORD_REQ_ID), init);
|
||||
DispatchTrustedEvent(event);
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothAdapter::HandlePullPhonebookReq(const BluetoothValue& aValue)
|
||||
{
|
||||
|
|
|
@ -86,16 +86,21 @@ public:
|
|||
* Event Handlers
|
||||
***************************************************************************/
|
||||
IMPL_EVENT_HANDLER(attributechanged);
|
||||
// PAIRING
|
||||
IMPL_EVENT_HANDLER(devicepaired);
|
||||
IMPL_EVENT_HANDLER(deviceunpaired);
|
||||
IMPL_EVENT_HANDLER(pairingaborted);
|
||||
// HFP/A2DP/AVRCP
|
||||
IMPL_EVENT_HANDLER(a2dpstatuschanged);
|
||||
IMPL_EVENT_HANDLER(hfpstatuschanged);
|
||||
IMPL_EVENT_HANDLER(scostatuschanged);
|
||||
IMPL_EVENT_HANDLER(requestmediaplaystatus);
|
||||
// PBAP
|
||||
IMPL_EVENT_HANDLER(obexpasswordreq);
|
||||
IMPL_EVENT_HANDLER(pullphonebookreq);
|
||||
IMPL_EVENT_HANDLER(pullvcardentryreq);
|
||||
IMPL_EVENT_HANDLER(pullvcardlistingreq);
|
||||
IMPL_EVENT_HANDLER(requestmediaplaystatus);
|
||||
IMPL_EVENT_HANDLER(scostatuschanged);
|
||||
// MAP
|
||||
IMPL_EVENT_HANDLER(mapfolderlistingreq);
|
||||
IMPL_EVENT_HANDLER(mapmessageslistingreq);
|
||||
IMPL_EVENT_HANDLER(mapgetmessagereq);
|
||||
|
@ -308,7 +313,7 @@ private:
|
|||
* - uint32_t 'maxListCount'
|
||||
* - uint32_t 'listStartOffset'
|
||||
* - uint32_t[] 'vCardSelector_AND'
|
||||
* - uint32_t[] 'vCardSelector_AND'
|
||||
* - uint32_t[] 'vCardSelector_OR'
|
||||
*/
|
||||
void HandlePullPhonebookReq(const BluetoothValue& aValue);
|
||||
|
||||
|
@ -335,10 +340,19 @@ private:
|
|||
* - uint32_t 'maxListCount'
|
||||
* - uint32_t 'listStartOffset'
|
||||
* - uint32_t[] 'vCardSelector_AND'
|
||||
* - uint32_t[] 'vCardSelector_AND'
|
||||
* - uint32_t[] 'vCardSelector_OR'
|
||||
*/
|
||||
void HandlePullVCardListingReq(const BluetoothValue& aValue);
|
||||
|
||||
/**
|
||||
* Handle OBEX_PASSWORD_REQ_ID bluetooth signal.
|
||||
*
|
||||
* @param aValue [in] Properties array of the PBAP request.
|
||||
* The array may contain the property:
|
||||
* - nsString 'userId'
|
||||
*/
|
||||
void HandleObexPasswordReq(const BluetoothValue& aValue);
|
||||
|
||||
/**
|
||||
* Get a Sequence of vCard properies from a BluetoothValue. The name of
|
||||
* BluetoothValue must be propSelector, vCardSelector_OR or vCardSelector_AND.
|
||||
|
@ -542,7 +556,7 @@ private:
|
|||
nsTArray<RefPtr<BluetoothDiscoveryHandle> > mLeScanHandleArray;
|
||||
|
||||
/**
|
||||
* nsRefPtr array of BluetoothDevices created by this adapter. The array is
|
||||
* RefPtr array of BluetoothDevices created by this adapter. The array is
|
||||
* empty when adapter state is Disabled.
|
||||
*
|
||||
* Devices will be appended when
|
||||
|
|
|
@ -202,6 +202,7 @@ BluetoothMapRequestHandle::ReplyToSetMessageStatus(long aMasId,
|
|||
|
||||
already_AddRefed<Promise>
|
||||
BluetoothMapRequestHandle::ReplyToSendMessage(long aMasId,
|
||||
const nsAString& aHandleId,
|
||||
bool aStatus,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
|
@ -220,7 +221,7 @@ BluetoothMapRequestHandle::ReplyToSendMessage(long aMasId,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
bs->ReplyToMapSendMessage(aMasId, aStatus,
|
||||
bs->ReplyToMapSendMessage(aMasId, aHandleId, aStatus,
|
||||
new BluetoothVoidReplyRunnable(nullptr, promise));
|
||||
|
||||
return promise.forget();
|
||||
|
|
|
@ -76,7 +76,7 @@ public:
|
|||
ErrorResult& aRv);
|
||||
|
||||
/**
|
||||
* Reply to get-message request
|
||||
* Reply to set-message request
|
||||
*
|
||||
* @param aMasId [in] MAS ID.
|
||||
* @param aStatus [in] MAP set message result.
|
||||
|
@ -86,14 +86,15 @@ public:
|
|||
ErrorResult& aRv);
|
||||
|
||||
/**
|
||||
* Reply to get-message request
|
||||
* Reply to send-message request
|
||||
*
|
||||
* @param aMasId [in] MAS ID.
|
||||
* @param aHandleId [in] Handle ID.
|
||||
* @param aStatus [in] MAP send message result.
|
||||
* @param aRv [out] Error result to set in case of error.
|
||||
*/
|
||||
already_AddRefed<Promise> ReplyToSendMessage(long aMasId, bool aStatus,
|
||||
ErrorResult& aRv);
|
||||
already_AddRefed<Promise> ReplyToSendMessage(
|
||||
long aMasId, const nsAString& aHandleId, bool aStatus, ErrorResult& aRv);
|
||||
|
||||
/**
|
||||
* Reply to message update request
|
||||
|
|
|
@ -0,0 +1,96 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "BluetoothCommon.h"
|
||||
#include "BluetoothDevice.h"
|
||||
#include "BluetoothObexAuthHandle.h"
|
||||
#include "BluetoothReplyRunnable.h"
|
||||
#include "BluetoothService.h"
|
||||
|
||||
#include "mozilla/dom/BluetoothObexAuthHandleBinding.h"
|
||||
#include "mozilla/dom/Promise.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace dom;
|
||||
|
||||
USING_BLUETOOTH_NAMESPACE
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(BluetoothObexAuthHandle, mOwner)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(BluetoothObexAuthHandle)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(BluetoothObexAuthHandle)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(BluetoothObexAuthHandle)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
BluetoothObexAuthHandle::BluetoothObexAuthHandle(nsPIDOMWindow* aOwner)
|
||||
: mOwner(aOwner)
|
||||
{
|
||||
MOZ_ASSERT(aOwner);
|
||||
}
|
||||
|
||||
BluetoothObexAuthHandle::~BluetoothObexAuthHandle()
|
||||
{
|
||||
}
|
||||
|
||||
already_AddRefed<BluetoothObexAuthHandle>
|
||||
BluetoothObexAuthHandle::Create(nsPIDOMWindow* aOwner)
|
||||
{
|
||||
MOZ_ASSERT(aOwner);
|
||||
|
||||
RefPtr<BluetoothObexAuthHandle> handle =
|
||||
new BluetoothObexAuthHandle(aOwner);
|
||||
|
||||
return handle.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<Promise>
|
||||
BluetoothObexAuthHandle::SetPassword(const nsAString& aPassword, ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject());
|
||||
if (!global) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<Promise> promise = Promise::Create(global, aRv);
|
||||
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
|
||||
|
||||
BluetoothService* bs = BluetoothService::Get();
|
||||
BT_ENSURE_TRUE_REJECT(bs, promise, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
bs->SetObexPassword(aPassword,
|
||||
new BluetoothVoidReplyRunnable(nullptr, promise));
|
||||
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<Promise>
|
||||
BluetoothObexAuthHandle::Reject(ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject());
|
||||
if (!global) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<Promise> promise = Promise::Create(global, aRv);
|
||||
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
|
||||
|
||||
BluetoothService* bs = BluetoothService::Get();
|
||||
BT_ENSURE_TRUE_REJECT(bs, promise, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
bs->RejectObexAuth(new BluetoothVoidReplyRunnable(nullptr, promise));
|
||||
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
JSObject*
|
||||
BluetoothObexAuthHandle::WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto)
|
||||
{
|
||||
return BluetoothObexAuthHandleBinding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_dom_bluetooth_BluetoothObexAuthHandle_h
|
||||
#define mozilla_dom_bluetooth_BluetoothObexAuthHandle_h
|
||||
|
||||
#include "BluetoothCommon.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsWrapperCache.h"
|
||||
|
||||
namespace mozilla {
|
||||
class ErrorResult;
|
||||
namespace dom {
|
||||
class Promise;
|
||||
}
|
||||
}
|
||||
|
||||
BEGIN_BLUETOOTH_NAMESPACE
|
||||
|
||||
class BluetoothObexAuthHandle final : public nsISupports
|
||||
, public nsWrapperCache
|
||||
{
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(BluetoothObexAuthHandle)
|
||||
|
||||
static already_AddRefed<BluetoothObexAuthHandle>
|
||||
Create(nsPIDOMWindow* aOwner);
|
||||
|
||||
nsPIDOMWindow* GetParentObject() const
|
||||
{
|
||||
return mOwner;
|
||||
}
|
||||
|
||||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
// Set password to the OBEX authentication request
|
||||
already_AddRefed<Promise>
|
||||
SetPassword(const nsAString& aPassword, ErrorResult& aRv);
|
||||
|
||||
// Reject the OBEX authentication request
|
||||
already_AddRefed<Promise> Reject(ErrorResult& aRv);
|
||||
|
||||
private:
|
||||
BluetoothObexAuthHandle(nsPIDOMWindow* aOwner);
|
||||
~BluetoothObexAuthHandle();
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> mOwner;
|
||||
};
|
||||
|
||||
END_BLUETOOTH_NAMESPACE
|
||||
|
||||
#endif // mozilla_dom_bluetooth_BluetoothObexAuthHandle_h
|
|
@ -246,6 +246,10 @@ BluetoothParent::RecvPBluetoothRequestConstructor(
|
|||
return actor->DoRequest(aRequest.get_DisconnectScoRequest());
|
||||
case Request::TIsScoConnectedRequest:
|
||||
return actor->DoRequest(aRequest.get_IsScoConnectedRequest());
|
||||
case Request::TSetObexPasswordRequest:
|
||||
return actor->DoRequest(aRequest.get_SetObexPasswordRequest());
|
||||
case Request::TRejectObexAuthRequest:
|
||||
return actor->DoRequest(aRequest.get_RejectObexAuthRequest());
|
||||
case Request::TReplyTovCardPullingRequest:
|
||||
return actor->DoRequest(aRequest.get_ReplyTovCardPullingRequest());
|
||||
case Request::TReplyToPhonebookPullingRequest:
|
||||
|
@ -750,6 +754,28 @@ BluetoothRequestParent::DoRequest(const IsScoConnectedRequest& aRequest)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothRequestParent::DoRequest(const SetObexPasswordRequest& aRequest)
|
||||
{
|
||||
MOZ_ASSERT(mService);
|
||||
MOZ_ASSERT(mRequestType == Request::TSetObexPasswordRequest);
|
||||
|
||||
mService->SetObexPassword(aRequest.password(), mReplyRunnable.get());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothRequestParent::DoRequest(const RejectObexAuthRequest& aRequest)
|
||||
{
|
||||
MOZ_ASSERT(mService);
|
||||
MOZ_ASSERT(mRequestType == Request::TRejectObexAuthRequest);
|
||||
|
||||
mService->RejectObexAuth(mReplyRunnable.get());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothRequestParent::DoRequest(const ReplyTovCardPullingRequest& aRequest)
|
||||
{
|
||||
|
@ -848,6 +874,7 @@ BluetoothRequestParent::DoRequest(const ReplyToSendMessageRequest& aRequest)
|
|||
MOZ_ASSERT(mRequestType == Request::TReplyToSendMessageRequest);
|
||||
|
||||
mService->ReplyToMapSendMessage(aRequest.masId(),
|
||||
aRequest.handleId(),
|
||||
aRequest.messageStatus(),
|
||||
mReplyRunnable.get());
|
||||
return true;
|
||||
|
|
|
@ -212,6 +212,12 @@ protected:
|
|||
bool
|
||||
DoRequest(const IsScoConnectedRequest& aRequest);
|
||||
|
||||
bool
|
||||
DoRequest(const SetObexPasswordRequest& aRequest);
|
||||
|
||||
bool
|
||||
DoRequest(const RejectObexAuthRequest& aRequest);
|
||||
|
||||
bool
|
||||
DoRequest(const ReplyTovCardPullingRequest& aRequest);
|
||||
|
||||
|
|
|
@ -366,6 +366,20 @@ BluetoothServiceChildProcess::IsScoConnected(BluetoothReplyRunnable* aRunnable)
|
|||
SendRequest(aRunnable, IsScoConnectedRequest());
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothServiceChildProcess::SetObexPassword(
|
||||
const nsAString& aPassword,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
SendRequest(aRunnable, SetObexPasswordRequest(nsString(aPassword)));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothServiceChildProcess::RejectObexAuth(BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
SendRequest(aRunnable, RejectObexAuthRequest());
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothServiceChildProcess::ReplyTovCardPulling(
|
||||
BlobParent* aBlobParent,
|
||||
|
@ -492,11 +506,12 @@ BluetoothServiceChildProcess::ReplyToMapSetMessageStatus(long aMasId,
|
|||
|
||||
void
|
||||
BluetoothServiceChildProcess::ReplyToMapSendMessage(long aMasId,
|
||||
const nsAString& aHandleId,
|
||||
bool aStatus,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
SendRequest(aRunnable,
|
||||
ReplyToSendMessageRequest(aMasId, aStatus));
|
||||
ReplyToSendMessageRequest(aMasId, nsString(aHandleId), aStatus));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -158,6 +158,13 @@ public:
|
|||
virtual void
|
||||
IsScoConnected(BluetoothReplyRunnable* aRunnable) override;
|
||||
|
||||
virtual void
|
||||
SetObexPassword(const nsAString& aPassword,
|
||||
BluetoothReplyRunnable* aRunnable) override;
|
||||
|
||||
virtual void
|
||||
RejectObexAuth(BluetoothReplyRunnable* aRunnable) override;
|
||||
|
||||
virtual void
|
||||
ReplyTovCardPulling(BlobParent* aBlobParent,
|
||||
BlobChild* aBlobChild,
|
||||
|
@ -228,8 +235,10 @@ public:
|
|||
BluetoothReplyRunnable* aRunnable) override;
|
||||
|
||||
virtual void
|
||||
ReplyToMapSendMessage(
|
||||
long aMasId, bool aStatus, BluetoothReplyRunnable* aRunnable) override;
|
||||
ReplyToMapSendMessage(long aMasId,
|
||||
const nsAString& aHandleId,
|
||||
bool aStatus,
|
||||
BluetoothReplyRunnable* aRunnable) override;
|
||||
|
||||
virtual void
|
||||
ReplyToMapMessageUpdate(
|
||||
|
|
|
@ -171,6 +171,15 @@ struct IsScoConnectedRequest
|
|||
{
|
||||
};
|
||||
|
||||
struct SetObexPasswordRequest
|
||||
{
|
||||
nsString password;
|
||||
};
|
||||
|
||||
struct RejectObexAuthRequest
|
||||
{
|
||||
};
|
||||
|
||||
struct ReplyTovCardPullingRequest
|
||||
{
|
||||
PBlob blob;
|
||||
|
@ -218,6 +227,7 @@ struct ReplyToSetMessageStatusRequest
|
|||
struct ReplyToSendMessageRequest
|
||||
{
|
||||
uint16_t masId;
|
||||
nsString handleId;
|
||||
bool messageStatus;
|
||||
};
|
||||
|
||||
|
@ -447,6 +457,8 @@ union Request
|
|||
ConnectScoRequest;
|
||||
DisconnectScoRequest;
|
||||
IsScoConnectedRequest;
|
||||
SetObexPasswordRequest;
|
||||
RejectObexAuthRequest;
|
||||
ReplyTovCardPullingRequest;
|
||||
ReplyToPhonebookPullingRequest;
|
||||
ReplyTovCardListingRequest;
|
||||
|
|
|
@ -38,6 +38,7 @@ if CONFIG['MOZ_B2G_BT']:
|
|||
'common/webapi/BluetoothLeDeviceEvent.cpp',
|
||||
'common/webapi/BluetoothManager.cpp',
|
||||
'common/webapi/BluetoothMapRequestHandle.cpp',
|
||||
'common/webapi/BluetoothObexAuthHandle.cpp',
|
||||
'common/webapi/BluetoothPairingHandle.cpp',
|
||||
'common/webapi/BluetoothPairingListener.cpp',
|
||||
'common/webapi/BluetoothPbapRequestHandle.cpp',
|
||||
|
@ -154,6 +155,7 @@ EXPORTS.mozilla.dom.bluetooth += [
|
|||
'common/webapi/BluetoothLeDeviceEvent.h',
|
||||
'common/webapi/BluetoothManager.h',
|
||||
'common/webapi/BluetoothMapRequestHandle.h',
|
||||
'common/webapi/BluetoothObexAuthHandle.h',
|
||||
'common/webapi/BluetoothPairingHandle.h',
|
||||
'common/webapi/BluetoothPairingListener.h',
|
||||
'common/webapi/BluetoothPbapRequestHandle.h'
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace mozilla {
|
|||
namespace dom {
|
||||
namespace cache {
|
||||
|
||||
using mozilla::dom::workers::Canceling;
|
||||
using mozilla::dom::workers::Terminating;
|
||||
using mozilla::dom::workers::Status;
|
||||
using mozilla::dom::workers::WorkerPrivate;
|
||||
|
||||
|
@ -73,7 +73,9 @@ Feature::Notify(JSContext* aCx, Status aStatus)
|
|||
{
|
||||
NS_ASSERT_OWNINGTHREAD(Feature);
|
||||
|
||||
if (aStatus < Canceling || mNotified) {
|
||||
// When the service worker thread is stopped we will get Terminating,
|
||||
// but nothing higher than that. We must shut things down at Terminating.
|
||||
if (aStatus < Terminating || mNotified) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ function CaptureStreamTestHelper(width, height) {
|
|||
CaptureStreamTestHelper.prototype = {
|
||||
/* Predefined colors for use in the methods below. */
|
||||
black: { data: [0, 0, 0, 255], name: "black" },
|
||||
blackTransparent: { data: [0, 0, 0, 0], name: "blackTransparent" },
|
||||
green: { data: [0, 255, 0, 255], name: "green" },
|
||||
red: { data: [255, 0, 0, 255], name: "red" },
|
||||
|
||||
|
@ -52,55 +53,90 @@ CaptureStreamTestHelper.prototype = {
|
|||
video.srcObject.requestFrame();
|
||||
},
|
||||
|
||||
/* Tests the top left pixel of |video| against |refData|. Format [R,G,B,A]. */
|
||||
testPixel: function (video, refData, threshold) {
|
||||
/*
|
||||
* Returns the pixel at (|offsetX|, |offsetY|) (from top left corner) of
|
||||
* |video| as an array of the pixel's color channels: [R,G,B,A].
|
||||
*/
|
||||
getPixel: function (video, offsetX, offsetY) {
|
||||
offsetX = offsetX || 0; // Set to 0 if not passed in.
|
||||
offsetY = offsetY || 0; // Set to 0 if not passed in.
|
||||
var ctxout = this.cout.getContext('2d');
|
||||
ctxout.drawImage(video, 0, 0);
|
||||
var pixel = ctxout.getImageData(0, 0, 1, 1).data;
|
||||
return pixel.every((val, i) => Math.abs(val - refData[i]) <= threshold);
|
||||
return ctxout.getImageData(offsetX, offsetY, 1, 1).data;
|
||||
},
|
||||
|
||||
/*
|
||||
* Returns a promise that resolves when the pixel matches. Use |threshold|
|
||||
* for fuzzy matching the color on each channel, in the range [0,255].
|
||||
* Returns true if px lies within the per-channel |threshold| of the
|
||||
* referenced color for all channels. px is on the form of an array of color
|
||||
* channels, [R,G,B,A]. Each channel is in the range [0, 255].
|
||||
*/
|
||||
waitForPixel: function (video, refColor, threshold, infoString) {
|
||||
isPixel: function (px, refColor, threshold) {
|
||||
threshold = threshold || 0; // Default to 0 (exact match) if not passed in.
|
||||
return px.every((ch, i) => Math.abs(ch - refColor.data[i]) <= threshold);
|
||||
},
|
||||
|
||||
/*
|
||||
* Returns true if px lies further away than |threshold| of the
|
||||
* referenced color for any channel. px is on the form of an array of color
|
||||
* channels, [R,G,B,A]. Each channel is in the range [0, 255].
|
||||
*/
|
||||
isPixelNot: function (px, refColor, threshold) {
|
||||
if (threshold === undefined) {
|
||||
// Default to 127 (should be sufficiently far away) if not passed in.
|
||||
threshold = 127;
|
||||
}
|
||||
return px.some((ch, i) => Math.abs(ch - refColor.data[i]) > threshold);
|
||||
},
|
||||
|
||||
/*
|
||||
* Returns a promise that resolves when the provided function |test|
|
||||
* returns true.
|
||||
*/
|
||||
waitForPixel: function (video, offsetX, offsetY, test, timeout) {
|
||||
return new Promise(resolve => {
|
||||
info("Testing " + video.id + " against [" + refColor.data.join(',') + "]");
|
||||
const startTime = video.currentTime;
|
||||
CaptureStreamTestHelper2D.prototype.clear.call(this, this.cout);
|
||||
video.ontimeupdate = () => {
|
||||
if (this.testPixel(video, refColor.data, threshold)) {
|
||||
ok(true, video.id + " " + infoString);
|
||||
video.ontimeupdate = null;
|
||||
resolve();
|
||||
var ontimeupdate = () => {
|
||||
const pixelMatch = test(this.getPixel(video, offsetX, offsetY));
|
||||
if (!pixelMatch &&
|
||||
(!timeout || video.currentTime < startTime + (timeout / 1000.0))) {
|
||||
// No match yet and,
|
||||
// No timeout (waiting indefinitely) or |timeout| has not passed yet.
|
||||
return;
|
||||
}
|
||||
video.removeEventListener("timeupdate", ontimeupdate);
|
||||
resolve(pixelMatch);
|
||||
};
|
||||
video.addEventListener("timeupdate", ontimeupdate);
|
||||
});
|
||||
},
|
||||
|
||||
/*
|
||||
* Returns a promise that resolves after |timeout| ms of playback or when a
|
||||
* pixel of |video| becomes the color |refData|. The test is failed if the
|
||||
* Returns a promise that resolves when the top left pixel of |video| matches
|
||||
* on all channels. Use |threshold| for fuzzy matching the color on each
|
||||
* channel, in the range [0,255].
|
||||
*/
|
||||
waitForPixelColor: function (video, refColor, threshold, infoString) {
|
||||
info("Waiting for video " + video.id + " to match [" +
|
||||
refColor.data.join(',') + "] - " + refColor.name +
|
||||
" (" + infoString + ")");
|
||||
return this.waitForPixel(video, 0, 0,
|
||||
px => this.isPixel(px, refColor, threshold))
|
||||
.then(() => ok(true, video.id + " " + infoString));
|
||||
},
|
||||
|
||||
/*
|
||||
* Returns a promise that resolves after |timeout| ms of playback or when the
|
||||
* top left pixel of |video| becomes |refColor|. The test is failed if the
|
||||
* timeout is not reached.
|
||||
*/
|
||||
waitForPixelToTimeout: function (video, refColor, threshold, timeout, infoString) {
|
||||
return new Promise(resolve => {
|
||||
info("Waiting for " + video.id + " to time out after " + timeout +
|
||||
"ms against [" + refColor.data.join(',') + "] - " + refColor.name);
|
||||
CaptureStreamTestHelper2D.prototype.clear.call(this, this.cout);
|
||||
var startTime = video.currentTime;
|
||||
video.ontimeupdate = () => {
|
||||
if (this.testPixel(video, refColor.data, threshold)) {
|
||||
ok(false, video.id + " " + infoString);
|
||||
video.ontimeupdate = null;
|
||||
resolve();
|
||||
} else if (video.currentTime > startTime + (timeout / 1000.0)) {
|
||||
ok(true, video.id + " " + infoString);
|
||||
video.ontimeupdate = null;
|
||||
resolve();
|
||||
}
|
||||
};
|
||||
});
|
||||
waitForPixelColorTimeout: function (video, refColor, threshold, timeout, infoString) {
|
||||
info("Waiting for " + video.id + " to time out after " + timeout +
|
||||
"ms against [" + refColor.data.join(',') + "] - " + refColor.name);
|
||||
return this.waitForPixel(video, 0, 0,
|
||||
px => this.isPixel(px, refColor, threshold),
|
||||
timeout)
|
||||
.then(result => ok(!result, video.id + " " + infoString));
|
||||
},
|
||||
|
||||
/* Create an element of type |type| with id |id| and append it to the body. */
|
||||
|
|
|
@ -23,15 +23,21 @@ function checkDrawColorInitialRed() {
|
|||
vmanual.srcObject = c.captureStream(0);
|
||||
vrate.srcObject = c.captureStream(10);
|
||||
|
||||
ok(h.testPixel(vauto, [0, 0, 0, 0], 0), "vauto hould not be drawn to before stable state");
|
||||
ok(h.testPixel(vrate, [0, 0, 0, 0], 0), "vrate Should not be drawn to before stable state");
|
||||
ok(h.testPixel(vmanual, [0, 0, 0, 0], 0), "vmanual Should not be drawn to before stable state");
|
||||
ok(h.isPixel(h.getPixel(vauto), h.blackTransparent, 0),
|
||||
"vauto should not be drawn to before stable state");
|
||||
ok(h.isPixel(h.getPixel(vrate), h.blackTransparent, 0),
|
||||
"vrate should not be drawn to before stable state");
|
||||
ok(h.isPixel(h.getPixel(vmanual), h.blackTransparent, 0),
|
||||
"vmanual should not be drawn to before stable state");
|
||||
|
||||
return Promise.resolve()
|
||||
.then(() => h.waitForPixel(vauto, h.red, 0, "should become red automatically"))
|
||||
.then(() => h.waitForPixel(vrate, h.red, 0, "should become red automatically"))
|
||||
.then(() => h.waitForPixel(vmanual, h.red, 0, "should become red when we get" +
|
||||
" to stable state (first frame)"));
|
||||
.then(() => h.waitForPixelColor(vauto, h.red, 0,
|
||||
"should become red automatically"))
|
||||
.then(() => h.waitForPixelColor(vrate, h.red, 0,
|
||||
"should become red automatically"))
|
||||
.then(() => h.waitForPixelColor(vmanual, h.red, 0,
|
||||
"should become red when we get" +
|
||||
" to stable state (first frame)"));
|
||||
}
|
||||
|
||||
function checkDrawColorGreen() {
|
||||
|
@ -40,11 +46,15 @@ function checkDrawColorGreen() {
|
|||
var drawing = h.startDrawing(() => h.drawColor(c, h.green));
|
||||
|
||||
return Promise.resolve()
|
||||
.then(() => h.waitForPixel(vauto, h.green, 0, "should become green automatically"))
|
||||
.then(() => h.waitForPixel(vrate, h.green, 0, "should become green automatically"))
|
||||
.then(() => h.waitForPixel(vmanual, h.red, 0, "should still be red"))
|
||||
.then(() => h.waitForPixelColor(vauto, h.green, 0,
|
||||
"should become green automatically"))
|
||||
.then(() => h.waitForPixelColor(vrate, h.green, 0,
|
||||
"should become green automatically"))
|
||||
.then(() => h.waitForPixelColor(vmanual, h.red, 0,
|
||||
"should still be red"))
|
||||
.then(() => h.requestFrame(vmanual))
|
||||
.then(() => h.waitForPixel(vmanual, h.green, 0, "should become green after requstFrame()"))
|
||||
.then(() => h.waitForPixelColor(vmanual, h.green, 0,
|
||||
"should become green after requstFrame()"))
|
||||
.catch(err => ok(false, "checkDrawColorGreen failed: ", err))
|
||||
.then(() => drawing.stop());
|
||||
}
|
||||
|
@ -54,10 +64,12 @@ function checkRequestFrameOrderGuarantee() {
|
|||
"call results in the expected frame seen in the stream.");
|
||||
|
||||
return Promise.resolve()
|
||||
.then(() => h.waitForPixel(vmanual, h.green, 0, "should still be green"))
|
||||
.then(() => h.waitForPixelColor(vmanual, h.green, 0,
|
||||
"should still be green"))
|
||||
.then(() => h.drawColor(c, h.red)) // 1. Draw canvas red
|
||||
.then(() => h.requestFrame(vmanual)) // 2. Immediately request a frame
|
||||
.then(() => h.waitForPixel(vmanual, h.red, 0, "should become red after call order test"))
|
||||
.then(() => h.waitForPixelColor(vmanual, h.red, 0,
|
||||
"should become red after call order test"))
|
||||
}
|
||||
|
||||
function checkDrawImageNotCleanRed() {
|
||||
|
@ -74,11 +86,14 @@ function checkDrawImageNotCleanRed() {
|
|||
})
|
||||
.then(() => drawing = h.startDrawing(() => ctx.drawImage(notCleanRed, 0, 0, c.width, c.height)))
|
||||
.then(() => h.testNotClean(c))
|
||||
.then(() => h.waitForPixelToTimeout(vauto, h.red, 0, 1000, "should not become red"))
|
||||
.then(() => h.waitForPixelToTimeout(vrate, h.red, 0, 0, "should not become red"))
|
||||
.then(() => h.waitForPixel(vmanual, h.green, 0, "should still be green"))
|
||||
.then(() => h.waitForPixelColorTimeout(vauto, h.red, 0, 1000,
|
||||
"should not become red"))
|
||||
.then(() => h.isPixelNot(h.getPixel(vrate), h.red, 250,
|
||||
"should not have become red"))
|
||||
.then(() => h.waitForPixelColor(vmanual, h.green, 0, "should still be green"))
|
||||
.then(() => h.requestFrame(vmanual))
|
||||
.then(() => h.waitForPixelToTimeout(vmanual, h.red, 0, 1000, "should not become red"))
|
||||
.then(() => h.waitForPixelColorTimeout(vmanual, h.red, 0, 1000,
|
||||
"should not become red"))
|
||||
.catch(err => ok(false, "checkDrawImageNotCleanRed failed: ", err))
|
||||
.then(() => drawing.stop());
|
||||
}
|
||||
|
|
|
@ -54,14 +54,21 @@ function checkClearColorInitialRed() {
|
|||
vmanual.srcObject = c.captureStream(0);
|
||||
vrate.srcObject = c.captureStream(10);
|
||||
|
||||
ok(h.testPixel(vauto, [0, 0, 0, 0], 0), "Should not be drawn to before stable state");
|
||||
ok(h.testPixel(vrate, [0, 0, 0, 0], 0), "Should not be drawn to before stable state");
|
||||
ok(h.testPixel(vmanual, [0, 0, 0, 0], 0), "Should not be drawn to before stable state");
|
||||
ok(h.isPixel(h.getPixel(vauto), h.blackTransparent, 0,
|
||||
"vauto should not be drawn to before stable state"));
|
||||
ok(h.isPixel(h.getPixel(vrate), h.blackTransparent, 0,
|
||||
"vrate should not be drawn to before stable state"));
|
||||
ok(h.isPixel(h.getPixel(vmanual), h.blackTransparent, 0,
|
||||
"vmanual should not be drawn to before stable state"));
|
||||
|
||||
return Promise.resolve()
|
||||
.then(() => h.waitForPixel(vauto, h.red, 0, "should become red automatically"))
|
||||
.then(() => h.waitForPixel(vrate, h.red, 0, "should become red automatically"))
|
||||
.then(() => h.waitForPixel(vmanual, h.red, 0, "should become red when we get to stable state (first frame)"))
|
||||
.then(() => h.waitForPixelColor(vauto, h.red, 0,
|
||||
"should become red automatically"))
|
||||
.then(() => h.waitForPixelColor(vrate, h.red, 0,
|
||||
"should become red automatically"))
|
||||
.then(() => h.waitForPixelColor(vmanual, h.red, 0,
|
||||
"should become red when we get to stable " +
|
||||
"state (first frame)"))
|
||||
}
|
||||
|
||||
function checkDrawColorGreen() {
|
||||
|
@ -69,11 +76,15 @@ function checkDrawColorGreen() {
|
|||
var drawing = h.startDrawing(h.drawColor.bind(h, c, h.green));
|
||||
checkGLError('after DrawColor');
|
||||
return Promise.resolve()
|
||||
.then(() => h.waitForPixel(vauto, h.green, 0, "should become green automatically"))
|
||||
.then(() => h.waitForPixel(vrate, h.green, 0, "should become green automatically"))
|
||||
.then(() => h.waitForPixel(vmanual, h.red, 0, "should still be red"))
|
||||
.then(() => h.waitForPixelColor(vauto, h.green, 0,
|
||||
"should become green automatically"))
|
||||
.then(() => h.waitForPixelColor(vrate, h.green, 0,
|
||||
"should become green automatically"))
|
||||
.then(() => h.waitForPixelColor(vmanual, h.red, 0,
|
||||
"should still be red"))
|
||||
.then(() => h.requestFrame(vmanual))
|
||||
.then(() => h.waitForPixel(vmanual, h.green, 0, "should become green after requstFrame()"))
|
||||
.then(() => h.waitForPixelColor(vmanual, h.green, 0,
|
||||
"should become green after requstFrame()"))
|
||||
.then(() => drawing.stop());
|
||||
}
|
||||
|
||||
|
@ -81,11 +92,15 @@ function checkClearColorRed() {
|
|||
info("Checking that clearing to red works.");
|
||||
var drawing = h.startDrawing(h.clearColor.bind(h, c, h.red));
|
||||
return Promise.resolve()
|
||||
.then(() => h.waitForPixel(vauto, h.red, 0, "should become red automatically"))
|
||||
.then(() => h.waitForPixel(vrate, h.red, 0, "should become red automatically"))
|
||||
.then(() => h.waitForPixel(vmanual, h.green, 0, "should still be green"))
|
||||
.then(() => h.waitForPixelColor(vauto, h.red, 0,
|
||||
"should become red automatically"))
|
||||
.then(() => h.waitForPixelColor(vrate, h.red, 0,
|
||||
"should become red automatically"))
|
||||
.then(() => h.waitForPixelColor(vmanual, h.green, 0,
|
||||
"should still be green"))
|
||||
.then(() => h.requestFrame(vmanual))
|
||||
.then(() => h.waitForPixel(vmanual, h.red, 0, "should become red after requestFrame()"))
|
||||
.then(() => h.waitForPixelColor(vmanual, h.red, 0,
|
||||
"should become red after requestFrame()"))
|
||||
.then(() => drawing.stop());
|
||||
}
|
||||
|
||||
|
@ -93,10 +108,11 @@ function checkRequestFrameOrderGuarantee() {
|
|||
info("Checking that requestFrame() immediately after a draw " +
|
||||
"call results in the expected frame seen in the stream.");
|
||||
return Promise.resolve()
|
||||
.then(() => h.waitForPixel(vmanual, h.red, 0, "should still be red"))
|
||||
.then(() => h.waitForPixelColor(vmanual, h.red, 0, "should still be red"))
|
||||
.then(() => h.drawColor(c, h.green)) // 1. Draw canvas green
|
||||
.then(() => h.requestFrame(vmanual)) // 2. Immediately request a frame
|
||||
.then(() => h.waitForPixel(vmanual, h.green, 0, "should become green after call order test"))
|
||||
.then(() => h.waitForPixelColor(vmanual, h.green, 0,
|
||||
"should become green after call order test"))
|
||||
}
|
||||
|
||||
function finish() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[DEFAULT]
|
||||
skip-if = e10s || (toolkit == 'android' && processor == 'x86') # bug 781789 & bug 782275
|
||||
skip-if = e10s || (toolkit == 'android' && processor == 'x86') # e10s: bug 1222522. Android: bug 781789 & bug 782275
|
||||
support-files = devicestorage_common.js
|
||||
|
||||
[test_823965.html]
|
||||
|
|
|
@ -899,7 +899,8 @@ Event::Shutdown()
|
|||
}
|
||||
}
|
||||
|
||||
LayoutDeviceIntPoint
|
||||
// static
|
||||
CSSIntPoint
|
||||
Event::GetScreenCoords(nsPresContext* aPresContext,
|
||||
WidgetEvent* aEvent,
|
||||
LayoutDeviceIntPoint aPoint)
|
||||
|
@ -907,8 +908,7 @@ Event::GetScreenCoords(nsPresContext* aPresContext,
|
|||
if (!nsContentUtils::LegacyIsCallerChromeOrNativeCode() &&
|
||||
nsContentUtils::ResistFingerprinting()) {
|
||||
// When resisting fingerprinting, return client coordinates instead.
|
||||
CSSIntPoint clientCoords = GetClientCoords(aPresContext, aEvent, aPoint, CSSIntPoint(0, 0));
|
||||
return LayoutDeviceIntPoint(clientCoords.x, clientCoords.y);
|
||||
return GetClientCoords(aPresContext, aEvent, aPoint, CSSIntPoint(0, 0));
|
||||
}
|
||||
|
||||
if (EventStateManager::sIsPointerLocked) {
|
||||
|
@ -923,19 +923,26 @@ Event::GetScreenCoords(nsPresContext* aPresContext,
|
|||
aEvent->mClass != eTouchEventClass &&
|
||||
aEvent->mClass != eDragEventClass &&
|
||||
aEvent->mClass != eSimpleGestureEventClass)) {
|
||||
return LayoutDeviceIntPoint(0, 0);
|
||||
return CSSIntPoint(0, 0);
|
||||
}
|
||||
|
||||
// Doing a straight conversion from LayoutDeviceIntPoint to CSSIntPoint
|
||||
// seem incorrect, but it is needed to maintain legacy functionality.
|
||||
if (!aPresContext) {
|
||||
return CSSIntPoint(aPoint.x, aPoint.y);
|
||||
}
|
||||
|
||||
LayoutDeviceIntPoint offset = aPoint;
|
||||
|
||||
WidgetGUIEvent* guiEvent = aEvent->AsGUIEvent();
|
||||
if (!guiEvent->widget) {
|
||||
return aPoint;
|
||||
if (guiEvent && guiEvent->widget) {
|
||||
offset += guiEvent->widget->WidgetToScreenOffset();
|
||||
}
|
||||
|
||||
LayoutDeviceIntPoint offset = aPoint + guiEvent->widget->WidgetToScreenOffset();
|
||||
nscoord factor =
|
||||
aPresContext->DeviceContext()->AppUnitsPerDevPixelAtUnitFullZoom();
|
||||
return LayoutDeviceIntPoint(nsPresContext::AppUnitsToIntCSSPixels(offset.x * factor),
|
||||
nsPresContext::AppUnitsToIntCSSPixels(offset.y * factor));
|
||||
nsPoint pt =
|
||||
LayoutDevicePixel::ToAppUnits(offset, aPresContext->DeviceContext()->AppUnitsPerDevPixelAtUnitFullZoom());
|
||||
|
||||
return CSSPixel::FromAppUnitsRounded(pt);
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
@ -133,9 +133,9 @@ public:
|
|||
WidgetEvent* aEvent,
|
||||
LayoutDeviceIntPoint aPoint,
|
||||
CSSIntPoint aDefaultPoint);
|
||||
static LayoutDeviceIntPoint GetScreenCoords(nsPresContext* aPresContext,
|
||||
WidgetEvent* aEvent,
|
||||
LayoutDeviceIntPoint aPoint);
|
||||
static CSSIntPoint GetScreenCoords(nsPresContext* aPresContext,
|
||||
WidgetEvent* aEvent,
|
||||
LayoutDeviceIntPoint aPoint);
|
||||
static CSSIntPoint GetOffsetCoords(nsPresContext* aPresContext,
|
||||
WidgetEvent* aEvent,
|
||||
LayoutDeviceIntPoint aPoint,
|
||||
|
|
|
@ -270,7 +270,7 @@ EventStateManager* EventStateManager::sActiveESM = nullptr;
|
|||
nsIDocument* EventStateManager::sMouseOverDocument = nullptr;
|
||||
nsWeakFrame EventStateManager::sLastDragOverFrame = nullptr;
|
||||
LayoutDeviceIntPoint EventStateManager::sLastRefPoint = kInvalidRefPoint;
|
||||
LayoutDeviceIntPoint EventStateManager::sLastScreenPoint = LayoutDeviceIntPoint(0, 0);
|
||||
CSSIntPoint EventStateManager::sLastScreenPoint = CSSIntPoint(0, 0);
|
||||
LayoutDeviceIntPoint EventStateManager::sSynthCenteringPoint = kInvalidRefPoint;
|
||||
CSSIntPoint EventStateManager::sLastClientPoint = CSSIntPoint(0, 0);
|
||||
bool EventStateManager::sIsPointerLocked = false;
|
||||
|
@ -560,9 +560,9 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
|||
aEvent->mClass == eWheelEventClass) &&
|
||||
!sIsPointerLocked) {
|
||||
sLastScreenPoint =
|
||||
UIEvent::CalculateScreenPoint(aPresContext, aEvent);
|
||||
Event::GetScreenCoords(aPresContext, aEvent, aEvent->refPoint);
|
||||
sLastClientPoint =
|
||||
UIEvent::CalculateClientPoint(aPresContext, aEvent, nullptr);
|
||||
Event::GetClientCoords(aPresContext, aEvent, aEvent->refPoint, CSSIntPoint(0, 0));
|
||||
}
|
||||
|
||||
*aStatus = nsEventStatus_eIgnore;
|
||||
|
@ -4144,7 +4144,7 @@ GetWindowInnerRectCenter(nsPIDOMWindow* aWindow,
|
|||
int32_t innerHeight = window->GetInnerHeightOuter(dummy);
|
||||
dummy.SuppressException();
|
||||
|
||||
nsIntRect screen;
|
||||
LayoutDeviceIntRect screen;
|
||||
aWidget->GetScreenBounds(screen);
|
||||
|
||||
int32_t cssScreenX = aContext->DevPixelsToIntCSSPixels(screen.x);
|
||||
|
|
|
@ -256,7 +256,7 @@ public:
|
|||
// locked. This is used by dom::Event::GetScreenCoords() to make mouse
|
||||
// events' screen coord appear frozen at the last mouse position while
|
||||
// the pointer is locked.
|
||||
static LayoutDeviceIntPoint sLastScreenPoint;
|
||||
static CSSIntPoint sLastScreenPoint;
|
||||
|
||||
// Holds the point in client coords of the last mouse event. Used by
|
||||
// dom::Event::GetClientCoords() to make mouse events' client coords appear
|
||||
|
|
|
@ -14,9 +14,6 @@
|
|||
#include "jsapi.h"
|
||||
#include "nsGlobalWindow.h" // So we can assign an nsGlobalWindow* to mWindowSource
|
||||
|
||||
#include "ServiceWorker.h"
|
||||
#include "ServiceWorkerClient.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
|
@ -107,14 +104,12 @@ MessageEvent::GetSource(nsIDOMWindow** aSource)
|
|||
}
|
||||
|
||||
void
|
||||
MessageEvent::GetSource(Nullable<OwningWindowProxyOrMessagePortOrClient>& aValue) const
|
||||
MessageEvent::GetSource(Nullable<OwningWindowProxyOrMessagePort>& aValue) const
|
||||
{
|
||||
if (mWindowSource) {
|
||||
aValue.SetValue().SetAsWindowProxy() = mWindowSource;
|
||||
} else if (mPortSource) {
|
||||
aValue.SetValue().SetAsMessagePort() = mPortSource;
|
||||
} else if (mClientSource) {
|
||||
aValue.SetValue().SetAsClient() = mClientSource;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -255,12 +250,6 @@ MessageEvent::SetSource(mozilla::dom::MessagePort* aPort)
|
|||
mPortSource = aPort;
|
||||
}
|
||||
|
||||
void
|
||||
MessageEvent::SetSource(mozilla::dom::workers::ServiceWorkerClient* aClient)
|
||||
{
|
||||
mClientSource = aClient;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
|
|
|
@ -19,15 +19,9 @@ namespace dom {
|
|||
struct MessageEventInit;
|
||||
class MessagePort;
|
||||
class MessagePortList;
|
||||
class OwningWindowProxyOrMessagePortOrClient;
|
||||
class OwningWindowProxyOrMessagePort;
|
||||
class WindowProxyOrMessagePort;
|
||||
|
||||
namespace workers {
|
||||
|
||||
class ServiceWorkerClient;
|
||||
|
||||
} // namespace workers
|
||||
|
||||
/**
|
||||
* Implements the MessageEvent event, used for cross-document messaging and
|
||||
* server-sent events.
|
||||
|
@ -56,7 +50,7 @@ public:
|
|||
void GetData(JSContext* aCx, JS::MutableHandle<JS::Value> aData,
|
||||
ErrorResult& aRv);
|
||||
|
||||
void GetSource(Nullable<OwningWindowProxyOrMessagePortOrClient>& aValue) const;
|
||||
void GetSource(Nullable<OwningWindowProxyOrMessagePort>& aValue) const;
|
||||
|
||||
MessagePortList* GetPorts()
|
||||
{
|
||||
|
@ -68,8 +62,6 @@ public:
|
|||
// Non WebIDL methods
|
||||
void SetSource(mozilla::dom::MessagePort* aPort);
|
||||
|
||||
void SetSource(workers::ServiceWorkerClient* aClient);
|
||||
|
||||
void SetSource(nsPIDOMWindow* aWindow)
|
||||
{
|
||||
mWindowSource = aWindow;
|
||||
|
@ -103,7 +95,6 @@ private:
|
|||
nsString mLastEventId;
|
||||
nsCOMPtr<nsIDOMWindow> mWindowSource;
|
||||
RefPtr<MessagePort> mPortSource;
|
||||
RefPtr<workers::ServiceWorkerClient> mClientSource;
|
||||
RefPtr<MessagePortList> mPorts;
|
||||
};
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ Touch::Touch(EventTarget* aTarget,
|
|||
mTarget = aTarget;
|
||||
mIdentifier = aIdentifier;
|
||||
mPagePoint = CSSIntPoint(aPageX, aPageY);
|
||||
mScreenPoint = LayoutDeviceIntPoint(aScreenX, aScreenY);
|
||||
mScreenPoint = CSSIntPoint(aScreenX, aScreenY);
|
||||
mClientPoint = CSSIntPoint(aClientX, aClientY);
|
||||
mRefPoint = LayoutDeviceIntPoint(0, 0);
|
||||
mPointsInitialized = true;
|
||||
|
@ -48,13 +48,13 @@ Touch::Touch(EventTarget* aTarget,
|
|||
|
||||
Touch::Touch(int32_t aIdentifier,
|
||||
LayoutDeviceIntPoint aPoint,
|
||||
nsIntPoint aRadius,
|
||||
LayoutDeviceIntPoint aRadius,
|
||||
float aRotationAngle,
|
||||
float aForce)
|
||||
{
|
||||
mIdentifier = aIdentifier;
|
||||
mPagePoint = CSSIntPoint(0, 0);
|
||||
mScreenPoint = LayoutDeviceIntPoint(0, 0);
|
||||
mScreenPoint = CSSIntPoint(0, 0);
|
||||
mClientPoint = CSSIntPoint(0, 0);
|
||||
mRefPoint = aPoint;
|
||||
mPointsInitialized = false;
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
float aForce);
|
||||
Touch(int32_t aIdentifier,
|
||||
LayoutDeviceIntPoint aPoint,
|
||||
nsIntPoint aRadius,
|
||||
LayoutDeviceIntPoint aRadius,
|
||||
float aRotationAngle,
|
||||
float aForce);
|
||||
Touch(const Touch& aOther);
|
||||
|
@ -81,8 +81,8 @@ public:
|
|||
int32_t mIdentifier;
|
||||
CSSIntPoint mPagePoint;
|
||||
CSSIntPoint mClientPoint;
|
||||
LayoutDeviceIntPoint mScreenPoint;
|
||||
nsIntPoint mRadius;
|
||||
CSSIntPoint mScreenPoint;
|
||||
LayoutDeviceIntPoint mRadius;
|
||||
float mRotationAngle;
|
||||
float mForce;
|
||||
protected:
|
||||
|
|
|
@ -359,11 +359,13 @@ UIEvent::DuplicatePrivateData()
|
|||
mPagePoint =
|
||||
Event::GetPageCoords(mPresContext, mEvent, mEvent->refPoint, mClientPoint);
|
||||
// GetScreenPoint converts mEvent->refPoint to right coordinates.
|
||||
LayoutDeviceIntPoint screenPoint =
|
||||
CSSIntPoint screenPoint =
|
||||
Event::GetScreenCoords(mPresContext, mEvent, mEvent->refPoint);
|
||||
nsresult rv = Event::DuplicatePrivateData();
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mEvent->refPoint = screenPoint;
|
||||
CSSToLayoutDeviceScale scale = mPresContext ? mPresContext->CSSToDevPixelScale()
|
||||
: CSSToLayoutDeviceScale(1);
|
||||
mEvent->refPoint = RoundedToInt(screenPoint * scale);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -40,62 +40,6 @@ public:
|
|||
NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override;
|
||||
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) override;
|
||||
|
||||
static LayoutDeviceIntPoint CalculateScreenPoint(nsPresContext* aPresContext,
|
||||
WidgetEvent* aEvent)
|
||||
{
|
||||
if (!aEvent ||
|
||||
(aEvent->mClass != eMouseEventClass &&
|
||||
aEvent->mClass != eMouseScrollEventClass &&
|
||||
aEvent->mClass != eWheelEventClass &&
|
||||
aEvent->mClass != eDragEventClass &&
|
||||
aEvent->mClass != ePointerEventClass &&
|
||||
aEvent->mClass != eSimpleGestureEventClass)) {
|
||||
return LayoutDeviceIntPoint(0, 0);
|
||||
}
|
||||
|
||||
WidgetGUIEvent* event = aEvent->AsGUIEvent();
|
||||
if (!event->widget) {
|
||||
return aEvent->refPoint;
|
||||
}
|
||||
|
||||
LayoutDeviceIntPoint offset = aEvent->refPoint + event->widget->WidgetToScreenOffset();
|
||||
nscoord factor =
|
||||
aPresContext->DeviceContext()->AppUnitsPerDevPixelAtUnitFullZoom();
|
||||
return LayoutDeviceIntPoint(nsPresContext::AppUnitsToIntCSSPixels(offset.x * factor),
|
||||
nsPresContext::AppUnitsToIntCSSPixels(offset.y * factor));
|
||||
}
|
||||
|
||||
static CSSIntPoint CalculateClientPoint(nsPresContext* aPresContext,
|
||||
WidgetEvent* aEvent,
|
||||
CSSIntPoint* aDefaultClientPoint)
|
||||
{
|
||||
if (!aEvent ||
|
||||
(aEvent->mClass != eMouseEventClass &&
|
||||
aEvent->mClass != eMouseScrollEventClass &&
|
||||
aEvent->mClass != eWheelEventClass &&
|
||||
aEvent->mClass != eDragEventClass &&
|
||||
aEvent->mClass != ePointerEventClass &&
|
||||
aEvent->mClass != eSimpleGestureEventClass) ||
|
||||
!aPresContext ||
|
||||
!aEvent->AsGUIEvent()->widget) {
|
||||
return aDefaultClientPoint
|
||||
? *aDefaultClientPoint
|
||||
: CSSIntPoint(0, 0);
|
||||
}
|
||||
|
||||
nsIPresShell* shell = aPresContext->GetPresShell();
|
||||
if (!shell) {
|
||||
return CSSIntPoint(0, 0);
|
||||
}
|
||||
nsIFrame* rootFrame = shell->GetRootFrame();
|
||||
if (!rootFrame) {
|
||||
return CSSIntPoint(0, 0);
|
||||
}
|
||||
nsPoint pt =
|
||||
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, rootFrame);
|
||||
|
||||
return CSSIntPoint::FromAppUnitsRounded(pt);
|
||||
}
|
||||
|
||||
static already_AddRefed<UIEvent> Constructor(const GlobalObject& aGlobal,
|
||||
const nsAString& aType,
|
||||
|
|
|
@ -124,7 +124,6 @@ skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM
|
|||
skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM
|
||||
[test_bug704423.html]
|
||||
[test_bug741666.html]
|
||||
skip-if = toolkit == 'android'
|
||||
[test_bug742376.html]
|
||||
[test_bug812744.html]
|
||||
[test_bug855741.html]
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче