mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge m-c to fx-team, a=merge
MozReview-Commit-ID: LQ4NtghbPdw
This commit is contained in:
commit
6e23a35025
@ -45,14 +45,16 @@ static ModuleRep sModuleMap[] = {
|
|||||||
|
|
||||||
{ "events", logging::eEvents },
|
{ "events", logging::eEvents },
|
||||||
{ "platforms", logging::ePlatforms },
|
{ "platforms", logging::ePlatforms },
|
||||||
{ "stack", logging::eStack },
|
|
||||||
{ "text", logging::eText },
|
{ "text", logging::eText },
|
||||||
{ "tree", logging::eTree },
|
{ "tree", logging::eTree },
|
||||||
|
|
||||||
{ "DOMEvents", logging::eDOMEvents },
|
{ "DOMEvents", logging::eDOMEvents },
|
||||||
{ "focus", logging::eFocus },
|
{ "focus", logging::eFocus },
|
||||||
{ "selection", logging::eSelection },
|
{ "selection", logging::eSelection },
|
||||||
{ "notifications", logging::eNotifications }
|
{ "notifications", logging::eNotifications },
|
||||||
|
|
||||||
|
{ "stack", logging::eStack },
|
||||||
|
{ "verbose", logging::eVerbose }
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -606,6 +608,61 @@ logging::SelChange(nsISelection* aSelection, DocAccessible* aDocument,
|
|||||||
Stack();
|
Stack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
logging::TreeInfo(const char* aMsg, uint32_t aExtraFlags, ...)
|
||||||
|
{
|
||||||
|
if (IsEnabledAll(logging::eTree | aExtraFlags)) {
|
||||||
|
MsgBegin("TREE", aMsg);
|
||||||
|
|
||||||
|
va_list vl;
|
||||||
|
va_start(vl, aExtraFlags);
|
||||||
|
const char* descr = nullptr;
|
||||||
|
while ((descr = va_arg(vl, const char*))) {
|
||||||
|
AccessibleInfo(descr, va_arg(vl, Accessible*));
|
||||||
|
}
|
||||||
|
va_end(vl);
|
||||||
|
|
||||||
|
MsgEnd();
|
||||||
|
|
||||||
|
if (aExtraFlags & eStack) {
|
||||||
|
Stack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
logging::TreeInfo(const char* aMsg, uint32_t aExtraFlags,
|
||||||
|
const char* aMsg1, Accessible* aAcc,
|
||||||
|
const char* aMsg2, nsINode* aNode)
|
||||||
|
{
|
||||||
|
if (IsEnabledAll(logging::eTree | logging::eVerbose)) {
|
||||||
|
MsgBegin("TREE", aMsg);
|
||||||
|
AccessibleInfo(aMsg1, aAcc);
|
||||||
|
Accessible* acc = aAcc->Document()->GetAccessible(aNode);
|
||||||
|
if (acc) {
|
||||||
|
AccessibleInfo(aMsg2, acc);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Node(aMsg2, aNode);
|
||||||
|
}
|
||||||
|
MsgEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
logging::TreeInfo(const char* aMsg, uint32_t aExtraFlags, Accessible* aParent)
|
||||||
|
{
|
||||||
|
if (IsEnabledAll(logging::eTree | aExtraFlags)) {
|
||||||
|
MsgBegin("TREE", aMsg);
|
||||||
|
AccessibleInfo("container", aParent);
|
||||||
|
for (uint32_t idx = 0; idx < aParent->ChildCount(); idx++) {
|
||||||
|
AccessibleInfo("child", aParent->GetChildAt(idx));
|
||||||
|
}
|
||||||
|
MsgEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
logging::MsgBegin(const char* aTitle, const char* aMsgText, ...)
|
logging::MsgBegin(const char* aTitle, const char* aMsgText, ...)
|
||||||
{
|
{
|
||||||
@ -736,6 +793,62 @@ logging::Document(DocAccessible* aDocument)
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
logging::AccessibleInfo(const char* aDescr, Accessible* aAccessible)
|
||||||
|
{
|
||||||
|
printf(" %s: %p; ", aDescr, static_cast<void*>(aAccessible));
|
||||||
|
if (!aAccessible) {
|
||||||
|
printf("\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (aAccessible->IsDefunct()) {
|
||||||
|
printf("defunct\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!aAccessible->Document() || aAccessible->Document()->IsDefunct()) {
|
||||||
|
printf("document is shutting down, no info\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsAutoString role;
|
||||||
|
GetAccService()->GetStringRole(aAccessible->Role(), role);
|
||||||
|
printf("role: %s", NS_ConvertUTF16toUTF8(role).get());
|
||||||
|
|
||||||
|
nsAutoString name;
|
||||||
|
aAccessible->Name(name);
|
||||||
|
if (!name.IsEmpty()) {
|
||||||
|
printf(", name: '%s'", NS_ConvertUTF16toUTF8(name).get());
|
||||||
|
}
|
||||||
|
|
||||||
|
printf(", idx: %d", aAccessible->IndexInParent());
|
||||||
|
|
||||||
|
nsINode* node = aAccessible->GetNode();
|
||||||
|
if (!node) {
|
||||||
|
printf(", node: null\n");
|
||||||
|
}
|
||||||
|
else if (node->IsNodeOfType(nsINode::eDOCUMENT)) {
|
||||||
|
printf(", document node: %p\n", static_cast<void*>(node));
|
||||||
|
}
|
||||||
|
else if (node->IsNodeOfType(nsINode::eTEXT)) {
|
||||||
|
printf(", text node: %p\n", static_cast<void*>(node));
|
||||||
|
}
|
||||||
|
else if (node->IsElement()) {
|
||||||
|
dom::Element* el = node->AsElement();
|
||||||
|
|
||||||
|
nsAutoCString tag;
|
||||||
|
el->NodeInfo()->NameAtom()->ToUTF8String(tag);
|
||||||
|
|
||||||
|
nsIAtom* idAtom = el->GetID();
|
||||||
|
nsAutoCString id;
|
||||||
|
if (idAtom) {
|
||||||
|
idAtom->ToUTF8String(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
printf(", element node: %p, %s@id='%s'\n",
|
||||||
|
static_cast<void*>(el), tag.get(), id.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
logging::AccessibleNNode(const char* aDescr, Accessible* aAccessible)
|
logging::AccessibleNNode(const char* aDescr, Accessible* aAccessible)
|
||||||
{
|
{
|
||||||
@ -814,6 +927,12 @@ logging::IsEnabled(uint32_t aModules)
|
|||||||
return sModules & aModules;
|
return sModules & aModules;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
logging::IsEnabledAll(uint32_t aModules)
|
||||||
|
{
|
||||||
|
return (sModules & aModules) == aModules;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
logging::IsEnabled(const nsAString& aModuleStr)
|
logging::IsEnabled(const nsAString& aModuleStr)
|
||||||
{
|
{
|
||||||
|
@ -35,14 +35,17 @@ enum EModules {
|
|||||||
|
|
||||||
eEvents = 1 << 3,
|
eEvents = 1 << 3,
|
||||||
ePlatforms = 1 << 4,
|
ePlatforms = 1 << 4,
|
||||||
eStack = 1 << 5,
|
eText = 1 << 5,
|
||||||
eText = 1 << 6,
|
eTree = 1 << 6,
|
||||||
eTree = 1 << 7,
|
|
||||||
|
|
||||||
eDOMEvents = 1 << 8,
|
eDOMEvents = 1 << 7,
|
||||||
eFocus = 1 << 9,
|
eFocus = 1 << 8,
|
||||||
eSelection = 1 << 10,
|
eSelection = 1 << 9,
|
||||||
eNotifications = eDOMEvents | eSelection | eFocus
|
eNotifications = eDOMEvents | eSelection | eFocus,
|
||||||
|
|
||||||
|
// extras
|
||||||
|
eStack = 1 << 10,
|
||||||
|
eVerbose = 1 << 11
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,6 +53,11 @@ enum EModules {
|
|||||||
*/
|
*/
|
||||||
bool IsEnabled(uint32_t aModules);
|
bool IsEnabled(uint32_t aModules);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if all of the given modules are logged.
|
||||||
|
*/
|
||||||
|
bool IsEnabledAll(uint32_t aModules);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if the given module is logged.
|
* Return true if the given module is logged.
|
||||||
*/
|
*/
|
||||||
@ -121,6 +129,15 @@ void FocusDispatched(Accessible* aTarget);
|
|||||||
void SelChange(nsISelection* aSelection, DocAccessible* aDocument,
|
void SelChange(nsISelection* aSelection, DocAccessible* aDocument,
|
||||||
int16_t aReason);
|
int16_t aReason);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Log the given accessible elements info.
|
||||||
|
*/
|
||||||
|
void TreeInfo(const char* aMsg, uint32_t aExtraFlags, ...);
|
||||||
|
void TreeInfo(const char* aMsg, uint32_t aExtraFlags,
|
||||||
|
const char* aMsg1, Accessible* aAcc,
|
||||||
|
const char* aMsg2, nsINode* aNode);
|
||||||
|
void TreeInfo(const char* aMsg, uint32_t aExtraFlags, Accessible* aParent);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log the message ('title: text' format) on new line. Print the start and end
|
* Log the message ('title: text' format) on new line. Print the start and end
|
||||||
* boundaries of the message body designated by '{' and '}' (2 spaces indent for
|
* boundaries of the message body designated by '{' and '}' (2 spaces indent for
|
||||||
@ -164,6 +181,7 @@ void Document(DocAccessible* aDocument);
|
|||||||
/**
|
/**
|
||||||
* Log the accessible and its DOM node as a message entry.
|
* Log the accessible and its DOM node as a message entry.
|
||||||
*/
|
*/
|
||||||
|
void AccessibleInfo(const char* aDescr, Accessible* aAccessible);
|
||||||
void AccessibleNNode(const char* aDescr, Accessible* aAccessible);
|
void AccessibleNNode(const char* aDescr, Accessible* aAccessible);
|
||||||
void AccessibleNNode(const char* aDescr, nsINode* aNode);
|
void AccessibleNNode(const char* aDescr, nsINode* aNode);
|
||||||
|
|
||||||
@ -189,7 +207,8 @@ void Enable(const nsAFlatCString& aModules);
|
|||||||
*/
|
*/
|
||||||
void CheckEnv();
|
void CheckEnv();
|
||||||
|
|
||||||
} // namespace logs
|
} // namespace logging
|
||||||
|
|
||||||
} // namespace a11y
|
} // namespace a11y
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
|
@ -590,6 +590,7 @@ public:
|
|||||||
HyperTextAccessible* AsHyperText();
|
HyperTextAccessible* AsHyperText();
|
||||||
|
|
||||||
bool IsHTMLBr() const { return mType == eHTMLBRType; }
|
bool IsHTMLBr() const { return mType == eHTMLBRType; }
|
||||||
|
bool IsHTMLCaption() const { return mType == eHTMLCaptionType; }
|
||||||
bool IsHTMLCombobox() const { return mType == eHTMLComboboxType; }
|
bool IsHTMLCombobox() const { return mType == eHTMLComboboxType; }
|
||||||
bool IsHTMLFileInput() const { return mType == eHTMLFileInputType; }
|
bool IsHTMLFileInput() const { return mType == eHTMLFileInputType; }
|
||||||
|
|
||||||
|
@ -393,24 +393,14 @@ NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableAccessible, Accessible)
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// HTMLTableAccessible: Accessible
|
// HTMLTableAccessible: Accessible
|
||||||
|
|
||||||
void
|
bool
|
||||||
HTMLTableAccessible::CacheChildren()
|
HTMLTableAccessible::InsertChildAt(uint32_t aIndex, Accessible* aChild)
|
||||||
{
|
{
|
||||||
// Move caption accessible so that it's the first child. Check for the first
|
// Move caption accessible so that it's the first child. Check for the first
|
||||||
// caption only, because nsAccessibilityService ensures we don't create
|
// caption only, because nsAccessibilityService ensures we don't create
|
||||||
// accessibles for the other captions, since only the first is actually
|
// accessibles for the other captions, since only the first is actually
|
||||||
// visible.
|
// visible.
|
||||||
TreeWalker walker(this, mContent);
|
return Accessible::InsertChildAt(aChild->IsHTMLCaption() ? 0 : aIndex, aChild);
|
||||||
|
|
||||||
Accessible* child = nullptr;
|
|
||||||
while ((child = walker.Next())) {
|
|
||||||
if (child->Role() == roles::CAPTION) {
|
|
||||||
InsertChildAt(0, child);
|
|
||||||
while ((child = walker.Next()) && AppendChild(child));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
AppendChild(child);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
role
|
role
|
||||||
|
@ -157,12 +157,13 @@ public:
|
|||||||
virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
|
virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
|
||||||
virtual Relation RelationByType(RelationType aRelationType) override;
|
virtual Relation RelationByType(RelationType aRelationType) override;
|
||||||
|
|
||||||
|
bool InsertChildAt(uint32_t aIndex, Accessible* aChild) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~HTMLTableAccessible() {}
|
virtual ~HTMLTableAccessible() {}
|
||||||
|
|
||||||
// Accessible
|
// Accessible
|
||||||
virtual ENameValueFlag NativeName(nsString& aName) override;
|
virtual ENameValueFlag NativeName(nsString& aName) override;
|
||||||
virtual void CacheChildren() override;
|
|
||||||
|
|
||||||
// HTMLTableAccessible
|
// HTMLTableAccessible
|
||||||
|
|
||||||
@ -209,7 +210,7 @@ class HTMLCaptionAccessible : public HyperTextAccessibleWrap
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HTMLCaptionAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
HTMLCaptionAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
||||||
HyperTextAccessibleWrap(aContent, aDoc) { }
|
HyperTextAccessibleWrap(aContent, aDoc) { mType = eHTMLCaptionType; }
|
||||||
|
|
||||||
// Accessible
|
// Accessible
|
||||||
virtual a11y::role NativeRole() override;
|
virtual a11y::role NativeRole() override;
|
||||||
|
@ -29,6 +29,7 @@ skip-if = buildapp == "mulet"
|
|||||||
[test_recreation.html]
|
[test_recreation.html]
|
||||||
[test_select.html]
|
[test_select.html]
|
||||||
[test_shutdown.xul]
|
[test_shutdown.xul]
|
||||||
|
[test_table.html]
|
||||||
[test_textleaf.html]
|
[test_textleaf.html]
|
||||||
[test_visibility.html]
|
[test_visibility.html]
|
||||||
[test_whitespace.html]
|
[test_whitespace.html]
|
||||||
|
81
accessible/tests/mochitest/treeupdate/test_table.html
Normal file
81
accessible/tests/mochitest/treeupdate/test_table.html
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Table update tests</title>
|
||||||
|
<link rel="stylesheet" type="text/css"
|
||||||
|
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||||
|
|
||||||
|
<script type="application/javascript"
|
||||||
|
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||||
|
|
||||||
|
<script type="application/javascript"
|
||||||
|
src="../common.js"></script>
|
||||||
|
<script type="application/javascript"
|
||||||
|
src="../role.js"></script>
|
||||||
|
<script type="application/javascript"
|
||||||
|
src="../events.js"></script>
|
||||||
|
|
||||||
|
<script type="application/javascript">
|
||||||
|
|
||||||
|
function appendCaption(aTableID)
|
||||||
|
{
|
||||||
|
this.invoke = function appendCaption_invoke()
|
||||||
|
{
|
||||||
|
// append a caption, it should appear as a first element in the
|
||||||
|
// accessible tree.
|
||||||
|
var caption = document.createElement("caption");
|
||||||
|
caption.textContent = "table caption";
|
||||||
|
getNode(aTableID).appendChild(caption);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.eventSeq = [
|
||||||
|
new invokerChecker(EVENT_REORDER, aTableID)
|
||||||
|
];
|
||||||
|
|
||||||
|
this.finalCheck = function appendCaption_finalCheck()
|
||||||
|
{
|
||||||
|
var tree =
|
||||||
|
{ TABLE: [
|
||||||
|
{ CAPTION: [
|
||||||
|
{ TEXT_LEAF: [] }
|
||||||
|
] },
|
||||||
|
{ ROW: [
|
||||||
|
{ CELL: [ {TEXT_LEAF: [] }]},
|
||||||
|
{ CELL: [ {TEXT_LEAF: [] }]}
|
||||||
|
] }
|
||||||
|
] };
|
||||||
|
testAccessibleTree(aTableID, tree);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getID = function appendCaption_getID()
|
||||||
|
{
|
||||||
|
return "append caption";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function doTest()
|
||||||
|
{
|
||||||
|
gQueue = new eventQueue();
|
||||||
|
gQueue.push(new appendCaption("table"));
|
||||||
|
gQueue.invoke(); // Will call SimpleTest.finish();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
SimpleTest.waitForExplicitFinish();
|
||||||
|
addA11yLoadEvent(doTest);
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p id="display"></p>
|
||||||
|
<div id="content" style="display: none"></div>
|
||||||
|
<pre id="test">
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<table id="table">
|
||||||
|
<tr>
|
||||||
|
<td>cell1</td>
|
||||||
|
<td>cell2</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -650,7 +650,6 @@ var settingsToObserve = {
|
|||||||
'dom.mozApps.signed_apps_installable_from': 'https://marketplace.firefox.com',
|
'dom.mozApps.signed_apps_installable_from': 'https://marketplace.firefox.com',
|
||||||
'dom.presentation.discovery.enabled': false,
|
'dom.presentation.discovery.enabled': false,
|
||||||
'dom.presentation.discoverable': false,
|
'dom.presentation.discoverable': false,
|
||||||
'dom.serviceWorkers.interception.enabled': true,
|
|
||||||
'dom.serviceWorkers.testing.enabled': false,
|
'dom.serviceWorkers.testing.enabled': false,
|
||||||
'gfx.layerscope.enabled': false,
|
'gfx.layerscope.enabled': false,
|
||||||
'layers.draw-borders': false,
|
'layers.draw-borders': false,
|
||||||
|
@ -210,7 +210,6 @@ function setup() {
|
|||||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||||
["dom.serviceWorkers.enabled", true],
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.testing.enabled", true],
|
["dom.serviceWorkers.testing.enabled", true],
|
||||||
["dom.serviceWorkers.interception.enabled", true]
|
|
||||||
]}, () => {
|
]}, () => {
|
||||||
SpecialPowers.pushPermissions([
|
SpecialPowers.pushPermissions([
|
||||||
{ "type": "webapps-manage", "allow": 1, "context": document },
|
{ "type": "webapps-manage", "allow": 1, "context": document },
|
||||||
|
@ -792,18 +792,6 @@
|
|||||||
@RESPATH@/res/table-remove-row-active.gif
|
@RESPATH@/res/table-remove-row-active.gif
|
||||||
@RESPATH@/res/table-remove-row-hover.gif
|
@RESPATH@/res/table-remove-row-hover.gif
|
||||||
@RESPATH@/res/table-remove-row.gif
|
@RESPATH@/res/table-remove-row.gif
|
||||||
@RESPATH@/res/accessiblecaret.png
|
|
||||||
@RESPATH@/res/accessiblecaret@1.5x.png
|
|
||||||
@RESPATH@/res/accessiblecaret@2.25x.png
|
|
||||||
@RESPATH@/res/accessiblecaret@2x.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_left.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_left@1.5x.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_left@2.25x.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_left@2x.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_right.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_right@1.5x.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_right@2.25x.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_right@2x.png
|
|
||||||
@RESPATH@/res/grabber.gif
|
@RESPATH@/res/grabber.gif
|
||||||
#ifdef XP_MACOSX
|
#ifdef XP_MACOSX
|
||||||
@RESPATH@/res/cursors/*
|
@RESPATH@/res/cursors/*
|
||||||
|
@ -1635,7 +1635,6 @@ pref("reader.errors.includeURLs", true);
|
|||||||
pref("view_source.tab", true);
|
pref("view_source.tab", true);
|
||||||
|
|
||||||
pref("dom.serviceWorkers.enabled", true);
|
pref("dom.serviceWorkers.enabled", true);
|
||||||
pref("dom.serviceWorkers.interception.enabled", true);
|
|
||||||
pref("dom.serviceWorkers.openWindow.enabled", true);
|
pref("dom.serviceWorkers.openWindow.enabled", true);
|
||||||
pref("dom.webnotifications.serviceworker.enabled", true);
|
pref("dom.webnotifications.serviceworker.enabled", true);
|
||||||
|
|
||||||
|
@ -108,7 +108,8 @@ var SessionStorageInternal = {
|
|||||||
let principal;
|
let principal;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let attrs = ChromeUtils.createOriginAttributesWithUserContextId(origin, aDocShell.userContextId);
|
let attrs = ChromeUtils.createDefaultOriginAttributes();
|
||||||
|
attrs.userContextId = aDocShell.userContextId;
|
||||||
let originURI = Services.io.newURI(origin, null, null);
|
let originURI = Services.io.newURI(origin, null, null);
|
||||||
principal = Services.scriptSecurityManager.createCodebasePrincipal(originURI, attrs);
|
principal = Services.scriptSecurityManager.createCodebasePrincipal(originURI, attrs);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -735,18 +735,6 @@
|
|||||||
@RESPATH@/res/table-remove-row-active.gif
|
@RESPATH@/res/table-remove-row-active.gif
|
||||||
@RESPATH@/res/table-remove-row-hover.gif
|
@RESPATH@/res/table-remove-row-hover.gif
|
||||||
@RESPATH@/res/table-remove-row.gif
|
@RESPATH@/res/table-remove-row.gif
|
||||||
@RESPATH@/res/accessiblecaret.png
|
|
||||||
@RESPATH@/res/accessiblecaret@1.5x.png
|
|
||||||
@RESPATH@/res/accessiblecaret@2.25x.png
|
|
||||||
@RESPATH@/res/accessiblecaret@2x.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_left.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_left@1.5x.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_left@2.25x.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_left@2x.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_right.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_right@1.5x.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_right@2.25x.png
|
|
||||||
@RESPATH@/res/accessiblecaret_tilt_right@2x.png
|
|
||||||
@RESPATH@/res/grabber.gif
|
@RESPATH@/res/grabber.gif
|
||||||
#ifdef XP_MACOSX
|
#ifdef XP_MACOSX
|
||||||
@RESPATH@/res/cursors/*
|
@RESPATH@/res/cursors/*
|
||||||
|
@ -33,9 +33,28 @@ function checkOriginAttributes(prin, attrs, suffix) {
|
|||||||
} else {
|
} else {
|
||||||
checkThrows(() => ssm.createCodebasePrincipalFromOrigin(prin.origin));
|
checkThrows(() => ssm.createCodebasePrincipalFromOrigin(prin.origin));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
do_check_eq(ChromeUtils.createOriginAttributesWithUserContextId("http://example.org", 2).userContextId, 2);
|
// utility function useful for debugging
|
||||||
do_check_eq(ChromeUtils.createOriginAttributesWithUserContextId("https://www.example.com:123^userContextId=4", 2).userContextId, 2);
|
function printAttrs(name, attrs) {
|
||||||
|
do_print(name + " {\n" +
|
||||||
|
"\tappId: " + attrs.appId + ",\n" +
|
||||||
|
"\tuserContextId: " + attrs.userContextId + ",\n" +
|
||||||
|
"\tinBrowser: " + attrs.inBrowser + ",\n" +
|
||||||
|
"\taddonId: '" + attrs.addonId + "',\n" +
|
||||||
|
"\tsignedPkg: '" + attrs.signedPkg + "'\n}");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function checkValues(attrs, values) {
|
||||||
|
values = values || {};
|
||||||
|
//printAttrs("attrs", attrs);
|
||||||
|
//printAttrs("values", values);
|
||||||
|
do_check_eq(attrs.appId, values.appId || 0);
|
||||||
|
do_check_eq(attrs.userContextId, values.userContextId || 0);
|
||||||
|
do_check_eq(attrs.inBrowser, values.inBrowser || false);
|
||||||
|
do_check_eq(attrs.addonId, values.addonId || '');
|
||||||
|
do_check_eq(attrs.signedPkg, values.signedPkg || '');
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
@ -177,4 +196,83 @@ function run_test() {
|
|||||||
checkKind(ssm.createCodebasePrincipal(makeURI('http://www.example.com'), {}), 'codebasePrincipal');
|
checkKind(ssm.createCodebasePrincipal(makeURI('http://www.example.com'), {}), 'codebasePrincipal');
|
||||||
checkKind(ssm.createExpandedPrincipal([ssm.createCodebasePrincipal(makeURI('http://www.example.com'), {})]), 'expandedPrincipal');
|
checkKind(ssm.createExpandedPrincipal([ssm.createCodebasePrincipal(makeURI('http://www.example.com'), {})]), 'expandedPrincipal');
|
||||||
checkKind(ssm.getSystemPrincipal(), 'systemPrincipal');
|
checkKind(ssm.getSystemPrincipal(), 'systemPrincipal');
|
||||||
|
|
||||||
|
//
|
||||||
|
// Test Origin Attribute Manipulation
|
||||||
|
//
|
||||||
|
|
||||||
|
// check that we can create an empty origin attributes dict with default
|
||||||
|
// members and values.
|
||||||
|
emptyAttrs = ChromeUtils.createDefaultOriginAttributes();
|
||||||
|
checkValues(emptyAttrs);
|
||||||
|
|
||||||
|
var uri = "http://example.org";
|
||||||
|
var tests = [
|
||||||
|
[ "", {} ],
|
||||||
|
[ "^appId=5", {appId: 5} ],
|
||||||
|
[ "^userContextId=3", {userContextId: 3} ],
|
||||||
|
[ "^addonId=fooBar", {addonId: "fooBar"} ],
|
||||||
|
[ "^inBrowser=1", {inBrowser: true} ],
|
||||||
|
[ "^signedPkg=bazQux", {signedPkg: "bazQux"} ],
|
||||||
|
[ "^appId=3&inBrowser=1&userContextId=6",
|
||||||
|
{appId: 3, userContextId: 6, inBrowser: true} ] ];
|
||||||
|
|
||||||
|
// check that we can create an origin attributes from an origin properly
|
||||||
|
tests.forEach(function(t) {
|
||||||
|
let attrs = ChromeUtils.createOriginAttributesFromOrigin(uri + t[0]);
|
||||||
|
checkValues(attrs, t[1]);
|
||||||
|
do_check_eq(ChromeUtils.originAttributesToSuffix(attrs), t[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
// check that we can create an origin attributes from a dict properly
|
||||||
|
tests.forEach(function(t) {
|
||||||
|
let attrs = ChromeUtils.createOriginAttributesFromDict(t[1]);
|
||||||
|
checkValues(attrs, t[1]);
|
||||||
|
do_check_eq(ChromeUtils.originAttributesToSuffix(attrs), t[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
// each row in the set_tests array has these values:
|
||||||
|
// [0] - the suffix used to create an origin attribute from
|
||||||
|
// [1] - the expected result of creating an origin attribute from [0]
|
||||||
|
// [2] - the pattern to set on the origin attributes
|
||||||
|
// [3] - the expected result of setting [2] values on [1]
|
||||||
|
// [4] - the expected result of creating a suffix from [3]
|
||||||
|
var set_tests = [
|
||||||
|
[ "", {}, {appId: 5}, {appId: 5}, "^appId=5" ],
|
||||||
|
[ "^appId=5", {appId: 5}, {appId: 3}, {appId: 3}, "^appId=3" ],
|
||||||
|
[ "^appId=5", {appId: 5}, {userContextId: 3}, {appId: 5, userContextId: 3}, "^appId=5&userContextId=3" ],
|
||||||
|
[ "^appId=5", {appId: 5}, {appId: 3, userContextId: 7}, {appId: 3, userContextId: 7}, "^appId=3&userContextId=7" ] ];
|
||||||
|
|
||||||
|
// check that we can set origin attributes values properly
|
||||||
|
set_tests.forEach(function(t) {
|
||||||
|
let orig = ChromeUtils.createOriginAttributesFromOrigin(uri + t[0]);
|
||||||
|
checkValues(orig, t[1]);
|
||||||
|
let mod = orig;
|
||||||
|
for (var key in t[2]) {
|
||||||
|
mod[key] = t[2][key];
|
||||||
|
}
|
||||||
|
checkValues(mod, t[3]);
|
||||||
|
do_check_eq(ChromeUtils.originAttributesToSuffix(mod), t[4]);
|
||||||
|
});
|
||||||
|
|
||||||
|
// each row in the dflt_tests array has these values:
|
||||||
|
// [0] - the suffix used to create an origin attribute from
|
||||||
|
// [1] - the expected result of creating an origin attributes from [0]
|
||||||
|
// [2] - the expected result after setting userContextId to the default
|
||||||
|
// [3] - the expected result of creating a suffix from [2]
|
||||||
|
var dflt_tests = [
|
||||||
|
[ "", {}, {}, "" ],
|
||||||
|
[ "^userContextId=3", {userContextId: 3}, {}, "" ],
|
||||||
|
[ "^appId=5", {appId: 5}, {appId: 5}, "^appId=5" ],
|
||||||
|
[ "^appId=5&userContextId=3", {appId: 5, userContextId: 3}, {appId: 5}, "^appId=5" ] ];
|
||||||
|
|
||||||
|
// check that we can set the userContextId to default properly
|
||||||
|
dflt_tests.forEach(function(t) {
|
||||||
|
let orig = ChromeUtils.createOriginAttributesFromOrigin(uri + t[0]);
|
||||||
|
checkValues(orig, t[1]);
|
||||||
|
let mod = orig;
|
||||||
|
mod['userContextId'] = 0;
|
||||||
|
checkValues(mod, t[2]);
|
||||||
|
do_check_eq(ChromeUtils.originAttributesToSuffix(mod), t[3]);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
@ -1158,18 +1158,6 @@ ifneq (,$(DIST_SUBDIR)$(XPI_NAME))
|
|||||||
PREF_DIR = defaults/preferences
|
PREF_DIR = defaults/preferences
|
||||||
endif
|
endif
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Copy each element of AUTOCFG_JS_EXPORTS to $(FINAL_TARGET)/defaults/autoconfig
|
|
||||||
|
|
||||||
ifneq ($(AUTOCFG_JS_EXPORTS),)
|
|
||||||
ifndef NO_DIST_INSTALL
|
|
||||||
AUTOCFG_JS_EXPORTS_FILES := $(AUTOCFG_JS_EXPORTS)
|
|
||||||
AUTOCFG_JS_EXPORTS_DEST := $(FINAL_TARGET)/defaults/autoconfig
|
|
||||||
AUTOCFG_JS_EXPORTS_TARGET := export
|
|
||||||
INSTALL_TARGETS += AUTOCFG_JS_EXPORTS
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# SDK
|
# SDK
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ const TAB_URL = HTTP_ROOT + "service-workers/empty-sw.html";
|
|||||||
add_task(function* () {
|
add_task(function* () {
|
||||||
yield new Promise(done => {
|
yield new Promise(done => {
|
||||||
let options = {"set": [
|
let options = {"set": [
|
||||||
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.testing.enabled", true],
|
["dom.serviceWorkers.testing.enabled", true],
|
||||||
]};
|
]};
|
||||||
SpecialPowers.pushPrefEnv(options, done);
|
SpecialPowers.pushPrefEnv(options, done);
|
||||||
|
@ -32,6 +32,7 @@ marker.label.cycleCollection=Cycle Collection
|
|||||||
marker.label.cycleCollection.forgetSkippable=CC Graph Reduction
|
marker.label.cycleCollection.forgetSkippable=CC Graph Reduction
|
||||||
marker.label.timestamp=Timestamp
|
marker.label.timestamp=Timestamp
|
||||||
marker.label.worker=Worker
|
marker.label.worker=Worker
|
||||||
|
marker.label.messagePort=MessagePort
|
||||||
marker.label.unknown=Unknown
|
marker.label.unknown=Unknown
|
||||||
|
|
||||||
# LOCALIZATION NOTE (marker.label.javascript.*):
|
# LOCALIZATION NOTE (marker.label.javascript.*):
|
||||||
@ -82,6 +83,9 @@ marker.worker.serializeDataOffMainThread=Serialize data in Worker
|
|||||||
marker.worker.serializeDataOnMainThread=Serialize data on the main thread
|
marker.worker.serializeDataOnMainThread=Serialize data on the main thread
|
||||||
marker.worker.deserializeDataOffMainThread=Deserialize data in Worker
|
marker.worker.deserializeDataOffMainThread=Deserialize data in Worker
|
||||||
marker.worker.deserializeDataOnMainThread=Deserialize data on the main thread
|
marker.worker.deserializeDataOnMainThread=Deserialize data on the main thread
|
||||||
|
# The type of operation performed by a MessagePort
|
||||||
|
marker.messagePort.serializeData=Serialize data
|
||||||
|
marker.messagePort.deserializeData=Deserialize data
|
||||||
|
|
||||||
# Strings used in the waterfall sidebar as values.
|
# Strings used in the waterfall sidebar as values.
|
||||||
marker.value.unknownFrame=<unknown location>
|
marker.value.unknownFrame=<unknown location>
|
||||||
|
@ -147,6 +147,13 @@ const Formatters = {
|
|||||||
[L10N.getStr("marker.field.type")]:
|
[L10N.getStr("marker.field.type")]:
|
||||||
L10N.getStr(`marker.worker.${marker.workerOperation}`)
|
L10N.getStr(`marker.worker.${marker.workerOperation}`)
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
MessagePortFields: function(marker) {
|
||||||
|
return {
|
||||||
|
[L10N.getStr("marker.field.type")]:
|
||||||
|
L10N.getStr(`marker.messagePort.${marker.messagePortOperation}`)
|
||||||
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -147,6 +147,12 @@ const TIMELINE_BLUEPRINT = {
|
|||||||
label: L10N.getStr("marker.label.worker"),
|
label: L10N.getStr("marker.label.worker"),
|
||||||
fields: Formatters.WorkerFields
|
fields: Formatters.WorkerFields
|
||||||
},
|
},
|
||||||
|
"MessagePort": {
|
||||||
|
group: 1,
|
||||||
|
colorName: "graphs-orange",
|
||||||
|
label: L10N.getStr("marker.label.messagePort"),
|
||||||
|
fields: Formatters.MessagePortFields
|
||||||
|
},
|
||||||
|
|
||||||
/* Group 2 - User Controlled */
|
/* Group 2 - User Controlled */
|
||||||
"ConsoleTime": {
|
"ConsoleTime": {
|
||||||
|
@ -105,7 +105,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.viewport-rotate-button {
|
.viewport-rotate-button {
|
||||||
mask-image: url("./images/rotate-viewport.svg");
|
mask: url("./images/rotate-viewport.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,6 +56,7 @@ let startTest = Task.async(function*() {
|
|||||||
|
|
||||||
yield new Promise(resolve => {
|
yield new Promise(resolve => {
|
||||||
SpecialPowers.pushPrefEnv({"set": [
|
SpecialPowers.pushPrefEnv({"set": [
|
||||||
|
["dom.serviceWorkers.enabled", true],
|
||||||
["devtools.webconsole.filter.serviceworkers", true]
|
["devtools.webconsole.filter.serviceworkers", true]
|
||||||
]}, resolve);
|
]}, resolve);
|
||||||
});
|
});
|
||||||
|
@ -49,6 +49,7 @@ let startTest = Task.async(function*() {
|
|||||||
|
|
||||||
yield new Promise(resolve => {
|
yield new Promise(resolve => {
|
||||||
SpecialPowers.pushPrefEnv({"set": [
|
SpecialPowers.pushPrefEnv({"set": [
|
||||||
|
["dom.serviceWorkers.enabled", true],
|
||||||
["devtools.webconsole.filter.serviceworkers", true]
|
["devtools.webconsole.filter.serviceworkers", true]
|
||||||
]}, resolve);
|
]}, resolve);
|
||||||
});
|
});
|
||||||
|
@ -14157,11 +14157,6 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNonSubresourceReques
|
|||||||
bool* aShouldIntercept)
|
bool* aShouldIntercept)
|
||||||
{
|
{
|
||||||
*aShouldIntercept = false;
|
*aShouldIntercept = false;
|
||||||
// Preffed off.
|
|
||||||
if (!nsContentUtils::ServiceWorkerInterceptionEnabled()) {
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
// No in private browsing
|
// No in private browsing
|
||||||
if (mInPrivateBrowsing) {
|
if (mInPrivateBrowsing) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -30,12 +30,12 @@ private:
|
|||||||
void operator=(const AbstractTimelineMarker& aOther) = delete;
|
void operator=(const AbstractTimelineMarker& aOther) = delete;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AbstractTimelineMarker(const char* aName,
|
AbstractTimelineMarker(const char* aName,
|
||||||
MarkerTracingType aTracingType);
|
MarkerTracingType aTracingType);
|
||||||
|
|
||||||
explicit AbstractTimelineMarker(const char* aName,
|
AbstractTimelineMarker(const char* aName,
|
||||||
const TimeStamp& aTime,
|
const TimeStamp& aTime,
|
||||||
MarkerTracingType aTracingType);
|
MarkerTracingType aTracingType);
|
||||||
|
|
||||||
virtual ~AbstractTimelineMarker();
|
virtual ~AbstractTimelineMarker();
|
||||||
|
|
||||||
|
@ -38,8 +38,8 @@ class MOZ_RAII AutoTimelineMarker
|
|||||||
RefPtr<nsIDocShell> mDocShell;
|
RefPtr<nsIDocShell> mDocShell;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AutoTimelineMarker(nsIDocShell* aDocShell, const char* aName
|
AutoTimelineMarker(nsIDocShell* aDocShell,
|
||||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
|
const char* aName MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
|
||||||
~AutoTimelineMarker();
|
~AutoTimelineMarker();
|
||||||
|
|
||||||
AutoTimelineMarker(const AutoTimelineMarker& aOther) = delete;
|
AutoTimelineMarker(const AutoTimelineMarker& aOther) = delete;
|
||||||
|
@ -15,8 +15,8 @@ namespace mozilla {
|
|||||||
class CompositeTimelineMarker : public TimelineMarker
|
class CompositeTimelineMarker : public TimelineMarker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit CompositeTimelineMarker(const TimeStamp& aTime,
|
CompositeTimelineMarker(const TimeStamp& aTime,
|
||||||
MarkerTracingType aTracingType)
|
MarkerTracingType aTracingType)
|
||||||
: TimelineMarker("Composite", aTime, aTracingType)
|
: TimelineMarker("Composite", aTime, aTracingType)
|
||||||
{
|
{
|
||||||
// Even though these markers end up being created on the main thread in the
|
// Even though these markers end up being created on the main thread in the
|
||||||
|
@ -15,8 +15,8 @@ namespace mozilla {
|
|||||||
class ConsoleTimelineMarker : public TimelineMarker
|
class ConsoleTimelineMarker : public TimelineMarker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit ConsoleTimelineMarker(const nsAString& aCause,
|
ConsoleTimelineMarker(const nsAString& aCause,
|
||||||
MarkerTracingType aTracingType)
|
MarkerTracingType aTracingType)
|
||||||
: TimelineMarker("ConsoleTime", aTracingType)
|
: TimelineMarker("ConsoleTime", aTracingType)
|
||||||
, mCause(aCause)
|
, mCause(aCause)
|
||||||
{
|
{
|
||||||
|
@ -15,9 +15,9 @@ namespace mozilla {
|
|||||||
class EventTimelineMarker : public TimelineMarker
|
class EventTimelineMarker : public TimelineMarker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit EventTimelineMarker(const nsAString& aType,
|
EventTimelineMarker(const nsAString& aType,
|
||||||
uint16_t aPhase,
|
uint16_t aPhase,
|
||||||
MarkerTracingType aTracingType)
|
MarkerTracingType aTracingType)
|
||||||
: TimelineMarker("DOMEvent", aTracingType)
|
: TimelineMarker("DOMEvent", aTracingType)
|
||||||
, mType(aType)
|
, mType(aType)
|
||||||
, mPhase(aPhase)
|
, mPhase(aPhase)
|
||||||
|
@ -17,13 +17,13 @@ namespace mozilla {
|
|||||||
class JavascriptTimelineMarker : public TimelineMarker
|
class JavascriptTimelineMarker : public TimelineMarker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit JavascriptTimelineMarker(const char* aReason,
|
JavascriptTimelineMarker(const char* aReason,
|
||||||
const char16_t* aFunctionName,
|
const char16_t* aFunctionName,
|
||||||
const char16_t* aFileName,
|
const char16_t* aFileName,
|
||||||
uint32_t aLineNumber,
|
uint32_t aLineNumber,
|
||||||
MarkerTracingType aTracingType,
|
MarkerTracingType aTracingType,
|
||||||
JS::Handle<JS::Value> aAsyncStack,
|
JS::Handle<JS::Value> aAsyncStack,
|
||||||
JS::Handle<JS::Value> aAsyncCause)
|
JS::Handle<JS::Value> aAsyncCause)
|
||||||
: TimelineMarker("Javascript", aTracingType, MarkerStackRequest::NO_STACK)
|
: TimelineMarker("Javascript", aTracingType, MarkerStackRequest::NO_STACK)
|
||||||
, mCause(NS_ConvertUTF8toUTF16(aReason))
|
, mCause(NS_ConvertUTF8toUTF16(aReason))
|
||||||
, mFunctionName(aFunctionName)
|
, mFunctionName(aFunctionName)
|
||||||
|
47
docshell/base/timeline/MessagePortTimelineMarker.h
Normal file
47
docshell/base/timeline/MessagePortTimelineMarker.h
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/* -*- 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_MessagePortTimelineMarker_h_
|
||||||
|
#define mozilla_MessagePortTimelineMarker_h_
|
||||||
|
|
||||||
|
#include "TimelineMarker.h"
|
||||||
|
#include "mozilla/dom/ProfileTimelineMarkerBinding.h"
|
||||||
|
|
||||||
|
namespace mozilla {
|
||||||
|
|
||||||
|
class MessagePortTimelineMarker : public TimelineMarker
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MessagePortTimelineMarker(dom::ProfileTimelineMessagePortOperationType aOperationType,
|
||||||
|
MarkerTracingType aTracingType)
|
||||||
|
: TimelineMarker("MessagePort", aTracingType, MarkerStackRequest::NO_STACK)
|
||||||
|
, mOperationType(aOperationType)
|
||||||
|
{}
|
||||||
|
|
||||||
|
virtual UniquePtr<AbstractTimelineMarker> Clone() override
|
||||||
|
{
|
||||||
|
MessagePortTimelineMarker* clone =
|
||||||
|
new MessagePortTimelineMarker(mOperationType, GetTracingType());
|
||||||
|
clone->SetCustomTime(GetTime());
|
||||||
|
return UniquePtr<AbstractTimelineMarker>(clone);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void AddDetails(JSContext* aCx, dom::ProfileTimelineMarker& aMarker) override
|
||||||
|
{
|
||||||
|
TimelineMarker::AddDetails(aCx, aMarker);
|
||||||
|
|
||||||
|
if (GetTracingType() == MarkerTracingType::START) {
|
||||||
|
aMarker.mMessagePortOperation.Construct(mOperationType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
dom::ProfileTimelineMessagePortOperationType mOperationType;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace mozilla
|
||||||
|
|
||||||
|
#endif /* mozilla_MessagePortTimelineMarker_h_ */
|
@ -15,8 +15,8 @@ namespace mozilla {
|
|||||||
class RestyleTimelineMarker : public TimelineMarker
|
class RestyleTimelineMarker : public TimelineMarker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit RestyleTimelineMarker(nsRestyleHint aRestyleHint,
|
RestyleTimelineMarker(nsRestyleHint aRestyleHint,
|
||||||
MarkerTracingType aTracingType)
|
MarkerTracingType aTracingType)
|
||||||
: TimelineMarker("Styles", aTracingType)
|
: TimelineMarker("Styles", aTracingType)
|
||||||
{
|
{
|
||||||
if (aRestyleHint) {
|
if (aRestyleHint) {
|
||||||
|
@ -18,14 +18,14 @@ namespace mozilla {
|
|||||||
class TimelineMarker : public AbstractTimelineMarker
|
class TimelineMarker : public AbstractTimelineMarker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit TimelineMarker(const char* aName,
|
TimelineMarker(const char* aName,
|
||||||
MarkerTracingType aTracingType,
|
MarkerTracingType aTracingType,
|
||||||
MarkerStackRequest aStackRequest = MarkerStackRequest::STACK);
|
MarkerStackRequest aStackRequest = MarkerStackRequest::STACK);
|
||||||
|
|
||||||
explicit TimelineMarker(const char* aName,
|
TimelineMarker(const char* aName,
|
||||||
const TimeStamp& aTime,
|
const TimeStamp& aTime,
|
||||||
MarkerTracingType aTracingType,
|
MarkerTracingType aTracingType,
|
||||||
MarkerStackRequest aStackRequest = MarkerStackRequest::STACK);
|
MarkerStackRequest aStackRequest = MarkerStackRequest::STACK);
|
||||||
|
|
||||||
virtual void AddDetails(JSContext* aCx, dom::ProfileTimelineMarker& aMarker) override;
|
virtual void AddDetails(JSContext* aCx, dom::ProfileTimelineMarker& aMarker) override;
|
||||||
virtual JSObject* GetStack() override;
|
virtual JSObject* GetStack() override;
|
||||||
|
@ -15,8 +15,8 @@ namespace mozilla {
|
|||||||
class WorkerTimelineMarker : public TimelineMarker
|
class WorkerTimelineMarker : public TimelineMarker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit WorkerTimelineMarker(ProfileTimelineWorkerOperationType aOperationType,
|
WorkerTimelineMarker(ProfileTimelineWorkerOperationType aOperationType,
|
||||||
MarkerTracingType aTracingType)
|
MarkerTracingType aTracingType)
|
||||||
: TimelineMarker("Worker", aTracingType, MarkerStackRequest::NO_STACK)
|
: TimelineMarker("Worker", aTracingType, MarkerStackRequest::NO_STACK)
|
||||||
, mOperationType(aOperationType)
|
, mOperationType(aOperationType)
|
||||||
{}
|
{}
|
||||||
|
@ -15,6 +15,7 @@ EXPORTS.mozilla += [
|
|||||||
'JavascriptTimelineMarker.h',
|
'JavascriptTimelineMarker.h',
|
||||||
'LayerTimelineMarker.h',
|
'LayerTimelineMarker.h',
|
||||||
'MarkersStorage.h',
|
'MarkersStorage.h',
|
||||||
|
'MessagePortTimelineMarker.h',
|
||||||
'ObservedDocShell.h',
|
'ObservedDocShell.h',
|
||||||
'RestyleTimelineMarker.h',
|
'RestyleTimelineMarker.h',
|
||||||
'TimelineConsumers.h',
|
'TimelineConsumers.h',
|
||||||
|
@ -179,9 +179,7 @@ const mozilla::Module::ContractIDEntry kDocShellContracts[] = {
|
|||||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "neterror", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
|
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "neterror", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
|
||||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "networking", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
|
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "networking", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
|
||||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "newaddon", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
|
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "newaddon", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
|
||||||
#ifdef NIGHTLY_BUILD
|
|
||||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "performance", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
|
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "performance", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
|
||||||
#endif
|
|
||||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "plugins", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
|
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "plugins", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
|
||||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "serviceworkers", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
|
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "serviceworkers", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
|
||||||
#ifndef ANDROID
|
#ifndef ANDROID
|
||||||
|
@ -50,7 +50,7 @@ ThreadSafeChromeUtils::NondeterministicGetWeakSetKeys(GlobalObject& aGlobal,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ void
|
/* static */ void
|
||||||
ChromeUtils::OriginAttributesToSuffix(dom::GlobalObject& aGlobal,
|
ChromeUtils::OriginAttributesToSuffix(dom::GlobalObject& aGlobal,
|
||||||
const dom::OriginAttributesDictionary& aAttrs,
|
const dom::OriginAttributesDictionary& aAttrs,
|
||||||
nsCString& aSuffix)
|
nsCString& aSuffix)
|
||||||
@ -71,11 +71,17 @@ ChromeUtils::OriginAttributesMatchPattern(dom::GlobalObject& aGlobal,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* static */ void
|
/* static */ void
|
||||||
ChromeUtils::CreateOriginAttributesWithUserContextId(dom::GlobalObject& aGlobal,
|
ChromeUtils::CreateDefaultOriginAttributes(dom::GlobalObject& aGlobal,
|
||||||
const nsAString& aOrigin,
|
dom::OriginAttributesDictionary& aAttrs)
|
||||||
uint32_t aUserContextId,
|
{
|
||||||
dom::OriginAttributesDictionary& aAttrs,
|
aAttrs = GenericOriginAttributes();
|
||||||
ErrorResult& aRv)
|
}
|
||||||
|
|
||||||
|
/* static */ void
|
||||||
|
ChromeUtils::CreateOriginAttributesFromOrigin(dom::GlobalObject& aGlobal,
|
||||||
|
const nsAString& aOrigin,
|
||||||
|
dom::OriginAttributesDictionary& aAttrs,
|
||||||
|
ErrorResult& aRv)
|
||||||
{
|
{
|
||||||
GenericOriginAttributes attrs;
|
GenericOriginAttributes attrs;
|
||||||
nsAutoCString suffix;
|
nsAutoCString suffix;
|
||||||
@ -83,11 +89,18 @@ ChromeUtils::CreateOriginAttributesWithUserContextId(dom::GlobalObject& aGlobal,
|
|||||||
aRv.Throw(NS_ERROR_FAILURE);
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
attrs.mUserContextId = aUserContextId;
|
|
||||||
aAttrs = attrs;
|
aAttrs = attrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* static */ void
|
||||||
|
ChromeUtils::CreateOriginAttributesFromDict(dom::GlobalObject& aGlobal,
|
||||||
|
const dom::OriginAttributesDictionary& aAttrs,
|
||||||
|
dom::OriginAttributesDictionary& aNewAttrs)
|
||||||
|
{
|
||||||
|
aNewAttrs = aAttrs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* static */ bool
|
/* static */ bool
|
||||||
ChromeUtils::IsOriginAttributesEqual(dom::GlobalObject& aGlobal,
|
ChromeUtils::IsOriginAttributesEqual(dom::GlobalObject& aGlobal,
|
||||||
const dom::OriginAttributesDictionary& aA,
|
const dom::OriginAttributesDictionary& aA,
|
||||||
|
@ -59,11 +59,19 @@ public:
|
|||||||
const dom::OriginAttributesPatternDictionary& aPattern);
|
const dom::OriginAttributesPatternDictionary& aPattern);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CreateOriginAttributesWithUserContextId(dom::GlobalObject& aGlobal,
|
CreateDefaultOriginAttributes(dom::GlobalObject& aGlobal,
|
||||||
const nsAString& aOrigin,
|
dom::OriginAttributesDictionary& aAttrs);
|
||||||
uint32_t aUserContextId,
|
|
||||||
dom::OriginAttributesDictionary& aAttrs,
|
static void
|
||||||
ErrorResult& aRv);
|
CreateOriginAttributesFromOrigin(dom::GlobalObject& aGlobal,
|
||||||
|
const nsAString& aOrigin,
|
||||||
|
dom::OriginAttributesDictionary& aAttrs,
|
||||||
|
ErrorResult& aRv);
|
||||||
|
|
||||||
|
static void
|
||||||
|
CreateOriginAttributesFromDict(dom::GlobalObject& aGlobal,
|
||||||
|
const dom::OriginAttributesDictionary& aAttrs,
|
||||||
|
dom::OriginAttributesDictionary& aNewAttrs);
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
IsOriginAttributesEqual(dom::GlobalObject& aGlobal,
|
IsOriginAttributesEqual(dom::GlobalObject& aGlobal,
|
||||||
|
@ -295,6 +295,7 @@ StructuredCloneHolder::Read(nsISupports* aParent,
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT_IF(mSupportedContext == SameProcessSameThread,
|
MOZ_ASSERT_IF(mSupportedContext == SameProcessSameThread,
|
||||||
mCreationThread == NS_GetCurrentThread());
|
mCreationThread == NS_GetCurrentThread());
|
||||||
|
MOZ_ASSERT(aParent);
|
||||||
|
|
||||||
mozilla::AutoRestore<nsISupports*> guard(mParent);
|
mozilla::AutoRestore<nsISupports*> guard(mParent);
|
||||||
mParent = aParent;
|
mParent = aParent;
|
||||||
@ -1044,9 +1045,11 @@ StructuredCloneHolder::CustomReadTransferHandler(JSContext* aCx,
|
|||||||
MOZ_ASSERT(aExtraData < mPortIdentifiers.Length());
|
MOZ_ASSERT(aExtraData < mPortIdentifiers.Length());
|
||||||
const MessagePortIdentifier& portIdentifier = mPortIdentifiers[aExtraData];
|
const MessagePortIdentifier& portIdentifier = mPortIdentifiers[aExtraData];
|
||||||
|
|
||||||
|
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(mParent);
|
||||||
|
|
||||||
ErrorResult rv;
|
ErrorResult rv;
|
||||||
RefPtr<MessagePort> port =
|
RefPtr<MessagePort> port =
|
||||||
MessagePort::Create(mParent, portIdentifier, rv);
|
MessagePort::Create(global, portIdentifier, rv);
|
||||||
if (NS_WARN_IF(rv.Failed())) {
|
if (NS_WARN_IF(rv.Failed())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -274,7 +274,6 @@ bool nsContentUtils::sEncodeDecodeURLHash = false;
|
|||||||
bool nsContentUtils::sGettersDecodeURLHash = false;
|
bool nsContentUtils::sGettersDecodeURLHash = false;
|
||||||
bool nsContentUtils::sPrivacyResistFingerprinting = false;
|
bool nsContentUtils::sPrivacyResistFingerprinting = false;
|
||||||
bool nsContentUtils::sSendPerformanceTimingNotifications = false;
|
bool nsContentUtils::sSendPerformanceTimingNotifications = false;
|
||||||
bool nsContentUtils::sSWInterceptionEnabled = false;
|
|
||||||
|
|
||||||
uint32_t nsContentUtils::sHandlingInputTimeout = 1000;
|
uint32_t nsContentUtils::sHandlingInputTimeout = 1000;
|
||||||
|
|
||||||
@ -569,10 +568,6 @@ nsContentUtils::Init()
|
|||||||
Preferences::AddBoolVarCache(&sPrivacyResistFingerprinting,
|
Preferences::AddBoolVarCache(&sPrivacyResistFingerprinting,
|
||||||
"privacy.resistFingerprinting", false);
|
"privacy.resistFingerprinting", false);
|
||||||
|
|
||||||
Preferences::AddBoolVarCache(&sSWInterceptionEnabled,
|
|
||||||
"dom.serviceWorkers.interception.enabled",
|
|
||||||
false);
|
|
||||||
|
|
||||||
Preferences::AddUintVarCache(&sHandlingInputTimeout,
|
Preferences::AddUintVarCache(&sHandlingInputTimeout,
|
||||||
"dom.event.handling-user-input-time-limit",
|
"dom.event.handling-user-input-time-limit",
|
||||||
1000);
|
1000);
|
||||||
@ -1754,8 +1749,7 @@ nsContentUtils::ParseLegacyFontSize(const nsAString& aValue)
|
|||||||
bool
|
bool
|
||||||
nsContentUtils::IsControlledByServiceWorker(nsIDocument* aDocument)
|
nsContentUtils::IsControlledByServiceWorker(nsIDocument* aDocument)
|
||||||
{
|
{
|
||||||
if (!ServiceWorkerInterceptionEnabled() ||
|
if (nsContentUtils::IsInPrivateBrowsing(aDocument)) {
|
||||||
nsContentUtils::IsInPrivateBrowsing(aDocument)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1996,14 +1996,6 @@ public:
|
|||||||
return sSendPerformanceTimingNotifications;
|
return sSendPerformanceTimingNotifications;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Returns true if ServiceWorker Interception is enabled by pref.
|
|
||||||
*/
|
|
||||||
static bool ServiceWorkerInterceptionEnabled()
|
|
||||||
{
|
|
||||||
return sSWInterceptionEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns true if the frame timing APIs are enabled.
|
* Returns true if the frame timing APIs are enabled.
|
||||||
*/
|
*/
|
||||||
@ -2706,7 +2698,6 @@ private:
|
|||||||
static bool sGettersDecodeURLHash;
|
static bool sGettersDecodeURLHash;
|
||||||
static bool sPrivacyResistFingerprinting;
|
static bool sPrivacyResistFingerprinting;
|
||||||
static bool sSendPerformanceTimingNotifications;
|
static bool sSendPerformanceTimingNotifications;
|
||||||
static bool sSWInterceptionEnabled;
|
|
||||||
static uint32_t sCookiesLifetimePolicy;
|
static uint32_t sCookiesLifetimePolicy;
|
||||||
static uint32_t sCookiesBehavior;
|
static uint32_t sCookiesBehavior;
|
||||||
|
|
||||||
|
@ -43,7 +43,6 @@ SpecialPowers.pushPrefEnv({'set': [
|
|||||||
['gfx.offscreencanvas.enabled', true],
|
['gfx.offscreencanvas.enabled', true],
|
||||||
['webgl.force-enabled', true],
|
['webgl.force-enabled', true],
|
||||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||||
["dom.serviceWorkers.interception.enabled", true],
|
|
||||||
["dom.serviceWorkers.enabled", true],
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.testing.enabled", true]
|
["dom.serviceWorkers.testing.enabled", true]
|
||||||
]}, runTest);
|
]}, runTest);
|
||||||
|
@ -31,16 +31,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=238987
|
|||||||
// but the last blur event goes to i1, not "begin".
|
// but the last blur event goes to i1, not "begin".
|
||||||
var expectedWindowBlurCount = forwardFocusArray.length + backwardFocusArray.length + 3;
|
var expectedWindowBlurCount = forwardFocusArray.length + backwardFocusArray.length + 3;
|
||||||
|
|
||||||
// accessibility.tabfocus must be set to value 7 before running test also
|
|
||||||
// on a mac.
|
|
||||||
function setOrRestoreTabFocus(newValue) {
|
|
||||||
if (!newValue) {
|
|
||||||
SpecialPowers.clearUserPref("accessibility.tabfocus");
|
|
||||||
} else {
|
|
||||||
SpecialPowers.setIntPref("accessibility.tabfocus", newValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleFocus(e) {
|
function handleFocus(e) {
|
||||||
if (e.target.id == "begin") {
|
if (e.target.id == "begin") {
|
||||||
// if the modifier is set, the test is coming back from the end.
|
// if the modifier is set, the test is coming back from the end.
|
||||||
@ -128,7 +118,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=238987
|
|||||||
"|window| didn't get the right amount of blur events");
|
"|window| didn't get the right amount of blur events");
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
setOrRestoreTabFocus(0);
|
|
||||||
window.removeEventListener("focus", handleWindowFocus, true);
|
window.removeEventListener("focus", handleWindowFocus, true);
|
||||||
window.removeEventListener("focus", handleWindowFocus, false);
|
window.removeEventListener("focus", handleWindowFocus, false);
|
||||||
window.removeEventListener("blur", handleWindowBlur, true);
|
window.removeEventListener("blur", handleWindowBlur, true);
|
||||||
@ -166,9 +155,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=238987
|
|||||||
tab();
|
tab();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// accessibility.tabfocus must be set to value 7 before running test also
|
||||||
|
// on a mac.
|
||||||
function doTest() {
|
function doTest() {
|
||||||
setOrRestoreTabFocus(7);
|
SpecialPowers.pushPrefEnv({"set": [["accessibility.tabfocus", 7]]}, start);
|
||||||
setTimeout(start, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
|
@ -90,15 +90,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
|
|||||||
"tr"
|
"tr"
|
||||||
];
|
];
|
||||||
|
|
||||||
// ui.key.contentAccess must be set to value 5 before running the test.
|
|
||||||
function setOrRestoreContentAccess(newValue) {
|
|
||||||
if (!newValue) {
|
|
||||||
SpecialPowers.clearUserPref("ui.key.contentAccess");
|
|
||||||
} else {
|
|
||||||
SpecialPowers.setIntPref("ui.key.contentAccess", newValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleFocus(e) {
|
function handleFocus(e) {
|
||||||
ok("accessKey" in e, "(focus) accesskey property not found on element");
|
ok("accessKey" in e, "(focus) accesskey property not found on element");
|
||||||
var expected = focusArray.shift();
|
var expected = focusArray.shift();
|
||||||
@ -218,17 +209,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
|
|||||||
function start() {
|
function start() {
|
||||||
testFocusableElements();
|
testFocusableElements();
|
||||||
testUnfocusableElements();
|
testUnfocusableElements();
|
||||||
setOrRestoreContentAccess(0);
|
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
function doTest() {
|
function doTest() {
|
||||||
setOrRestoreContentAccess(5);
|
SpecialPowers.pushPrefEnv({"set": [["ui.key.contentAccess", 5]]}, start);
|
||||||
setTimeout(start, 100);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
SimpleTest.requestFlakyTimeout("untriaged");
|
|
||||||
addLoadEvent(doTest);
|
addLoadEvent(doTest);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -21,19 +21,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=457672
|
|||||||
|
|
||||||
var windowBlurCount = 0;
|
var windowBlurCount = 0;
|
||||||
|
|
||||||
function setUserPref(reset) {
|
|
||||||
if (reset) {
|
|
||||||
SpecialPowers.clearUserPref("browser.link.open_newwindow");
|
|
||||||
} else {
|
|
||||||
SpecialPowers.setIntPref("browser.link.open_newwindow", 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function listener(evt) {
|
function listener(evt) {
|
||||||
if (evt.type == "focus") {
|
if (evt.type == "focus") {
|
||||||
is(windowBlurCount, 1,
|
is(windowBlurCount, 1,
|
||||||
"Window should have got blur event when opening a new tab!");
|
"Window should have got blur event when opening a new tab!");
|
||||||
setUserPref(true);
|
|
||||||
document.getElementsByTagName("a")[0].focus();
|
document.getElementsByTagName("a")[0].focus();
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
} else if (evt.type == "blur") {
|
} else if (evt.type == "blur") {
|
||||||
@ -43,13 +34,14 @@ function listener(evt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function startTest() {
|
function startTest() {
|
||||||
setUserPref(false);
|
SpecialPowers.pushPrefEnv({"set": [["browser.link.open_newwindow", 3]]}, function() {
|
||||||
document.getElementsByTagName("a")[0].focus();
|
document.getElementsByTagName("a")[0].focus();
|
||||||
// Note, focus/blur don't bubble
|
// Note, focus/blur don't bubble
|
||||||
window.addEventListener("focus", listener, false);
|
window.addEventListener("focus", listener, false);
|
||||||
window.addEventListener("blur", listener, false);
|
window.addEventListener("blur", listener, false);
|
||||||
var subwin = window.open("about:blank", "", "");
|
var subwin = window.open("about:blank", "", "");
|
||||||
subwin.addEventListener("focus", function(e) { subwin.close(); }, false);
|
subwin.addEventListener("focus", function(e) { subwin.close(); }, false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
addLoadEvent(startTest);
|
addLoadEvent(startTest);
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
SimpleTest.waitForFocus(runTest, window);
|
SimpleTest.waitForFocus(startTest, window);
|
||||||
|
|
||||||
var gScrollable128 = document.getElementById("Scrollable128");
|
var gScrollable128 = document.getElementById("Scrollable128");
|
||||||
var gScrollable96 = document.getElementById("Scrollable96");
|
var gScrollable96 = document.getElementById("Scrollable96");
|
||||||
@ -1315,50 +1315,8 @@ function* doTests()
|
|||||||
|
|
||||||
function* testBody()
|
function* testBody()
|
||||||
{
|
{
|
||||||
SpecialPowers.setIntPref("mousewheel.default.delta_multiplier_x", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.default.delta_multiplier_y", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.default.delta_multiplier_z", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.with_alt.delta_multiplier_x", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.with_alt.delta_multiplier_y", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.with_alt.delta_multiplier_z", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.with_control.delta_multiplier_x", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.with_control.delta_multiplier_y", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.with_control.delta_multiplier_z", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.with_meta.delta_multiplier_x", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.with_meta.delta_multiplier_y", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.with_meta.delta_multiplier_z", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.with_shift.delta_multiplier_x", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.with_shift.delta_multiplier_y", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.with_shift.delta_multiplier_z", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.with_win.delta_multiplier_x", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.with_win.delta_multiplier_y", 100);
|
|
||||||
SpecialPowers.setIntPref("mousewheel.with_win.delta_multiplier_z", 100);
|
|
||||||
// If APZ is enabled we should ensure the preventDefault calls work even
|
|
||||||
// if the test is running slowly.
|
|
||||||
SpecialPowers.setIntPref("apz.content_response_timeout", 2000);
|
|
||||||
|
|
||||||
yield* prepareScrollUnits();
|
yield* prepareScrollUnits();
|
||||||
yield* doTests();
|
yield* doTests();
|
||||||
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.default.delta_multiplier_x");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.default.delta_multiplier_y");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.default.delta_multiplier_z");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_alt.delta_multiplier_x");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_alt.delta_multiplier_y");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_alt.delta_multiplier_z");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_control.delta_multiplier_x");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_control.delta_multiplier_y");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_control.delta_multiplier_z");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_meta.delta_multiplier_x");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_meta.delta_multiplier_y");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_meta.delta_multiplier_z");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_shift.delta_multiplier_x");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_shift.delta_multiplier_y");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_shift.delta_multiplier_z");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_win.delta_multiplier_x");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_win.delta_multiplier_y");
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_win.delta_multiplier_z");
|
|
||||||
SpecialPowers.clearUserPref("apz.content_response_timeout");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var gTestContinuation = null;
|
var gTestContinuation = null;
|
||||||
@ -1374,6 +1332,31 @@ function runTest()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function startTest() {
|
||||||
|
SpecialPowers.pushPrefEnv({"set": [["mousewheel.default.delta_multiplier_x", 100],
|
||||||
|
["mousewheel.default.delta_multiplier_y", 100],
|
||||||
|
["mousewheel.default.delta_multiplier_z", 100],
|
||||||
|
["mousewheel.with_alt.delta_multiplier_x", 100],
|
||||||
|
["mousewheel.with_alt.delta_multiplier_y", 100],
|
||||||
|
["mousewheel.with_alt.delta_multiplier_z", 100],
|
||||||
|
["mousewheel.with_control.delta_multiplier_x", 100],
|
||||||
|
["mousewheel.with_control.delta_multiplier_y", 100],
|
||||||
|
["mousewheel.with_control.delta_multiplier_z", 100],
|
||||||
|
["mousewheel.with_meta.delta_multiplier_x", 100],
|
||||||
|
["mousewheel.with_meta.delta_multiplier_y", 100],
|
||||||
|
["mousewheel.with_meta.delta_multiplier_z", 100],
|
||||||
|
["mousewheel.with_shift.delta_multiplier_x", 100],
|
||||||
|
["mousewheel.with_shift.delta_multiplier_y", 100],
|
||||||
|
["mousewheel.with_shift.delta_multiplier_z", 100],
|
||||||
|
["mousewheel.with_win.delta_multiplier_x", 100],
|
||||||
|
["mousewheel.with_win.delta_multiplier_y", 100],
|
||||||
|
["mousewheel.with_win.delta_multiplier_z", 100],
|
||||||
|
// If APZ is enabled we should ensure the preventDefault calls work even
|
||||||
|
// if the test is running slowly.
|
||||||
|
["apz.content_response_timeout", 2000],
|
||||||
|
]}, runTest);
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</pre>
|
</pre>
|
||||||
</body>
|
</body>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<video id="v" controls></video>
|
<video id="v" controls></video>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
|
|
||||||
SimpleTest.waitForFocus(runTests, window);
|
SimpleTest.waitForFocus(startTests, window);
|
||||||
SimpleTest.requestFlakyTimeout("untriaged");
|
SimpleTest.requestFlakyTimeout("untriaged");
|
||||||
|
|
||||||
function is()
|
function is()
|
||||||
@ -32,9 +32,12 @@ function hitEventLoop(aFunc, aTimes)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function startTests() {
|
||||||
|
SpecialPowers.pushPrefEnv({"set": [["mousewheel.with_control.action", 3]]}, runTests);
|
||||||
|
}
|
||||||
|
|
||||||
function runTests()
|
function runTests()
|
||||||
{
|
{
|
||||||
SpecialPowers.setIntPref("mousewheel.with_control.action", 3);
|
|
||||||
synthesizeKey("0", { accelKey: true });
|
synthesizeKey("0", { accelKey: true });
|
||||||
|
|
||||||
var video = document.getElementById("v");
|
var video = document.getElementById("v");
|
||||||
@ -55,8 +58,6 @@ function runTests()
|
|||||||
is(SpecialPowers.getFullZoom(window), 1.0,
|
is(SpecialPowers.getFullZoom(window), 1.0,
|
||||||
"failed to reset zoom");
|
"failed to reset zoom");
|
||||||
|
|
||||||
SpecialPowers.clearUserPref("mousewheel.with_control.action");
|
|
||||||
|
|
||||||
hitEventLoop(window.opener.finish, 20);
|
hitEventLoop(window.opener.finish, 20);
|
||||||
}, 20);
|
}, 20);
|
||||||
}, 20);
|
}, 20);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -35,6 +35,35 @@ function testSteps()
|
|||||||
let quotaManagerService = Cc["@mozilla.org/dom/quota-manager-service;1"].
|
let quotaManagerService = Cc["@mozilla.org/dom/quota-manager-service;1"].
|
||||||
getService(Ci.nsIQuotaManagerService);
|
getService(Ci.nsIQuotaManagerService);
|
||||||
|
|
||||||
|
// Keep at least one database open.
|
||||||
|
let req = indexedDB.open("foo-a", 1);
|
||||||
|
req.onerror = errorHandler;
|
||||||
|
req.onsuccess = grabEventAndContinueHandler;
|
||||||
|
let event = yield undefined;
|
||||||
|
|
||||||
|
let dbA = event.target.result;
|
||||||
|
|
||||||
|
// Keep at least one factory operation alive by deleting a database that is
|
||||||
|
// stil open.
|
||||||
|
req = indexedDB.open("foo-b", 1);
|
||||||
|
req.onerror = errorHandler;
|
||||||
|
req.onsuccess = grabEventAndContinueHandler;
|
||||||
|
event = yield undefined;
|
||||||
|
|
||||||
|
let dbB = event.target.result;
|
||||||
|
|
||||||
|
indexedDB.deleteDatabase("foo-b");
|
||||||
|
|
||||||
|
// Create a database which we will later try to open while maintenance is
|
||||||
|
// performed.
|
||||||
|
req = indexedDB.open("foo-c", 1);
|
||||||
|
req.onerror = errorHandler;
|
||||||
|
req.onsuccess = grabEventAndContinueHandler;
|
||||||
|
event = yield undefined;
|
||||||
|
|
||||||
|
let dbC = event.target.result;
|
||||||
|
dbC.close();
|
||||||
|
|
||||||
let dbCount = 0;
|
let dbCount = 0;
|
||||||
|
|
||||||
for (let persistence of ["persistent", "temporary", "default"]) {
|
for (let persistence of ["persistent", "temporary", "default"]) {
|
||||||
@ -104,6 +133,13 @@ function testSteps()
|
|||||||
let observer = quotaManagerService.QueryInterface(Ci.nsIObserver);
|
let observer = quotaManagerService.QueryInterface(Ci.nsIObserver);
|
||||||
observer.observe(null, "idle-daily", "");
|
observer.observe(null, "idle-daily", "");
|
||||||
|
|
||||||
|
info("Opening database while maintenance is performed");
|
||||||
|
|
||||||
|
req = indexedDB.open("foo-c", 1);
|
||||||
|
req.onerror = errorHandler;
|
||||||
|
req.onsuccess = grabEventAndContinueHandler;
|
||||||
|
yield undefined;
|
||||||
|
|
||||||
info("Waiting for maintenance to start");
|
info("Waiting for maintenance to start");
|
||||||
|
|
||||||
// This time is totally arbitrary. Most likely directory scanning will have
|
// This time is totally arbitrary. Most likely directory scanning will have
|
||||||
|
@ -173,8 +173,6 @@ WebrtcDeprecatedPrefixWarning=WebRTC interfaces with the "moz" prefix (mozRTCPee
|
|||||||
NavigatorGetUserMediaWarning=navigator.mozGetUserMedia has been replaced by navigator.mediaDevices.getUserMedia
|
NavigatorGetUserMediaWarning=navigator.mozGetUserMedia has been replaced by navigator.mediaDevices.getUserMedia
|
||||||
# LOCALIZATION NOTE: Do not translate "ServiceWorker". %S is a URL.
|
# LOCALIZATION NOTE: Do not translate "ServiceWorker". %S is a URL.
|
||||||
InterceptionFailedWithURL=Failed to load '%S'. A ServiceWorker intercepted the request and encountered an unexpected error.
|
InterceptionFailedWithURL=Failed to load '%S'. A ServiceWorker intercepted the request and encountered an unexpected error.
|
||||||
# LOCALIZATION NOTE: Do not translate "ServiceWorker", "FetchEvent.respondWith()", "opaque", or "Response". %S is a URL.
|
|
||||||
OpaqueInterceptionDisabledWithURL=Failed to load '%S'. A ServiceWorker passed an opaque Response to FetchEvent.respondWith() while opaque interception is disabled.
|
|
||||||
# LOCALIZATION NOTE: Do not translate "ServiceWorker", "FetchEvent.respondWith()", "FetchEvent", "no-cors", "opaque", "Response", or "RequestMode". %1$S is a URL. %2$S is a RequestMode value.
|
# LOCALIZATION NOTE: Do not translate "ServiceWorker", "FetchEvent.respondWith()", "FetchEvent", "no-cors", "opaque", "Response", or "RequestMode". %1$S is a URL. %2$S is a RequestMode value.
|
||||||
BadOpaqueInterceptionRequestModeWithURL=Failed to load '%1$S'. A ServiceWorker passed an opaque Response to FetchEvent.respondWith() while handling a '%2$S' FetchEvent. Opaque Response objects are only valid when the RequestMode is 'no-cors'.
|
BadOpaqueInterceptionRequestModeWithURL=Failed to load '%1$S'. A ServiceWorker passed an opaque Response to FetchEvent.respondWith() while handling a '%2$S' FetchEvent. Opaque Response objects are only valid when the RequestMode is 'no-cors'.
|
||||||
# LOCALIZATION NOTE: Do not translate "ServiceWorker", "Error", "Response", "FetchEvent.respondWith()", or "fetch()". %S is a URL.
|
# LOCALIZATION NOTE: Do not translate "ServiceWorker", "Error", "Response", "FetchEvent.respondWith()", or "fetch()". %S is a URL.
|
||||||
|
@ -326,8 +326,6 @@ MediaDecoderStateMachine::~MediaDecoderStateMachine()
|
|||||||
MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
|
MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
|
||||||
MOZ_COUNT_DTOR(MediaDecoderStateMachine);
|
MOZ_COUNT_DTOR(MediaDecoderStateMachine);
|
||||||
|
|
||||||
mReader = nullptr;
|
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
timeEndPeriod(1);
|
timeEndPeriod(1);
|
||||||
#endif
|
#endif
|
||||||
|
@ -212,12 +212,10 @@ public:
|
|||||||
OwnerThread()->Dispatch(r.forget());
|
OwnerThread()->Dispatch(r.forget());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Drop reference to mReader and mResource. Only called during shutdown dance.
|
// Drop reference to mResource. Only called during shutdown dance.
|
||||||
void BreakCycles() {
|
void BreakCycles() {
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
if (mReader) {
|
mReader->BreakCycles();
|
||||||
mReader->BreakCycles();
|
|
||||||
}
|
|
||||||
mResource = nullptr;
|
mResource = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,17 +246,11 @@ public:
|
|||||||
bool IsRealTime() const { return mRealTime; }
|
bool IsRealTime() const { return mRealTime; }
|
||||||
|
|
||||||
size_t SizeOfVideoQueue() {
|
size_t SizeOfVideoQueue() {
|
||||||
if (mReader) {
|
return mReader->SizeOfVideoQueueInBytes();
|
||||||
return mReader->SizeOfVideoQueueInBytes();
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t SizeOfAudioQueue() {
|
size_t SizeOfAudioQueue() {
|
||||||
if (mReader) {
|
return mReader->SizeOfAudioQueueInBytes();
|
||||||
return mReader->SizeOfAudioQueueInBytes();
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -903,7 +895,7 @@ private:
|
|||||||
|
|
||||||
// The reader, don't call its methods with the decoder monitor held.
|
// The reader, don't call its methods with the decoder monitor held.
|
||||||
// This is created in the state machine's constructor.
|
// This is created in the state machine's constructor.
|
||||||
RefPtr<MediaDecoderReader> mReader;
|
const RefPtr<MediaDecoderReader> mReader;
|
||||||
|
|
||||||
// The end time of the last audio frame that's been pushed onto the media sink
|
// The end time of the last audio frame that's been pushed onto the media sink
|
||||||
// in microseconds. This will approximately be the end time
|
// in microseconds. This will approximately be the end time
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
skip-if = buildapp == 'b2g' # b2g( ReferenceError: MediaSource is not defined)
|
skip-if = buildapp == 'b2g' # b2g( ReferenceError: MediaSource is not defined)
|
||||||
subsuite = media
|
|
||||||
support-files =
|
support-files =
|
||||||
mediasource.js
|
mediasource.js
|
||||||
seek.webm seek.webm^headers^
|
seek.webm seek.webm^headers^
|
||||||
|
@ -127,13 +127,7 @@ MediaOmxCommonDecoder::PauseStateMachine()
|
|||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
DECODER_LOG(LogLevel::Debug, ("%s", __PRETTY_FUNCTION__));
|
DECODER_LOG(LogLevel::Debug, ("%s", __PRETTY_FUNCTION__));
|
||||||
|
|
||||||
if (mShuttingDown) {
|
MOZ_ASSERT(GetStateMachine());
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!GetStateMachine()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// enter dormant state
|
// enter dormant state
|
||||||
GetStateMachine()->DispatchSetDormant(true);
|
GetStateMachine()->DispatchSetDormant(true);
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
skip-if = buildapp == 'mulet' || (os == 'win' && strictContentSandbox) || android_version == '18' # strictContentSandbox (Bug 1042735)
|
skip-if = buildapp == 'mulet' || (os == 'win' && strictContentSandbox) || android_version == '18' # strictContentSandbox (Bug 1042735)
|
||||||
subsuite = media
|
|
||||||
support-files =
|
support-files =
|
||||||
16bit_wave_extrametadata.wav
|
16bit_wave_extrametadata.wav
|
||||||
16bit_wave_extrametadata.wav^headers^
|
16bit_wave_extrametadata.wav^headers^
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
# won't run on b2g desktop tests - bug 1119993
|
# won't run on b2g desktop tests - bug 1119993
|
||||||
# broken HTTPS on b2g emulator - bug 1135339
|
# broken HTTPS on b2g emulator - bug 1135339
|
||||||
skip-if = (os == 'win' && strictContentSandbox) || android_version == '10' || android_version == '18' || (buildapp == 'b2g' && toolkit != 'gonk') || (buildapp == 'b2g' && toolkit == 'gonk') || buildapp == 'mulet'
|
skip-if = (os == 'win' && strictContentSandbox) || android_version == '10' || android_version == '18' || (buildapp == 'b2g' && toolkit != 'gonk') || (buildapp == 'b2g' && toolkit == 'gonk') || buildapp == 'mulet'
|
||||||
subsuite = media
|
|
||||||
support-files =
|
support-files =
|
||||||
/.well-known/idp-proxy/idp.js
|
/.well-known/idp-proxy/idp.js
|
||||||
identityPcTest.js
|
identityPcTest.js
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
tags=msg
|
tags=msg
|
||||||
subsuite=media
|
|
||||||
support-files =
|
support-files =
|
||||||
ipc.json
|
ipc.json
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
# strictContentSandbox - bug 1042735, Android 2.3 - bug 981881
|
# strictContentSandbox - bug 1042735, Android 2.3 - bug 981881
|
||||||
tags = msg webrtc
|
tags = msg webrtc
|
||||||
subsuite = media
|
|
||||||
skip-if = (os == 'win' && strictContentSandbox) || android_version == '10' || (buildapp == 'mulet') || (toolkit == 'gonk' && debug) # b2g(Either bug 1171118 or bug 1169838, take your pick)
|
skip-if = (os == 'win' && strictContentSandbox) || android_version == '10' || (buildapp == 'mulet') || (toolkit == 'gonk' && debug) # b2g(Either bug 1171118 or bug 1169838, take your pick)
|
||||||
support-files =
|
support-files =
|
||||||
head.js
|
head.js
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
tags=msg
|
tags=msg
|
||||||
tags = webaudio
|
tags = webaudio
|
||||||
subsuite = media
|
|
||||||
skip-if = ((buildapp == 'b2g') && (toolkit != 'gonk' || debug)) || (os == 'win' && strictContentSandbox) #b2g-debug,b2g-desktop(bug 916135); strictContentSandbox(Bug 1042735)
|
skip-if = ((buildapp == 'b2g') && (toolkit != 'gonk' || debug)) || (os == 'win' && strictContentSandbox) #b2g-debug,b2g-desktop(bug 916135); strictContentSandbox(Bug 1042735)
|
||||||
support-files =
|
support-files =
|
||||||
audio-expected.wav
|
audio-expected.wav
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
tags=msg
|
tags=msg
|
||||||
skip-if = buildapp == 'b2g' # Bug 1191270, bug 1037287, bug 967606, bug 1096400, etc
|
skip-if = buildapp == 'b2g' # Bug 1191270, bug 1037287, bug 967606, bug 1096400, etc
|
||||||
subsuite = media
|
|
||||||
support-files =
|
support-files =
|
||||||
head.js
|
head.js
|
||||||
hello.ogg
|
hello.ogg
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
tags=msg
|
tags=msg
|
||||||
subsuite = media
|
|
||||||
support-files =
|
support-files =
|
||||||
common.js
|
common.js
|
||||||
file_bfcache_frame.html
|
file_bfcache_frame.html
|
||||||
|
@ -13,14 +13,14 @@
|
|||||||
#include "mozilla/dom/WorkerRunnable.h"
|
#include "mozilla/dom/WorkerRunnable.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
#include "nsIDocument.h"
|
#include "nsIDocument.h"
|
||||||
|
#include "nsIGlobalObject.h"
|
||||||
#include "nsIPrincipal.h"
|
#include "nsIPrincipal.h"
|
||||||
#include "nsPIDOMWindow.h"
|
|
||||||
#include "nsServiceManagerUtils.h"
|
#include "nsServiceManagerUtils.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(MessageChannel, mWindow, mPort1, mPort2)
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(MessageChannel, mGlobal, mPort1, mPort2)
|
||||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(MessageChannel)
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(MessageChannel)
|
||||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(MessageChannel)
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(MessageChannel)
|
||||||
|
|
||||||
@ -29,9 +29,10 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MessageChannel)
|
|||||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||||
NS_INTERFACE_MAP_END
|
NS_INTERFACE_MAP_END
|
||||||
|
|
||||||
MessageChannel::MessageChannel(nsPIDOMWindowInner* aWindow)
|
MessageChannel::MessageChannel(nsIGlobalObject* aGlobal)
|
||||||
: mWindow(aWindow)
|
: mGlobal(aGlobal)
|
||||||
{
|
{
|
||||||
|
MOZ_ASSERT(aGlobal);
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageChannel::~MessageChannel()
|
MessageChannel::~MessageChannel()
|
||||||
@ -47,14 +48,15 @@ MessageChannel::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
|||||||
/* static */ already_AddRefed<MessageChannel>
|
/* static */ already_AddRefed<MessageChannel>
|
||||||
MessageChannel::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv)
|
MessageChannel::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv)
|
||||||
{
|
{
|
||||||
// window can be null in workers.
|
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
|
||||||
nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(aGlobal.GetAsSupports());
|
return Constructor(global, aRv);
|
||||||
return Constructor(window, aRv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ already_AddRefed<MessageChannel>
|
/* static */ already_AddRefed<MessageChannel>
|
||||||
MessageChannel::Constructor(nsPIDOMWindowInner* aWindow, ErrorResult& aRv)
|
MessageChannel::Constructor(nsIGlobalObject* aGlobal, ErrorResult& aRv)
|
||||||
{
|
{
|
||||||
|
MOZ_ASSERT(aGlobal);
|
||||||
|
|
||||||
nsID portUUID1;
|
nsID portUUID1;
|
||||||
aRv = nsContentUtils::GenerateUUIDInPlace(portUUID1);
|
aRv = nsContentUtils::GenerateUUIDInPlace(portUUID1);
|
||||||
if (aRv.Failed()) {
|
if (aRv.Failed()) {
|
||||||
@ -67,14 +69,14 @@ MessageChannel::Constructor(nsPIDOMWindowInner* aWindow, ErrorResult& aRv)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<MessageChannel> channel = new MessageChannel(aWindow);
|
RefPtr<MessageChannel> channel = new MessageChannel(aGlobal);
|
||||||
|
|
||||||
channel->mPort1 = MessagePort::Create(aWindow, portUUID1, portUUID2, aRv);
|
channel->mPort1 = MessagePort::Create(aGlobal, portUUID1, portUUID2, aRv);
|
||||||
if (NS_WARN_IF(aRv.Failed())) {
|
if (NS_WARN_IF(aRv.Failed())) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
channel->mPort2 = MessagePort::Create(aWindow, portUUID2, portUUID1, aRv);
|
channel->mPort2 = MessagePort::Create(aGlobal, portUUID2, portUUID1, aRv);
|
||||||
if (NS_WARN_IF(aRv.Failed())) {
|
if (NS_WARN_IF(aRv.Failed())) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include "nsWrapperCache.h"
|
#include "nsWrapperCache.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
|
|
||||||
class nsPIDOMWindowInner;
|
class nsIGlobalObject;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
@ -28,10 +28,10 @@ public:
|
|||||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MessageChannel)
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MessageChannel)
|
||||||
|
|
||||||
nsPIDOMWindowInner*
|
nsIGlobalObject*
|
||||||
GetParentObject() const
|
GetParentObject() const
|
||||||
{
|
{
|
||||||
return mWindow;
|
return mGlobal;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual JSObject*
|
virtual JSObject*
|
||||||
@ -41,7 +41,7 @@ public:
|
|||||||
Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
|
Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
|
||||||
|
|
||||||
static already_AddRefed<MessageChannel>
|
static already_AddRefed<MessageChannel>
|
||||||
Constructor(nsPIDOMWindowInner* aWindow, ErrorResult& aRv);
|
Constructor(nsIGlobalObject* aGlobal, ErrorResult& aRv);
|
||||||
|
|
||||||
MessagePort*
|
MessagePort*
|
||||||
Port1() const
|
Port1() const
|
||||||
@ -56,10 +56,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit MessageChannel(nsPIDOMWindowInner* aWindow);
|
explicit MessageChannel(nsIGlobalObject* aGlobal);
|
||||||
~MessageChannel();
|
~MessageChannel();
|
||||||
|
|
||||||
nsCOMPtr<nsPIDOMWindowInner> mWindow;
|
nsCOMPtr<nsIGlobalObject> mGlobal;
|
||||||
|
|
||||||
RefPtr<MessagePort> mPort1;
|
RefPtr<MessagePort> mPort1;
|
||||||
RefPtr<MessagePort> mPort2;
|
RefPtr<MessagePort> mPort2;
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
#include "mozilla/dom/WorkerScope.h"
|
#include "mozilla/dom/WorkerScope.h"
|
||||||
#include "mozilla/ipc/BackgroundChild.h"
|
#include "mozilla/ipc/BackgroundChild.h"
|
||||||
#include "mozilla/ipc/PBackgroundChild.h"
|
#include "mozilla/ipc/PBackgroundChild.h"
|
||||||
|
#include "mozilla/MessagePortTimelineMarker.h"
|
||||||
|
#include "mozilla/TimelineConsumers.h"
|
||||||
|
#include "mozilla/TimelineMarker.h"
|
||||||
#include "mozilla/unused.h"
|
#include "mozilla/unused.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
#include "nsGlobalWindow.h"
|
#include "nsGlobalWindow.h"
|
||||||
@ -86,15 +89,8 @@ private:
|
|||||||
nsresult
|
nsresult
|
||||||
DispatchMessage() const
|
DispatchMessage() const
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIGlobalObject> globalObject;
|
nsCOMPtr<nsIGlobalObject> globalObject = mPort->GetParentObject();
|
||||||
|
MOZ_ASSERT(globalObject);
|
||||||
if (NS_IsMainThread()) {
|
|
||||||
globalObject = do_QueryInterface(mPort->GetParentObject());
|
|
||||||
} else {
|
|
||||||
WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
|
|
||||||
MOZ_ASSERT(workerPrivate);
|
|
||||||
globalObject = workerPrivate->GlobalScope();
|
|
||||||
}
|
|
||||||
|
|
||||||
AutoJSAPI jsapi;
|
AutoJSAPI jsapi;
|
||||||
if (!globalObject || !jsapi.Init(globalObject)) {
|
if (!globalObject || !jsapi.Init(globalObject)) {
|
||||||
@ -107,7 +103,27 @@ private:
|
|||||||
ErrorResult rv;
|
ErrorResult rv;
|
||||||
JS::Rooted<JS::Value> value(cx);
|
JS::Rooted<JS::Value> value(cx);
|
||||||
|
|
||||||
|
UniquePtr<AbstractTimelineMarker> start;
|
||||||
|
UniquePtr<AbstractTimelineMarker> end;
|
||||||
|
RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
|
||||||
|
bool isTimelineRecording = timelines && !timelines->IsEmpty();
|
||||||
|
|
||||||
|
if (isTimelineRecording) {
|
||||||
|
start = MakeUnique<MessagePortTimelineMarker>(
|
||||||
|
ProfileTimelineMessagePortOperationType::DeserializeData,
|
||||||
|
MarkerTracingType::START);
|
||||||
|
}
|
||||||
|
|
||||||
mData->Read(mPort->GetParentObject(), cx, &value, rv);
|
mData->Read(mPort->GetParentObject(), cx, &value, rv);
|
||||||
|
|
||||||
|
if (isTimelineRecording) {
|
||||||
|
end = MakeUnique<MessagePortTimelineMarker>(
|
||||||
|
ProfileTimelineMessagePortOperationType::DeserializeData,
|
||||||
|
MarkerTracingType::END);
|
||||||
|
timelines->AddMarkerForAllObservedDocShells(start);
|
||||||
|
timelines->AddMarkerForAllObservedDocShells(end);
|
||||||
|
}
|
||||||
|
|
||||||
if (NS_WARN_IF(rv.Failed())) {
|
if (NS_WARN_IF(rv.Failed())) {
|
||||||
return rv.StealNSResult();
|
return rv.StealNSResult();
|
||||||
}
|
}
|
||||||
@ -259,20 +275,17 @@ NS_IMPL_ISUPPORTS(ForceCloseHelper, nsIIPCBackgroundChildCreateCallback)
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
MessagePort::MessagePort(nsISupports* aSupports)
|
MessagePort::MessagePort(nsIGlobalObject* aGlobal)
|
||||||
: mInnerID(0)
|
: DOMEventTargetHelper(aGlobal)
|
||||||
|
, mInnerID(0)
|
||||||
, mMessageQueueEnabled(false)
|
, mMessageQueueEnabled(false)
|
||||||
, mIsKeptAlive(false)
|
, mIsKeptAlive(false)
|
||||||
{
|
{
|
||||||
|
MOZ_ASSERT(aGlobal);
|
||||||
|
|
||||||
mIdentifier = new MessagePortIdentifier();
|
mIdentifier = new MessagePortIdentifier();
|
||||||
mIdentifier->neutered() = true;
|
mIdentifier->neutered() = true;
|
||||||
mIdentifier->sequenceId() = 0;
|
mIdentifier->sequenceId() = 0;
|
||||||
|
|
||||||
nsCOMPtr<nsIGlobalObject> globalObject = do_QueryInterface(aSupports);
|
|
||||||
if (NS_WARN_IF(!globalObject)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
BindToOwner(globalObject);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MessagePort::~MessagePort()
|
MessagePort::~MessagePort()
|
||||||
@ -282,21 +295,25 @@ MessagePort::~MessagePort()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* static */ already_AddRefed<MessagePort>
|
/* static */ already_AddRefed<MessagePort>
|
||||||
MessagePort::Create(nsISupports* aSupport, const nsID& aUUID,
|
MessagePort::Create(nsIGlobalObject* aGlobal, const nsID& aUUID,
|
||||||
const nsID& aDestinationUUID, ErrorResult& aRv)
|
const nsID& aDestinationUUID, ErrorResult& aRv)
|
||||||
{
|
{
|
||||||
RefPtr<MessagePort> mp = new MessagePort(aSupport);
|
MOZ_ASSERT(aGlobal);
|
||||||
|
|
||||||
|
RefPtr<MessagePort> mp = new MessagePort(aGlobal);
|
||||||
mp->Initialize(aUUID, aDestinationUUID, 1 /* 0 is an invalid sequence ID */,
|
mp->Initialize(aUUID, aDestinationUUID, 1 /* 0 is an invalid sequence ID */,
|
||||||
false /* Neutered */, eStateUnshippedEntangled, aRv);
|
false /* Neutered */, eStateUnshippedEntangled, aRv);
|
||||||
return mp.forget();
|
return mp.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ already_AddRefed<MessagePort>
|
/* static */ already_AddRefed<MessagePort>
|
||||||
MessagePort::Create(nsISupports* aSupport,
|
MessagePort::Create(nsIGlobalObject* aGlobal,
|
||||||
const MessagePortIdentifier& aIdentifier,
|
const MessagePortIdentifier& aIdentifier,
|
||||||
ErrorResult& aRv)
|
ErrorResult& aRv)
|
||||||
{
|
{
|
||||||
RefPtr<MessagePort> mp = new MessagePort(aSupport);
|
MOZ_ASSERT(aGlobal);
|
||||||
|
|
||||||
|
RefPtr<MessagePort> mp = new MessagePort(aGlobal);
|
||||||
mp->Initialize(aIdentifier.uuid(), aIdentifier.destinationUuid(),
|
mp->Initialize(aIdentifier.uuid(), aIdentifier.destinationUuid(),
|
||||||
aIdentifier.sequenceId(), aIdentifier.neutered(),
|
aIdentifier.sequenceId(), aIdentifier.neutered(),
|
||||||
eStateEntangling, aRv);
|
eStateEntangling, aRv);
|
||||||
@ -420,7 +437,27 @@ MessagePort::PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
|
|||||||
|
|
||||||
RefPtr<SharedMessagePortMessage> data = new SharedMessagePortMessage();
|
RefPtr<SharedMessagePortMessage> data = new SharedMessagePortMessage();
|
||||||
|
|
||||||
|
UniquePtr<AbstractTimelineMarker> start;
|
||||||
|
UniquePtr<AbstractTimelineMarker> end;
|
||||||
|
RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
|
||||||
|
bool isTimelineRecording = timelines && !timelines->IsEmpty();
|
||||||
|
|
||||||
|
if (isTimelineRecording) {
|
||||||
|
start = MakeUnique<MessagePortTimelineMarker>(
|
||||||
|
ProfileTimelineMessagePortOperationType::SerializeData,
|
||||||
|
MarkerTracingType::START);
|
||||||
|
}
|
||||||
|
|
||||||
data->Write(aCx, aMessage, transferable, aRv);
|
data->Write(aCx, aMessage, transferable, aRv);
|
||||||
|
|
||||||
|
if (isTimelineRecording) {
|
||||||
|
end = MakeUnique<MessagePortTimelineMarker>(
|
||||||
|
ProfileTimelineMessagePortOperationType::SerializeData,
|
||||||
|
MarkerTracingType::END);
|
||||||
|
timelines->AddMarkerForAllObservedDocShells(start);
|
||||||
|
timelines->AddMarkerForAllObservedDocShells(end);
|
||||||
|
}
|
||||||
|
|
||||||
if (NS_WARN_IF(aRv.Failed())) {
|
if (NS_WARN_IF(aRv.Failed())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#undef PostMessage
|
#undef PostMessage
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class nsPIDOMWindowInner;
|
class nsIGlobalObject;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
@ -45,11 +45,12 @@ public:
|
|||||||
DOMEventTargetHelper)
|
DOMEventTargetHelper)
|
||||||
|
|
||||||
static already_AddRefed<MessagePort>
|
static already_AddRefed<MessagePort>
|
||||||
Create(nsISupports* aSupport, const nsID& aUUID,
|
Create(nsIGlobalObject* aGlobal, const nsID& aUUID,
|
||||||
const nsID& aDestinationUUID, ErrorResult& aRv);
|
const nsID& aDestinationUUID, ErrorResult& aRv);
|
||||||
|
|
||||||
static already_AddRefed<MessagePort>
|
static already_AddRefed<MessagePort>
|
||||||
Create(nsISupports* aSupport, const MessagePortIdentifier& aIdentifier,
|
Create(nsIGlobalObject* aGlobal,
|
||||||
|
const MessagePortIdentifier& aIdentifier,
|
||||||
ErrorResult& aRv);
|
ErrorResult& aRv);
|
||||||
|
|
||||||
// For IPC.
|
// For IPC.
|
||||||
@ -88,7 +89,7 @@ public:
|
|||||||
void Closed();
|
void Closed();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit MessagePort(nsISupports* nsISupports);
|
explicit MessagePort(nsIGlobalObject* aGlobal);
|
||||||
~MessagePort();
|
~MessagePort();
|
||||||
|
|
||||||
enum State {
|
enum State {
|
||||||
|
@ -68,6 +68,7 @@ http://creativecommons.org/licenses/publicdomain/
|
|||||||
SpecialPowers.addPermission("desktop-notification", false, document);
|
SpecialPowers.addPermission("desktop-notification", false, document);
|
||||||
SpecialPowers.pushPrefEnv({"set": [
|
SpecialPowers.pushPrefEnv({"set": [
|
||||||
["dom.push.enabled", true],
|
["dom.push.enabled", true],
|
||||||
|
["dom.push.connection.enabled", true],
|
||||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||||
["dom.serviceWorkers.enabled", true],
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.testing.enabled", true]
|
["dom.serviceWorkers.testing.enabled", true]
|
||||||
|
@ -120,6 +120,7 @@ http://creativecommons.org/licenses/publicdomain/
|
|||||||
|
|
||||||
SpecialPowers.pushPrefEnv({"set": [
|
SpecialPowers.pushPrefEnv({"set": [
|
||||||
["dom.push.enabled", true],
|
["dom.push.enabled", true],
|
||||||
|
["dom.push.connection.enabled", true],
|
||||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||||
["dom.serviceWorkers.enabled", true],
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.testing.enabled", true]
|
["dom.serviceWorkers.testing.enabled", true]
|
||||||
|
@ -115,6 +115,7 @@ http://creativecommons.org/licenses/publicdomain/
|
|||||||
|
|
||||||
SpecialPowers.pushPrefEnv({"set": [
|
SpecialPowers.pushPrefEnv({"set": [
|
||||||
["dom.push.enabled", true],
|
["dom.push.enabled", true],
|
||||||
|
["dom.push.connection.enabled", true],
|
||||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||||
["dom.serviceWorkers.enabled", true],
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.testing.enabled", true]
|
["dom.serviceWorkers.testing.enabled", true]
|
||||||
|
@ -102,6 +102,7 @@ var defaultServerURL = SpecialPowers.getCharPref("dom.push.serverURL");
|
|||||||
|
|
||||||
SpecialPowers.pushPrefEnv({"set": [
|
SpecialPowers.pushPrefEnv({"set": [
|
||||||
["dom.push.enabled", true],
|
["dom.push.enabled", true],
|
||||||
|
["dom.push.connection.enabled", true],
|
||||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||||
["dom.serviceWorkers.enabled", true],
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.testing.enabled", true],
|
["dom.serviceWorkers.testing.enabled", true],
|
||||||
|
@ -323,10 +323,10 @@
|
|||||||
|
|
||||||
SpecialPowers.pushPrefEnv({"set": [
|
SpecialPowers.pushPrefEnv({"set": [
|
||||||
["dom.push.enabled", true],
|
["dom.push.enabled", true],
|
||||||
|
["dom.push.connection.enabled", true],
|
||||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||||
["dom.serviceWorkers.enabled", true],
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.testing.enabled", true],
|
["dom.serviceWorkers.testing.enabled", true],
|
||||||
["dom.serviceWorkers.interception.enabled", true]
|
|
||||||
]}, runTest);
|
]}, runTest);
|
||||||
SpecialPowers.addPermission('desktop-notification', true, document);
|
SpecialPowers.addPermission('desktop-notification', true, document);
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
|
@ -289,6 +289,7 @@ http://creativecommons.org/licenses/publicdomain/
|
|||||||
|
|
||||||
SpecialPowers.pushPrefEnv({"set": [
|
SpecialPowers.pushPrefEnv({"set": [
|
||||||
["dom.push.enabled", true],
|
["dom.push.enabled", true],
|
||||||
|
["dom.push.connection.enabled", true],
|
||||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||||
["dom.serviceWorkers.enabled", true],
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.testing.enabled", true]
|
["dom.serviceWorkers.testing.enabled", true]
|
||||||
|
@ -81,6 +81,7 @@ http://creativecommons.org/licenses/publicdomain/
|
|||||||
|
|
||||||
SpecialPowers.pushPrefEnv({"set": [
|
SpecialPowers.pushPrefEnv({"set": [
|
||||||
["dom.push.enabled", true],
|
["dom.push.enabled", true],
|
||||||
|
["dom.push.connection.enabled", true],
|
||||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||||
["dom.serviceWorkers.enabled", true],
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.testing.enabled", true]
|
["dom.serviceWorkers.testing.enabled", true]
|
||||||
|
@ -19,6 +19,7 @@ function setupPrefs() {
|
|||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
SpecialPowers.pushPrefEnv({"set": [
|
SpecialPowers.pushPrefEnv({"set": [
|
||||||
["dom.push.enabled", true],
|
["dom.push.enabled", true],
|
||||||
|
["dom.push.connection.enabled", true],
|
||||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||||
["dom.serviceWorkers.enabled", true],
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.testing.enabled", true]
|
["dom.serviceWorkers.testing.enabled", true]
|
||||||
|
@ -9,6 +9,8 @@ const {PushDB, PushService, PushServiceHttp2} = serviceExports;
|
|||||||
|
|
||||||
var prefs;
|
var prefs;
|
||||||
var tlsProfile;
|
var tlsProfile;
|
||||||
|
var pushEnabled;
|
||||||
|
var pushConnectionEnabled;
|
||||||
|
|
||||||
var serverPort = -1;
|
var serverPort = -1;
|
||||||
|
|
||||||
@ -19,14 +21,19 @@ function run_test() {
|
|||||||
dump("using port " + serverPort + "\n");
|
dump("using port " + serverPort + "\n");
|
||||||
|
|
||||||
do_get_profile();
|
do_get_profile();
|
||||||
|
setPrefs();
|
||||||
prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
|
prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
|
||||||
|
|
||||||
tlsProfile = prefs.getBoolPref("network.http.spdy.enforce-tls-profile");
|
tlsProfile = prefs.getBoolPref("network.http.spdy.enforce-tls-profile");
|
||||||
|
pushEnabled = prefs.getBoolPref("dom.push.enabled");
|
||||||
|
pushConnectionEnabled = prefs.getBoolPref("dom.push.connection.enabled");
|
||||||
|
|
||||||
// Set to allow the cert presented by our H2 server
|
// Set to allow the cert presented by our H2 server
|
||||||
var oldPref = prefs.getIntPref("network.http.speculative-parallel-limit");
|
var oldPref = prefs.getIntPref("network.http.speculative-parallel-limit");
|
||||||
prefs.setIntPref("network.http.speculative-parallel-limit", 0);
|
prefs.setIntPref("network.http.speculative-parallel-limit", 0);
|
||||||
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", false);
|
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", false);
|
||||||
|
prefs.setBoolPref("dom.push.enabled", true);
|
||||||
|
prefs.setBoolPref("dom.push.connection.enabled", true);
|
||||||
|
|
||||||
addCertOverride("localhost", serverPort,
|
addCertOverride("localhost", serverPort,
|
||||||
Ci.nsICertOverrideService.ERROR_UNTRUSTED |
|
Ci.nsICertOverrideService.ERROR_UNTRUSTED |
|
||||||
@ -155,4 +162,6 @@ add_task(function* test_pushNotifications() {
|
|||||||
|
|
||||||
add_task(function* test_complete() {
|
add_task(function* test_complete() {
|
||||||
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", tlsProfile);
|
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", tlsProfile);
|
||||||
|
prefs.setBoolPref("dom.push.enabled", pushEnabled);
|
||||||
|
prefs.setBoolPref("dom.push.connection.enabled", pushConnectionEnabled);
|
||||||
});
|
});
|
||||||
|
@ -11,6 +11,8 @@ var prefs;
|
|||||||
var tlsProfile;
|
var tlsProfile;
|
||||||
var serverURL;
|
var serverURL;
|
||||||
var serverPort = -1;
|
var serverPort = -1;
|
||||||
|
var pushEnabled;
|
||||||
|
var pushConnectionEnabled;
|
||||||
var db;
|
var db;
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
@ -22,11 +24,15 @@ function run_test() {
|
|||||||
prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
|
prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
|
||||||
|
|
||||||
tlsProfile = prefs.getBoolPref("network.http.spdy.enforce-tls-profile");
|
tlsProfile = prefs.getBoolPref("network.http.spdy.enforce-tls-profile");
|
||||||
|
pushEnabled = prefs.getBoolPref("dom.push.enabled");
|
||||||
|
pushConnectionEnabled = prefs.getBoolPref("dom.push.connection.enabled");
|
||||||
|
|
||||||
// Set to allow the cert presented by our H2 server
|
// Set to allow the cert presented by our H2 server
|
||||||
var oldPref = prefs.getIntPref("network.http.speculative-parallel-limit");
|
var oldPref = prefs.getIntPref("network.http.speculative-parallel-limit");
|
||||||
prefs.setIntPref("network.http.speculative-parallel-limit", 0);
|
prefs.setIntPref("network.http.speculative-parallel-limit", 0);
|
||||||
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", false);
|
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", false);
|
||||||
|
prefs.setBoolPref("dom.push.enabled", true);
|
||||||
|
prefs.setBoolPref("dom.push.connection.enabled", true);
|
||||||
|
|
||||||
addCertOverride("localhost", serverPort,
|
addCertOverride("localhost", serverPort,
|
||||||
Ci.nsICertOverrideService.ERROR_UNTRUSTED |
|
Ci.nsICertOverrideService.ERROR_UNTRUSTED |
|
||||||
@ -119,4 +125,6 @@ add_task(function* test_pushSubscriptionMissingLink2() {
|
|||||||
|
|
||||||
add_task(function* test_complete() {
|
add_task(function* test_complete() {
|
||||||
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", tlsProfile);
|
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", tlsProfile);
|
||||||
|
prefs.setBoolPref("dom.push.enabled", pushEnabled);
|
||||||
|
prefs.setBoolPref("dom.push.connection.enabled", pushConnectionEnabled);
|
||||||
});
|
});
|
||||||
|
@ -53,6 +53,7 @@ function run_test() {
|
|||||||
|
|
||||||
servicePrefs.set('testing.notifyWorkers', false);
|
servicePrefs.set('testing.notifyWorkers', false);
|
||||||
servicePrefs.set('testing.notifyAllObservers', true);
|
servicePrefs.set('testing.notifyAllObservers', true);
|
||||||
|
setPrefs();
|
||||||
|
|
||||||
run_next_test();
|
run_next_test();
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,8 @@ const {PushDB, PushService, PushServiceHttp2} = serviceExports;
|
|||||||
|
|
||||||
var prefs;
|
var prefs;
|
||||||
var tlsProfile;
|
var tlsProfile;
|
||||||
|
var pushEnabled;
|
||||||
|
var pushConnectionEnabled;
|
||||||
|
|
||||||
var serverPort = -1;
|
var serverPort = -1;
|
||||||
|
|
||||||
@ -30,11 +32,15 @@ function run_test() {
|
|||||||
prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
|
prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
|
||||||
|
|
||||||
tlsProfile = prefs.getBoolPref("network.http.spdy.enforce-tls-profile");
|
tlsProfile = prefs.getBoolPref("network.http.spdy.enforce-tls-profile");
|
||||||
|
pushEnabled = prefs.getBoolPref("dom.push.enabled");
|
||||||
|
pushConnectionEnabled = prefs.getBoolPref("dom.push.connection.enabled");
|
||||||
|
|
||||||
// Set to allow the cert presented by our H2 server
|
// Set to allow the cert presented by our H2 server
|
||||||
var oldPref = prefs.getIntPref("network.http.speculative-parallel-limit");
|
var oldPref = prefs.getIntPref("network.http.speculative-parallel-limit");
|
||||||
prefs.setIntPref("network.http.speculative-parallel-limit", 0);
|
prefs.setIntPref("network.http.speculative-parallel-limit", 0);
|
||||||
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", false);
|
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", false);
|
||||||
|
prefs.setBoolPref("dom.push.enabled", true);
|
||||||
|
prefs.setBoolPref("dom.push.connection.enabled", true);
|
||||||
|
|
||||||
addCertOverride("localhost", serverPort,
|
addCertOverride("localhost", serverPort,
|
||||||
Ci.nsICertOverrideService.ERROR_UNTRUSTED |
|
Ci.nsICertOverrideService.ERROR_UNTRUSTED |
|
||||||
@ -81,4 +87,6 @@ add_task(function* test_pushUnsubscriptionSuccess() {
|
|||||||
|
|
||||||
add_task(function* test_complete() {
|
add_task(function* test_complete() {
|
||||||
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", tlsProfile);
|
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", tlsProfile);
|
||||||
|
prefs.setBoolPref("dom.push.enabled", pushEnabled);
|
||||||
|
prefs.setBoolPref("dom.push.connection.enabled", pushConnectionEnabled);
|
||||||
});
|
});
|
||||||
|
@ -3773,6 +3773,7 @@ QuotaManager::OpenDirectory(PersistenceType aPersistenceType,
|
|||||||
void
|
void
|
||||||
QuotaManager::OpenDirectoryInternal(Nullable<PersistenceType> aPersistenceType,
|
QuotaManager::OpenDirectoryInternal(Nullable<PersistenceType> aPersistenceType,
|
||||||
const OriginScope& aOriginScope,
|
const OriginScope& aOriginScope,
|
||||||
|
Nullable<Client::Type> aClientType,
|
||||||
bool aExclusive,
|
bool aExclusive,
|
||||||
OpenDirectoryListener* aOpenListener)
|
OpenDirectoryListener* aOpenListener)
|
||||||
{
|
{
|
||||||
@ -3783,7 +3784,7 @@ QuotaManager::OpenDirectoryInternal(Nullable<PersistenceType> aPersistenceType,
|
|||||||
EmptyCString(),
|
EmptyCString(),
|
||||||
aOriginScope,
|
aOriginScope,
|
||||||
Nullable<bool>(),
|
Nullable<bool>(),
|
||||||
Nullable<Client::Type>(),
|
Nullable<Client::Type>(aClientType),
|
||||||
aExclusive,
|
aExclusive,
|
||||||
true,
|
true,
|
||||||
aOpenListener);
|
aOpenListener);
|
||||||
@ -5029,6 +5030,7 @@ NormalOriginOperationBase::Open()
|
|||||||
|
|
||||||
QuotaManager::Get()->OpenDirectoryInternal(mPersistenceType,
|
QuotaManager::Get()->OpenDirectoryInternal(mPersistenceType,
|
||||||
mOriginScope,
|
mOriginScope,
|
||||||
|
Nullable<Client::Type>(),
|
||||||
mExclusive,
|
mExclusive,
|
||||||
this);
|
this);
|
||||||
}
|
}
|
||||||
|
@ -230,6 +230,7 @@ public:
|
|||||||
void
|
void
|
||||||
OpenDirectoryInternal(Nullable<PersistenceType> aPersistenceType,
|
OpenDirectoryInternal(Nullable<PersistenceType> aPersistenceType,
|
||||||
const OriginScope& aOriginScope,
|
const OriginScope& aOriginScope,
|
||||||
|
Nullable<Client::Type> aClientType,
|
||||||
bool aExclusive,
|
bool aExclusive,
|
||||||
OpenDirectoryListener* aOpenListener);
|
OpenDirectoryListener* aOpenListener);
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ EXPORTS.mozilla.dom.quota += [
|
|||||||
'ActorsParent.h',
|
'ActorsParent.h',
|
||||||
'Client.h',
|
'Client.h',
|
||||||
'FileStreams.h',
|
'FileStreams.h',
|
||||||
|
'OriginScope.h',
|
||||||
'PersistenceType.h',
|
'PersistenceType.h',
|
||||||
'QuotaCommon.h',
|
'QuotaCommon.h',
|
||||||
'QuotaManager.h',
|
'QuotaManager.h',
|
||||||
|
@ -135,7 +135,6 @@
|
|||||||
onload = function() {
|
onload = function() {
|
||||||
SpecialPowers.pushPrefEnv({"set": [
|
SpecialPowers.pushPrefEnv({"set": [
|
||||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||||
["dom.serviceWorkers.interception.enabled", true],
|
|
||||||
["dom.serviceWorkers.enabled", true],
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.testing.enabled", true],
|
["dom.serviceWorkers.testing.enabled", true],
|
||||||
["dom.caches.enabled", true]
|
["dom.caches.enabled", true]
|
||||||
|
@ -36,7 +36,6 @@ function receiveMessage(event) {
|
|||||||
onload = function() {
|
onload = function() {
|
||||||
SpecialPowers.pushPrefEnv({"set": [
|
SpecialPowers.pushPrefEnv({"set": [
|
||||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||||
["dom.serviceWorkers.interception.enabled", true],
|
|
||||||
["dom.serviceWorkers.enabled", true],
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.testing.enabled", true],
|
["dom.serviceWorkers.testing.enabled", true],
|
||||||
["dom.caches.enabled", true]
|
["dom.caches.enabled", true]
|
||||||
|
@ -12,7 +12,6 @@ function testScript(script) {
|
|||||||
SpecialPowers.pushPrefEnv({
|
SpecialPowers.pushPrefEnv({
|
||||||
"set": [["dom.requestcache.enabled", true],
|
"set": [["dom.requestcache.enabled", true],
|
||||||
["dom.serviceWorkers.enabled", true],
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.interception.opaque.enabled", true],
|
|
||||||
["dom.serviceWorkers.testing.enabled", true],
|
["dom.serviceWorkers.testing.enabled", true],
|
||||||
["dom.serviceWorkers.exemptFromPerDomainMax", true]]
|
["dom.serviceWorkers.exemptFromPerDomainMax", true]]
|
||||||
}, function() {
|
}, function() {
|
||||||
|
@ -1378,7 +1378,7 @@ var interfaceNamesInGlobalScope =
|
|||||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||||
{name: "TVTuner", b2g: true, permission: ["tv"]},
|
{name: "TVTuner", b2g: true, permission: ["tv"]},
|
||||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||||
{name: "U2F", release: false},
|
{name: "U2F", disabled: true},
|
||||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||||
{name: "UDPMessageEvent", b2g: true, permission: ["udp-socket"]},
|
{name: "UDPMessageEvent", b2g: true, permission: ["udp-socket"]},
|
||||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||||
|
@ -30,13 +30,39 @@ interface ChromeUtils : ThreadSafeChromeUtils {
|
|||||||
optional OriginAttributesPatternDictionary pattern);
|
optional OriginAttributesPatternDictionary pattern);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an OriginAttributes dictionary using the origin URI but forcing
|
* Returns an OriginAttributesDictionary with all default attributes added
|
||||||
* the passed userContextId.
|
* and assigned default values.
|
||||||
|
*
|
||||||
|
* @returns An OriginAttributesDictionary populated with the
|
||||||
|
* default attributes added and assigned default values.
|
||||||
|
*/
|
||||||
|
static OriginAttributesDictionary
|
||||||
|
createDefaultOriginAttributes();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an OriginAttributesDictionary with values from the |origin| suffix
|
||||||
|
* and unspecified attributes added and assigned default values.
|
||||||
|
*
|
||||||
|
* @param origin The origin URI to create from.
|
||||||
|
* @returns An OriginAttributesDictionary with values from
|
||||||
|
* the origin suffix and unspecified attributes
|
||||||
|
* added and assigned default values.
|
||||||
*/
|
*/
|
||||||
[Throws]
|
[Throws]
|
||||||
static OriginAttributesDictionary
|
static OriginAttributesDictionary
|
||||||
createOriginAttributesWithUserContextId(DOMString origin,
|
createOriginAttributesFromOrigin(DOMString origin);
|
||||||
unsigned long userContextId);
|
|
||||||
|
/**
|
||||||
|
* Returns an OriginAttributesDictionary that is a copy of |originAttrs| with
|
||||||
|
* unspecified attributes added and assigned default values.
|
||||||
|
*
|
||||||
|
* @param originAttrs The origin attributes to copy.
|
||||||
|
* @returns An OriginAttributesDictionary copy of |originAttrs|
|
||||||
|
* with unspecified attributes added and assigned
|
||||||
|
* default values.
|
||||||
|
*/
|
||||||
|
static OriginAttributesDictionary
|
||||||
|
createOriginAttributesFromDict(optional OriginAttributesDictionary originAttrs);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the 2 OriginAttributes are equal.
|
* Returns true if the 2 OriginAttributes are equal.
|
||||||
|
@ -25,6 +25,11 @@ dictionary ProfileTimelineLayerRect {
|
|||||||
long height = 0;
|
long height = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum ProfileTimelineMessagePortOperationType {
|
||||||
|
"serializeData",
|
||||||
|
"deserializeData",
|
||||||
|
};
|
||||||
|
|
||||||
enum ProfileTimelineWorkerOperationType {
|
enum ProfileTimelineWorkerOperationType {
|
||||||
"serializeDataOffMainThread",
|
"serializeDataOffMainThread",
|
||||||
"serializeDataOnMainThread",
|
"serializeDataOnMainThread",
|
||||||
@ -61,6 +66,9 @@ dictionary ProfileTimelineMarker {
|
|||||||
/* For Style markers. */
|
/* For Style markers. */
|
||||||
DOMString restyleHint;
|
DOMString restyleHint;
|
||||||
|
|
||||||
|
/* For MessagePort markers. */
|
||||||
|
ProfileTimelineMessagePortOperationType messagePortOperation;
|
||||||
|
|
||||||
/* For Worker markers. */
|
/* For Worker markers. */
|
||||||
ProfileTimelineWorkerOperationType workerOperation;
|
ProfileTimelineWorkerOperationType workerOperation;
|
||||||
};
|
};
|
||||||
|
@ -22,7 +22,6 @@ interface ServiceWorkerGlobalScope : WorkerGlobalScope {
|
|||||||
attribute EventHandler oninstall;
|
attribute EventHandler oninstall;
|
||||||
attribute EventHandler onactivate;
|
attribute EventHandler onactivate;
|
||||||
|
|
||||||
[Func="mozilla::dom::workers::ServiceWorkerGlobalScope::InterceptionEnabled"]
|
|
||||||
attribute EventHandler onfetch;
|
attribute EventHandler onfetch;
|
||||||
|
|
||||||
// The event.source of these MessageEvents are instances of Client
|
// The event.source of these MessageEvents are instances of Client
|
||||||
|
@ -68,6 +68,7 @@ dictionary SignResponse {
|
|||||||
callback U2FRegisterCallback = void(RegisterResponse response);
|
callback U2FRegisterCallback = void(RegisterResponse response);
|
||||||
callback U2FSignCallback = void(SignResponse response);
|
callback U2FSignCallback = void(SignResponse response);
|
||||||
|
|
||||||
|
[Pref="security.webauth.u2f"]
|
||||||
interface U2F {
|
interface U2F {
|
||||||
// These enumerations are defined in the FIDO U2F Javascript API under the
|
// These enumerations are defined in the FIDO U2F Javascript API under the
|
||||||
// interface "ErrorCode" as constant integers, and also in the U2F.cpp file.
|
// interface "ErrorCode" as constant integers, and also in the U2F.cpp file.
|
||||||
|
@ -2288,13 +2288,14 @@ RuntimeService::CreateSharedWorkerFromLoadInfo(JSContext* aCx,
|
|||||||
|
|
||||||
// We don't actually care about this MessageChannel, but we use it to 'steal'
|
// We don't actually care about this MessageChannel, but we use it to 'steal'
|
||||||
// its 2 connected ports.
|
// its 2 connected ports.
|
||||||
RefPtr<MessageChannel> channel = MessageChannel::Constructor(window, rv);
|
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(window);
|
||||||
|
RefPtr<MessageChannel> channel = MessageChannel::Constructor(global, rv);
|
||||||
if (NS_WARN_IF(rv.Failed())) {
|
if (NS_WARN_IF(rv.Failed())) {
|
||||||
return rv.StealNSResult();
|
return rv.StealNSResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<SharedWorker> sharedWorker = new SharedWorker(window, workerPrivate,
|
RefPtr<SharedWorker> sharedWorker = new SharedWorker(window, workerPrivate,
|
||||||
channel->Port1());
|
channel->Port1());
|
||||||
|
|
||||||
if (!workerPrivate->RegisterSharedWorker(sharedWorker, channel->Port2())) {
|
if (!workerPrivate->RegisterSharedWorker(sharedWorker, channel->Port2())) {
|
||||||
NS_WARNING("Worker is unreachable, this shouldn't happen!");
|
NS_WARNING("Worker is unreachable, this shouldn't happen!");
|
||||||
|
@ -554,15 +554,6 @@ RespondWithHandler::ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValu
|
|||||||
MOZ_ASSERT(worker);
|
MOZ_ASSERT(worker);
|
||||||
worker->AssertIsOnWorkerThread();
|
worker->AssertIsOnWorkerThread();
|
||||||
|
|
||||||
// Allow opaque response interception to be disabled until we can ensure the
|
|
||||||
// security implications are not a complete disaster.
|
|
||||||
if (response->Type() == ResponseType::Opaque &&
|
|
||||||
!worker->OpaqueInterceptionEnabled()) {
|
|
||||||
autoCancel.SetCancelMessage(
|
|
||||||
NS_LITERAL_CSTRING("OpaqueInterceptionDisabledWithURL"), mRequestURL);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Section "HTTP Fetch", step 2.2:
|
// Section "HTTP Fetch", step 2.2:
|
||||||
// If one of the following conditions is true, return a network error:
|
// If one of the following conditions is true, return a network error:
|
||||||
// * response's type is "error".
|
// * response's type is "error".
|
||||||
|
@ -31,8 +31,6 @@ WORKER_SIMPLE_PREF("dom.webnotifications.enabled", DOMWorkerNotificationEnabled,
|
|||||||
WORKER_SIMPLE_PREF("dom.webnotifications.serviceworker.enabled", DOMServiceWorkerNotificationEnabled, DOM_SERVICEWORKERNOTIFICATION)
|
WORKER_SIMPLE_PREF("dom.webnotifications.serviceworker.enabled", DOMServiceWorkerNotificationEnabled, DOM_SERVICEWORKERNOTIFICATION)
|
||||||
WORKER_SIMPLE_PREF("dom.serviceWorkers.enabled", ServiceWorkersEnabled, SERVICEWORKERS_ENABLED)
|
WORKER_SIMPLE_PREF("dom.serviceWorkers.enabled", ServiceWorkersEnabled, SERVICEWORKERS_ENABLED)
|
||||||
WORKER_SIMPLE_PREF("dom.serviceWorkers.testing.enabled", ServiceWorkersTestingEnabled, SERVICEWORKERS_TESTING_ENABLED)
|
WORKER_SIMPLE_PREF("dom.serviceWorkers.testing.enabled", ServiceWorkersTestingEnabled, SERVICEWORKERS_TESTING_ENABLED)
|
||||||
WORKER_SIMPLE_PREF("dom.serviceWorkers.interception.enabled", InterceptionEnabled, INTERCEPTION_ENABLED)
|
|
||||||
WORKER_SIMPLE_PREF("dom.serviceWorkers.interception.opaque.enabled", OpaqueInterceptionEnabled, INTERCEPTION_OPAQUE_ENABLED)
|
|
||||||
WORKER_SIMPLE_PREF("dom.serviceWorkers.openWindow.enabled", OpenWindowEnabled, OPEN_WINDOW_ENABLED)
|
WORKER_SIMPLE_PREF("dom.serviceWorkers.openWindow.enabled", OpenWindowEnabled, OPEN_WINDOW_ENABLED)
|
||||||
WORKER_SIMPLE_PREF("dom.push.enabled", PushEnabled, PUSH_ENABLED)
|
WORKER_SIMPLE_PREF("dom.push.enabled", PushEnabled, PUSH_ENABLED)
|
||||||
WORKER_SIMPLE_PREF("dom.requestcache.enabled", RequestCacheEnabled, REQUESTCACHE_ENABLED)
|
WORKER_SIMPLE_PREF("dom.requestcache.enabled", RequestCacheEnabled, REQUESTCACHE_ENABLED)
|
||||||
|
@ -668,11 +668,24 @@ public:
|
|||||||
DispatchDOMEvent(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
|
DispatchDOMEvent(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
|
||||||
DOMEventTargetHelper* aTarget, bool aIsMainThread)
|
DOMEventTargetHelper* aTarget, bool aIsMainThread)
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsPIDOMWindowInner> parent;
|
nsCOMPtr<nsIGlobalObject> parent = do_QueryInterface(aTarget->GetParentObject());
|
||||||
if (aIsMainThread) {
|
|
||||||
parent = do_QueryInterface(aTarget->GetParentObject());
|
// For some workers without window, parent is null and we try to find it
|
||||||
|
// from the JS Context.
|
||||||
|
if (!parent) {
|
||||||
|
JS::Rooted<JSObject*> globalObject(aCx, JS::CurrentGlobalOrNull(aCx));
|
||||||
|
if (NS_WARN_IF(!globalObject)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
parent = xpc::NativeGlobal(globalObject);
|
||||||
|
if (NS_WARN_IF(!parent)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MOZ_ASSERT(parent);
|
||||||
|
|
||||||
JS::Rooted<JS::Value> messageData(aCx);
|
JS::Rooted<JS::Value> messageData(aCx);
|
||||||
ErrorResult rv;
|
ErrorResult rv;
|
||||||
|
|
||||||
@ -6376,7 +6389,7 @@ WorkerPrivate::ConnectMessagePort(JSContext* aCx,
|
|||||||
// This MessagePortIdentifier is used to create a new port, still connected
|
// This MessagePortIdentifier is used to create a new port, still connected
|
||||||
// with the other one, but in the worker thread.
|
// with the other one, but in the worker thread.
|
||||||
ErrorResult rv;
|
ErrorResult rv;
|
||||||
RefPtr<MessagePort> port = MessagePort::Create(nullptr, aIdentifier, rv);
|
RefPtr<MessagePort> port = MessagePort::Create(globalScope, aIdentifier, rv);
|
||||||
if (NS_WARN_IF(rv.Failed())) {
|
if (NS_WARN_IF(rv.Failed())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -633,16 +633,6 @@ ServiceWorkerGlobalScope::SkipWaiting(ErrorResult& aRv)
|
|||||||
return promise.forget();
|
return promise.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
|
||||||
bool
|
|
||||||
ServiceWorkerGlobalScope::InterceptionEnabled(JSContext* aCx, JSObject* aObj)
|
|
||||||
{
|
|
||||||
WorkerPrivate* worker = GetCurrentThreadWorkerPrivate();
|
|
||||||
MOZ_ASSERT(worker);
|
|
||||||
worker->AssertIsOnWorkerThread();
|
|
||||||
return worker->InterceptionEnabled();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ServiceWorkerGlobalScope::OpenWindowEnabled(JSContext* aCx, JSObject* aObj)
|
ServiceWorkerGlobalScope::OpenWindowEnabled(JSContext* aCx, JSObject* aObj)
|
||||||
{
|
{
|
||||||
|
@ -239,9 +239,6 @@ public:
|
|||||||
WrapGlobalObject(JSContext* aCx,
|
WrapGlobalObject(JSContext* aCx,
|
||||||
JS::MutableHandle<JSObject*> aReflector) override;
|
JS::MutableHandle<JSObject*> aReflector) override;
|
||||||
|
|
||||||
static bool
|
|
||||||
InterceptionEnabled(JSContext* aCx, JSObject* aObj);
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
OpenWindowEnabled(JSContext* aCx, JSObject* aObj);
|
OpenWindowEnabled(JSContext* aCx, JSObject* aObj);
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "nsVariant.h"
|
#include "nsVariant.h"
|
||||||
|
|
||||||
#include "RuntimeService.h"
|
#include "RuntimeService.h"
|
||||||
|
#include "WorkerScope.h"
|
||||||
#include "WorkerPrivate.h"
|
#include "WorkerPrivate.h"
|
||||||
#include "WorkerRunnable.h"
|
#include "WorkerRunnable.h"
|
||||||
#include "XMLHttpRequestUpload.h"
|
#include "XMLHttpRequestUpload.h"
|
||||||
@ -1355,7 +1356,12 @@ EventRunnable::WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
|
|||||||
|
|
||||||
ErrorResult rv;
|
ErrorResult rv;
|
||||||
JS::Rooted<JS::Value> response(aCx);
|
JS::Rooted<JS::Value> response(aCx);
|
||||||
Read(nullptr, aCx, &response, rv);
|
|
||||||
|
GlobalObject globalObj(aCx, aWorkerPrivate->GlobalScope()->GetWrapper());
|
||||||
|
nsCOMPtr<nsIGlobalObject> global =
|
||||||
|
do_QueryInterface(globalObj.GetAsSupports());
|
||||||
|
|
||||||
|
Read(global, aCx, &response, rv);
|
||||||
if (NS_WARN_IF(rv.Failed())) {
|
if (NS_WARN_IF(rv.Failed())) {
|
||||||
rv.SuppressException();
|
rv.SuppressException();
|
||||||
return false;
|
return false;
|
||||||
@ -1532,8 +1538,18 @@ SendRunnable::MainThreadRun()
|
|||||||
|
|
||||||
ErrorResult rv;
|
ErrorResult rv;
|
||||||
|
|
||||||
|
JS::Rooted<JSObject*> globalObject(cx, JS::CurrentGlobalOrNull(cx));
|
||||||
|
if (NS_WARN_IF(!globalObject)) {
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsCOMPtr<nsIGlobalObject> parent = xpc::NativeGlobal(globalObject);
|
||||||
|
if (NS_WARN_IF(!parent)) {
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
JS::Rooted<JS::Value> body(cx);
|
JS::Rooted<JS::Value> body(cx);
|
||||||
Read(nullptr, cx, &body, rv);
|
Read(parent, cx, &body, rv);
|
||||||
if (NS_WARN_IF(rv.Failed())) {
|
if (NS_WARN_IF(rv.Failed())) {
|
||||||
return rv.StealNSResult();
|
return rv.StealNSResult();
|
||||||
}
|
}
|
||||||
|
@ -45,8 +45,7 @@ function test() {
|
|||||||
|
|
||||||
SpecialPowers.pushPrefEnv({'set': [['dom.serviceWorkers.enabled', true],
|
SpecialPowers.pushPrefEnv({'set': [['dom.serviceWorkers.enabled', true],
|
||||||
['dom.serviceWorkers.exemptFromPerDomainMax', true],
|
['dom.serviceWorkers.exemptFromPerDomainMax', true],
|
||||||
['dom.serviceWorkers.testing.enabled', true],
|
['dom.serviceWorkers.testing.enabled', true]]},
|
||||||
['dom.serviceWorkers.interception.enabled', true]]},
|
|
||||||
function() {
|
function() {
|
||||||
var url = gTestRoot + 'download/window.html';
|
var url = gTestRoot + 'download/window.html';
|
||||||
var tab = gBrowser.addTab();
|
var tab = gBrowser.addTab();
|
||||||
|
@ -29,7 +29,6 @@ function test() {
|
|||||||
SpecialPowers.pushPrefEnv({'set': [['dom.serviceWorkers.enabled', true],
|
SpecialPowers.pushPrefEnv({'set': [['dom.serviceWorkers.enabled', true],
|
||||||
['dom.serviceWorkers.exemptFromPerDomainMax', true],
|
['dom.serviceWorkers.exemptFromPerDomainMax', true],
|
||||||
['dom.serviceWorkers.testing.enabled', true],
|
['dom.serviceWorkers.testing.enabled', true],
|
||||||
['dom.serviceWorkers.interception.enabled', true],
|
|
||||||
['dom.caches.enabled', true],
|
['dom.caches.enabled', true],
|
||||||
['browser.cache.disk.enable', false],
|
['browser.cache.disk.enable', false],
|
||||||
['browser.cache.memory.enable', false]]},
|
['browser.cache.memory.enable', false]]},
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
// Only succeeds if onfetch is available.
|
|
||||||
if (!("onfetch" in self)) {
|
|
||||||
throw new Error("Not capable of interception");
|
|
||||||
}
|
|
@ -171,7 +171,6 @@ support-files =
|
|||||||
strict_mode_warning.js
|
strict_mode_warning.js
|
||||||
skip_waiting_installed_worker.js
|
skip_waiting_installed_worker.js
|
||||||
skip_waiting_scope/index.html
|
skip_waiting_scope/index.html
|
||||||
interception_featuredetect.js
|
|
||||||
thirdparty/iframe1.html
|
thirdparty/iframe1.html
|
||||||
thirdparty/iframe2.html
|
thirdparty/iframe2.html
|
||||||
thirdparty/register.html
|
thirdparty/register.html
|
||||||
@ -239,8 +238,6 @@ skip-if = e10s && debug && os == 'win'
|
|||||||
skip-if = e10s && debug && os == 'win'
|
skip-if = e10s && debug && os == 'win'
|
||||||
[test_installation_simple.html]
|
[test_installation_simple.html]
|
||||||
skip-if = e10s && debug && os == 'win'
|
skip-if = e10s && debug && os == 'win'
|
||||||
[test_interception_featuredetect.html]
|
|
||||||
skip-if = e10s && debug && os == 'win'
|
|
||||||
[test_match_all.html]
|
[test_match_all.html]
|
||||||
skip-if = e10s && debug && os == 'win'
|
skip-if = e10s && debug && os == 'win'
|
||||||
[test_match_all_advanced.html]
|
[test_match_all_advanced.html]
|
||||||
|
@ -94,7 +94,6 @@
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
SpecialPowers.pushPrefEnv({"set": [
|
SpecialPowers.pushPrefEnv({"set": [
|
||||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||||
["dom.serviceWorkers.interception.enabled", true],
|
|
||||||
["dom.serviceWorkers.enabled", true],
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.testing.enabled", true],
|
["dom.serviceWorkers.testing.enabled", true],
|
||||||
["dom.caches.enabled", true],
|
["dom.caches.enabled", true],
|
||||||
|
@ -162,7 +162,6 @@
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
SpecialPowers.pushPrefEnv({"set": [
|
SpecialPowers.pushPrefEnv({"set": [
|
||||||
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
["dom.serviceWorkers.exemptFromPerDomainMax", true],
|
||||||
["dom.serviceWorkers.interception.enabled", true],
|
|
||||||
["dom.serviceWorkers.enabled", true],
|
["dom.serviceWorkers.enabled", true],
|
||||||
["dom.serviceWorkers.testing.enabled", true]
|
["dom.serviceWorkers.testing.enabled", true]
|
||||||
]}, runTest);
|
]}, runTest);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user