зеркало из https://github.com/mozilla/gecko-dev.git
merge mozilla-central to mozilla-inbound. r=merge a=merge
--HG-- rename : media/libstagefright/binding/include/mp4_demuxer/ByteReader.h => media/libstagefright/binding/include/mp4_demuxer/BufferReader.h extra : rebase_source : 98d9275bf6065bc701881aed6c4635f1da9ea642
This commit is contained in:
Коммит
f3f32c7851
|
@ -890,6 +890,8 @@ pref("browser.sessionstore.debug.no_auto_updates", false);
|
|||
pref("browser.sessionstore.cleanup.forget_closed_after", 1209600000);
|
||||
// Maximum number of bytes of DOMSessionStorage data we collect per origin.
|
||||
pref("browser.sessionstore.dom_storage_limit", 2048);
|
||||
// Amount of failed SessionFile writes until we restart the worker.
|
||||
pref("browser.sessionstore.max_write_failures", 5);
|
||||
|
||||
// allow META refresh by default
|
||||
pref("accessibility.blockautorefresh", false);
|
||||
|
|
|
@ -21,6 +21,7 @@ const TRANSITION_TO_TRANSITION_TYPES_MAP = new Map([
|
|||
["auto_bookmark", nsINavHistoryService.TRANSITION_BOOKMARK],
|
||||
["auto_subframe", nsINavHistoryService.TRANSITION_EMBED],
|
||||
["manual_subframe", nsINavHistoryService.TRANSITION_FRAMED_LINK],
|
||||
["reload", nsINavHistoryService.TRANSITION_RELOAD],
|
||||
]);
|
||||
|
||||
let TRANSITION_TYPE_TO_TRANSITIONS_MAP = new Map();
|
||||
|
@ -189,6 +190,7 @@ this.history = class extends ExtensionAPI {
|
|||
}
|
||||
|
||||
let options = PlacesUtils.history.getNewQueryOptions();
|
||||
options.includeHidden = true;
|
||||
options.sortingMode = options.SORT_BY_DATE_DESCENDING;
|
||||
options.maxResults = query.maxResults || 100;
|
||||
|
||||
|
@ -208,6 +210,7 @@ this.history = class extends ExtensionAPI {
|
|||
}
|
||||
|
||||
let options = PlacesUtils.history.getNewQueryOptions();
|
||||
options.includeHidden = true;
|
||||
options.sortingMode = options.SORT_BY_DATE_DESCENDING;
|
||||
options.resultType = options.RESULTS_AS_VISIT;
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": "plugin:mozilla/mochitest-test",
|
||||
|
||||
"env": {
|
||||
"browser": true,
|
||||
"webextensions": true,
|
||||
},
|
||||
};
|
|
@ -2,6 +2,8 @@
|
|||
support-files =
|
||||
../../../../../toolkit/components/extensions/test/mochitest/test_ext_all_apis.js
|
||||
../../../../../toolkit/components/extensions/test/mochitest/file_sample.html
|
||||
../../../../../toolkit/components/extensions/test/mochitest/redirection.sjs
|
||||
tags = webextensions
|
||||
|
||||
[test_ext_all_apis.html]
|
||||
[test_ext_history_redirect.html]
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for simple WebExtension</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript">
|
||||
"use strict";
|
||||
|
||||
const REDIRECT_URL = new URL("redirection.sjs", location).href;
|
||||
|
||||
function waitForLoad(win) {
|
||||
return new Promise(resolve => {
|
||||
win.addEventListener("load", function() {
|
||||
resolve();
|
||||
}, {capture: true, once: true});
|
||||
});
|
||||
}
|
||||
|
||||
add_task(async function history_redirect() {
|
||||
function background() {
|
||||
browser.test.onMessage.addListener(async (msg, url) => {
|
||||
switch (msg) {
|
||||
case "delete-all": {
|
||||
let results = await browser.history.deleteAll();
|
||||
browser.test.sendMessage("delete-all-result", results);
|
||||
break;
|
||||
}
|
||||
case "search": {
|
||||
let results = await browser.history.search({text: url, startTime: new Date(0)});
|
||||
browser.test.sendMessage("search-result", results);
|
||||
break;
|
||||
}
|
||||
case "get-visits": {
|
||||
let results = await browser.history.getVisits({url});
|
||||
browser.test.sendMessage("get-visits-result", results);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
browser.test.sendMessage("ready");
|
||||
}
|
||||
|
||||
let extensionData = {
|
||||
manifest: {
|
||||
permissions: [
|
||||
"history",
|
||||
],
|
||||
},
|
||||
background,
|
||||
};
|
||||
|
||||
let extension = ExtensionTestUtils.loadExtension(extensionData);
|
||||
|
||||
await Promise.all([extension.startup(), extension.awaitMessage("ready")]);
|
||||
info("extension loaded");
|
||||
|
||||
extension.sendMessage("delete-all");
|
||||
await extension.awaitMessage("delete-all-result");
|
||||
|
||||
let win = window.open(REDIRECT_URL);
|
||||
await waitForLoad(win);
|
||||
|
||||
extension.sendMessage("search", REDIRECT_URL);
|
||||
let results = await extension.awaitMessage("search-result");
|
||||
is(results.length, 1, "search returned expected length of results");
|
||||
|
||||
extension.sendMessage("get-visits", REDIRECT_URL);
|
||||
let visits = await extension.awaitMessage("get-visits-result");
|
||||
is(visits.length, 1, "getVisits returned expected length of visits");
|
||||
|
||||
// cleanup phase
|
||||
win.close();
|
||||
|
||||
await extension.unload();
|
||||
info("extension unloaded");
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -404,6 +404,83 @@ add_task(async function test_get_visits() {
|
|||
await extension.unload();
|
||||
});
|
||||
|
||||
add_task(async function test_transition_types() {
|
||||
const VISIT_URL_PREFIX = "http://example.com/";
|
||||
const TRANSITIONS = [
|
||||
["link", Ci.nsINavHistoryService.TRANSITION_LINK],
|
||||
["typed", Ci.nsINavHistoryService.TRANSITION_TYPED],
|
||||
["auto_bookmark", Ci.nsINavHistoryService.TRANSITION_BOOKMARK],
|
||||
// Only session history contains TRANSITION_EMBED visits,
|
||||
// So global history query cannot find them.
|
||||
// ["auto_subframe", Ci.nsINavHistoryService.TRANSITION_EMBED],
|
||||
// Redirects are not correctly tested here because History::UpdatePlaces
|
||||
// will not make redirect entries hidden.
|
||||
["link", Ci.nsINavHistoryService.TRANSITION_REDIRECT_PERMANENT],
|
||||
["link", Ci.nsINavHistoryService.TRANSITION_REDIRECT_TEMPORARY],
|
||||
["link", Ci.nsINavHistoryService.TRANSITION_DOWNLOAD],
|
||||
["manual_subframe", Ci.nsINavHistoryService.TRANSITION_FRAMED_LINK],
|
||||
["reload", Ci.nsINavHistoryService.TRANSITION_RELOAD],
|
||||
];
|
||||
|
||||
// pages/visits to add via History.insertMany
|
||||
let pageInfos = [];
|
||||
let visitDate = new Date(1999, 9, 9, 9, 9).getTime();
|
||||
for (let [, transitionType] of TRANSITIONS) {
|
||||
pageInfos.push({
|
||||
url: VISIT_URL_PREFIX + transitionType + "/",
|
||||
visits: [
|
||||
{transition: transitionType, date: new Date(visitDate -= 1000)},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
function background() {
|
||||
browser.test.onMessage.addListener(async (msg, url) => {
|
||||
switch (msg) {
|
||||
case "search": {
|
||||
let results = await browser.history.search({text: "", startTime: new Date(0)});
|
||||
browser.test.sendMessage("search-result", results);
|
||||
break;
|
||||
}
|
||||
case "get-visits": {
|
||||
let results = await browser.history.getVisits({url});
|
||||
browser.test.sendMessage("get-visits-result", results);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
browser.test.sendMessage("ready");
|
||||
}
|
||||
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
permissions: ["history"],
|
||||
},
|
||||
background,
|
||||
});
|
||||
|
||||
await PlacesTestUtils.clearHistory();
|
||||
await extension.startup();
|
||||
await extension.awaitMessage("ready");
|
||||
|
||||
await PlacesUtils.history.insertMany(pageInfos);
|
||||
|
||||
extension.sendMessage("search");
|
||||
let results = await extension.awaitMessage("search-result");
|
||||
equal(results.length, pageInfos.length, "search returned expected length of results");
|
||||
for (let i = 0; i < pageInfos.length; ++i) {
|
||||
equal(results[i].url, pageInfos[i].url, "search returned the expected url");
|
||||
|
||||
extension.sendMessage("get-visits", pageInfos[i].url);
|
||||
let visits = await extension.awaitMessage("get-visits-result");
|
||||
equal(visits.length, 1, "getVisits returned expected length of visits");
|
||||
equal(visits[0].transition, TRANSITIONS[i][0], "getVisits returned the expected transition");
|
||||
}
|
||||
|
||||
await extension.unload();
|
||||
});
|
||||
|
||||
add_task(async function test_on_visited() {
|
||||
const SINGLE_VISIT_URL = "http://example.com/1/";
|
||||
const DOUBLE_VISIT_URL = "http://example.com/2/";
|
||||
|
|
|
@ -40,53 +40,6 @@ const TAB_DROP_TYPE = "application/x-moz-tabbrowser-tab";
|
|||
const PREF_LOAD_BOOKMARKS_IN_BACKGROUND = "browser.tabs.loadBookmarksInBackground";
|
||||
const PREF_LOAD_BOOKMARKS_IN_TABS = "browser.tabs.loadBookmarksInTabs";
|
||||
|
||||
// This function isn't public both because it's synchronous and because it is
|
||||
// going to be removed in bug 1072833.
|
||||
function IsLivemark(aItemId) {
|
||||
// Since this check may be done on each dragover event, it's worth maintaining
|
||||
// a cache.
|
||||
let self = IsLivemark;
|
||||
if (!("ids" in self)) {
|
||||
const LIVEMARK_ANNO = PlacesUtils.LMANNO_FEEDURI;
|
||||
|
||||
let idsVec = PlacesUtils.annotations.getItemsWithAnnotation(LIVEMARK_ANNO);
|
||||
self.ids = new Set(idsVec);
|
||||
|
||||
let obs = Object.freeze({
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarksObserver]),
|
||||
|
||||
onItemChanged(itemId, property, isAnnoProperty, newValue, lastModified,
|
||||
itemType, parentId, guid) {
|
||||
if (isAnnoProperty && property == LIVEMARK_ANNO) {
|
||||
self.ids.add(itemId);
|
||||
}
|
||||
},
|
||||
|
||||
onItemRemoved(itemId) {
|
||||
// Since the bookmark is removed, we know we can remove any references
|
||||
// to it from the cache.
|
||||
self.ids.delete(itemId);
|
||||
},
|
||||
|
||||
onItemAdded() {},
|
||||
onBeginUpdateBatch() {},
|
||||
onEndUpdateBatch() {},
|
||||
onItemVisited() {},
|
||||
onItemMoved() {},
|
||||
onPageAnnotationSet() { },
|
||||
onPageAnnotationRemoved() { },
|
||||
skipDescendantsOnItemRemoval: false,
|
||||
skipTags: true,
|
||||
});
|
||||
|
||||
PlacesUtils.bookmarks.addObserver(obs);
|
||||
PlacesUtils.registerShutdownFunction(() => {
|
||||
PlacesUtils.bookmarks.removeObserver(obs);
|
||||
});
|
||||
}
|
||||
return self.ids.has(aItemId);
|
||||
}
|
||||
|
||||
let InternalFaviconLoader = {
|
||||
/**
|
||||
* This gets called for every inner window that is destroyed.
|
||||
|
@ -814,9 +767,11 @@ this.PlacesUIUtils = {
|
|||
*
|
||||
* @param aNode
|
||||
* a node, except the root node of a query.
|
||||
* @param aView
|
||||
* The view originating the request.
|
||||
* @return true if the aNode represents a removable entry, false otherwise.
|
||||
*/
|
||||
canUserRemove(aNode) {
|
||||
canUserRemove(aNode, aView) {
|
||||
let parentNode = aNode.parent;
|
||||
if (!parentNode) {
|
||||
// canUserRemove doesn't accept root nodes.
|
||||
|
@ -837,44 +792,40 @@ this.PlacesUIUtils = {
|
|||
return true;
|
||||
|
||||
// Otherwise it has to be a child of an editable folder.
|
||||
return !this.isContentsReadOnly(parentNode);
|
||||
return !this.isFolderReadOnly(parentNode, aView);
|
||||
},
|
||||
|
||||
/**
|
||||
* DO NOT USE THIS API IN ADDONS. IT IS VERY LIKELY TO CHANGE WHEN THE SWITCH
|
||||
* TO GUIDS IS COMPLETE (BUG 1071511).
|
||||
*
|
||||
* Check whether or not the given node or item-id points to a folder which
|
||||
* Check whether or not the given Places node points to a folder which
|
||||
* should not be modified by the user (i.e. its children should be unremovable
|
||||
* and unmovable, new children should be disallowed, etc).
|
||||
* These semantics are not inherited, meaning that read-only folder may
|
||||
* contain editable items (for instance, the places root is read-only, but all
|
||||
* of its direct children aren't).
|
||||
*
|
||||
* You should only pass folder item ids or folder nodes for aNodeOrItemId.
|
||||
* While this is only enforced for the node case (if an item id of a separator
|
||||
* or a bookmark is passed, false is returned), it's considered the caller's
|
||||
* job to ensure that it checks a folder.
|
||||
* Also note that folder-shortcuts should only be passed as result nodes.
|
||||
* Otherwise they are just treated as bookmarks (i.e. false is returned).
|
||||
* You should only pass folder nodes.
|
||||
*
|
||||
* @param aNodeOrItemId
|
||||
* any item id or result node.
|
||||
* @throws if aNodeOrItemId is neither an item id nor a folder result node.
|
||||
* @param placesNode
|
||||
* any folder result node.
|
||||
* @param view
|
||||
* The view originating the request.
|
||||
* @throws if placesNode is not a folder result node or views is invalid.
|
||||
* @note livemark "folders" are considered read-only (but see bug 1072833).
|
||||
* @return true if aItemId points to a read-only folder, false otherwise.
|
||||
* @return true if placesNode is a read-only folder, false otherwise.
|
||||
*/
|
||||
isContentsReadOnly(aNodeOrItemId) {
|
||||
let itemId;
|
||||
if (typeof(aNodeOrItemId) == "number") {
|
||||
itemId = aNodeOrItemId;
|
||||
} else if (PlacesUtils.nodeIsFolder(aNodeOrItemId)) {
|
||||
itemId = PlacesUtils.getConcreteItemId(aNodeOrItemId);
|
||||
} else {
|
||||
throw new Error("invalid value for aNodeOrItemId");
|
||||
isFolderReadOnly(placesNode, view) {
|
||||
if (typeof placesNode != "object" || !PlacesUtils.nodeIsFolder(placesNode)) {
|
||||
throw new Error("invalid value for placesNode");
|
||||
}
|
||||
|
||||
if (itemId == PlacesUtils.placesRootId || IsLivemark(itemId))
|
||||
if (!view || typeof view != "object") {
|
||||
throw new Error("invalid value for aView");
|
||||
}
|
||||
let itemId = PlacesUtils.getConcreteItemId(placesNode);
|
||||
if (itemId == PlacesUtils.placesRootId ||
|
||||
view.controller.hasCachedLivemarkInfo(placesNode))
|
||||
return true;
|
||||
|
||||
// leftPaneFolderId, and as a result, allBookmarksFolderId, is a lazy getter
|
||||
|
@ -888,9 +839,9 @@ this.PlacesUIUtils = {
|
|||
// special folder if the lazy getter is still in place. This is safe merely
|
||||
// because the only way to access the left pane contents goes through
|
||||
// "resolving" the leftPaneFolderId getter.
|
||||
if ("get" in Object.getOwnPropertyDescriptor(this, "leftPaneFolderId"))
|
||||
if (typeof Object.getOwnPropertyDescriptor(this, "leftPaneFolderId").get == "function") {
|
||||
return false;
|
||||
|
||||
}
|
||||
return itemId == this.leftPaneFolderId ||
|
||||
itemId == this.allBookmarksFolderId;
|
||||
},
|
||||
|
|
|
@ -217,7 +217,7 @@ PlacesViewBase.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
if (PlacesControllerDragHelper.disallowInsertion(container))
|
||||
if (PlacesControllerDragHelper.disallowInsertion(container, this))
|
||||
return null;
|
||||
|
||||
return new InsertionPoint({
|
||||
|
@ -1499,7 +1499,7 @@ PlacesToolbar.prototype = {
|
|||
let eltRect = elt.getBoundingClientRect();
|
||||
let eltIndex = Array.prototype.indexOf.call(this._rootElt.childNodes, elt);
|
||||
if (PlacesUtils.nodeIsFolder(elt._placesNode) &&
|
||||
!PlacesUIUtils.isContentsReadOnly(elt._placesNode)) {
|
||||
!PlacesUIUtils.isFolderReadOnly(elt._placesNode, this)) {
|
||||
// This is a folder.
|
||||
// If we are in the middle of it, drop inside it.
|
||||
// Otherwise, drop before it, with regards to RTL mode.
|
||||
|
|
|
@ -200,7 +200,7 @@ PlacesController.prototype = {
|
|||
let selectedNode = this._view.selectedNode;
|
||||
return selectedNode &&
|
||||
PlacesUtils.nodeIsFolder(selectedNode) &&
|
||||
!PlacesUIUtils.isContentsReadOnly(selectedNode) &&
|
||||
!PlacesUIUtils.isFolderReadOnly(selectedNode, this._view) &&
|
||||
this._view.result.sortingMode ==
|
||||
Ci.nsINavHistoryQueryOptions.SORT_BY_NONE;
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ PlacesController.prototype = {
|
|||
if (nodes[i] == root)
|
||||
return false;
|
||||
|
||||
if (!PlacesUIUtils.canUserRemove(nodes[i]))
|
||||
if (!PlacesUIUtils.canUserRemove(nodes[i], this._view))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1550,16 +1550,31 @@ var PlacesControllerDragHelper = {
|
|||
/**
|
||||
* Determines if an unwrapped node can be moved.
|
||||
*
|
||||
* @param aUnwrappedNode
|
||||
* A node unwrapped by PlacesUtils.unwrapNodes().
|
||||
* @param unwrappedNode
|
||||
* A node unwrapped by PlacesUtils.unwrapNodes().
|
||||
* @return True if the node can be moved, false otherwise.
|
||||
*/
|
||||
canMoveUnwrappedNode(aUnwrappedNode) {
|
||||
return aUnwrappedNode.id > 0 &&
|
||||
!PlacesUtils.isRootItem(aUnwrappedNode.id) &&
|
||||
(!aUnwrappedNode.parent || !PlacesUIUtils.isContentsReadOnly(aUnwrappedNode.parent)) &&
|
||||
aUnwrappedNode.parent != PlacesUtils.tagsFolderId &&
|
||||
aUnwrappedNode.grandParentId != PlacesUtils.tagsFolderId;
|
||||
canMoveUnwrappedNode(unwrappedNode) {
|
||||
if (unwrappedNode.id <= 0 || PlacesUtils.isRootItem(unwrappedNode.id)) {
|
||||
return false;
|
||||
}
|
||||
let parentId = unwrappedNode.parent;
|
||||
if (parentId <= 0 ||
|
||||
parentId == PlacesUtils.placesRootId ||
|
||||
parentId == PlacesUtils.tagsFolderId ||
|
||||
unwrappedNode.grandParentId == PlacesUtils.tagsFolderId) {
|
||||
return false;
|
||||
}
|
||||
// leftPaneFolderId and allBookmarksFolderId are lazy getters running
|
||||
// at least a synchronous DB query. Therefore we don't want to invoke
|
||||
// them first, especially because isCommandEnabled may be called way
|
||||
// before the left pane folder is even necessary.
|
||||
if (typeof Object.getOwnPropertyDescriptor(PlacesUIUtils, "leftPaneFolderId").get != "function" &&
|
||||
(parentId == PlacesUIUtils.leftPaneFolderId ||
|
||||
parentId == PlacesUIUtils.allBookmarksFolderId)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1567,11 +1582,13 @@ var PlacesControllerDragHelper = {
|
|||
*
|
||||
* @param aNode
|
||||
* A nsINavHistoryResultNode node.
|
||||
* @param aView
|
||||
* The view originating the request
|
||||
* @param [optional] aDOMNode
|
||||
* A XUL DOM node.
|
||||
* @return True if the node can be moved, false otherwise.
|
||||
*/
|
||||
canMoveNode(aNode, aDOMNode) {
|
||||
canMoveNode(aNode, aView, aDOMNode) {
|
||||
// Only bookmark items are movable.
|
||||
if (aNode.itemId == -1)
|
||||
return false;
|
||||
|
@ -1587,8 +1604,8 @@ var PlacesControllerDragHelper = {
|
|||
|
||||
// Once tags and bookmarked are divorced, the tag-query check should be
|
||||
// removed.
|
||||
return !(PlacesUtils.nodeIsFolder(parentNode) &&
|
||||
PlacesUIUtils.isContentsReadOnly(parentNode)) &&
|
||||
return PlacesUtils.nodeIsFolder(parentNode) &&
|
||||
!PlacesUIUtils.isFolderReadOnly(parentNode, aView) &&
|
||||
!PlacesUtils.nodeIsTagQuery(parentNode);
|
||||
},
|
||||
|
||||
|
@ -1738,13 +1755,15 @@ var PlacesControllerDragHelper = {
|
|||
* Checks if we can insert into a container.
|
||||
* @param aContainer
|
||||
* The container were we are want to drop
|
||||
* @param aView
|
||||
* The view generating the request
|
||||
*/
|
||||
disallowInsertion(aContainer) {
|
||||
disallowInsertion(aContainer, aView) {
|
||||
NS_ASSERT(aContainer, "empty container");
|
||||
// Allow dropping into Tag containers and editable folders.
|
||||
return !PlacesUtils.nodeIsTagQuery(aContainer) &&
|
||||
(!PlacesUtils.nodeIsFolder(aContainer) ||
|
||||
PlacesUIUtils.isContentsReadOnly(aContainer));
|
||||
PlacesUIUtils.isFolderReadOnly(aContainer, aView));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -55,8 +55,14 @@ var gEditItemOverlay = {
|
|||
throw new Error("Cannot use an incomplete node to initialize the edit bookmark panel");
|
||||
}
|
||||
let parent = node.parent;
|
||||
isParentReadOnly = !PlacesUtils.nodeIsFolder(parent) ||
|
||||
PlacesUIUtils.isContentsReadOnly(parent);
|
||||
isParentReadOnly = !PlacesUtils.nodeIsFolder(parent);
|
||||
if (!isParentReadOnly) {
|
||||
let folderId = PlacesUtils.getConcreteItemId(parent);
|
||||
isParentReadOnly = folderId == PlacesUtils.placesRootId ||
|
||||
(!("get" in Object.getOwnPropertyDescriptor(PlacesUIUtils, "leftPaneFolderId")) &&
|
||||
(folderId == PlacesUIUtils.leftPaneFolderId ||
|
||||
folderId == PlacesUIUtils.allBookmarksFolderId));
|
||||
}
|
||||
parentId = parent.itemId;
|
||||
parentGuid = parent.bookmarkGuid;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
let resultNode = this._placesNode;
|
||||
|
||||
if (!PlacesUtils.nodeIsFolder(resultNode) ||
|
||||
PlacesControllerDragHelper.disallowInsertion(resultNode)) {
|
||||
PlacesControllerDragHelper.disallowInsertion(resultNode, this._rootView)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@
|
|||
let tagName = PlacesUtils.nodeIsTagQuery(elt._placesNode) ?
|
||||
elt._placesNode.title : null;
|
||||
if ((PlacesUtils.nodeIsFolder(elt._placesNode) &&
|
||||
!PlacesUIUtils.isContentsReadOnly(elt._placesNode)) ||
|
||||
!PlacesUIUtils.isFolderReadOnly(elt._placesNode, this._rootView)) ||
|
||||
PlacesUtils.nodeIsTagQuery(elt._placesNode)) {
|
||||
// This is a folder or a tag container.
|
||||
if (eventY - eltY < eltHeight * 0.20) {
|
||||
|
@ -350,7 +350,7 @@
|
|||
|
||||
// Force a copy action if parent node is a query or we are dragging a
|
||||
// not-removable node.
|
||||
if (!PlacesControllerDragHelper.canMoveNode(draggedElt, elt))
|
||||
if (!PlacesControllerDragHelper.canMoveNode(draggedElt, this._rootView, elt))
|
||||
event.dataTransfer.effectAllowed = "copyLink";
|
||||
|
||||
// Activate the view and cache the dragged element.
|
||||
|
|
|
@ -500,7 +500,7 @@
|
|||
|
||||
// Avoid the potentially expensive call to getChildIndex
|
||||
// if we know this container doesn't allow insertion
|
||||
if (PlacesControllerDragHelper.disallowInsertion(container))
|
||||
if (PlacesControllerDragHelper.disallowInsertion(container, this))
|
||||
return null;
|
||||
|
||||
var queryOptions = PlacesUtils.asQuery(result.root).queryOptions;
|
||||
|
@ -523,7 +523,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (PlacesControllerDragHelper.disallowInsertion(container))
|
||||
if (PlacesControllerDragHelper.disallowInsertion(container, this))
|
||||
return null;
|
||||
|
||||
// TODO (Bug 1160193): properly support dropping on a tag root.
|
||||
|
@ -733,7 +733,7 @@
|
|||
|
||||
// If this node is child of a readonly container (e.g. a livemark)
|
||||
// or cannot be moved, we must force a copy.
|
||||
if (!PlacesControllerDragHelper.canMoveNode(node)) {
|
||||
if (!PlacesControllerDragHelper.canMoveNode(node, this)) {
|
||||
event.dataTransfer.effectAllowed = "copyLink";
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1406,7 +1406,7 @@ PlacesTreeView.prototype = {
|
|||
|
||||
// Avoid the potentially expensive call to getChildIndex
|
||||
// if we know this container doesn't allow insertion.
|
||||
if (PlacesControllerDragHelper.disallowInsertion(container))
|
||||
if (PlacesControllerDragHelper.disallowInsertion(container, this._tree.element))
|
||||
return null;
|
||||
|
||||
let queryOptions = PlacesUtils.asQuery(this._result.root).queryOptions;
|
||||
|
@ -1429,7 +1429,7 @@ PlacesTreeView.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
if (PlacesControllerDragHelper.disallowInsertion(container))
|
||||
if (PlacesControllerDragHelper.disallowInsertion(container, this._tree.element))
|
||||
return null;
|
||||
|
||||
// TODO (Bug 1160193): properly support dropping on a tag root.
|
||||
|
|
|
@ -5,181 +5,121 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
let rootFolder;
|
||||
let rootNode;
|
||||
|
||||
add_task(async function setup() {
|
||||
rootFolder = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: PlacesUtils.bookmarks.toolbarGuid,
|
||||
add_task(async function() {
|
||||
let root = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
|
||||
title: "",
|
||||
type: PlacesUtils.bookmarks.TYPE_FOLDER,
|
||||
type: PlacesUtils.bookmarks.TYPE_FOLDER
|
||||
});
|
||||
|
||||
let rootId = await PlacesUtils.promiseItemId(rootFolder.guid);
|
||||
rootNode = PlacesUtils.getFolderContents(rootId, false, true).root;
|
||||
|
||||
Assert.equal(rootNode.childCount, 0, "confirm test root is empty");
|
||||
|
||||
registerCleanupFunction(async () => {
|
||||
await PlacesUtils.bookmarks.eraseEverything();
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_regular_folder() {
|
||||
let regularFolder = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: rootFolder.guid,
|
||||
title: "",
|
||||
type: PlacesUtils.bookmarks.TYPE_FOLDER,
|
||||
});
|
||||
|
||||
Assert.equal(rootNode.childCount, 1,
|
||||
"populate added data to the test root");
|
||||
Assert.equal(PlacesControllerDragHelper.canMoveNode(rootNode.getChild(0)),
|
||||
true, "can move regular folder node");
|
||||
|
||||
await PlacesUtils.bookmarks.remove(regularFolder);
|
||||
});
|
||||
|
||||
add_task(async function test_folder_shortcut() {
|
||||
let regularFolder = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: rootFolder.guid,
|
||||
title: "",
|
||||
type: PlacesUtils.bookmarks.TYPE_FOLDER,
|
||||
});
|
||||
let regularFolderId = await PlacesUtils.promiseItemId(regularFolder.guid);
|
||||
|
||||
let shortcut = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: rootFolder.guid,
|
||||
title: "bar",
|
||||
url: `place:folder=${regularFolderId}`
|
||||
});
|
||||
|
||||
Assert.equal(rootNode.childCount, 2,
|
||||
"populated data to the test root");
|
||||
|
||||
let folderNode = rootNode.getChild(0);
|
||||
Assert.equal(folderNode.type, 6, "node is folder");
|
||||
Assert.equal(regularFolder.guid, folderNode.bookmarkGuid, "folder guid and folder node item guid match");
|
||||
|
||||
let shortcutNode = rootNode.getChild(1);
|
||||
Assert.equal(shortcutNode.type, 9, "node is folder shortcut");
|
||||
Assert.equal(shortcut.guid, shortcutNode.bookmarkGuid, "shortcut guid and shortcut node item guid match");
|
||||
|
||||
let concreteId = PlacesUtils.getConcreteItemGuid(shortcutNode);
|
||||
Assert.equal(concreteId, folderNode.bookmarkGuid, "shortcut node id and concrete id match");
|
||||
|
||||
Assert.equal(PlacesControllerDragHelper.canMoveNode(shortcutNode), true,
|
||||
"can move folder shortcut node");
|
||||
|
||||
await PlacesUtils.bookmarks.remove(shortcut);
|
||||
await PlacesUtils.bookmarks.remove(regularFolder);
|
||||
});
|
||||
|
||||
add_task(async function test_regular_query() {
|
||||
let bookmark = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: rootFolder.guid,
|
||||
title: "",
|
||||
url: "http://foo.com",
|
||||
});
|
||||
|
||||
let query = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: rootFolder.guid,
|
||||
title: "bar",
|
||||
url: `place:terms=foo`
|
||||
});
|
||||
|
||||
Assert.equal(rootNode.childCount, 2,
|
||||
"populated data to the test root");
|
||||
|
||||
let bmNode = rootNode.getChild(0);
|
||||
Assert.equal(bmNode.bookmarkGuid, bookmark.guid, "bookmark guid and bookmark node item guid match");
|
||||
|
||||
let queryNode = rootNode.getChild(1);
|
||||
Assert.equal(queryNode.bookmarkGuid, query.guid, "query guid and query node item guid match");
|
||||
|
||||
Assert.equal(PlacesControllerDragHelper.canMoveNode(queryNode),
|
||||
true, "can move query node");
|
||||
|
||||
await PlacesUtils.bookmarks.remove(query);
|
||||
await PlacesUtils.bookmarks.remove(bookmark);
|
||||
});
|
||||
|
||||
add_task(async function test_special_folders() {
|
||||
// Test that special folders and special folder shortcuts cannot be moved.
|
||||
let folders = [
|
||||
PlacesUtils.bookmarksMenuFolderId,
|
||||
PlacesUtils.tagsFolderId,
|
||||
PlacesUtils.unfiledBookmarksFolderId,
|
||||
PlacesUtils.toolbarFolderId
|
||||
];
|
||||
|
||||
let children = folders.map(folderId => {
|
||||
return {
|
||||
await withSidebarTree("bookmarks", async function(tree) {
|
||||
info("Test a regular folder");
|
||||
let folder = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: root.guid,
|
||||
title: "",
|
||||
type: PlacesUtils.bookmarks.TYPE_FOLDER,
|
||||
});
|
||||
let folderId = await PlacesUtils.promiseItemId(folder.guid);
|
||||
tree.selectItems([folderId]);
|
||||
Assert.equal(tree.selectedNode.bookmarkGuid, folder.guid,
|
||||
"Selected the expected node");
|
||||
Assert.equal(tree.selectedNode.type, 6, "node is a folder");
|
||||
Assert.ok(PlacesControllerDragHelper.canMoveNode(tree.selectedNode, tree),
|
||||
"can move regular folder node");
|
||||
|
||||
info("Test a folder shortcut");
|
||||
let shortcut = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: root.guid,
|
||||
title: "bar",
|
||||
url: `place:folder=${folderId}`
|
||||
};
|
||||
});
|
||||
});
|
||||
let shortcutId = await PlacesUtils.promiseItemId(shortcut.guid);
|
||||
tree.selectItems([shortcutId]);
|
||||
Assert.equal(tree.selectedNode.bookmarkGuid, shortcut.guid,
|
||||
"Selected the expected node");
|
||||
Assert.equal(tree.selectedNode.type, 9, "node is a folder shortcut");
|
||||
Assert.equal(PlacesUtils.getConcreteItemGuid(tree.selectedNode),
|
||||
folder.guid, "shortcut node guid and concrete guid match");
|
||||
Assert.ok(PlacesControllerDragHelper.canMoveNode(tree.selectedNode, tree),
|
||||
"can move folder shortcut node");
|
||||
|
||||
let shortcuts = await PlacesUtils.bookmarks.insertTree({
|
||||
guid: rootFolder.guid,
|
||||
children
|
||||
});
|
||||
info("Test a query");
|
||||
let bookmark = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: root.guid,
|
||||
title: "",
|
||||
url: "http://foo.com",
|
||||
});
|
||||
let bookmarkId = await PlacesUtils.promiseItemId(bookmark.guid);
|
||||
tree.selectItems([bookmarkId]);
|
||||
Assert.equal(tree.selectedNode.bookmarkGuid, bookmark.guid,
|
||||
"Selected the expected node");
|
||||
let query = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: root.guid,
|
||||
title: "bar",
|
||||
url: `place:terms=foo`
|
||||
});
|
||||
let queryId = await PlacesUtils.promiseItemId(query.guid);
|
||||
tree.selectItems([queryId]);
|
||||
Assert.equal(tree.selectedNode.bookmarkGuid, query.guid,
|
||||
"Selected the expected node");
|
||||
Assert.ok(PlacesControllerDragHelper.canMoveNode(tree.selectedNode, tree),
|
||||
"can move query node");
|
||||
|
||||
// test toolbar shortcut node
|
||||
Assert.equal(rootNode.childCount, folders.length,
|
||||
"populated data to the test root");
|
||||
|
||||
function getRootChildNode(aId) {
|
||||
let node = PlacesUtils.getFolderContents(PlacesUtils.placesRootId, false, true).root;
|
||||
for (let i = 0; i < node.childCount; i++) {
|
||||
let child = node.getChild(i);
|
||||
if (child.itemId == aId) {
|
||||
node.containerOpen = false;
|
||||
return child;
|
||||
}
|
||||
info("Test a tag container");
|
||||
PlacesUtils.tagging.tagURI(Services.io.newURI(bookmark.url.href), ["bar"]);
|
||||
// Add the tags root query.
|
||||
let tagsQuery = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: root.guid,
|
||||
title: "",
|
||||
url: "place:type=" + Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_QUERY,
|
||||
});
|
||||
let tagsQueryId = await PlacesUtils.promiseItemId(tagsQuery.guid);
|
||||
tree.selectItems([tagsQueryId]);
|
||||
PlacesUtils.asQuery(tree.selectedNode).containerOpen = true;
|
||||
Assert.equal(tree.selectedNode.childCount, 1, "has tags");
|
||||
let tagNode = tree.selectedNode.getChild(0);
|
||||
Assert.ok(!PlacesControllerDragHelper.canMoveNode(tagNode, tree),
|
||||
"should not be able to move tag container node");
|
||||
tree.selectedNode.containerOpen = false;
|
||||
|
||||
info("Test that special folders and cannot be moved but other shortcuts can.");
|
||||
let roots = [
|
||||
PlacesUtils.bookmarksMenuFolderId,
|
||||
PlacesUtils.unfiledBookmarksFolderId,
|
||||
PlacesUtils.toolbarFolderId,
|
||||
];
|
||||
|
||||
for (let id of roots) {
|
||||
selectShortcutForRootId(tree, id);
|
||||
Assert.ok(!PlacesControllerDragHelper.canMoveNode(tree.selectedNode, tree),
|
||||
"shouldn't be able to move default shortcuts to roots");
|
||||
let s = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: root.guid,
|
||||
title: "bar",
|
||||
url: `place:folder=${id}`,
|
||||
});
|
||||
let sid = await PlacesUtils.promiseItemId(s.guid);
|
||||
tree.selectItems([sid]);
|
||||
Assert.equal(tree.selectedNode.bookmarkGuid, s.guid,
|
||||
"Selected the expected node");
|
||||
Assert.ok(PlacesControllerDragHelper.canMoveNode(tree.selectedNode, tree),
|
||||
"should be able to move user-created shortcuts to roots");
|
||||
}
|
||||
node.containerOpen = false;
|
||||
ok(false, "Unable to find child node");
|
||||
return null;
|
||||
}
|
||||
|
||||
for (let i = 0; i < folders.length; i++) {
|
||||
let id = folders[i];
|
||||
|
||||
let node = getRootChildNode(id);
|
||||
isnot(node, null, "Node found");
|
||||
Assert.equal(PlacesControllerDragHelper.canMoveNode(node),
|
||||
false, "shouldn't be able to move special folder node");
|
||||
|
||||
let shortcut = shortcuts[i];
|
||||
let shortcutNode = rootNode.getChild(i);
|
||||
|
||||
Assert.equal(shortcutNode.bookmarkGuid, shortcut.guid,
|
||||
"shortcut guid and shortcut node item guid match");
|
||||
|
||||
Assert.equal(PlacesControllerDragHelper.canMoveNode(shortcutNode),
|
||||
true, "should be able to move special folder shortcut node");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_tag_container() {
|
||||
// tag a uri
|
||||
this.uri = makeURI("http://foo.com");
|
||||
PlacesUtils.tagging.tagURI(this.uri, ["bar"]);
|
||||
registerCleanupFunction(() => PlacesUtils.tagging.untagURI(this.uri, ["bar"]));
|
||||
|
||||
// get tag root
|
||||
let query = PlacesUtils.history.getNewQuery();
|
||||
let options = PlacesUtils.history.getNewQueryOptions();
|
||||
options.resultType = Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_QUERY;
|
||||
let tagsNode = PlacesUtils.history.executeQuery(query, options).root;
|
||||
|
||||
tagsNode.containerOpen = true;
|
||||
Assert.equal(tagsNode.childCount, 1, "has new tag");
|
||||
|
||||
let tagNode = tagsNode.getChild(0);
|
||||
|
||||
Assert.equal(PlacesControllerDragHelper.canMoveNode(tagNode),
|
||||
false, "should not be able to move tag container node");
|
||||
tagsNode.containerOpen = false;
|
||||
});
|
||||
function selectShortcutForRootId(tree, id) {
|
||||
for (let i = 0; i < tree.result.root.childCount; ++i) {
|
||||
let child = tree.result.root.getChild(i);
|
||||
if (PlacesUtils.getConcreteItemId(child) == id) {
|
||||
tree.selectItems([child.itemId]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Assert.ok(false, "Cannot find shortcut to root");
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ function test() {
|
|||
PlacesUtils.bookmarks.setItemTitle(query.concreteId, "badName");
|
||||
}
|
||||
|
||||
PlacesUIUtils.__defineGetter__("leftPaneFolderId", cachedLeftPaneFolderIdGetter);
|
||||
restoreLeftPaneGetters();
|
||||
|
||||
// Open Library, this will kick-off left pane code.
|
||||
openLibrary(onLibraryReady);
|
||||
|
|
|
@ -5,20 +5,27 @@ XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
|
|||
XPCOMUtils.defineLazyModuleGetter(this, "TestUtils",
|
||||
"resource://testing-common/TestUtils.jsm");
|
||||
|
||||
// We need to cache this before test runs...
|
||||
var cachedLeftPaneFolderIdGetter;
|
||||
var getter = PlacesUIUtils.__lookupGetter__("leftPaneFolderId");
|
||||
if (!cachedLeftPaneFolderIdGetter && typeof(getter) == "function") {
|
||||
cachedLeftPaneFolderIdGetter = getter;
|
||||
// We need to cache these before test runs...
|
||||
let leftPaneGetters = new Map([["leftPaneFolderId", null],
|
||||
["allBookmarksFolderId", null]]);
|
||||
for (let [key, val] of leftPaneGetters) {
|
||||
if (!val) {
|
||||
let getter = Object.getOwnPropertyDescriptor(PlacesUIUtils, key).get;
|
||||
if (typeof getter == "function") {
|
||||
leftPaneGetters.set(key, getter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ...And restore it when test ends.
|
||||
registerCleanupFunction(function() {
|
||||
let updatedGetter = PlacesUIUtils.__lookupGetter__("leftPaneFolderId");
|
||||
if (cachedLeftPaneFolderIdGetter && typeof(updatedGetter) != "function") {
|
||||
PlacesUIUtils.__defineGetter__("leftPaneFolderId", cachedLeftPaneFolderIdGetter);
|
||||
// ...And restore them when test ends.
|
||||
function restoreLeftPaneGetters() {
|
||||
for (let [key, getter] of leftPaneGetters) {
|
||||
Object.defineProperty(PlacesUIUtils, key, {
|
||||
enumerable: true, configurable: true, get: getter
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
registerCleanupFunction(restoreLeftPaneGetters);
|
||||
|
||||
function openLibrary(callback, aLeftPaneRoot) {
|
||||
let library = window.openDialog("chrome://browser/content/places/places.xul",
|
||||
|
|
|
@ -44,19 +44,29 @@
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function runTest() {
|
||||
// We need to cache and restore this getter in order to simulate
|
||||
// Bug 510634
|
||||
let cachedLeftPaneFolderIdGetter =
|
||||
PlacesUIUtils.__lookupGetter__("leftPaneFolderId");
|
||||
// Must also cache and restore this getter as it is affected by
|
||||
// leftPaneFolderId, from bug 564900.
|
||||
let cachedAllBookmarksFolderIdGetter =
|
||||
PlacesUIUtils.__lookupGetter__("allBookmarksFolderId");
|
||||
// We need to cache and restore the getters in order to simulate
|
||||
// Bug 510634.
|
||||
let leftPaneGetters = new Map([["leftPaneFolderId", null],
|
||||
["allBookmarksFolderId", null]]);
|
||||
for (let [key, val] of leftPaneGetters) {
|
||||
if (!val) {
|
||||
let getter = Object.getOwnPropertyDescriptor(PlacesUIUtils, key).get;
|
||||
if (typeof getter == "function") {
|
||||
leftPaneGetters.set(key, getter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function restoreLeftPaneGetters() {
|
||||
for (let [key, getter] of leftPaneGetters) {
|
||||
Object.defineProperty(PlacesUIUtils, key, {
|
||||
enumerable: true, configurable: true, get: getter
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
let leftPaneFolderId = PlacesUIUtils.leftPaneFolderId;
|
||||
|
||||
// restore the getter
|
||||
PlacesUIUtils.__defineGetter__("leftPaneFolderId", cachedLeftPaneFolderIdGetter);
|
||||
restoreLeftPaneGetters();
|
||||
|
||||
// Setup the places tree contents.
|
||||
let tree = document.getElementById("tree");
|
||||
|
@ -87,9 +97,7 @@
|
|||
tree.result.root.containerOpen = false;
|
||||
|
||||
// Restore the getters for the next test.
|
||||
PlacesUIUtils.__defineGetter__("leftPaneFolderId", cachedLeftPaneFolderIdGetter);
|
||||
PlacesUIUtils.__defineGetter__("allBookmarksFolderId",
|
||||
cachedAllBookmarksFolderIdGetter);
|
||||
restoreLeftPaneGetters();
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
let {IsLivemark} = Cu.import("resource:///modules/PlacesUIUtils.jsm", {});
|
||||
|
||||
add_task(function test_livemark_cache_builtin_folder() {
|
||||
// This test checks a basic livemark, and also initializes the observer for
|
||||
// updates to the bookmarks.
|
||||
Assert.ok(!IsLivemark(PlacesUtils.unfiledBookmarksFolderId),
|
||||
"unfiled bookmarks should not be seen as a livemark");
|
||||
});
|
||||
|
||||
add_task(async function test_livemark_add_and_remove_items() {
|
||||
let bookmark = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
|
||||
title: "Grandsire",
|
||||
url: "http://example.com",
|
||||
});
|
||||
|
||||
let bookmarkId = await PlacesUtils.promiseItemId(bookmark.guid);
|
||||
|
||||
Assert.ok(!IsLivemark(bookmarkId),
|
||||
"a simple bookmark should not be seen as a livemark");
|
||||
|
||||
let livemark = await PlacesUtils.livemarks.addLivemark({
|
||||
title: "Stedman",
|
||||
feedURI: Services.io.newURI("http://livemark.com/"),
|
||||
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
|
||||
});
|
||||
|
||||
let livemarkId = await PlacesUtils.promiseItemId(livemark.guid);
|
||||
|
||||
Assert.ok(IsLivemark(livemarkId),
|
||||
"a livemark should be reported as a livemark");
|
||||
|
||||
// Now remove the livemark.
|
||||
await PlacesUtils.livemarks.removeLivemark(livemark);
|
||||
|
||||
Assert.ok(!IsLivemark(livemarkId),
|
||||
"the livemark should have been removed from the cache");
|
||||
});
|
|
@ -22,5 +22,4 @@ support-files =
|
|||
[test_clearHistory_shutdown.js]
|
||||
[test_leftpane_corruption_handling.js]
|
||||
[test_PUIU_batchUpdatesForNode.js]
|
||||
[test_PUIU_livemarksCache.js]
|
||||
[test_PUIU_makeTransaction.js]
|
||||
|
|
|
@ -14,11 +14,14 @@ support-files =
|
|||
[browser_performanceAPI.js]
|
||||
[browser_roundedWindow_dialogWindow.js]
|
||||
[browser_roundedWindow_newWindow.js]
|
||||
[browser_roundedWindow_open_max.js]
|
||||
[browser_roundedWindow_open_max_inner.js]
|
||||
[browser_roundedWindow_open_max_outer.js]
|
||||
[browser_roundedWindow_open_mid.js]
|
||||
[browser_roundedWindow_open_min.js]
|
||||
[browser_roundedWindow_windowSetting_max.js]
|
||||
[browser_roundedWindow_windowSetting_max_inner.js]
|
||||
[browser_roundedWindow_windowSetting_max_outer.js]
|
||||
[browser_roundedWindow_windowSetting_mid.js]
|
||||
[browser_roundedWindow_windowSetting_min.js]
|
||||
[browser_roundedWindow_windowSetting_min_inner.js]
|
||||
[browser_roundedWindow_windowSetting_min_outer.js]
|
||||
[browser_timezone.js]
|
||||
[browser_bug1369357_site_specific_zoom_level.js]
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* Bug 1330882 - A test case for opening new windows through window.open() as
|
||||
* rounded size when fingerprinting resistance is enabled. This test is for
|
||||
* maximum values.
|
||||
*/
|
||||
|
||||
OpenTest.run([
|
||||
{settingWidth: 1025, settingHeight: 1050, targetWidth: 1000, targetHeight: 1000},
|
||||
{settingWidth: 9999, settingHeight: 9999, targetWidth: 1000, targetHeight: 1000},
|
||||
{settingWidth: 999, settingHeight: 999, targetWidth: 1000, targetHeight: 1000}
|
||||
], false);
|
|
@ -8,4 +8,4 @@ OpenTest.run([
|
|||
{settingWidth: 1025, settingHeight: 1050, targetWidth: 1000, targetHeight: 1000},
|
||||
{settingWidth: 9999, settingHeight: 9999, targetWidth: 1000, targetHeight: 1000},
|
||||
{settingWidth: 999, settingHeight: 999, targetWidth: 1000, targetHeight: 1000}
|
||||
]);
|
||||
], true);
|
|
@ -1,11 +1,10 @@
|
|||
/*
|
||||
* Bug 1330882 - A test case for setting window size through window.innerWidth/Height
|
||||
* and window.outerWidth/Height when fingerprinting resistance is enabled. This
|
||||
* test is for maximum values.
|
||||
* when fingerprinting resistance is enabled. This test is for maximum values.
|
||||
*/
|
||||
|
||||
WindowSettingTest.run([
|
||||
{settingWidth: 1025, settingHeight: 1050, targetWidth: 1000, targetHeight: 1000, initWidth: 200, initHeight: 100},
|
||||
{settingWidth: 9999, settingHeight: 9999, targetWidth: 1000, targetHeight: 1000, initWidth: 200, initHeight: 100},
|
||||
{settingWidth: 999, settingHeight: 999, targetWidth: 1000, targetHeight: 1000, initWidth: 200, initHeight: 100}
|
||||
]);
|
||||
], false);
|
|
@ -0,0 +1,10 @@
|
|||
/*
|
||||
* Bug 1330882 - A test case for setting window size through window.outerWidth/Height
|
||||
* when fingerprinting resistance is enabled. This test is for maximum values.
|
||||
*/
|
||||
|
||||
WindowSettingTest.run([
|
||||
{settingWidth: 1025, settingHeight: 1050, targetWidth: 1000, targetHeight: 1000, initWidth: 200, initHeight: 100},
|
||||
{settingWidth: 9999, settingHeight: 9999, targetWidth: 1000, targetHeight: 1000, initWidth: 200, initHeight: 100},
|
||||
{settingWidth: 999, settingHeight: 999, targetWidth: 1000, targetHeight: 1000, initWidth: 200, initHeight: 100}
|
||||
], true);
|
|
@ -1,10 +1,9 @@
|
|||
/*
|
||||
* Bug 1330882 - A test case for setting window size through window.innerWidth/Height
|
||||
* and window.outerWidth/Height when fingerprinting resistance is enabled. This
|
||||
* test is for minimum values.
|
||||
* when fingerprinting resistance is enabled. This test is for minimum values.
|
||||
*/
|
||||
|
||||
WindowSettingTest.run([
|
||||
{settingWidth: 199, settingHeight: 99, targetWidth: 200, targetHeight: 100, initWidth: 1000, initHeight: 1000},
|
||||
{settingWidth: 10, settingHeight: 10, targetWidth: 200, targetHeight: 100, initWidth: 1000, initHeight: 1000}
|
||||
]);
|
||||
], false);
|
|
@ -0,0 +1,9 @@
|
|||
/*
|
||||
* Bug 1330882 - A test case for setting window size through window.outerWidth/Height
|
||||
* when fingerprinting resistance is enabled. This test is for minimum values.
|
||||
*/
|
||||
|
||||
WindowSettingTest.run([
|
||||
{settingWidth: 199, settingHeight: 99, targetWidth: 200, targetHeight: 100, initWidth: 1000, initHeight: 1000},
|
||||
{settingWidth: 10, settingHeight: 10, targetWidth: 200, targetHeight: 100, initWidth: 1000, initHeight: 1000}
|
||||
], true);
|
|
@ -58,6 +58,9 @@ const PREF_MAX_UPGRADE_BACKUPS = "browser.sessionstore.upgradeBackup.maxUpgradeB
|
|||
const PREF_MAX_SERIALIZE_BACK = "browser.sessionstore.max_serialize_back";
|
||||
const PREF_MAX_SERIALIZE_FWD = "browser.sessionstore.max_serialize_forward";
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(this, "kMaxWriteFailures",
|
||||
"browser.sessionstore.max_write_failures", 5);
|
||||
|
||||
this.SessionFile = {
|
||||
/**
|
||||
* Read the contents of the session file, asynchronously.
|
||||
|
@ -84,6 +87,10 @@ this.SessionFile = {
|
|||
*/
|
||||
get Paths() {
|
||||
return SessionFileInternal.Paths;
|
||||
},
|
||||
|
||||
get MaxWriteFailures() {
|
||||
return kMaxWriteFailures;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -187,6 +194,12 @@ var SessionFileInternal = {
|
|||
// Used for error reporting.
|
||||
_failures: 0,
|
||||
|
||||
// Object that keeps statistics that should help us make informed decisions
|
||||
// about the current status of the worker.
|
||||
_workerHealth: {
|
||||
failures: 0
|
||||
},
|
||||
|
||||
// Resolved once initialization is complete.
|
||||
// The promise never rejects.
|
||||
_deferredInitialized: PromiseUtils.defer(),
|
||||
|
@ -231,7 +244,8 @@ var SessionFileInternal = {
|
|||
|
||||
if (!SessionStore.isFormatVersionCompatible(parsed.version || ["sessionrestore", 0] /* fallback for old versions*/)) {
|
||||
// Skip sessionstore files that we don't understand.
|
||||
Cu.reportError("Cannot extract data from Session Restore file " + path + ". Wrong format/version: " + JSON.stringify(parsed.version) + ".");
|
||||
Cu.reportError("Cannot extract data from Session Restore file " + path +
|
||||
". Wrong format/version: " + JSON.stringify(parsed.version) + ".");
|
||||
continue;
|
||||
}
|
||||
result = {
|
||||
|
@ -332,6 +346,20 @@ var SessionFileInternal = {
|
|||
return SessionWorker.post(...args);
|
||||
},
|
||||
|
||||
/**
|
||||
* For good measure, terminate the worker when we've had over `kMaxWriteFailures`
|
||||
* amount of failures to deal with. This will spawn a fresh worker upon the next
|
||||
* write.
|
||||
* This also resets the `_workerHealth` stats.
|
||||
*/
|
||||
_checkWorkerHealth() {
|
||||
if (this._workerHealth.failures >= kMaxWriteFailures) {
|
||||
SessionWorker.terminate();
|
||||
this._workerHealth.failures = 0;
|
||||
Telemetry.scalarAdd("browser.session.restore.worker_restart_count", 1);
|
||||
}
|
||||
},
|
||||
|
||||
write(aData) {
|
||||
if (RunState.isClosed) {
|
||||
return Promise.reject(new Error("SessionFile is closed"));
|
||||
|
@ -367,6 +395,7 @@ var SessionFileInternal = {
|
|||
// Catch and report any errors.
|
||||
console.error("Could not write session state file ", err, err.stack);
|
||||
this._failures++;
|
||||
this._workerHealth.failures++;
|
||||
// By not doing anything special here we ensure that |promise| cannot
|
||||
// be rejected anymore. The shutdown/cleanup code at the end of the
|
||||
// function will thus always be executed.
|
||||
|
@ -395,6 +424,8 @@ var SessionFileInternal = {
|
|||
|
||||
if (isFinalWrite) {
|
||||
Services.obs.notifyObservers(null, "sessionstore-final-state-write-complete");
|
||||
} else {
|
||||
this._checkWorkerHealth();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* The primary purpose of this test is to ensure that the sessionstore component
|
||||
* records information about erroneous workers into a scalar.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
const Telemetry = Services.telemetry;
|
||||
const ScalarId = "browser.session.restore.worker_restart_count";
|
||||
|
||||
// Prepare the session file.
|
||||
var profd = do_get_profile();
|
||||
Cu.import("resource:///modules/sessionstore/SessionFile.jsm", this);
|
||||
|
||||
/**
|
||||
* In order to use browser.session.restore.worker_restart_count scalar, it has
|
||||
* to be registered in "toolkit/components/telemetry/Scalars.yaml".
|
||||
* This test ensures that the scalar is registered and empty.
|
||||
*/
|
||||
add_task(async function test_ensure_scalar_is_empty() {
|
||||
const scalars = Telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTOUT, false).parent || {};
|
||||
Assert.ok(!(ScalarId in scalars), "Sanity check; no scalars should be there yet.");
|
||||
});
|
||||
|
||||
/**
|
||||
* Makes sure that the scalar is positively updated when amount of failures
|
||||
* becomes higher than the threshold.
|
||||
*/
|
||||
add_task(async function test_worker_restart() {
|
||||
let backstagePass = Cu.import("resource:///modules/sessionstore/SessionFile.jsm", {});
|
||||
backstagePass.SessionFileInternal._workerHealth.failures = backstagePass.kMaxWriteFailures + 1;
|
||||
backstagePass.SessionFileInternal._checkWorkerHealth();
|
||||
|
||||
Assert.equal(backstagePass.SessionFileInternal._workerHealth.failures, 0,
|
||||
"Worker failure count should've been reset.");
|
||||
|
||||
// Checking if the scalar is positively updated.
|
||||
const scalars = Telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTOUT, false).parent;
|
||||
Assert.equal(scalars[ScalarId], 1, "Should be increased with one hit.");
|
||||
});
|
|
@ -9,8 +9,9 @@ support-files =
|
|||
|
||||
[test_backup_once.js]
|
||||
[test_histogram_corrupt_files.js]
|
||||
[test_migration_lz4compression.js]
|
||||
[test_scalar_worker_restarts.js]
|
||||
[test_shutdown_cleanup.js]
|
||||
[test_startup_nosession_async.js]
|
||||
[test_startup_session_async.js]
|
||||
[test_startup_invalid_session.js]
|
||||
[test_migration_lz4compression.js]
|
||||
|
|
|
@ -23,8 +23,9 @@ Cu.import("resource://formautofill/FormAutofillUtils.jsm");
|
|||
this.log = null;
|
||||
FormAutofillUtils.defineLazyLogGetter(this, this.EXPORTED_SYMBOLS[0]);
|
||||
|
||||
const BUNDLE_URI = "chrome://formautofill/locale/formautofill.properties";
|
||||
const GetStringFromName = Services.strings.createBundle(BUNDLE_URI).GetStringFromName;
|
||||
const GetStringFromName = FormAutofillUtils.stringBundle.GetStringFromName;
|
||||
const formatStringFromName = FormAutofillUtils.stringBundle.formatStringFromName;
|
||||
const brandShortName = FormAutofillUtils.brandBundle.GetStringFromName("brandShortName");
|
||||
let changeAutofillOptsKey = "changeAutofillOptions";
|
||||
let autofillOptsKey = "autofillOptionsLink";
|
||||
let autofillSecurityOptionsKey = "autofillSecurityOptionsLink";
|
||||
|
@ -37,7 +38,7 @@ if (AppConstants.platform == "macosx") {
|
|||
const CONTENT = {
|
||||
firstTimeUse: {
|
||||
notificationId: "autofill-address",
|
||||
message: GetStringFromName("saveAddressesMessage"),
|
||||
message: formatStringFromName("saveAddressesMessage", [brandShortName], 1),
|
||||
anchor: {
|
||||
id: "autofill-address-notification-icon",
|
||||
URL: "chrome://formautofill/content/formfill-anchor.svg",
|
||||
|
@ -97,7 +98,7 @@ const CONTENT = {
|
|||
},
|
||||
creditCard: {
|
||||
notificationId: "autofill-credit-card",
|
||||
message: GetStringFromName("saveCreditCardMessage"),
|
||||
message: formatStringFromName("saveCreditCardMessage", [brandShortName], 1),
|
||||
linkMessage: GetStringFromName(autofillSecurityOptionsKey),
|
||||
anchor: {
|
||||
id: "autofill-credit-card-notification-icon",
|
||||
|
|
|
@ -87,9 +87,9 @@ FormAutofillPreferences.prototype = {
|
|||
addressAutofill.id = "addressAutofill";
|
||||
addressAutofillLearnMore.id = "addressAutofillLearnMore";
|
||||
|
||||
addressAutofillLearnMore.setAttribute("value", this.bundle.GetStringFromName("learnMore"));
|
||||
addressAutofillCheckbox.setAttribute("label", this.bundle.GetStringFromName("enableAddressAutofill"));
|
||||
savedAddressesBtn.setAttribute("label", this.bundle.GetStringFromName("savedAddresses"));
|
||||
addressAutofillLearnMore.setAttribute("value", this.bundle.GetStringFromName("learnMoreLabel"));
|
||||
addressAutofillCheckbox.setAttribute("label", this.bundle.GetStringFromName("autofillAddressesCheckbox"));
|
||||
savedAddressesBtn.setAttribute("label", this.bundle.GetStringFromName("savedAddressesBtnLabel"));
|
||||
|
||||
addressAutofillLearnMore.setAttribute("href", learnMoreURL);
|
||||
|
||||
|
@ -130,9 +130,9 @@ FormAutofillPreferences.prototype = {
|
|||
creditCardAutofill.id = "creditCardAutofill";
|
||||
creditCardAutofillLearnMore.id = "creditCardAutofillLearnMore";
|
||||
|
||||
creditCardAutofillLearnMore.setAttribute("value", this.bundle.GetStringFromName("learnMore"));
|
||||
creditCardAutofillCheckbox.setAttribute("label", this.bundle.GetStringFromName("enableCreditCardAutofill"));
|
||||
savedCreditCardsBtn.setAttribute("label", this.bundle.GetStringFromName("savedCreditCards"));
|
||||
creditCardAutofillLearnMore.setAttribute("value", this.bundle.GetStringFromName("learnMoreLabel"));
|
||||
creditCardAutofillCheckbox.setAttribute("label", this.bundle.GetStringFromName("autofillCreditCardsCheckbox"));
|
||||
savedCreditCardsBtn.setAttribute("label", this.bundle.GetStringFromName("savedCreditCardsBtnLabel"));
|
||||
|
||||
creditCardAutofillLearnMore.setAttribute("href", learnMoreURL);
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ const EDIT_ADDRESS_KEYWORDS = [
|
|||
"givenName", "additionalName", "familyName", "organization", "streetAddress",
|
||||
"state", "province", "city", "country", "zip", "postalCode", "email", "tel",
|
||||
];
|
||||
const MANAGE_CREDITCARDS_KEYWORDS = ["manageCreditCardsTitle", "addNewCreditCardTitle", "showCreditCards"];
|
||||
const MANAGE_CREDITCARDS_KEYWORDS = ["manageCreditCardsTitle", "addNewCreditCardTitle", "showCreditCardsBtnLabel"];
|
||||
const EDIT_CREDITCARD_KEYWORDS = ["cardNumber", "nameOnCard", "cardExpires"];
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
@ -536,6 +536,10 @@ XPCOMUtils.defineLazyGetter(FormAutofillUtils, "stringBundle", function() {
|
|||
return Services.strings.createBundle("chrome://formautofill/locale/formautofill.properties");
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(FormAutofillUtils, "brandBundle", function() {
|
||||
return Services.strings.createBundle("chrome://branding/locale/brand.properties");
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(this.FormAutofillUtils,
|
||||
"isAutofillAddressesEnabled", ENABLED_AUTOFILL_ADDRESSES_PREF);
|
||||
XPCOMUtils.defineLazyPreferenceGetter(this.FormAutofillUtils,
|
||||
|
|
|
@ -12,9 +12,6 @@ Cu.import("resource://gre/modules/Services.jsm");
|
|||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://formautofill/FormAutofillUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() {
|
||||
return Services.strings.createBundle("chrome://branding/locale/brand.properties");
|
||||
});
|
||||
XPCOMUtils.defineLazyPreferenceGetter(this, "insecureWarningEnabled", "security.insecure_field_warning.contextual.enabled");
|
||||
|
||||
this.log = null;
|
||||
|
@ -333,7 +330,7 @@ class CreditCardResult extends ProfileAutoCompleteResult {
|
|||
if (!insecureWarningEnabled) {
|
||||
return [];
|
||||
}
|
||||
let brandName = gBrandBundle.GetStringFromName("brandShortName");
|
||||
let brandName = FormAutofillUtils.brandBundle.GetStringFromName("brandShortName");
|
||||
|
||||
return [FormAutofillUtils.stringBundle.formatStringFromName("insecureFieldWarningDescription", [brandName], 1)];
|
||||
}
|
||||
|
|
|
@ -63,8 +63,8 @@
|
|||
</label>
|
||||
</form>
|
||||
<div id="controls-container">
|
||||
<button id="cancel" data-localization="cancel"/>
|
||||
<button id="save" disabled="disabled" data-localization="save"/>
|
||||
<button id="cancel" data-localization="cancelBtnLabel"/>
|
||||
<button id="save" disabled="disabled" data-localization="saveBtnLabel"/>
|
||||
</div>
|
||||
<script type="application/javascript"><![CDATA[
|
||||
"use strict";
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
</div>
|
||||
</form>
|
||||
<div id="controls-container">
|
||||
<button id="cancel" data-localization="cancel"/>
|
||||
<button id="save" disabled="disabled" data-localization="save"/>
|
||||
<button id="cancel" data-localization="cancelBtnLabel"/>
|
||||
<button id="save" disabled="disabled" data-localization="saveBtnLabel"/>
|
||||
</div>
|
||||
<script type="application/javascript"><![CDATA[
|
||||
"use strict";
|
||||
|
|
|
@ -16,12 +16,12 @@
|
|||
<select id="addresses" size="9" multiple="multiple"/>
|
||||
</fieldset>
|
||||
<div id="controls-container">
|
||||
<button id="remove" disabled="disabled" data-localization="remove"/>
|
||||
<button id="remove" disabled="disabled" data-localization="removeBtnLabel"/>
|
||||
<!-- Wrapper is used to properly compute the search tooltip position -->
|
||||
<div>
|
||||
<button id="add" data-localization="add"/>
|
||||
<button id="add" data-localization="addBtnLabel"/>
|
||||
</div>
|
||||
<button id="edit" disabled="disabled" data-localization="edit"/>
|
||||
<button id="edit" disabled="disabled" data-localization="editBtnLabel"/>
|
||||
</div>
|
||||
<script type="application/javascript">
|
||||
"use strict";
|
||||
|
|
|
@ -16,13 +16,13 @@
|
|||
<select id="credit-cards" size="9" multiple="multiple"/>
|
||||
</fieldset>
|
||||
<div id="controls-container">
|
||||
<button id="remove" disabled="disabled" data-localization="remove"/>
|
||||
<button id="show-hide-credit-cards" data-localization="showCreditCards"/>
|
||||
<button id="remove" disabled="disabled" data-localization="removeBtnLabel"/>
|
||||
<button id="show-hide-credit-cards" data-localization="showCreditCardsBtnLabel"/>
|
||||
<!-- Wrapper is used to properly compute the search tooltip position -->
|
||||
<div>
|
||||
<button id="add" data-localization="add"/>
|
||||
<button id="add" data-localization="addBtnLabel"/>
|
||||
</div>
|
||||
<button id="edit" disabled="disabled" data-localization="edit"/>
|
||||
<button id="edit" disabled="disabled" data-localization="editBtnLabel"/>
|
||||
</div>
|
||||
<script type="application/javascript">
|
||||
"use strict";
|
||||
|
|
|
@ -412,8 +412,8 @@ class ManageCreditCards extends ManageRecords {
|
|||
this._elements.showHideCreditCards.setAttribute("disabled", true);
|
||||
}
|
||||
this._elements.showHideCreditCards.textContent =
|
||||
this._isDecrypted ? FormAutofillUtils.stringBundle.GetStringFromName("hideCreditCards") :
|
||||
FormAutofillUtils.stringBundle.GetStringFromName("showCreditCards");
|
||||
this._isDecrypted ? FormAutofillUtils.stringBundle.GetStringFromName("hideCreditCardsBtnLabel") :
|
||||
FormAutofillUtils.stringBundle.GetStringFromName("showCreditCardsBtnLabel");
|
||||
}
|
||||
|
||||
handleClick(event) {
|
||||
|
|
|
@ -2,32 +2,50 @@
|
|||
# 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/.
|
||||
|
||||
preferenceGroupTitle = Form Autofill
|
||||
enableAddressAutofill = Autofill addresses
|
||||
learnMore = Learn more
|
||||
savedAddresses = Saved Addresses…
|
||||
enableCreditCardAutofill = Autofill credit cards
|
||||
savedCreditCards = Saved Credit Cards…
|
||||
saveAddressesMessage = Firefox now saves addresses so you can fill out forms faster.
|
||||
# LOCALIZATION NOTE (saveAddressesMessage): %S is brandShortName. This string is used on the doorhanger to
|
||||
# notify users that addresses are saved.
|
||||
saveAddressesMessage = %S now saves addresses so you can fill out forms faster.
|
||||
# LOCALIZATION NOTE (autofillOptionsLink, autofillOptionsLinkOSX): These strings are used in the doorhanger for
|
||||
# updating addresses. The link leads users to Form Autofill browser preferences.
|
||||
autofillOptionsLink = Form Autofill Options
|
||||
autofillSecurityOptionsLink = Form Autofill & Security Options
|
||||
changeAutofillOptions = Change Form Autofill Options
|
||||
autofillOptionsLinkOSX = Form Autofill Preferences
|
||||
# LOCALIZATION NOTE (autofillSecurityOptionsLink, autofillSecurityOptionsLinkOSX): These strings are used
|
||||
# in the doorhanger for saving credit card info. The link leads users to Form Autofill browser preferences.
|
||||
autofillSecurityOptionsLink = Form Autofill & Security Options
|
||||
autofillSecurityOptionsLinkOSX = Form Autofill & Security Preferences
|
||||
# LOCALIZATION NOTE (changeAutofillOptions, changeAutofillOptionsOSX): These strings are used on the doorhanger
|
||||
# that notifies users that addresses are saved. The button leads users to Form Autofill browser preferences.
|
||||
changeAutofillOptions = Change Form Autofill Options
|
||||
changeAutofillOptionsOSX = Change Form Autofill Preferences
|
||||
# LOCALIZATION NOTE (addressesSyncCheckbox): If Sync is enabled, this checkbox is displayed on the doorhanger
|
||||
# shown when saving addresses.
|
||||
addressesSyncCheckbox = Share addresses with synced devices
|
||||
# LOCALIZATION NOTE (updateAddressMessage, createAddressLabel, updateAddressLabel): Used on the doorhanger
|
||||
# when an address change is detected.
|
||||
updateAddressMessage = Would you like to update your address with this new information?
|
||||
createAddressLabel = Create New Address
|
||||
updateAddressLabel = Update Address
|
||||
saveCreditCardMessage = Would you like Firefox to save this credit card? (Security code will not be saved)
|
||||
# LOCALIZATION NOTE (saveCreditCardMessage, saveCreditCardLabel, cancelCreditCardLabel, neverSaveCreditCardLabel):
|
||||
# Used on the doorhanger when users submit payment with credit card.
|
||||
# LOCALIZATION NOTE (saveCreditCardMessage): %S is brandShortName.
|
||||
saveCreditCardMessage = Would you like %S to save this credit card? (Security code will not be saved)
|
||||
saveCreditCardLabel = Save Credit Card
|
||||
cancelCreditCardLabel = Don’t Save
|
||||
neverSaveCreditCardLabel = Never Save Credit Cards
|
||||
# LOCALIZATION NOTE (openAutofillMessagePanel): Tooltip label for Form Autofill doorhanger icon on address bar.
|
||||
openAutofillMessagePanel = Open Form Autofill message panel
|
||||
|
||||
# LOCALIZATION NOTE (autocompleteFooterOption, autocompleteFooterOptionOSX): Used as a label for the button,
|
||||
# displayed at the bottom of the drop down suggestion, to open Form Autofill browser preferences.
|
||||
autocompleteFooterOption = Form Autofill Options
|
||||
autocompleteFooterOptionShort = More Options
|
||||
autocompleteFooterOptionOSX = Form Autofill Preferences
|
||||
# LOCALIZATION NOTE (autocompleteFooterOptionShort, autocompleteFooterOptionOSXShort): Used as a label for the button,
|
||||
# displayed at the bottom of the drop down suggestion, to open Form Autofill browser preferences. This version is used
|
||||
# instead of autocompleteFooterOption* when the menu width is below 185px.
|
||||
autocompleteFooterOptionShort = More Options
|
||||
autocompleteFooterOptionOSXShort = Preferences
|
||||
# LOCALIZATION NOTE (category.address, category.name, category.organization, category.tel, category.email):
|
||||
# Used in autofill drop down suggestion to indicate what other categories Form Autofill will attempt to fill.
|
||||
category.address = address
|
||||
category.name = name
|
||||
category.organization = company
|
||||
|
@ -38,20 +56,42 @@ fieldNameSeparator = ,\u0020
|
|||
# LOCALIZATION NOTE (phishingWarningMessage, phishingWarningMessage2): The warning
|
||||
# text that is displayed for informing users what categories are about to be filled.
|
||||
# "%S" will be replaced with a list generated from the pre-defined categories.
|
||||
# The text would be e.g. Also fill company, phone, email
|
||||
# The text would be e.g. Also autofills company, phone, email.
|
||||
phishingWarningMessage = Also autofills %S
|
||||
phishingWarningMessage2 = Autofills %S
|
||||
# LOCALIZATION NOTE (insecureFieldWarningDescription): %S is brandShortName. This string is used in drop down
|
||||
# suggestion when users try to autofill credit card on an insecure website (without https).
|
||||
insecureFieldWarningDescription = %S has detected an insecure site. Form Autofill is temporarily disabled
|
||||
|
||||
# LOCALIZATION NOTE (autofillAddressesCheckbox): Label for the checkbox that enables autofilling addresses.
|
||||
autofillAddressesCheckbox = Autofill addresses
|
||||
# LOCALIZATION NOTE (learnMoreLabel): Label for the link that leads users to the Form Autofill SUMO page.
|
||||
learnMoreLabel = Learn more
|
||||
# LOCALIZATION NOTE (savedAddressesBtnLabel): Label for the button that opens a dialog that shows the
|
||||
# list of saved addresses.
|
||||
savedAddressesBtnLabel = Saved Addresses…
|
||||
# LOCALIZATION NOTE (autofillCreditCardsCheckbox): Label for the checkbox that enables autofilling credit cards.
|
||||
autofillCreditCardsCheckbox = Autofill credit cards
|
||||
# LOCALIZATION NOTE (savedCreditCardsBtnLabel): Label for the button that opens a dialog that shows the list
|
||||
# of saved credit cards.
|
||||
savedCreditCardsBtnLabel = Saved Credit Cards…
|
||||
|
||||
# LOCALIZATION NOTE (manageAddressesTitle, manageCreditCardsTitle): The dialog title for the list of addresses or
|
||||
# credit cards in browser preferences.
|
||||
manageAddressesTitle = Saved Addresses
|
||||
manageCreditCardsTitle = Saved Credit Cards
|
||||
# LOCALIZATION NOTE (addressesListHeader, creditCardsListHeader): The header for the list of addresses or credit cards
|
||||
# in browser preferences.
|
||||
addressesListHeader = Addresses
|
||||
creditCardsListHeader = Credit Cards
|
||||
showCreditCards = Show Credit Cards
|
||||
hideCreditCards = Hide Credit Cards
|
||||
remove = Remove
|
||||
add = Add…
|
||||
edit = Edit…
|
||||
showCreditCardsBtnLabel = Show Credit Cards
|
||||
hideCreditCardsBtnLabel = Hide Credit Cards
|
||||
removeBtnLabel = Remove
|
||||
addBtnLabel = Add…
|
||||
editBtnLabel = Edit…
|
||||
|
||||
# LOCALIZATION NOTE (addNewAddressTitle, editAddressTitle): The dialog title for creating or editing addresses
|
||||
# in browser preferences.
|
||||
addNewAddressTitle = Add New Address
|
||||
editAddressTitle = Edit Address
|
||||
givenName = First Name
|
||||
|
@ -67,14 +107,14 @@ zip = Zip Code
|
|||
country = Country or Region
|
||||
tel = Phone
|
||||
email = Email
|
||||
cancel = Cancel
|
||||
save = Save
|
||||
countryWarningMessage = Autofill is currently available only for US addresses
|
||||
cancelBtnLabel = Cancel
|
||||
saveBtnLabel = Save
|
||||
countryWarningMessage = Form Autofill is currently available only for US addresses
|
||||
|
||||
# LOCALIZATION NOTE (addNewCreditCardTitle, editCreditCardTitle): The dialog title for creating or editing
|
||||
# credit cards in browser preferences.
|
||||
addNewCreditCardTitle = Add New Credit Card
|
||||
editCreditCardTitle = Edit Credit Card
|
||||
cardNumber = Card Number
|
||||
nameOnCard = Name on Card
|
||||
cardExpires = Expires
|
||||
|
||||
insecureFieldWarningDescription = %S has detected an insecure site. Credit card autofill is temporarily disabled
|
||||
|
|
|
@ -18,6 +18,17 @@
|
|||
#main-window[tabsintitlebar] #titlebar:-moz-lwtheme {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
/* Prevent accent color overriding the window background for
|
||||
* light and dark theme on Aero Basic. This is copied from browser-aero.css. */
|
||||
@media (-moz-windows-default-theme) {
|
||||
#main-window {
|
||||
background-color: rgb(185,209,234) !important;
|
||||
}
|
||||
#main-window:-moz-window-inactive {
|
||||
background-color: rgb(215,228,242) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#toolbar-menubar {
|
||||
|
|
|
@ -17,6 +17,31 @@ const TreeViewClass = require("devtools/client/shared/components/tree/TreeView")
|
|||
const PropertiesView = createFactory(require("./properties-view"));
|
||||
|
||||
const { div, input, span } = DOM;
|
||||
const NOT_AVAILABLE = L10N.getStr("netmonitor.security.notAvailable");
|
||||
const ERROR_LABEL = L10N.getStr("netmonitor.security.error");
|
||||
const CIPHER_SUITE_LABEL = L10N.getStr("netmonitor.security.cipherSuite");
|
||||
const WARNING_CIPHER_LABEL = L10N.getStr("netmonitor.security.warning.cipher");
|
||||
const ENABLED_LABEL = L10N.getStr("netmonitor.security.enabled");
|
||||
const DISABLED_LABEL = L10N.getStr("netmonitor.security.disabled");
|
||||
const CONNECTION_LABEL = L10N.getStr("netmonitor.security.connection");
|
||||
const PROTOCOL_VERSION_LABEL = L10N.getStr("netmonitor.security.protocolVersion");
|
||||
const KEA_GROUP_LABEL = L10N.getStr("netmonitor.security.keaGroup");
|
||||
const SIGNATURE_SCHEME_LABEL = L10N.getStr("netmonitor.security.signatureScheme");
|
||||
const HSTS_LABEL = L10N.getStr("netmonitor.security.hsts");
|
||||
const HPKP_LABEL = L10N.getStr("netmonitor.security.hpkp");
|
||||
const CERTIFICATE_LABEL = L10N.getStr("netmonitor.security.certificate");
|
||||
const SUBJECT_INFO_LABEL = L10N.getStr("certmgr.subjectinfo.label");
|
||||
const CERT_DETAIL_COMMON_NAME_LABEL = L10N.getStr("certmgr.certdetail.cn");
|
||||
const CERT_DETAIL_ORG_LABEL = L10N.getStr("certmgr.certdetail.o");
|
||||
const CERT_DETAIL_ORG_UNIT_LABEL = L10N.getStr("certmgr.certdetail.ou");
|
||||
const ISSUER_INFO_LABEL = L10N.getStr("certmgr.issuerinfo.label");
|
||||
const PERIOD_OF_VALIDITY_LABEL = L10N.getStr("certmgr.periodofvalidity.label");
|
||||
const BEGINS_LABEL = L10N.getStr("certmgr.begins");
|
||||
const EXPIRES_LABEL = L10N.getStr("certmgr.expires");
|
||||
const FINGERPRINTS_LABEL = L10N.getStr("certmgr.fingerprints.label");
|
||||
const SHA256_FINGERPRINT_LABEL =
|
||||
L10N.getStr("certmgr.certdetail.sha256fingerprint");
|
||||
const SHA1_FINGERPRINT_LABEL = L10N.getStr("certmgr.certdetail.sha1fingerprint");
|
||||
|
||||
/*
|
||||
* Security panel component
|
||||
|
@ -34,67 +59,66 @@ function SecurityPanel({
|
|||
return null;
|
||||
}
|
||||
|
||||
const notAvailable = L10N.getStr("netmonitor.security.notAvailable");
|
||||
let object;
|
||||
|
||||
if (securityInfo.state === "secure" || securityInfo.state === "weak") {
|
||||
const { subject, issuer, validity, fingerprint } = securityInfo.cert;
|
||||
const enabledLabel = L10N.getStr("netmonitor.security.enabled");
|
||||
const disabledLabel = L10N.getStr("netmonitor.security.disabled");
|
||||
const HOST_HEADER_LABEL = L10N.getFormatStr("netmonitor.security.hostHeader",
|
||||
getUrlHost(url));
|
||||
|
||||
object = {
|
||||
[L10N.getStr("netmonitor.security.connection")]: {
|
||||
[L10N.getStr("netmonitor.security.protocolVersion")]:
|
||||
securityInfo.protocolVersion || notAvailable,
|
||||
[L10N.getStr("netmonitor.security.cipherSuite")]:
|
||||
securityInfo.cipherSuite || notAvailable,
|
||||
[L10N.getStr("netmonitor.security.keaGroup")]:
|
||||
securityInfo.keaGroupName || notAvailable,
|
||||
[L10N.getStr("netmonitor.security.signatureScheme")]:
|
||||
securityInfo.signatureSchemeName || notAvailable,
|
||||
[CONNECTION_LABEL]: {
|
||||
[PROTOCOL_VERSION_LABEL]:
|
||||
securityInfo.protocolVersion || NOT_AVAILABLE,
|
||||
[CIPHER_SUITE_LABEL]:
|
||||
securityInfo.cipherSuite || NOT_AVAILABLE,
|
||||
[KEA_GROUP_LABEL]:
|
||||
securityInfo.keaGroupName || NOT_AVAILABLE,
|
||||
[SIGNATURE_SCHEME_LABEL]:
|
||||
securityInfo.signatureSchemeName || NOT_AVAILABLE,
|
||||
},
|
||||
[L10N.getFormatStr("netmonitor.security.hostHeader", getUrlHost(url))]: {
|
||||
[L10N.getStr("netmonitor.security.hsts")]:
|
||||
securityInfo.hsts ? enabledLabel : disabledLabel,
|
||||
[L10N.getStr("netmonitor.security.hpkp")]:
|
||||
securityInfo.hpkp ? enabledLabel : disabledLabel,
|
||||
[HOST_HEADER_LABEL]: {
|
||||
[HSTS_LABEL]:
|
||||
securityInfo.hsts ? ENABLED_LABEL : DISABLED_LABEL,
|
||||
[HPKP_LABEL]:
|
||||
securityInfo.hpkp ? ENABLED_LABEL : DISABLED_LABEL,
|
||||
},
|
||||
[L10N.getStr("netmonitor.security.certificate")]: {
|
||||
[L10N.getStr("certmgr.subjectinfo.label")]: {
|
||||
[L10N.getStr("certmgr.certdetail.cn")]:
|
||||
subject.commonName || notAvailable,
|
||||
[L10N.getStr("certmgr.certdetail.o")]:
|
||||
subject.organization || notAvailable,
|
||||
[L10N.getStr("certmgr.certdetail.ou")]:
|
||||
subject.organizationUnit || notAvailable,
|
||||
[CERTIFICATE_LABEL]: {
|
||||
[SUBJECT_INFO_LABEL]: {
|
||||
[CERT_DETAIL_COMMON_NAME_LABEL]:
|
||||
subject.commonName || NOT_AVAILABLE,
|
||||
[CERT_DETAIL_ORG_LABEL]:
|
||||
subject.organization || NOT_AVAILABLE,
|
||||
[CERT_DETAIL_ORG_UNIT_LABEL]:
|
||||
subject.organizationUnit || NOT_AVAILABLE,
|
||||
},
|
||||
[L10N.getStr("certmgr.issuerinfo.label")]: {
|
||||
[L10N.getStr("certmgr.certdetail.cn")]:
|
||||
issuer.commonName || notAvailable,
|
||||
[L10N.getStr("certmgr.certdetail.o")]:
|
||||
issuer.organization || notAvailable,
|
||||
[L10N.getStr("certmgr.certdetail.ou")]:
|
||||
issuer.organizationUnit || notAvailable,
|
||||
[ISSUER_INFO_LABEL]: {
|
||||
[CERT_DETAIL_COMMON_NAME_LABEL]:
|
||||
issuer.commonName || NOT_AVAILABLE,
|
||||
[CERT_DETAIL_ORG_LABEL]:
|
||||
issuer.organization || NOT_AVAILABLE,
|
||||
[CERT_DETAIL_ORG_UNIT_LABEL]:
|
||||
issuer.organizationUnit || NOT_AVAILABLE,
|
||||
},
|
||||
[L10N.getStr("certmgr.periodofvalidity.label")]: {
|
||||
[L10N.getStr("certmgr.begins")]:
|
||||
validity.start || notAvailable,
|
||||
[L10N.getStr("certmgr.expires")]:
|
||||
validity.end || notAvailable,
|
||||
[PERIOD_OF_VALIDITY_LABEL]: {
|
||||
[BEGINS_LABEL]:
|
||||
validity.start || NOT_AVAILABLE,
|
||||
[EXPIRES_LABEL]:
|
||||
validity.end || NOT_AVAILABLE,
|
||||
},
|
||||
[L10N.getStr("certmgr.fingerprints.label")]: {
|
||||
[L10N.getStr("certmgr.certdetail.sha256fingerprint")]:
|
||||
fingerprint.sha256 || notAvailable,
|
||||
[L10N.getStr("certmgr.certdetail.sha1fingerprint")]:
|
||||
fingerprint.sha1 || notAvailable,
|
||||
[FINGERPRINTS_LABEL]: {
|
||||
[SHA256_FINGERPRINT_LABEL]:
|
||||
fingerprint.sha256 || NOT_AVAILABLE,
|
||||
[SHA1_FINGERPRINT_LABEL]:
|
||||
fingerprint.sha1 || NOT_AVAILABLE,
|
||||
},
|
||||
},
|
||||
};
|
||||
} else {
|
||||
object = {
|
||||
[L10N.getStr("netmonitor.security.error")]:
|
||||
[ERROR_LABEL]:
|
||||
new DOMParser().parseFromString(securityInfo.errorMessage, "text/html")
|
||||
.body.textContent || notAvailable
|
||||
.body.textContent || NOT_AVAILABLE
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -125,7 +149,7 @@ function renderValue(props, weaknessReasons = []) {
|
|||
}
|
||||
|
||||
return span({ className: "security-info-value" },
|
||||
member.name === L10N.getStr("netmonitor.security.error") ?
|
||||
member.name === ERROR_LABEL ?
|
||||
// Display multiline text for security error
|
||||
value
|
||||
:
|
||||
|
@ -137,12 +161,12 @@ function renderValue(props, weaknessReasons = []) {
|
|||
})
|
||||
,
|
||||
weaknessReasons.indexOf("cipher") !== -1 &&
|
||||
member.name === L10N.getStr("netmonitor.security.cipherSuite") ?
|
||||
member.name === CIPHER_SUITE_LABEL ?
|
||||
// Display an extra warning icon after the cipher suite
|
||||
div({
|
||||
id: "security-warning-cipher",
|
||||
className: "security-warning-icon",
|
||||
title: L10N.getStr("netmonitor.security.warning.cipher"),
|
||||
title: WARNING_CIPHER_LABEL,
|
||||
})
|
||||
:
|
||||
null
|
||||
|
|
|
@ -201,7 +201,6 @@ subsuite = clipboard
|
|||
# old console skip-if = (os == 'linux' && bits == 32 && debug) # bug 1328915, disable linux32 debug devtools for timeouts
|
||||
[browser_jsterm_dollar.js]
|
||||
[browser_jsterm_history_persist.js]
|
||||
skip-if = true # Bug 1408870
|
||||
[browser_jsterm_inspect.js]
|
||||
[browser_jsterm_no_autocompletion_on_defined_variables.js]
|
||||
skip-if = true # Bug 1408872
|
||||
|
|
|
@ -15,6 +15,9 @@ add_task(function* () {
|
|||
let hud = yield openNewTabAndConsole(TEST_URI);
|
||||
yield test$(hud);
|
||||
yield test$$(hud);
|
||||
|
||||
// Clear history to not affect next tests.
|
||||
yield hud.jsterm.clearHistory();
|
||||
});
|
||||
|
||||
async function test$(hud) {
|
||||
|
|
|
@ -16,15 +16,16 @@ const INPUT_HISTORY_COUNT = 10;
|
|||
|
||||
add_task(function* () {
|
||||
info("Setting custom input history pref to " + INPUT_HISTORY_COUNT);
|
||||
Services.prefs.setIntPref("devtools.webconsole.inputHistoryCount",
|
||||
INPUT_HISTORY_COUNT);
|
||||
Services.prefs.setIntPref("devtools.webconsole.inputHistoryCount", INPUT_HISTORY_COUNT);
|
||||
|
||||
// First tab: run a bunch of commands and then make sure that you can
|
||||
// navigate through their history.
|
||||
yield loadTab(TEST_URI);
|
||||
let hud1 = yield openConsole();
|
||||
is(JSON.stringify(hud1.jsterm.history), "[]",
|
||||
"No history on first tab initially");
|
||||
let hud1 = yield openNewTabAndConsole(TEST_URI);
|
||||
|
||||
// Clearing history that might have been set in previous tests.
|
||||
yield hud1.jsterm.clearHistory();
|
||||
|
||||
is(JSON.stringify(hud1.jsterm.history), "[]", "No history on first tab initially");
|
||||
yield populateInputHistory(hud1);
|
||||
is(JSON.stringify(hud1.jsterm.history),
|
||||
'["0","1","2","3","4","5","6","7","8","9"]',
|
||||
|
@ -32,20 +33,18 @@ add_task(function* () {
|
|||
|
||||
// Second tab: Just make sure that you can navigate through the history
|
||||
// generated by the first tab.
|
||||
yield loadTab(TEST_URI);
|
||||
let hud2 = yield openConsole();
|
||||
let hud2 = yield openNewTabAndConsole(TEST_URI);
|
||||
is(JSON.stringify(hud2.jsterm.history),
|
||||
'["0","1","2","3","4","5","6","7","8","9"]',
|
||||
"Second tab has populated history");
|
||||
yield testNaviatingHistoryInUI(hud2);
|
||||
yield testNavigatingHistoryInUI(hud2);
|
||||
is(JSON.stringify(hud2.jsterm.history),
|
||||
'["0","1","2","3","4","5","6","7","8","9",""]',
|
||||
"An empty entry has been added in the second tab due to history perusal");
|
||||
|
||||
// Third tab: Should have the same history as first tab, but if we run a
|
||||
// command, then the history of the first and second shouldn't be affected
|
||||
yield loadTab(TEST_URI);
|
||||
let hud3 = yield openConsole();
|
||||
let hud3 = yield openNewTabAndConsole(TEST_URI);
|
||||
is(JSON.stringify(hud3.jsterm.history),
|
||||
'["0","1","2","3","4","5","6","7","8","9"]',
|
||||
"Third tab has populated history");
|
||||
|
@ -68,18 +67,15 @@ add_task(function* () {
|
|||
|
||||
// Fourth tab: Should have the latest command from the third tab, followed
|
||||
// by the rest of the history from the first tab.
|
||||
yield loadTab(TEST_URI);
|
||||
let hud4 = yield openConsole();
|
||||
let hud4 = yield openNewTabAndConsole(TEST_URI);
|
||||
is(JSON.stringify(hud4.jsterm.history),
|
||||
'["1","2","3","4","5","6","7","8","9","\\"hello from third tab\\""]',
|
||||
"Fourth tab has most recent history");
|
||||
|
||||
yield hud4.jsterm.clearHistory();
|
||||
is(JSON.stringify(hud4.jsterm.history), "[]",
|
||||
"Clearing history for a tab works");
|
||||
is(JSON.stringify(hud4.jsterm.history), "[]", "Clearing history for a tab works");
|
||||
|
||||
yield loadTab(TEST_URI);
|
||||
let hud5 = yield openConsole();
|
||||
let hud5 = yield openNewTabAndConsole(TEST_URI);
|
||||
is(JSON.stringify(hud5.jsterm.history), "[]",
|
||||
"Clearing history carries over to a new tab");
|
||||
|
||||
|
@ -98,7 +94,7 @@ function* populateInputHistory(hud) {
|
|||
// Set input value separately from execute so UP arrow accurately navigates
|
||||
// history.
|
||||
jsterm.setInputValue(i);
|
||||
jsterm.execute();
|
||||
yield jsterm.execute();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,7 +102,7 @@ function* populateInputHistory(hud) {
|
|||
* Check pressing up results in history traversal like:
|
||||
* [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
|
||||
*/
|
||||
function* testNaviatingHistoryInUI(hud) {
|
||||
function testNavigatingHistoryInUI(hud) {
|
||||
let jsterm = hud.jsterm;
|
||||
jsterm.focus();
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ function isEvalSource(source) {
|
|||
// These are all the sources that are essentially eval-ed (either
|
||||
// by calling eval or passing a string to one of these functions).
|
||||
return (introType === "eval" ||
|
||||
introType === "debugger eval" ||
|
||||
introType === "Function" ||
|
||||
introType === "eventHandler" ||
|
||||
introType === "setTimeout" ||
|
||||
|
@ -41,8 +42,7 @@ function getSourceURL(source, window) {
|
|||
// created with the sourceURL pragma. If the introduction script
|
||||
// is a non-eval script, generate an full absolute URL relative to it.
|
||||
|
||||
if (source.displayURL && source.introductionScript &&
|
||||
!isEvalSource(source.introductionScript.source)) {
|
||||
if (source.displayURL && source.introductionScript) {
|
||||
if (source.introductionScript.source.url === "debugger eval code") {
|
||||
if (window) {
|
||||
// If this is a named eval script created from the console, make it
|
||||
|
@ -50,7 +50,7 @@ function getSourceURL(source, window) {
|
|||
// when we care about this.
|
||||
return joinURI(window.location.href, source.displayURL);
|
||||
}
|
||||
} else {
|
||||
} else if (!isEvalSource(source.introductionScript.source)) {
|
||||
return joinURI(source.introductionScript.source.url, source.displayURL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Check that sourceURL has the correct effect when using gThreadClient.eval.
|
||||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadClient;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function () {
|
||||
attachTestTabAndResume(gClient, "test-stack",
|
||||
function (response, tabClient, threadClient) {
|
||||
gThreadClient = threadClient;
|
||||
test_simple_new_source();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
|
||||
function test_simple_new_source() {
|
||||
gThreadClient.addOneTimeListener("paused", function () {
|
||||
gThreadClient.addOneTimeListener("newSource", function (event, packet) {
|
||||
do_check_eq(event, "newSource");
|
||||
do_check_eq(packet.type, "newSource");
|
||||
do_check_true(!!packet.source);
|
||||
do_check_true(!!packet.source.url.match(/example\.com/));
|
||||
|
||||
finishClient(gClient);
|
||||
});
|
||||
gThreadClient.eval(null, "function f() { }\n//# sourceURL=http://example.com/code.js");
|
||||
});
|
||||
|
||||
/* eslint-disable */
|
||||
gDebuggee.eval("(" + function () {
|
||||
function stopMe(arg1) { debugger; }
|
||||
stopMe({obj: true});
|
||||
} + ")()");
|
||||
/* eslint-enable */
|
||||
}
|
|
@ -141,6 +141,7 @@ reason = only ran on B2G
|
|||
[test_listsources-03.js]
|
||||
[test_listsources-04.js]
|
||||
[test_new_source-01.js]
|
||||
[test_new_source-02.js]
|
||||
[test_sourcemaps-01.js]
|
||||
[test_sourcemaps-02.js]
|
||||
[test_sourcemaps-03.js]
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "nsIFrame.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "mozilla/ServoCSSParser.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -116,6 +117,11 @@ DOMIntersectionObserver::Constructor(const mozilla::dom::GlobalObject& aGlobal,
|
|||
bool
|
||||
DOMIntersectionObserver::SetRootMargin(const nsAString& aString)
|
||||
{
|
||||
if (mDocument && mDocument->IsStyledByServo()) {
|
||||
return ServoCSSParser::ParseIntersectionObserverRootMargin(aString,
|
||||
&mRootMargin);
|
||||
}
|
||||
|
||||
// By not passing a CSS Loader object we make sure we don't parse in quirks
|
||||
// mode so that pixel/percent and unit-less values will be differentiated.
|
||||
nsCSSParser parser(nullptr);
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
Test whether the speculative parser should use the referrerpolicy attribute
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1399780
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<script type="text/javascript" src="file_bug704320_preload_common.js"></script>
|
||||
<script language="javascript" type="text/javascript">
|
||||
// interfere doc.write(meta referrer) to the down side preloads
|
||||
document.write("<meta name='referrer' content='unsafe-url'>");
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="http://example.com/tests/dom/base/test/bug704320_counter.sjs?type=css"
|
||||
onload="incrementLoad2('link', 2);"
|
||||
referrerpolicy="origin"/>
|
||||
|
||||
<img src="http://example.com/tests/dom/base/test/bug704320_counter.sjs?type=img"
|
||||
onload="incrementLoad2('img', 2);"
|
||||
referrerpolicy="origin"/>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -108,6 +108,7 @@ support-files =
|
|||
file_bug687859-http.js^headers^
|
||||
file_bug687859-inherit.js
|
||||
file_bug692434.xml
|
||||
file_bug704320_preload_attr.html
|
||||
file_bug704320_preload_common.js
|
||||
file_bug704320_preload_reuse.html
|
||||
file_bug704320_preload_noreuse.html
|
||||
|
|
|
@ -47,6 +47,17 @@ var tests = (function*() {
|
|||
// check the second test
|
||||
yield checkResults(finalizePreloadReuse);
|
||||
|
||||
// reset the counter
|
||||
yield resetCounter();
|
||||
|
||||
// load the third test frame
|
||||
// it will call back into this function via postMessage when it finishes loading.
|
||||
// and continue beyond the yield.
|
||||
yield iframe.src = 'file_bug704320_preload_attr.html';
|
||||
|
||||
// check the third test
|
||||
yield checkResults(finalizePreloadReferrerPolicyAttr);
|
||||
|
||||
// complete.
|
||||
SimpleTest.finish();
|
||||
})();
|
||||
|
@ -121,6 +132,34 @@ function finalizePreloadReuse(results) {
|
|||
advance();
|
||||
}
|
||||
|
||||
/**
|
||||
* This checks the third test: a test where preload requests of image, style
|
||||
* should use referrerpolicy attribute and we expect the preloads should not
|
||||
* be reused
|
||||
*/
|
||||
function finalizePreloadReferrerPolicyAttr(results) {
|
||||
var expected = {'css': {'count': 1, 'referrers': ['origin']},
|
||||
'img': {'count': 1, 'referrers': ['origin']}};
|
||||
|
||||
for (var x in expected) {
|
||||
ok(x in results, "some " + x + " loads required in results object.");
|
||||
|
||||
is(results[x].count, expected[x].count,
|
||||
"Expected " + expected[x].count + " loads for " + x + " requests.");
|
||||
|
||||
// 'origin' is required
|
||||
ok(results[x].referrers.indexOf('origin') >= 0,
|
||||
"One load for " + x + " should have had 'origin' referrer.");
|
||||
|
||||
// no other values should be in the referrers.
|
||||
is(results[x].referrers.indexOf('none'), -1,
|
||||
"No loads for " + x + " should have a missing referrer.");
|
||||
is(results[x].referrers.indexOf('full'), -1,
|
||||
"No loads for " + x + " should have an 'full' referrer.")
|
||||
}
|
||||
|
||||
advance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Grabs the results via XHR and passes to checker.
|
||||
|
|
|
@ -35,9 +35,8 @@ class SourceBufferResource;
|
|||
class SourceBufferTaskQueue
|
||||
{
|
||||
public:
|
||||
SourceBufferTaskQueue()
|
||||
: mMutex("SourceBufferTaskQueue")
|
||||
{}
|
||||
SourceBufferTaskQueue() { }
|
||||
|
||||
~SourceBufferTaskQueue()
|
||||
{
|
||||
MOZ_ASSERT(mQueue.IsEmpty(), "All tasks must have been processed");
|
||||
|
@ -45,13 +44,11 @@ public:
|
|||
|
||||
void Push(SourceBufferTask* aTask)
|
||||
{
|
||||
MutexAutoLock mut(mMutex);
|
||||
mQueue.AppendElement(aTask);
|
||||
}
|
||||
|
||||
already_AddRefed<SourceBufferTask> Pop()
|
||||
{
|
||||
MutexAutoLock mut(mMutex);
|
||||
if (!mQueue.Length()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -62,12 +59,9 @@ public:
|
|||
|
||||
nsTArray<SourceBufferTask>::size_type Length() const
|
||||
{
|
||||
MutexAutoLock mut(mMutex);
|
||||
return mQueue.Length();
|
||||
}
|
||||
|
||||
private:
|
||||
mutable Mutex mMutex;
|
||||
nsTArray<RefPtr<SourceBufferTask>> mQueue;
|
||||
};
|
||||
|
||||
|
|
|
@ -248,6 +248,8 @@ skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emula
|
|||
skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
|
||||
[test_peerConnection_addSecondVideoStream.html]
|
||||
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
|
||||
[test_peerConnection_restrictBandwidthTargetBitrate.html]
|
||||
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
|
||||
[test_peerConnection_restrictBandwidthWithTias.html]
|
||||
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
|
||||
[test_peerConnection_removeVideoTrack.html]
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<script type="application/javascript" src="pc.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
createHTML({
|
||||
bug: "Bug 1404250",
|
||||
title: "Extremely bitrate restricted video-only peer connection"
|
||||
});
|
||||
|
||||
var test;
|
||||
runNetworkTest(function (options) {
|
||||
test = new PeerConnectionTest(options);
|
||||
test.setMediaConstraints([{video: true}], [{video: true}]);
|
||||
test.chain.insertAfter('PC_REMOTE_GET_OFFER', [
|
||||
function PC_REMOTE_ADD_TIAS(test) {
|
||||
test._local_offer.sdp = sdputils.addTiasBps(
|
||||
test._local_offer.sdp, 25000);
|
||||
info("Offer with TIAS: " + JSON.stringify(test._local_offer));
|
||||
}
|
||||
]);
|
||||
test.run();
|
||||
});
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -111,7 +111,13 @@ nsXBLPrototypeResources::FlushSkinSheets()
|
|||
mStyleSheetList.AppendElement(newSheet);
|
||||
}
|
||||
|
||||
GatherRuleProcessor();
|
||||
if (doc->IsStyledByServo()) {
|
||||
MOZ_ASSERT(doc->GetShell());
|
||||
MOZ_ASSERT(doc->GetShell()->GetPresContext());
|
||||
ComputeServoStyleSet(doc->GetShell()->GetPresContext());
|
||||
} else {
|
||||
GatherRuleProcessor();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -543,19 +543,18 @@ private:
|
|||
DECL_OVERRIDE_PREF(Live, "layers.advanced.background-image", LayersAllowBackgroundImage, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_GFX_PREF(Live, "layers.advanced.basic-layer.enabled", LayersAdvancedBasicLayerEnabled, bool, false);
|
||||
DECL_OVERRIDE_PREF(Live, "layers.advanced.border-layers", LayersAllowBorderLayers, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_OVERRIDE_PREF(Live, "layers.advanced.boxshadow-inset-layers", LayersAllowInsetBoxShadow, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_OVERRIDE_PREF(Live, "layers.advanced.boxshadow-outer-layers", LayersAllowOuterBoxShadow, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_GFX_PREF(Live, "layers.advanced.boxshadow-inset-layers", LayersAllowInsetBoxShadow, bool, false);
|
||||
DECL_GFX_PREF(Live, "layers.advanced.boxshadow-outer-layers", LayersAllowOuterBoxShadow, bool, false);
|
||||
DECL_OVERRIDE_PREF(Live, "layers.advanced.bullet-layers", LayersAllowBulletLayers, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_OVERRIDE_PREF(Live, "layers.advanced.button-foreground-layers", LayersAllowButtonForegroundLayers, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_OVERRIDE_PREF(Live, "layers.advanced.canvas-background-color", LayersAllowCanvasBackgroundColorLayers, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_OVERRIDE_PREF(Live, "layers.advanced.caret-layers", LayersAllowCaretLayers, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_GFX_PREF(Live, "layers.advanced.caret-layers", LayersAllowCaretLayers, bool, false);
|
||||
DECL_OVERRIDE_PREF(Live, "layers.advanced.columnRule-layers", LayersAllowColumnRuleLayers, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_OVERRIDE_PREF(Live, "layers.advanced.displaybuttonborder-layers", LayersAllowDisplayButtonBorder, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_OVERRIDE_PREF(Live, "layers.advanced.filter-layers", LayersAllowFilterLayers, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_OVERRIDE_PREF(Live, "layers.advanced.image-layers", LayersAllowImageLayers, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_OVERRIDE_PREF(Live, "layers.advanced.outline-layers", LayersAllowOutlineLayers, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_OVERRIDE_PREF(Live, "layers.advanced.solid-color", LayersAllowSolidColorLayers, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_OVERRIDE_PREF(Live, "layers.advanced.table", LayersAllowTable, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_GFX_PREF(Live, "layers.advanced.solid-color", LayersAllowSolidColorLayers, bool, false);
|
||||
DECL_GFX_PREF(Live, "layers.advanced.table", LayersAllowTable, bool, false);
|
||||
DECL_OVERRIDE_PREF(Live, "layers.advanced.text-layers", LayersAllowTextLayers, gfxPrefs::OverrideBase_WebRender());
|
||||
DECL_GFX_PREF(Once, "layers.amd-switchable-gfx.enabled", LayersAMDSwitchableGfxEnabled, bool, false);
|
||||
DECL_GFX_PREF(Once, "layers.async-pan-zoom.enabled", AsyncPanZoomEnabledDoNotUseDirectly, bool, true);
|
||||
|
|
|
@ -787,7 +787,7 @@ js::atomics_wait(JSContext* cx, unsigned argc, Value* vp)
|
|||
// and it provides the necessary memory fence.
|
||||
AutoLockFutexAPI lock;
|
||||
|
||||
SharedMem<int32_t*>(addr) = view->viewDataShared().cast<int32_t*>() + offset;
|
||||
SharedMem<int32_t*> addr = view->viewDataShared().cast<int32_t*>() + offset;
|
||||
if (jit::AtomicOperations::loadSafeWhenRacy(addr) != value) {
|
||||
r.setString(cx->names().futexNotEqual);
|
||||
return true;
|
||||
|
|
|
@ -152,7 +152,8 @@ NativeObject::copyDenseElements(uint32_t dstStart, const Value* src, uint32_t co
|
|||
src[i]);
|
||||
}
|
||||
} else {
|
||||
memcpy(&elements_[dstStart], src, count * sizeof(HeapSlot));
|
||||
memcpy(reinterpret_cast<Value*>(&elements_[dstStart]), src,
|
||||
count * sizeof(Value));
|
||||
elementsRangeWriteBarrierPost(dstStart, count);
|
||||
}
|
||||
}
|
||||
|
@ -181,7 +182,7 @@ NativeObject::initDenseElements(const Value* src, uint32_t count)
|
|||
checkStoredValue(src[i]);
|
||||
#endif
|
||||
|
||||
memcpy(elements_, src, count * sizeof(HeapSlot));
|
||||
memcpy(reinterpret_cast<Value*>(elements_), src, count * sizeof(Value));
|
||||
elementsRangeWriteBarrierPost(0, count);
|
||||
}
|
||||
|
||||
|
@ -256,7 +257,8 @@ NativeObject::moveDenseElements(uint32_t dstStart, uint32_t srcStart, uint32_t c
|
|||
dst->set(this, HeapSlot::Element, dst - elements_ + numShifted, *src);
|
||||
}
|
||||
} else {
|
||||
memmove(elements_ + dstStart, elements_ + srcStart, count * sizeof(HeapSlot));
|
||||
memmove(reinterpret_cast<Value*>(elements_ + dstStart), elements_ + srcStart,
|
||||
count * sizeof(Value));
|
||||
elementsRangeWriteBarrierPost(dstStart, count);
|
||||
}
|
||||
}
|
||||
|
@ -271,7 +273,8 @@ NativeObject::moveDenseElementsNoPreBarrier(uint32_t dstStart, uint32_t srcStart
|
|||
MOZ_ASSERT(!denseElementsAreCopyOnWrite());
|
||||
MOZ_ASSERT(!denseElementsAreFrozen());
|
||||
|
||||
memmove(elements_ + dstStart, elements_ + srcStart, count * sizeof(Value));
|
||||
memmove(reinterpret_cast<Value*>(elements_ + dstStart), elements_ + srcStart,
|
||||
count * sizeof(Value));
|
||||
elementsRangeWriteBarrierPost(dstStart, count);
|
||||
}
|
||||
|
||||
|
|
|
@ -2937,11 +2937,6 @@ nsDisplaySolidColor::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aB
|
|||
mozilla::layers::WebRenderLayerManager* aManager,
|
||||
nsDisplayListBuilder* aDisplayListBuilder)
|
||||
{
|
||||
ContainerLayerParameters parameter;
|
||||
if (GetLayerState(aDisplayListBuilder, aManager, parameter) != LAYER_ACTIVE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
LayoutDeviceRect bounds = LayoutDeviceRect::FromAppUnits(
|
||||
mVisibleRect, mFrame->PresContext()->AppUnitsPerDevPixel());
|
||||
wr::LayoutRect transformedRect = aSc.ToRelativeLayoutRect(bounds);
|
||||
|
@ -4764,11 +4759,6 @@ nsDisplayCaret::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilde
|
|||
mozilla::layers::WebRenderLayerManager* aManager,
|
||||
nsDisplayListBuilder* aDisplayListBuilder)
|
||||
{
|
||||
ContainerLayerParameters parameter;
|
||||
if (GetLayerState(aDisplayListBuilder, aManager, parameter) != LAYER_ACTIVE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
using namespace mozilla::layers;
|
||||
int32_t contentOffset;
|
||||
nsIFrame* frame = mCaret->GetFrame(&contentOffset);
|
||||
|
@ -5332,8 +5322,7 @@ nsDisplayBoxShadowOuter::GetLayerState(nsDisplayListBuilder* aBuilder,
|
|||
LayerManager* aManager,
|
||||
const ContainerLayerParameters& aParameters)
|
||||
{
|
||||
if (ShouldUseAdvancedLayer(aManager, gfxPrefs::LayersAllowOuterBoxShadow) &&
|
||||
CanBuildWebRenderDisplayItems()) {
|
||||
if (ShouldUseAdvancedLayer(aManager, gfxPrefs::LayersAllowOuterBoxShadow)) {
|
||||
return LAYER_ACTIVE;
|
||||
}
|
||||
|
||||
|
@ -5398,8 +5387,7 @@ nsDisplayBoxShadowOuter::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder
|
|||
mozilla::layers::WebRenderLayerManager* aManager,
|
||||
nsDisplayListBuilder* aDisplayListBuilder)
|
||||
{
|
||||
ContainerLayerParameters parameter;
|
||||
if (GetLayerState(aDisplayListBuilder, aManager, parameter) != LAYER_ACTIVE) {
|
||||
if (!CanBuildWebRenderDisplayItems()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -5574,8 +5562,7 @@ nsDisplayBoxShadowInner::GetLayerState(nsDisplayListBuilder* aBuilder,
|
|||
LayerManager* aManager,
|
||||
const ContainerLayerParameters& aParameters)
|
||||
{
|
||||
if (ShouldUseAdvancedLayer(aManager, gfxPrefs::LayersAllowInsetBoxShadow) &&
|
||||
CanCreateWebRenderCommands(aBuilder, mFrame, ToReferenceFrame())) {
|
||||
if (ShouldUseAdvancedLayer(aManager, gfxPrefs::LayersAllowInsetBoxShadow)) {
|
||||
return LAYER_ACTIVE;
|
||||
}
|
||||
|
||||
|
@ -5661,8 +5648,7 @@ nsDisplayBoxShadowInner::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder
|
|||
mozilla::layers::WebRenderLayerManager* aManager,
|
||||
nsDisplayListBuilder* aDisplayListBuilder)
|
||||
{
|
||||
ContainerLayerParameters parameter;
|
||||
if (GetLayerState(aDisplayListBuilder, aManager, parameter) != LAYER_ACTIVE) {
|
||||
if (!CanCreateWebRenderCommands(aDisplayListBuilder, mFrame, ToReferenceFrame())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -9313,32 +9299,7 @@ nsDisplayFilter::GetLayerState(nsDisplayListBuilder* aBuilder,
|
|||
LayerManager* aManager,
|
||||
const ContainerLayerParameters& aParameters)
|
||||
{
|
||||
if (mFrame->IsFrameOfType(nsIFrame::eSVG)) {
|
||||
return LAYER_SVG_EFFECTS;
|
||||
}
|
||||
|
||||
if (!ShouldUseAdvancedLayer(aManager, gfxPrefs::LayersAllowFilterLayers)) {
|
||||
return LAYER_SVG_EFFECTS;
|
||||
}
|
||||
|
||||
if (mFrame->StyleEffects()->mOpacity != 1.0f) {
|
||||
return LAYER_SVG_EFFECTS;
|
||||
}
|
||||
|
||||
// Due to differences in the way that WebRender filters operate
|
||||
// only the brightness and contrast filters use that path. We
|
||||
// can gradually enable more filters as WebRender bugs are fixed.
|
||||
for (const nsStyleFilter& filter : mFrame->StyleEffects()->mFilters) {
|
||||
if (filter.GetType() != NS_STYLE_FILTER_BRIGHTNESS &&
|
||||
filter.GetType() != NS_STYLE_FILTER_CONTRAST &&
|
||||
filter.GetType() != NS_STYLE_FILTER_GRAYSCALE &&
|
||||
filter.GetType() != NS_STYLE_FILTER_INVERT &&
|
||||
filter.GetType() != NS_STYLE_FILTER_SEPIA) {
|
||||
return LAYER_SVG_EFFECTS;
|
||||
}
|
||||
}
|
||||
|
||||
return LAYER_ACTIVE;
|
||||
return LAYER_SVG_EFFECTS;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -9404,12 +9365,23 @@ nsDisplayFilter::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuild
|
|||
mozilla::layers::WebRenderLayerManager* aManager,
|
||||
nsDisplayListBuilder* aDisplayListBuilder)
|
||||
{
|
||||
ContainerLayerParameters parameter;
|
||||
if (GetLayerState(aDisplayListBuilder, aManager, parameter) != LAYER_ACTIVE) {
|
||||
// TODO: should have a fallback path to paint the child list
|
||||
if (mFrame->IsFrameOfType(nsIFrame::eSVG) || mFrame->StyleEffects()->mOpacity != 1.0f) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Due to differences in the way that WebRender filters operate
|
||||
// only the brightness and contrast filters use that path. We
|
||||
// can gradually enable more filters as WebRender bugs are fixed.
|
||||
for (const nsStyleFilter& filter : mFrame->StyleEffects()->mFilters) {
|
||||
if (filter.GetType() != NS_STYLE_FILTER_BRIGHTNESS &&
|
||||
filter.GetType() != NS_STYLE_FILTER_CONTRAST &&
|
||||
filter.GetType() != NS_STYLE_FILTER_GRAYSCALE &&
|
||||
filter.GetType() != NS_STYLE_FILTER_INVERT &&
|
||||
filter.GetType() != NS_STYLE_FILTER_SEPIA) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
nsTArray<mozilla::wr::WrFilterOp> wrFilters;
|
||||
const nsTArray<nsStyleFilter>& filters = mFrame->StyleEffects()->mFilters;
|
||||
nsTArray<layers::CSSFilter> cssFilters = nsTArray<layers::CSSFilter>(filters.Length());
|
||||
|
|
|
@ -689,6 +689,9 @@ SERVO_BINDING_FUNC(Servo_ComputeColor, bool,
|
|||
nscolor current_color,
|
||||
const nsAString* value,
|
||||
nscolor* result_color);
|
||||
SERVO_BINDING_FUNC(Servo_ParseIntersectionObserverRootMargin, bool,
|
||||
const nsAString* value,
|
||||
nsCSSRect* result);
|
||||
|
||||
// AddRef / Release functions
|
||||
#define SERVO_ARC_TYPE(name_, type_) \
|
||||
|
|
|
@ -449,6 +449,7 @@ structs-types = [
|
|||
"nsCSSKeyword",
|
||||
"nsCSSPropertyID",
|
||||
"nsCSSPropertyIDSet",
|
||||
"nsCSSRect",
|
||||
"nsCSSShadowArray",
|
||||
"nsCSSUnit",
|
||||
"nsCSSValue",
|
||||
|
|
|
@ -25,3 +25,10 @@ ServoCSSParser::ComputeColor(ServoStyleSet* aStyleSet,
|
|||
return Servo_ComputeColor(aStyleSet ? aStyleSet->RawSet() : nullptr,
|
||||
aCurrentColor, &aValue, aResultColor);
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
ServoCSSParser::ParseIntersectionObserverRootMargin(const nsAString& aValue,
|
||||
nsCSSRect* aResult)
|
||||
{
|
||||
return Servo_ParseIntersectionObserverRootMargin(&aValue, aResult);
|
||||
}
|
||||
|
|
|
@ -38,6 +38,17 @@ public:
|
|||
nscolor aCurrentColor,
|
||||
const nsAString& aValue,
|
||||
nscolor* aResultColor);
|
||||
|
||||
/**
|
||||
* Parses a IntersectionObserver's initialization dictionary's rootMargin
|
||||
* property.
|
||||
*
|
||||
* @param aValue The rootMargin value.
|
||||
* @param aResult The nsCSSRect object to write the result into.
|
||||
* @return Whether the value was successfully parsed.
|
||||
*/
|
||||
static bool ParseIntersectionObserverRootMargin(const nsAString& aValue,
|
||||
nsCSSRect* aResult);
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -1314,11 +1314,6 @@ nsDisplayTableBorderCollapse::CreateWebRenderCommands(mozilla::wr::DisplayListBu
|
|||
mozilla::layers::WebRenderLayerManager* aManager,
|
||||
nsDisplayListBuilder* aDisplayListBuilder)
|
||||
{
|
||||
ContainerLayerParameters parameter;
|
||||
if (GetLayerState(aDisplayListBuilder, aManager, parameter) != LAYER_ACTIVE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static_cast<nsTableFrame *>(mFrame)->CreateWebRenderCommandsForBCBorders(aBuilder,
|
||||
aSc,
|
||||
ToReferenceFrame());
|
||||
|
|
|
@ -122,10 +122,11 @@ fn get_temp_path(name: &str) -> PathBuf {
|
|||
path
|
||||
}
|
||||
|
||||
pub fn get_uds_path() -> PathBuf {
|
||||
get_temp_path("cubeb-sock")
|
||||
pub fn get_uds_path(id: u64) -> PathBuf {
|
||||
get_temp_path(&format!("cubeb-sock-{}", id))
|
||||
}
|
||||
|
||||
pub fn get_shm_path(dir: &str) -> PathBuf {
|
||||
get_temp_path(&format!("cubeb-shm-{}", dir))
|
||||
let pid = unsafe { libc::getpid() };
|
||||
get_temp_path(&format!("cubeb-shm-{}-{}", pid, dir))
|
||||
}
|
||||
|
|
|
@ -8,4 +8,5 @@ description = "Cubeb Backend for talking to remote cubeb server."
|
|||
audioipc = { path="../audioipc" }
|
||||
cubeb-backend = { path="../../cubeb-rs/cubeb-backend" }
|
||||
cubeb-core = { path="../../cubeb-rs/cubeb-core" }
|
||||
libc = "0.2"
|
||||
log = "^0.3.6"
|
||||
|
|
|
@ -15,6 +15,7 @@ use std::os::raw::c_void;
|
|||
use std::os::unix::net::UnixStream;
|
||||
use std::sync::{Mutex, MutexGuard};
|
||||
use stream;
|
||||
use libc;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ClientContext {
|
||||
|
@ -43,7 +44,12 @@ impl Context for ClientContext {
|
|||
fn init(_context_name: Option<&CStr>) -> Result<*mut ffi::cubeb> {
|
||||
assert_not_in_callback();
|
||||
// TODO: encapsulate connect, etc inside audioipc.
|
||||
let stream = t!(UnixStream::connect(audioipc::get_uds_path()));
|
||||
let ppid = unsafe { libc::getppid() };
|
||||
let path = audioipc::get_uds_path(ppid as u64);
|
||||
let stream = match UnixStream::connect(path) {
|
||||
Ok(stream) => stream,
|
||||
_ => t!(UnixStream::connect(audioipc::get_uds_path(1)))
|
||||
};
|
||||
let ctx = Box::new(ClientContext {
|
||||
_ops: &CLIENT_OPS as *const _,
|
||||
connection: Mutex::new(Connection::new(stream))
|
||||
|
@ -52,18 +58,14 @@ impl Context for ClientContext {
|
|||
}
|
||||
|
||||
fn backend_id(&self) -> &'static CStr {
|
||||
// HACK: This is called reentrantly from Gecko's AudioStream::DataCallback.
|
||||
//assert_not_in_callback();
|
||||
assert_not_in_callback();
|
||||
unsafe { CStr::from_ptr(b"remote\0".as_ptr() as *const _) }
|
||||
}
|
||||
|
||||
fn max_channel_count(&self) -> Result<u32> {
|
||||
// HACK: This needs to be reentrant as MSG calls it from within data_callback.
|
||||
//assert_not_in_callback();
|
||||
//let mut conn = self.connection();
|
||||
//send_recv!(conn, ContextGetMaxChannelCount => ContextMaxChannelCount())
|
||||
warn!("Context::max_channel_count lying about result until reentrancy issues resolved.");
|
||||
Ok(2)
|
||||
assert_not_in_callback();
|
||||
let mut conn = self.connection();
|
||||
send_recv!(conn, ContextGetMaxChannelCount => ContextMaxChannelCount())
|
||||
}
|
||||
|
||||
fn min_latency(&self, params: &StreamParams) -> Result<u32> {
|
||||
|
|
|
@ -7,6 +7,7 @@ extern crate audioipc;
|
|||
extern crate cubeb_core;
|
||||
#[macro_use]
|
||||
extern crate cubeb_backend;
|
||||
extern crate libc;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ cubeb = { path = "../../cubeb-rs/cubeb-api" }
|
|||
bytes = "0.4"
|
||||
error-chain = "0.10.0"
|
||||
lazycell = "^0.4"
|
||||
libc = "0.2"
|
||||
log = "^0.3.6"
|
||||
mio = "0.6.7"
|
||||
mio-uds = "0.6.4"
|
||||
|
|
|
@ -9,6 +9,7 @@ extern crate bytes;
|
|||
extern crate cubeb;
|
||||
extern crate cubeb_core;
|
||||
extern crate lazycell;
|
||||
extern crate libc;
|
||||
extern crate mio;
|
||||
extern crate mio_uds;
|
||||
extern crate slab;
|
||||
|
@ -706,13 +707,14 @@ impl Server {
|
|||
// it as an Evented that we can send/recv file descriptors (or HANDLEs on
|
||||
// Windows) over.
|
||||
pub fn run(running: Arc<AtomicBool>) -> Result<()> {
|
||||
let path = audioipc::get_uds_path(1);
|
||||
|
||||
// Ignore result.
|
||||
let _ = std::fs::remove_file(audioipc::get_uds_path());
|
||||
let _ = std::fs::remove_file(&path);
|
||||
|
||||
// TODO: Use a SEQPACKET, wrap it in UnixStream?
|
||||
let mut poll = mio::Poll::new()?;
|
||||
let mut server = Server::new(UnixListener::bind(audioipc::get_uds_path())?);
|
||||
let mut server = Server::new(UnixListener::bind(&path)?);
|
||||
|
||||
poll.register(
|
||||
&server.socket,
|
||||
|
@ -723,10 +725,15 @@ pub fn run(running: Arc<AtomicBool>) -> Result<()> {
|
|||
|
||||
loop {
|
||||
if !running.load(Ordering::SeqCst) {
|
||||
let _ = std::fs::remove_file(&path);
|
||||
bail!("server quit due to ctrl-c");
|
||||
}
|
||||
|
||||
try!(server.poll(&mut poll));
|
||||
let r = server.poll(&mut poll);
|
||||
if r.is_err() {
|
||||
let _ = std::fs::remove_file(&path);
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
//poll.deregister(&server.socket).unwrap();
|
||||
|
@ -739,6 +746,7 @@ fn error(error: cubeb::Error) -> ClientMessage {
|
|||
struct ServerWrapper {
|
||||
thread_handle: std::thread::JoinHandle<()>,
|
||||
sender_ctl: channel::SenderCtl,
|
||||
path: std::path::PathBuf,
|
||||
}
|
||||
|
||||
impl ServerWrapper {
|
||||
|
@ -746,21 +754,26 @@ impl ServerWrapper {
|
|||
// Dropping SenderCtl here will notify the other end.
|
||||
drop(self.sender_ctl);
|
||||
self.thread_handle.join().unwrap();
|
||||
// Ignore result.
|
||||
let _ = std::fs::remove_file(self.path);
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn audioipc_server_start() -> *mut c_void {
|
||||
let pid = unsafe { libc::getpid() };
|
||||
let path = audioipc::get_uds_path(pid as u64);
|
||||
|
||||
let (tx, rx) = channel::ctl_pair();
|
||||
|
||||
let handle = thread::spawn(move || {
|
||||
let path = audioipc::get_uds_path(pid as u64);
|
||||
// Ignore result.
|
||||
let _ = std::fs::remove_file(audioipc::get_uds_path());
|
||||
let _ = std::fs::remove_file(&path);
|
||||
|
||||
// TODO: Use a SEQPACKET, wrap it in UnixStream?
|
||||
let mut poll = mio::Poll::new().unwrap();
|
||||
let mut server = Server::new(UnixListener::bind(audioipc::get_uds_path()).unwrap());
|
||||
let mut server = Server::new(UnixListener::bind(&path).unwrap());
|
||||
|
||||
poll.register(
|
||||
&server.socket,
|
||||
|
@ -781,7 +794,8 @@ pub extern "C" fn audioipc_server_start() -> *mut c_void {
|
|||
|
||||
let wrapper = ServerWrapper {
|
||||
thread_handle: handle,
|
||||
sender_ctl: tx
|
||||
sender_ctl: tx,
|
||||
path: path
|
||||
};
|
||||
|
||||
Box::into_raw(Box::new(wrapper)) as *mut _
|
||||
|
|
|
@ -590,9 +590,10 @@ Moof::ParseTraf(Box& aBox, Trex& aTrex, Mvhd& aMvhd, Mdhd& aMdhd, Edts& aEdts, S
|
|||
tfdt.IsValid() ? tfdt.mBaseMediaDecodeTime : *aDecodeTime;
|
||||
for (Box box = aBox.FirstChild(); box.IsAvailable(); box = box.Next()) {
|
||||
if (box.IsType("trun")) {
|
||||
if (ParseTrun(box, tfhd, aMvhd, aMdhd, aEdts, &decodeTime, aIsAudio)) {
|
||||
if (ParseTrun(box, tfhd, aMvhd, aMdhd, aEdts, &decodeTime, aIsAudio).isOk()) {
|
||||
mValid = true;
|
||||
} else {
|
||||
LOG(Moof, "ParseTrun failed");
|
||||
mValid = false;
|
||||
break;
|
||||
}
|
||||
|
@ -609,70 +610,69 @@ Moof::FixRounding(const Moof& aMoof) {
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
Result<Ok, nsresult>
|
||||
Moof::ParseTrun(Box& aBox, Tfhd& aTfhd, Mvhd& aMvhd, Mdhd& aMdhd, Edts& aEdts, uint64_t* aDecodeTime, bool aIsAudio)
|
||||
{
|
||||
if (!aTfhd.IsValid() || !aMvhd.IsValid() || !aMdhd.IsValid() ||
|
||||
!aEdts.IsValid()) {
|
||||
LOG(Moof, "Invalid dependencies: aTfhd(%d) aMvhd(%d) aMdhd(%d) aEdts(%d)",
|
||||
aTfhd.IsValid(), aMvhd.IsValid(), aMdhd.IsValid(), !aEdts.IsValid());
|
||||
return false;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
BoxReader reader(aBox);
|
||||
if (!reader->CanReadType<uint32_t>()) {
|
||||
LOG(Moof, "Incomplete Box (missing flags)");
|
||||
return false;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
uint32_t flags = reader->ReadU32();
|
||||
uint32_t flags;
|
||||
MOZ_TRY_VAR(flags, reader->ReadU32());
|
||||
uint8_t version = flags >> 24;
|
||||
|
||||
if (!reader->CanReadType<uint32_t>()) {
|
||||
LOG(Moof, "Incomplete Box (missing sampleCount)");
|
||||
return false;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
uint32_t sampleCount = reader->ReadU32();
|
||||
uint32_t sampleCount;
|
||||
MOZ_TRY_VAR(sampleCount, reader->ReadU32());
|
||||
if (sampleCount == 0) {
|
||||
return true;
|
||||
return Ok();
|
||||
}
|
||||
|
||||
size_t need =
|
||||
((flags & 1) ? sizeof(uint32_t) : 0) +
|
||||
((flags & 4) ? sizeof(uint32_t) : 0);
|
||||
uint16_t flag[] = { 0x100, 0x200, 0x400, 0x800, 0 };
|
||||
for (size_t i = 0; flag[i]; i++) {
|
||||
if (flags & flag[i]) {
|
||||
need += sizeof(uint32_t) * sampleCount;
|
||||
}
|
||||
uint64_t offset = aTfhd.mBaseDataOffset;
|
||||
if (flags & 0x01) {
|
||||
uint32_t tmp;
|
||||
MOZ_TRY_VAR(tmp, reader->ReadU32());
|
||||
offset += tmp;
|
||||
}
|
||||
if (reader->Remaining() < need) {
|
||||
LOG(Moof, "Incomplete Box (have:%zu need:%zu)",
|
||||
reader->Remaining(), need);
|
||||
return false;
|
||||
uint32_t firstSampleFlags = aTfhd.mDefaultSampleFlags;
|
||||
if (flags & 0x04) {
|
||||
MOZ_TRY_VAR(firstSampleFlags, reader->ReadU32());
|
||||
}
|
||||
|
||||
uint64_t offset = aTfhd.mBaseDataOffset + (flags & 1 ? reader->ReadU32() : 0);
|
||||
uint32_t firstSampleFlags =
|
||||
flags & 4 ? reader->ReadU32() : aTfhd.mDefaultSampleFlags;
|
||||
uint64_t decodeTime = *aDecodeTime;
|
||||
nsTArray<Interval<Microseconds>> timeRanges;
|
||||
|
||||
if (!mIndex.SetCapacity(sampleCount, fallible)) {
|
||||
LOG(Moof, "Out of Memory");
|
||||
return false;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < sampleCount; i++) {
|
||||
uint32_t sampleDuration =
|
||||
flags & 0x100 ? reader->ReadU32() : aTfhd.mDefaultSampleDuration;
|
||||
uint32_t sampleSize =
|
||||
flags & 0x200 ? reader->ReadU32() : aTfhd.mDefaultSampleSize;
|
||||
uint32_t sampleFlags =
|
||||
flags & 0x400 ? reader->ReadU32()
|
||||
: i ? aTfhd.mDefaultSampleFlags : firstSampleFlags;
|
||||
uint32_t sampleDuration = aTfhd.mDefaultSampleDuration;
|
||||
if (flags & 0x100) {
|
||||
MOZ_TRY_VAR(sampleDuration, reader->ReadU32());
|
||||
}
|
||||
uint32_t sampleSize = aTfhd.mDefaultSampleSize;
|
||||
if (flags & 0x200) {
|
||||
MOZ_TRY_VAR(sampleSize, reader->ReadU32());
|
||||
}
|
||||
uint32_t sampleFlags = i ? aTfhd.mDefaultSampleFlags : firstSampleFlags;
|
||||
if (flags & 0x400) {
|
||||
MOZ_TRY_VAR(sampleFlags, reader->ReadU32());
|
||||
}
|
||||
int32_t ctsOffset = 0;
|
||||
if (flags & 0x800) {
|
||||
ctsOffset = reader->Read32();
|
||||
MOZ_TRY_VAR(ctsOffset, reader->Read32());
|
||||
}
|
||||
|
||||
if (sampleSize) {
|
||||
|
@ -701,78 +701,84 @@ Moof::ParseTrun(Box& aBox, Tfhd& aTfhd, Mvhd& aMvhd, Mdhd& aMdhd, Edts& aEdts, u
|
|||
|
||||
*aDecodeTime = decodeTime;
|
||||
|
||||
return true;
|
||||
return Ok();
|
||||
}
|
||||
|
||||
Tkhd::Tkhd(Box& aBox)
|
||||
{
|
||||
mValid = Parse(aBox).isOk();
|
||||
if (!mValid) {
|
||||
LOG(Tkhd, "Parse failed");
|
||||
}
|
||||
}
|
||||
|
||||
Result<Ok, nsresult>
|
||||
Tkhd::Parse(Box& aBox)
|
||||
{
|
||||
BoxReader reader(aBox);
|
||||
if (!reader->CanReadType<uint32_t>()) {
|
||||
LOG(Tkhd, "Incomplete Box (missing flags)");
|
||||
return;
|
||||
}
|
||||
uint32_t flags = reader->ReadU32();
|
||||
uint32_t flags;
|
||||
MOZ_TRY_VAR(flags, reader->ReadU32());
|
||||
uint8_t version = flags >> 24;
|
||||
size_t need =
|
||||
3*(version ? sizeof(int64_t) : sizeof(int32_t)) + 2*sizeof(int32_t);
|
||||
if (reader->Remaining() < need) {
|
||||
LOG(Tkhd, "Incomplete Box (have:%" PRIu64 " need:%" PRIu64 ")",
|
||||
(uint64_t)reader->Remaining(), (uint64_t)need);
|
||||
return;
|
||||
}
|
||||
if (version == 0) {
|
||||
mCreationTime = reader->ReadU32();
|
||||
mModificationTime = reader->ReadU32();
|
||||
mTrackId = reader->ReadU32();
|
||||
uint32_t reserved = reader->ReadU32();
|
||||
uint32_t creationTime, modificationTime, reserved, duration;
|
||||
MOZ_TRY_VAR(creationTime, reader->ReadU32());
|
||||
MOZ_TRY_VAR(modificationTime, reader->ReadU32());
|
||||
MOZ_TRY_VAR(mTrackId, reader->ReadU32());
|
||||
MOZ_TRY_VAR(reserved, reader->ReadU32());
|
||||
MOZ_TRY_VAR(duration, reader->ReadU32());
|
||||
|
||||
NS_ASSERTION(!reserved, "reserved should be 0");
|
||||
mDuration = reader->ReadU32();
|
||||
|
||||
mCreationTime = creationTime;
|
||||
mModificationTime = modificationTime;
|
||||
mDuration = duration;
|
||||
} else if (version == 1) {
|
||||
mCreationTime = reader->ReadU64();
|
||||
mModificationTime = reader->ReadU64();
|
||||
mTrackId = reader->ReadU32();
|
||||
uint32_t reserved = reader->ReadU32();
|
||||
uint32_t reserved;
|
||||
MOZ_TRY_VAR(mCreationTime, reader->ReadU64());
|
||||
MOZ_TRY_VAR(mModificationTime, reader->ReadU64());
|
||||
MOZ_TRY_VAR(mTrackId, reader->ReadU32());
|
||||
MOZ_TRY_VAR(reserved, reader->ReadU32());
|
||||
NS_ASSERTION(!reserved, "reserved should be 0");
|
||||
mDuration = reader->ReadU64();
|
||||
MOZ_TRY_VAR(mDuration, reader->ReadU64());
|
||||
}
|
||||
// We don't care about whatever else may be in the box.
|
||||
mValid = true;
|
||||
return Ok();
|
||||
}
|
||||
|
||||
Mvhd::Mvhd(Box& aBox)
|
||||
{
|
||||
mValid = Parse(aBox).isOk();
|
||||
if (!mValid) {
|
||||
LOG(Mvhd, "Parse failed");
|
||||
}
|
||||
}
|
||||
|
||||
Result<Ok, nsresult>
|
||||
Mvhd::Parse(Box& aBox)
|
||||
{
|
||||
BoxReader reader(aBox);
|
||||
if (!reader->CanReadType<uint32_t>()) {
|
||||
LOG(Mdhd, "Incomplete Box (missing flags)");
|
||||
return;
|
||||
}
|
||||
uint32_t flags = reader->ReadU32();
|
||||
|
||||
uint32_t flags;
|
||||
MOZ_TRY_VAR(flags, reader->ReadU32());
|
||||
uint8_t version = flags >> 24;
|
||||
size_t need =
|
||||
3*(version ? sizeof(int64_t) : sizeof(int32_t)) + sizeof(uint32_t);
|
||||
if (reader->Remaining() < need) {
|
||||
LOG(Mvhd, "Incomplete Box (have:%" PRIu64 " need:%" PRIu64 ")",
|
||||
(uint64_t)reader->Remaining(), (uint64_t)need);
|
||||
return;
|
||||
}
|
||||
|
||||
if (version == 0) {
|
||||
mCreationTime = reader->ReadU32();
|
||||
mModificationTime = reader->ReadU32();
|
||||
mTimescale = reader->ReadU32();
|
||||
mDuration = reader->ReadU32();
|
||||
uint32_t creationTime, modificationTime, duration;
|
||||
MOZ_TRY_VAR(creationTime, reader->ReadU32());
|
||||
MOZ_TRY_VAR(modificationTime, reader->ReadU32());
|
||||
MOZ_TRY_VAR(mTimescale, reader->ReadU32());
|
||||
MOZ_TRY_VAR(duration, reader->ReadU32());
|
||||
mCreationTime = creationTime;
|
||||
mModificationTime = modificationTime;
|
||||
mDuration = duration;
|
||||
} else if (version == 1) {
|
||||
mCreationTime = reader->ReadU64();
|
||||
mModificationTime = reader->ReadU64();
|
||||
mTimescale = reader->ReadU32();
|
||||
mDuration = reader->ReadU64();
|
||||
MOZ_TRY_VAR(mCreationTime, reader->ReadU64());
|
||||
MOZ_TRY_VAR(mModificationTime, reader->ReadU64());
|
||||
MOZ_TRY_VAR(mTimescale, reader->ReadU32());
|
||||
MOZ_TRY_VAR(mDuration, reader->ReadU64());
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
// We don't care about whatever else may be in the box.
|
||||
if (mTimescale) {
|
||||
mValid = true;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
return Ok();
|
||||
}
|
||||
|
||||
Mdhd::Mdhd(Box& aBox)
|
||||
|
@ -782,122 +788,131 @@ Mdhd::Mdhd(Box& aBox)
|
|||
|
||||
Trex::Trex(Box& aBox)
|
||||
{
|
||||
BoxReader reader(aBox);
|
||||
if (reader->Remaining() < 6*sizeof(uint32_t)) {
|
||||
LOG(Trex, "Incomplete Box (have:%" PRIu64 " need:%" PRIu64 ")",
|
||||
(uint64_t)reader->Remaining(), (uint64_t)6*sizeof(uint32_t));
|
||||
return;
|
||||
mValid = Parse(aBox).isOk();
|
||||
if (!mValid) {
|
||||
LOG(Trex, "Parse failed");
|
||||
}
|
||||
mFlags = reader->ReadU32();
|
||||
mTrackId = reader->ReadU32();
|
||||
mDefaultSampleDescriptionIndex = reader->ReadU32();
|
||||
mDefaultSampleDuration = reader->ReadU32();
|
||||
mDefaultSampleSize = reader->ReadU32();
|
||||
mDefaultSampleFlags = reader->ReadU32();
|
||||
mValid = true;
|
||||
}
|
||||
|
||||
Result<Ok, nsresult>
|
||||
Trex::Parse(Box& aBox)
|
||||
{
|
||||
BoxReader reader(aBox);
|
||||
|
||||
MOZ_TRY_VAR(mFlags, reader->ReadU32());
|
||||
MOZ_TRY_VAR(mTrackId, reader->ReadU32());
|
||||
MOZ_TRY_VAR(mDefaultSampleDescriptionIndex, reader->ReadU32());
|
||||
MOZ_TRY_VAR(mDefaultSampleDuration, reader->ReadU32());
|
||||
MOZ_TRY_VAR(mDefaultSampleSize, reader->ReadU32());
|
||||
MOZ_TRY_VAR(mDefaultSampleFlags, reader->ReadU32());
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
Tfhd::Tfhd(Box& aBox, Trex& aTrex)
|
||||
: Trex(aTrex)
|
||||
{
|
||||
mValid = Parse(aBox).isOk();
|
||||
if (!mValid) {
|
||||
LOG(Tfhd, "Parse failed");
|
||||
}
|
||||
}
|
||||
|
||||
Result<Ok, nsresult>
|
||||
Tfhd::Parse(Box& aBox)
|
||||
{
|
||||
MOZ_ASSERT(aBox.IsType("tfhd"));
|
||||
MOZ_ASSERT(aBox.Parent()->IsType("traf"));
|
||||
MOZ_ASSERT(aBox.Parent()->Parent()->IsType("moof"));
|
||||
|
||||
BoxReader reader(aBox);
|
||||
if (!reader->CanReadType<uint32_t>()) {
|
||||
LOG(Tfhd, "Incomplete Box (missing flags)");
|
||||
return;
|
||||
|
||||
MOZ_TRY_VAR(mFlags, reader->ReadU32());
|
||||
MOZ_TRY_VAR(mTrackId, reader->ReadU32());
|
||||
mBaseDataOffset = aBox.Parent()->Parent()->Offset();
|
||||
if (mFlags & 0x01) {
|
||||
MOZ_TRY_VAR(mBaseDataOffset, reader->ReadU64());
|
||||
}
|
||||
mFlags = reader->ReadU32();
|
||||
size_t need = sizeof(uint32_t) /* trackid */;
|
||||
uint8_t flag[] = { 1, 2, 8, 0x10, 0x20, 0 };
|
||||
uint8_t flagSize[] = { sizeof(uint64_t), sizeof(uint32_t), sizeof(uint32_t), sizeof(uint32_t), sizeof(uint32_t) };
|
||||
for (size_t i = 0; flag[i]; i++) {
|
||||
if (mFlags & flag[i]) {
|
||||
need += flagSize[i];
|
||||
}
|
||||
if (mFlags & 0x02) {
|
||||
MOZ_TRY_VAR(mDefaultSampleDescriptionIndex, reader->ReadU32());
|
||||
}
|
||||
if (reader->Remaining() < need) {
|
||||
LOG(Tfhd, "Incomplete Box (have:%" PRIu64 " need:%" PRIu64 ")",
|
||||
(uint64_t)reader->Remaining(), (uint64_t)need);
|
||||
return;
|
||||
}
|
||||
mTrackId = reader->ReadU32();
|
||||
mBaseDataOffset =
|
||||
mFlags & 1 ? reader->ReadU64() : aBox.Parent()->Parent()->Offset();
|
||||
if (mFlags & 2) {
|
||||
mDefaultSampleDescriptionIndex = reader->ReadU32();
|
||||
}
|
||||
if (mFlags & 8) {
|
||||
mDefaultSampleDuration = reader->ReadU32();
|
||||
if (mFlags & 0x08) {
|
||||
MOZ_TRY_VAR(mDefaultSampleDuration, reader->ReadU32());
|
||||
}
|
||||
if (mFlags & 0x10) {
|
||||
mDefaultSampleSize = reader->ReadU32();
|
||||
MOZ_TRY_VAR(mDefaultSampleSize, reader->ReadU32());
|
||||
}
|
||||
if (mFlags & 0x20) {
|
||||
mDefaultSampleFlags = reader->ReadU32();
|
||||
MOZ_TRY_VAR(mDefaultSampleFlags, reader->ReadU32());
|
||||
}
|
||||
mValid = true;
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
Tfdt::Tfdt(Box& aBox)
|
||||
{
|
||||
mValid = Parse(aBox).isOk();
|
||||
if (!mValid) {
|
||||
LOG(Tfdt, "Parse failed");
|
||||
}
|
||||
}
|
||||
|
||||
Result<Ok, nsresult>
|
||||
Tfdt::Parse(Box& aBox)
|
||||
{
|
||||
BoxReader reader(aBox);
|
||||
if (!reader->CanReadType<uint32_t>()) {
|
||||
LOG(Tfdt, "Incomplete Box (missing flags)");
|
||||
return;
|
||||
}
|
||||
uint32_t flags = reader->ReadU32();
|
||||
|
||||
uint32_t flags;
|
||||
MOZ_TRY_VAR(flags, reader->ReadU32());
|
||||
uint8_t version = flags >> 24;
|
||||
size_t need = version ? sizeof(uint64_t) : sizeof(uint32_t) ;
|
||||
if (reader->Remaining() < need) {
|
||||
LOG(Tfdt, "Incomplete Box (have:%" PRIu64 " need:%" PRIu64 ")",
|
||||
(uint64_t)reader->Remaining(), (uint64_t)need);
|
||||
return;
|
||||
}
|
||||
if (version == 0) {
|
||||
mBaseMediaDecodeTime = reader->ReadU32();
|
||||
uint32_t tmp;
|
||||
MOZ_TRY_VAR(tmp, reader->ReadU32());
|
||||
mBaseMediaDecodeTime = tmp;
|
||||
} else if (version == 1) {
|
||||
mBaseMediaDecodeTime = reader->ReadU64();
|
||||
MOZ_TRY_VAR(mBaseMediaDecodeTime, reader->ReadU64());
|
||||
}
|
||||
mValid = true;
|
||||
return Ok();
|
||||
}
|
||||
|
||||
Edts::Edts(Box& aBox)
|
||||
: mMediaStart(0)
|
||||
, mEmptyOffset(0)
|
||||
{
|
||||
mValid = Parse(aBox).isOk();
|
||||
if (!mValid) {
|
||||
LOG(Edts, "Parse failed");
|
||||
}
|
||||
}
|
||||
|
||||
Result<Ok, nsresult>
|
||||
Edts::Parse(Box& aBox)
|
||||
{
|
||||
Box child = aBox.FirstChild();
|
||||
if (!child.IsType("elst")) {
|
||||
return;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
BoxReader reader(child);
|
||||
if (!reader->CanReadType<uint32_t>()) {
|
||||
LOG(Edts, "Incomplete Box (missing flags)");
|
||||
return;
|
||||
}
|
||||
uint32_t flags = reader->ReadU32();
|
||||
uint32_t flags;
|
||||
MOZ_TRY_VAR(flags, reader->ReadU32());
|
||||
uint8_t version = flags >> 24;
|
||||
size_t need =
|
||||
sizeof(uint32_t) + 2*(version ? sizeof(int64_t) : sizeof(uint32_t));
|
||||
if (reader->Remaining() < need) {
|
||||
LOG(Edts, "Incomplete Box (have:%" PRIu64 " need:%" PRIu64 ")",
|
||||
(uint64_t)reader->Remaining(), (uint64_t)need);
|
||||
return;
|
||||
}
|
||||
bool emptyEntry = false;
|
||||
uint32_t entryCount = reader->ReadU32();
|
||||
uint32_t entryCount;
|
||||
MOZ_TRY_VAR(entryCount, reader->ReadU32());
|
||||
for (uint32_t i = 0; i < entryCount; i++) {
|
||||
uint64_t segment_duration;
|
||||
int64_t media_time;
|
||||
if (version == 1) {
|
||||
segment_duration = reader->ReadU64();
|
||||
media_time = reader->Read64();
|
||||
MOZ_TRY_VAR(segment_duration, reader->ReadU64());
|
||||
MOZ_TRY_VAR(media_time, reader->Read64());
|
||||
} else {
|
||||
segment_duration = reader->ReadU32();
|
||||
media_time = reader->Read32();
|
||||
uint32_t tmp;
|
||||
MOZ_TRY_VAR(tmp, reader->ReadU32());
|
||||
segment_duration = tmp;
|
||||
int32_t tmp2;
|
||||
MOZ_TRY_VAR(tmp2, reader->Read32());
|
||||
media_time = tmp2;
|
||||
}
|
||||
if (media_time == -1 && i) {
|
||||
LOG(Edts, "Multiple empty edit, not handled");
|
||||
|
@ -910,235 +925,230 @@ Edts::Edts(Box& aBox)
|
|||
} else {
|
||||
mMediaStart = media_time;
|
||||
}
|
||||
reader->ReadU32(); // media_rate_integer and media_rate_fraction
|
||||
MOZ_TRY(reader->ReadU32()); // media_rate_integer and media_rate_fraction
|
||||
}
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
Saiz::Saiz(Box& aBox, AtomType aDefaultType)
|
||||
: mAuxInfoType(aDefaultType)
|
||||
, mAuxInfoTypeParameter(0)
|
||||
{
|
||||
mValid = Parse(aBox).isOk();
|
||||
if (!mValid) {
|
||||
LOG(Saiz, "Parse failed");
|
||||
}
|
||||
}
|
||||
|
||||
Result<Ok, nsresult>
|
||||
Saiz::Parse(Box& aBox)
|
||||
{
|
||||
BoxReader reader(aBox);
|
||||
if (!reader->CanReadType<uint32_t>()) {
|
||||
LOG(Saiz, "Incomplete Box (missing flags)");
|
||||
return;
|
||||
}
|
||||
uint32_t flags = reader->ReadU32();
|
||||
|
||||
uint32_t flags;
|
||||
MOZ_TRY_VAR(flags, reader->ReadU32());
|
||||
uint8_t version = flags >> 24;
|
||||
size_t need =
|
||||
((flags & 1) ? 2*sizeof(uint32_t) : 0) + sizeof(uint8_t) + sizeof(uint32_t);
|
||||
if (reader->Remaining() < need) {
|
||||
LOG(Saiz, "Incomplete Box (have:%" PRIu64 " need:%" PRIu64 ")",
|
||||
(uint64_t)reader->Remaining(), (uint64_t)need);
|
||||
return;
|
||||
}
|
||||
if (flags & 1) {
|
||||
mAuxInfoType = reader->ReadU32();
|
||||
mAuxInfoTypeParameter = reader->ReadU32();
|
||||
MOZ_TRY_VAR(mAuxInfoType, reader->ReadU32());
|
||||
MOZ_TRY_VAR(mAuxInfoTypeParameter, reader->ReadU32());
|
||||
}
|
||||
uint8_t defaultSampleInfoSize = reader->ReadU8();
|
||||
uint32_t count = reader->ReadU32();
|
||||
uint8_t defaultSampleInfoSize;
|
||||
MOZ_TRY_VAR(defaultSampleInfoSize, reader->ReadU8());
|
||||
uint32_t count;
|
||||
MOZ_TRY_VAR(count, reader->ReadU32());
|
||||
if (defaultSampleInfoSize) {
|
||||
if (!mSampleInfoSize.SetLength(count, fallible)) {
|
||||
LOG(Saiz, "OOM");
|
||||
return;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
memset(mSampleInfoSize.Elements(), defaultSampleInfoSize, mSampleInfoSize.Length());
|
||||
} else {
|
||||
if (!reader->ReadArray(mSampleInfoSize, count)) {
|
||||
LOG(Saiz, "Incomplete Box (OOM or missing count:%u)", count);
|
||||
return;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
}
|
||||
mValid = true;
|
||||
return Ok();
|
||||
}
|
||||
|
||||
Saio::Saio(Box& aBox, AtomType aDefaultType)
|
||||
: mAuxInfoType(aDefaultType)
|
||||
, mAuxInfoTypeParameter(0)
|
||||
{
|
||||
mValid = Parse(aBox).isOk();
|
||||
if (!mValid) {
|
||||
LOG(Saio, "Parse failed");
|
||||
}
|
||||
}
|
||||
|
||||
Result<Ok, nsresult>
|
||||
Saio::Parse(Box& aBox)
|
||||
{
|
||||
BoxReader reader(aBox);
|
||||
if (!reader->CanReadType<uint32_t>()) {
|
||||
LOG(Saio, "Incomplete Box (missing flags)");
|
||||
return;
|
||||
}
|
||||
uint32_t flags = reader->ReadU32();
|
||||
|
||||
uint32_t flags;
|
||||
MOZ_TRY_VAR(flags, reader->ReadU32());
|
||||
uint8_t version = flags >> 24;
|
||||
size_t need = ((flags & 1) ? (2*sizeof(uint32_t)) : 0) + sizeof(uint32_t);
|
||||
if (reader->Remaining() < need) {
|
||||
LOG(Saio, "Incomplete Box (have:%" PRIu64 " need:%" PRIu64 ")",
|
||||
(uint64_t)reader->Remaining(), (uint64_t)need);
|
||||
return;
|
||||
}
|
||||
if (flags & 1) {
|
||||
mAuxInfoType = reader->ReadU32();
|
||||
mAuxInfoTypeParameter = reader->ReadU32();
|
||||
}
|
||||
size_t count = reader->ReadU32();
|
||||
need = (version ? sizeof(uint64_t) : sizeof(uint32_t)) * count;
|
||||
if (reader->Remaining() < need) {
|
||||
LOG(Saio, "Incomplete Box (have:%" PRIu64 " need:%" PRIu64 ")",
|
||||
(uint64_t)reader->Remaining(), (uint64_t)need);
|
||||
return;
|
||||
MOZ_TRY_VAR(mAuxInfoType, reader->ReadU32());
|
||||
MOZ_TRY_VAR(mAuxInfoTypeParameter, reader->ReadU32());
|
||||
}
|
||||
|
||||
size_t count;
|
||||
MOZ_TRY_VAR(count, reader->ReadU32());
|
||||
if (!mOffsets.SetCapacity(count, fallible)) {
|
||||
LOG(Saiz, "OOM");
|
||||
return;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
if (version == 0) {
|
||||
uint32_t offset;
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
MOZ_ALWAYS_TRUE(mOffsets.AppendElement(reader->ReadU32(), fallible));
|
||||
MOZ_TRY_VAR(offset, reader->ReadU32());
|
||||
MOZ_ALWAYS_TRUE(mOffsets.AppendElement(offset, fallible));
|
||||
}
|
||||
} else {
|
||||
uint64_t offset;
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
MOZ_ALWAYS_TRUE(mOffsets.AppendElement(reader->ReadU64(), fallible));
|
||||
MOZ_TRY_VAR(offset, reader->ReadU64());
|
||||
MOZ_ALWAYS_TRUE(mOffsets.AppendElement(offset, fallible));
|
||||
}
|
||||
}
|
||||
mValid = true;
|
||||
return Ok();
|
||||
}
|
||||
|
||||
Sbgp::Sbgp(Box& aBox)
|
||||
{
|
||||
mValid = Parse(aBox).isOk();
|
||||
if (!mValid) {
|
||||
LOG(Sbgp, "Parse failed");
|
||||
}
|
||||
}
|
||||
|
||||
Result<Ok, nsresult>
|
||||
Sbgp::Parse(Box& aBox)
|
||||
{
|
||||
BoxReader reader(aBox);
|
||||
|
||||
if (!reader->CanReadType<uint32_t>()) {
|
||||
LOG(Sbgp, "Incomplete Box (missing flags)");
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t flags = reader->ReadU32();
|
||||
uint32_t flags;
|
||||
MOZ_TRY_VAR(flags, reader->ReadU32());
|
||||
const uint8_t version = flags >> 24;
|
||||
flags = flags & 0xffffff;
|
||||
|
||||
// Make sure we have enough bytes to read as far as the count.
|
||||
uint32_t need = (version == 1 ? sizeof(uint32_t) : 0) + sizeof(uint32_t) * 2;
|
||||
if (reader->Remaining() < need) {
|
||||
LOG(Sbgp, "Incomplete Box (have:%" PRIu64 ", need:%" PRIu64 ")",
|
||||
(uint64_t)reader->Remaining(), (uint64_t)need);
|
||||
return;
|
||||
}
|
||||
|
||||
mGroupingType = reader->ReadU32();
|
||||
uint32_t type;
|
||||
MOZ_TRY_VAR(type, reader->ReadU32());
|
||||
mGroupingType = type;
|
||||
|
||||
if (version == 1) {
|
||||
mGroupingTypeParam = reader->Read32();
|
||||
MOZ_TRY_VAR(mGroupingTypeParam, reader->ReadU32());
|
||||
}
|
||||
|
||||
uint32_t count = reader->ReadU32();
|
||||
|
||||
// Make sure we can read all the entries.
|
||||
need = sizeof(uint32_t) * 2 * count;
|
||||
if (reader->Remaining() < need) {
|
||||
LOG(Sbgp, "Incomplete Box (have:%" PRIu64 ", need:%" PRIu64 "). Failed to read entries",
|
||||
(uint64_t)reader->Remaining(), (uint64_t)need);
|
||||
return;
|
||||
}
|
||||
uint32_t count;
|
||||
MOZ_TRY_VAR(count, reader->ReadU32());
|
||||
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
uint32_t sampleCount = reader->ReadU32();
|
||||
uint32_t groupDescriptionIndex = reader->ReadU32();
|
||||
uint32_t sampleCount;
|
||||
MOZ_TRY_VAR(sampleCount, reader->ReadU32());
|
||||
uint32_t groupDescriptionIndex;
|
||||
MOZ_TRY_VAR(groupDescriptionIndex, reader->ReadU32());
|
||||
|
||||
SampleToGroupEntry entry(sampleCount, groupDescriptionIndex);
|
||||
if (!mEntries.AppendElement(entry, mozilla::fallible)) {
|
||||
LOG(Sbgp, "OOM");
|
||||
return;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
mValid = true;
|
||||
return Ok();
|
||||
}
|
||||
|
||||
Sgpd::Sgpd(Box& aBox)
|
||||
{
|
||||
mValid = Parse(aBox).isOk();
|
||||
if (!mValid) {
|
||||
LOG(Sgpd, "Parse failed");
|
||||
}
|
||||
}
|
||||
|
||||
Result<Ok, nsresult>
|
||||
Sgpd::Parse(Box& aBox)
|
||||
{
|
||||
BoxReader reader(aBox);
|
||||
|
||||
if (!reader->CanReadType<uint32_t>()) {
|
||||
LOG(Sgpd, "Incomplete Box (missing flags)");
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t flags = reader->ReadU32();
|
||||
uint32_t flags;
|
||||
MOZ_TRY_VAR(flags, reader->ReadU32());
|
||||
const uint8_t version = flags >> 24;
|
||||
flags = flags & 0xffffff;
|
||||
|
||||
uint32_t need = ((flags & 1) ? sizeof(uint32_t) : 0) + sizeof(uint32_t) * 2;
|
||||
if (reader->Remaining() < need) {
|
||||
LOG(Sgpd, "Incomplete Box (have:%" PRIu64 " need:%" PRIu64 ")",
|
||||
(uint64_t)reader->Remaining(), (uint64_t)need);
|
||||
return;
|
||||
}
|
||||
|
||||
mGroupingType = reader->ReadU32();
|
||||
uint32_t type;
|
||||
MOZ_TRY_VAR(type, reader->ReadU32());
|
||||
mGroupingType = type;
|
||||
|
||||
const uint32_t entrySize = sizeof(uint32_t) + kKeyIdSize;
|
||||
uint32_t defaultLength = 0;
|
||||
|
||||
if (version == 1) {
|
||||
defaultLength = reader->ReadU32();
|
||||
MOZ_TRY_VAR(defaultLength, reader->ReadU32());
|
||||
if (defaultLength < entrySize && defaultLength != 0) {
|
||||
return;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t count = reader->ReadU32();
|
||||
uint32_t count;
|
||||
MOZ_TRY_VAR(count, reader->ReadU32());
|
||||
|
||||
// Make sure we have sufficient remaining bytes to read the entries.
|
||||
need =
|
||||
count * (sizeof(uint32_t) * (version == 1 && defaultLength == 0 ? 2 : 1) +
|
||||
kKeyIdSize * sizeof(uint8_t));
|
||||
if (reader->Remaining() < need) {
|
||||
LOG(Sgpd, "Incomplete Box (have:%" PRIu64 " need:%" PRIu64 "). Failed to read entries",
|
||||
(uint64_t)reader->Remaining(), (uint64_t)need);
|
||||
return;
|
||||
}
|
||||
for (uint32_t i = 0; i < count; ++i) {
|
||||
if (version == 1 && defaultLength == 0) {
|
||||
uint32_t descriptionLength = reader->ReadU32();
|
||||
uint32_t descriptionLength;
|
||||
MOZ_TRY_VAR(descriptionLength, reader->ReadU32());
|
||||
if (descriptionLength < entrySize) {
|
||||
return;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
CencSampleEncryptionInfoEntry entry;
|
||||
bool valid = entry.Init(reader);
|
||||
bool valid = entry.Init(reader).isOk();
|
||||
if (!valid) {
|
||||
return;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
if (!mEntries.AppendElement(entry, mozilla::fallible)) {
|
||||
LOG(Sgpd, "OOM");
|
||||
return;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
mValid = true;
|
||||
return Ok();
|
||||
}
|
||||
|
||||
bool CencSampleEncryptionInfoEntry::Init(BoxReader& aReader)
|
||||
Result<Ok, nsresult>
|
||||
CencSampleEncryptionInfoEntry::Init(BoxReader& aReader)
|
||||
{
|
||||
// Skip a reserved byte.
|
||||
aReader->ReadU8();
|
||||
MOZ_TRY(aReader->ReadU8());
|
||||
|
||||
uint8_t possiblePatternInfo = aReader->ReadU8();
|
||||
uint8_t flag = aReader->ReadU8();
|
||||
uint8_t possiblePatternInfo;
|
||||
MOZ_TRY_VAR(possiblePatternInfo, aReader->ReadU8());
|
||||
uint8_t flag;
|
||||
MOZ_TRY_VAR(flag, aReader->ReadU8());
|
||||
|
||||
mIVSize = aReader->ReadU8();
|
||||
MOZ_TRY_VAR(mIVSize, aReader->ReadU8());
|
||||
|
||||
// Read the key id.
|
||||
uint8_t key;
|
||||
for (uint32_t i = 0; i < kKeyIdSize; ++i) {
|
||||
mKeyId.AppendElement(aReader->ReadU8());
|
||||
MOZ_TRY_VAR(key, aReader->ReadU8());
|
||||
mKeyId.AppendElement(key);
|
||||
}
|
||||
|
||||
mIsEncrypted = flag != 0;
|
||||
|
||||
if (mIsEncrypted) {
|
||||
if (mIVSize != 8 && mIVSize != 16) {
|
||||
return false;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
} else if (mIVSize != 0) {
|
||||
return false;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
return true;
|
||||
return Ok();
|
||||
}
|
||||
|
||||
#undef LOG
|
||||
|
|
|
@ -24,50 +24,54 @@ SinfParser::SinfParser(Box& aBox)
|
|||
{
|
||||
for (Box box = aBox.FirstChild(); box.IsAvailable(); box = box.Next()) {
|
||||
if (box.IsType("schm")) {
|
||||
ParseSchm(box);
|
||||
mozilla::Unused << ParseSchm(box);
|
||||
} else if (box.IsType("schi")) {
|
||||
ParseSchi(box);
|
||||
mozilla::Unused << ParseSchi(box);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Result<Ok, nsresult>
|
||||
SinfParser::ParseSchm(Box& aBox)
|
||||
{
|
||||
BoxReader reader(aBox);
|
||||
|
||||
if (reader->Remaining() < 8) {
|
||||
return;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
mozilla::Unused << reader->ReadU32(); // flags -- ignore
|
||||
mSinf.mDefaultEncryptionType = reader->ReadU32();
|
||||
MOZ_TRY(reader->ReadU32()); // flags -- ignore
|
||||
MOZ_TRY_VAR(mSinf.mDefaultEncryptionType, reader->ReadU32());
|
||||
return Ok();
|
||||
}
|
||||
|
||||
void
|
||||
Result<Ok, nsresult>
|
||||
SinfParser::ParseSchi(Box& aBox)
|
||||
{
|
||||
for (Box box = aBox.FirstChild(); box.IsAvailable(); box = box.Next()) {
|
||||
if (box.IsType("tenc")) {
|
||||
ParseTenc(box);
|
||||
if (box.IsType("tenc") && ParseTenc(box).isErr()) {
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
}
|
||||
return Ok();
|
||||
}
|
||||
|
||||
void
|
||||
Result<Ok, nsresult>
|
||||
SinfParser::ParseTenc(Box& aBox)
|
||||
{
|
||||
BoxReader reader(aBox);
|
||||
|
||||
if (reader->Remaining() < 24) {
|
||||
return;
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
mozilla::Unused << reader->ReadU32(); // flags -- ignore
|
||||
MOZ_TRY(reader->ReadU32()); // flags -- ignore
|
||||
|
||||
uint32_t isEncrypted = reader->ReadU24();
|
||||
mSinf.mDefaultIVSize = reader->ReadU8();
|
||||
uint32_t isEncrypted;
|
||||
MOZ_TRY_VAR(isEncrypted, reader->ReadU24());
|
||||
MOZ_TRY_VAR(mSinf.mDefaultIVSize, reader->ReadU8());
|
||||
memcpy(mSinf.mDefaultKeyID, reader->Read(16), 16);
|
||||
return Ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "MediaResource.h"
|
||||
#include "mozilla/EndianUtils.h"
|
||||
#include "mp4_demuxer/AtomType.h"
|
||||
#include "mp4_demuxer/ByteReader.h"
|
||||
#include "mp4_demuxer/BufferReader.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
@ -75,11 +75,11 @@ public:
|
|||
, mReader(mBuffer.Elements(), mBuffer.Length())
|
||||
{
|
||||
}
|
||||
ByteReader* operator->() { return &mReader; }
|
||||
BufferReader* operator->() { return &mReader; }
|
||||
|
||||
private:
|
||||
nsTArray<uint8_t> mBuffer;
|
||||
ByteReader mReader;
|
||||
BufferReader mReader;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,345 @@
|
|||
/* 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 BUFFER_READER_H_
|
||||
#define BUFFER_READER_H_
|
||||
|
||||
#include "mozilla/EndianUtils.h"
|
||||
#include "nscore.h"
|
||||
#include "nsTArray.h"
|
||||
#include "MediaData.h"
|
||||
#include "mozilla/Result.h"
|
||||
|
||||
namespace mp4_demuxer {
|
||||
|
||||
class MOZ_RAII BufferReader
|
||||
{
|
||||
public:
|
||||
BufferReader() : mPtr(nullptr), mRemaining(0) {}
|
||||
BufferReader(const uint8_t* aData, size_t aSize)
|
||||
: mPtr(aData), mRemaining(aSize), mLength(aSize)
|
||||
{
|
||||
}
|
||||
template<size_t S>
|
||||
explicit BufferReader(const AutoTArray<uint8_t, S>& aData)
|
||||
: mPtr(aData.Elements()), mRemaining(aData.Length()), mLength(aData.Length())
|
||||
{
|
||||
}
|
||||
explicit BufferReader(const nsTArray<uint8_t>& aData)
|
||||
: mPtr(aData.Elements()), mRemaining(aData.Length()), mLength(aData.Length())
|
||||
{
|
||||
}
|
||||
explicit BufferReader(const mozilla::MediaByteBuffer* aData)
|
||||
: mPtr(aData->Elements()), mRemaining(aData->Length()), mLength(aData->Length())
|
||||
{
|
||||
}
|
||||
|
||||
void SetData(const nsTArray<uint8_t>& aData)
|
||||
{
|
||||
MOZ_ASSERT(!mPtr && !mRemaining);
|
||||
mPtr = aData.Elements();
|
||||
mRemaining = aData.Length();
|
||||
mLength = mRemaining;
|
||||
}
|
||||
|
||||
~BufferReader()
|
||||
{}
|
||||
|
||||
size_t Offset() const
|
||||
{
|
||||
return mLength - mRemaining;
|
||||
}
|
||||
|
||||
size_t Remaining() const { return mRemaining; }
|
||||
|
||||
Result<uint8_t, nsresult> ReadU8()
|
||||
{
|
||||
auto ptr = Read(1);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to read data");
|
||||
return mozilla::Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
Result<uint16_t, nsresult> ReadU16()
|
||||
{
|
||||
auto ptr = Read(2);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to read data");
|
||||
return mozilla::Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
return mozilla::BigEndian::readUint16(ptr);
|
||||
}
|
||||
|
||||
Result<int16_t, nsresult> ReadLE16()
|
||||
{
|
||||
auto ptr = Read(2);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to read data");
|
||||
return mozilla::Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
return mozilla::LittleEndian::readInt16(ptr);
|
||||
}
|
||||
|
||||
Result<uint32_t, nsresult> ReadU24()
|
||||
{
|
||||
auto ptr = Read(3);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to read data");
|
||||
return mozilla::Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
return ptr[0] << 16 | ptr[1] << 8 | ptr[2];
|
||||
}
|
||||
|
||||
Result<int32_t, nsresult> Read24()
|
||||
{
|
||||
auto res = ReadU24();
|
||||
if (res.isErr()) {
|
||||
return mozilla::Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
return (int32_t)res.unwrap();
|
||||
}
|
||||
|
||||
Result<int32_t, nsresult> ReadLE24()
|
||||
{
|
||||
auto ptr = Read(3);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to read data");
|
||||
return mozilla::Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
int32_t result = int32_t(ptr[2] << 16 | ptr[1] << 8 | ptr[0]);
|
||||
if (result & 0x00800000u) {
|
||||
result -= 0x1000000;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Result<uint32_t, nsresult> ReadU32()
|
||||
{
|
||||
auto ptr = Read(4);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to read data");
|
||||
return mozilla::Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
return mozilla::BigEndian::readUint32(ptr);
|
||||
}
|
||||
|
||||
Result<int32_t, nsresult> Read32()
|
||||
{
|
||||
auto ptr = Read(4);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to read data");
|
||||
return mozilla::Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
return mozilla::BigEndian::readInt32(ptr);
|
||||
}
|
||||
|
||||
Result<uint64_t, nsresult> ReadU64()
|
||||
{
|
||||
auto ptr = Read(8);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to read data");
|
||||
return mozilla::Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
return mozilla::BigEndian::readUint64(ptr);
|
||||
}
|
||||
|
||||
Result<int64_t, nsresult> Read64()
|
||||
{
|
||||
auto ptr = Read(8);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to read data");
|
||||
return mozilla::Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
return mozilla::BigEndian::readInt64(ptr);
|
||||
}
|
||||
|
||||
const uint8_t* Read(size_t aCount)
|
||||
{
|
||||
if (aCount > mRemaining) {
|
||||
mRemaining = 0;
|
||||
return nullptr;
|
||||
}
|
||||
mRemaining -= aCount;
|
||||
|
||||
const uint8_t* result = mPtr;
|
||||
mPtr += aCount;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
const uint8_t* Rewind(size_t aCount)
|
||||
{
|
||||
MOZ_ASSERT(aCount <= Offset());
|
||||
size_t rewind = Offset();
|
||||
if (aCount < rewind) {
|
||||
rewind = aCount;
|
||||
}
|
||||
mRemaining += rewind;
|
||||
mPtr -= rewind;
|
||||
return mPtr;
|
||||
}
|
||||
|
||||
uint8_t PeekU8() const
|
||||
{
|
||||
auto ptr = Peek(1);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to peek data");
|
||||
return 0;
|
||||
}
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
uint16_t PeekU16() const
|
||||
{
|
||||
auto ptr = Peek(2);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to peek data");
|
||||
return 0;
|
||||
}
|
||||
return mozilla::BigEndian::readUint16(ptr);
|
||||
}
|
||||
|
||||
uint32_t PeekU24() const
|
||||
{
|
||||
auto ptr = Peek(3);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to peek data");
|
||||
return 0;
|
||||
}
|
||||
return ptr[0] << 16 | ptr[1] << 8 | ptr[2];
|
||||
}
|
||||
|
||||
uint32_t Peek24() const
|
||||
{
|
||||
return (uint32_t)PeekU24();
|
||||
}
|
||||
|
||||
uint32_t PeekU32() const
|
||||
{
|
||||
auto ptr = Peek(4);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to peek data");
|
||||
return 0;
|
||||
}
|
||||
return mozilla::BigEndian::readUint32(ptr);
|
||||
}
|
||||
|
||||
int32_t Peek32() const
|
||||
{
|
||||
auto ptr = Peek(4);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to peek data");
|
||||
return 0;
|
||||
}
|
||||
return mozilla::BigEndian::readInt32(ptr);
|
||||
}
|
||||
|
||||
uint64_t PeekU64() const
|
||||
{
|
||||
auto ptr = Peek(8);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to peek data");
|
||||
return 0;
|
||||
}
|
||||
return mozilla::BigEndian::readUint64(ptr);
|
||||
}
|
||||
|
||||
int64_t Peek64() const
|
||||
{
|
||||
auto ptr = Peek(8);
|
||||
if (!ptr) {
|
||||
NS_WARNING("Failed to peek data");
|
||||
return 0;
|
||||
}
|
||||
return mozilla::BigEndian::readInt64(ptr);
|
||||
}
|
||||
|
||||
const uint8_t* Peek(size_t aCount) const
|
||||
{
|
||||
if (aCount > mRemaining) {
|
||||
return nullptr;
|
||||
}
|
||||
return mPtr;
|
||||
}
|
||||
|
||||
const uint8_t* Seek(size_t aOffset)
|
||||
{
|
||||
if (aOffset >= mLength) {
|
||||
NS_WARNING("Seek failed");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
mPtr = mPtr - Offset() + aOffset;
|
||||
mRemaining = mLength - aOffset;
|
||||
return mPtr;
|
||||
}
|
||||
|
||||
const uint8_t* Reset()
|
||||
{
|
||||
mPtr -= Offset();
|
||||
mRemaining = mLength;
|
||||
return mPtr;
|
||||
}
|
||||
|
||||
uint32_t Align() const
|
||||
{
|
||||
return 4 - ((intptr_t)mPtr & 3);
|
||||
}
|
||||
|
||||
template <typename T> bool CanReadType() const { return mRemaining >= sizeof(T); }
|
||||
|
||||
template <typename T> T ReadType()
|
||||
{
|
||||
auto ptr = Read(sizeof(T));
|
||||
if (!ptr) {
|
||||
NS_WARNING("ReadType failed");
|
||||
return 0;
|
||||
}
|
||||
return *reinterpret_cast<const T*>(ptr);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
MOZ_MUST_USE bool ReadArray(nsTArray<T>& aDest, size_t aLength)
|
||||
{
|
||||
auto ptr = Read(aLength * sizeof(T));
|
||||
if (!ptr) {
|
||||
NS_WARNING("ReadArray failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
aDest.Clear();
|
||||
aDest.AppendElements(reinterpret_cast<const T*>(ptr), aLength);
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
MOZ_MUST_USE bool ReadArray(FallibleTArray<T>& aDest, size_t aLength)
|
||||
{
|
||||
auto ptr = Read(aLength * sizeof(T));
|
||||
if (!ptr) {
|
||||
NS_WARNING("ReadArray failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
aDest.Clear();
|
||||
if (!aDest.SetCapacity(aLength, mozilla::fallible)) {
|
||||
return false;
|
||||
}
|
||||
MOZ_ALWAYS_TRUE(aDest.AppendElements(reinterpret_cast<const T*>(ptr),
|
||||
aLength,
|
||||
mozilla::fallible));
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
const uint8_t* mPtr;
|
||||
size_t mRemaining;
|
||||
size_t mLength;
|
||||
};
|
||||
|
||||
} // namespace mp4_demuxer
|
||||
|
||||
#endif
|
|
@ -5,6 +5,7 @@
|
|||
#ifndef MOOF_PARSER_H_
|
||||
#define MOOF_PARSER_H_
|
||||
|
||||
#include "mozilla/ResultExtensions.h"
|
||||
#include "mp4_demuxer/Atom.h"
|
||||
#include "mp4_demuxer/AtomType.h"
|
||||
#include "mp4_demuxer/SinfParser.h"
|
||||
|
@ -43,6 +44,9 @@ public:
|
|||
uint64_t mModificationTime;
|
||||
uint32_t mTimescale;
|
||||
uint64_t mDuration;
|
||||
|
||||
protected:
|
||||
Result<Ok, nsresult> Parse(Box& aBox);
|
||||
};
|
||||
|
||||
class Tkhd : public Mvhd
|
||||
|
@ -55,6 +59,9 @@ public:
|
|||
explicit Tkhd(Box& aBox);
|
||||
|
||||
uint32_t mTrackId;
|
||||
|
||||
protected:
|
||||
Result<Ok, nsresult> Parse(Box& aBox);
|
||||
};
|
||||
|
||||
class Mdhd : public Mvhd
|
||||
|
@ -85,6 +92,9 @@ public:
|
|||
uint32_t mDefaultSampleDuration;
|
||||
uint32_t mDefaultSampleSize;
|
||||
uint32_t mDefaultSampleFlags;
|
||||
|
||||
protected:
|
||||
Result<Ok, nsresult> Parse(Box& aBox);
|
||||
};
|
||||
|
||||
class Tfhd : public Trex
|
||||
|
@ -99,6 +109,9 @@ public:
|
|||
Tfhd(Box& aBox, Trex& aTrex);
|
||||
|
||||
uint64_t mBaseDataOffset;
|
||||
|
||||
protected:
|
||||
Result<Ok, nsresult> Parse(Box& aBox);
|
||||
};
|
||||
|
||||
class Tfdt : public Atom
|
||||
|
@ -111,6 +124,9 @@ public:
|
|||
explicit Tfdt(Box& aBox);
|
||||
|
||||
uint64_t mBaseMediaDecodeTime;
|
||||
|
||||
protected:
|
||||
Result<Ok, nsresult> Parse(Box& aBox);
|
||||
};
|
||||
|
||||
class Edts : public Atom
|
||||
|
@ -130,6 +146,9 @@ public:
|
|||
|
||||
int64_t mMediaStart;
|
||||
int64_t mEmptyOffset;
|
||||
|
||||
protected:
|
||||
Result<Ok, nsresult> Parse(Box& aBox);
|
||||
};
|
||||
|
||||
struct Sample
|
||||
|
@ -149,6 +168,9 @@ public:
|
|||
AtomType mAuxInfoType;
|
||||
uint32_t mAuxInfoTypeParameter;
|
||||
FallibleTArray<uint8_t> mSampleInfoSize;
|
||||
|
||||
protected:
|
||||
Result<Ok, nsresult> Parse(Box& aBox);
|
||||
};
|
||||
|
||||
class Saio final : public Atom
|
||||
|
@ -159,6 +181,9 @@ public:
|
|||
AtomType mAuxInfoType;
|
||||
uint32_t mAuxInfoTypeParameter;
|
||||
FallibleTArray<uint64_t> mOffsets;
|
||||
|
||||
protected:
|
||||
Result<Ok, nsresult> Parse(Box& aBox);
|
||||
};
|
||||
|
||||
struct SampleToGroupEntry
|
||||
|
@ -185,6 +210,9 @@ public:
|
|||
AtomType mGroupingType;
|
||||
uint32_t mGroupingTypeParam;
|
||||
FallibleTArray<SampleToGroupEntry> mEntries;
|
||||
|
||||
protected:
|
||||
Result<Ok, nsresult> Parse(Box& aBox);
|
||||
};
|
||||
|
||||
struct CencSampleEncryptionInfoEntry final
|
||||
|
@ -192,7 +220,7 @@ struct CencSampleEncryptionInfoEntry final
|
|||
public:
|
||||
CencSampleEncryptionInfoEntry() { }
|
||||
|
||||
bool Init(BoxReader& aReader);
|
||||
Result<Ok, nsresult> Init(BoxReader& aReader);
|
||||
|
||||
bool mIsEncrypted = false;
|
||||
uint8_t mIVSize = 0;
|
||||
|
@ -206,6 +234,9 @@ public:
|
|||
|
||||
AtomType mGroupingType;
|
||||
FallibleTArray<CencSampleEncryptionInfoEntry> mEntries;
|
||||
|
||||
protected:
|
||||
Result<Ok, nsresult> Parse(Box& aBox);
|
||||
};
|
||||
|
||||
class AuxInfo {
|
||||
|
@ -241,7 +272,7 @@ private:
|
|||
// aDecodeTime is updated to the end of the parsed TRAF on return.
|
||||
void ParseTraf(Box& aBox, Trex& aTrex, Mvhd& aMvhd, Mdhd& aMdhd, Edts& aEdts, Sinf& aSinf, uint64_t* aDecodeTime, bool aIsAudio);
|
||||
// aDecodeTime is updated to the end of the parsed TRUN on return.
|
||||
bool ParseTrun(Box& aBox, Tfhd& aTfhd, Mvhd& aMvhd, Mdhd& aMdhd, Edts& aEdts, uint64_t* aDecodeTime, bool aIsAudio);
|
||||
Result<Ok, nsresult> ParseTrun(Box& aBox, Tfhd& aTfhd, Mvhd& aMvhd, Mdhd& aMdhd, Edts& aEdts, uint64_t* aDecodeTime, bool aIsAudio);
|
||||
void ParseSaiz(Box& aBox);
|
||||
void ParseSaio(Box& aBox);
|
||||
bool ProcessCenc();
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#ifndef SINF_PARSER_H_
|
||||
#define SINF_PARSER_H_
|
||||
|
||||
#include "mozilla/ResultExtensions.h"
|
||||
#include "mp4_demuxer/Atom.h"
|
||||
#include "mp4_demuxer/AtomType.h"
|
||||
|
||||
|
@ -39,9 +40,9 @@ public:
|
|||
|
||||
Sinf& GetSinf() { return mSinf; }
|
||||
private:
|
||||
void ParseSchm(Box& aBox);
|
||||
void ParseSchi(Box& aBox);
|
||||
void ParseTenc(Box& aBox);
|
||||
Result<Ok, nsresult> ParseSchm(Box& aBox);
|
||||
Result<Ok, nsresult> ParseSchi(Box& aBox);
|
||||
Result<Ok, nsresult> ParseTenc(Box& aBox);
|
||||
|
||||
Sinf mSinf;
|
||||
};
|
||||
|
|
|
@ -59,6 +59,7 @@ EXPORTS.mp4_demuxer += [
|
|||
'binding/include/mp4_demuxer/Atom.h',
|
||||
'binding/include/mp4_demuxer/AtomType.h',
|
||||
'binding/include/mp4_demuxer/BitReader.h',
|
||||
'binding/include/mp4_demuxer/BufferReader.h',
|
||||
'binding/include/mp4_demuxer/BufferStream.h',
|
||||
'binding/include/mp4_demuxer/ByteReader.h',
|
||||
'binding/include/mp4_demuxer/ByteWriter.h',
|
||||
|
|
|
@ -1672,7 +1672,12 @@ WebrtcVideoConduit::SelectBitrates(
|
|||
if (mStartBitrate && mStartBitrate > out_start) {
|
||||
out_start = mStartBitrate;
|
||||
}
|
||||
out_start = std::max(out_start, out_min);
|
||||
|
||||
// Ensure that min <= start <= max
|
||||
if (out_min > out_max) {
|
||||
out_min = out_max;
|
||||
}
|
||||
out_start = std::min(out_max, std::max(out_start, out_min));
|
||||
|
||||
MOZ_ASSERT(mPrefMaxBitrate == 0 || out_max <= mPrefMaxBitrate);
|
||||
}
|
||||
|
|
|
@ -505,27 +505,34 @@ static size_t recycled_size;
|
|||
* places, because they require malloc()ed memory, which causes bootstrapping
|
||||
* issues in some cases.
|
||||
*/
|
||||
struct Mutex
|
||||
{
|
||||
#if defined(XP_WIN)
|
||||
#define malloc_mutex_t CRITICAL_SECTION
|
||||
CRITICAL_SECTION mMutex;
|
||||
#elif defined(XP_DARWIN)
|
||||
struct malloc_mutex_t {
|
||||
OSSpinLock lock;
|
||||
};
|
||||
OSSpinLock mMutex;
|
||||
#else
|
||||
typedef pthread_mutex_t malloc_mutex_t;
|
||||
pthread_mutex_t mMutex;
|
||||
#endif
|
||||
|
||||
inline bool Init();
|
||||
|
||||
inline void Lock();
|
||||
|
||||
inline void Unlock();
|
||||
};
|
||||
|
||||
/* Set to true once the allocator has been initialized. */
|
||||
static bool malloc_initialized = false;
|
||||
|
||||
#if defined(XP_WIN)
|
||||
/* No init lock for Windows. */
|
||||
#elif defined(XP_DARWIN)
|
||||
static malloc_mutex_t init_lock = {OS_SPINLOCK_INIT};
|
||||
static Mutex gInitLock = { OS_SPINLOCK_INIT };
|
||||
#elif defined(XP_LINUX) && !defined(ANDROID)
|
||||
static malloc_mutex_t init_lock = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP;
|
||||
static Mutex gInitLock = { PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP };
|
||||
#else
|
||||
static malloc_mutex_t init_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static Mutex gInitLock = { PTHREAD_MUTEX_INITIALIZER };
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -668,7 +675,7 @@ class AddressRadixTree {
|
|||
static_assert(kBitsAtLevel1 + (kHeight - 1) * kBitsPerLevel == Bits,
|
||||
"AddressRadixTree parameters don't work out");
|
||||
|
||||
malloc_mutex_t mLock;
|
||||
Mutex mLock;
|
||||
void** mRoot;
|
||||
|
||||
public:
|
||||
|
@ -925,7 +932,7 @@ struct arena_t {
|
|||
RedBlackTreeNode<arena_t> mLink;
|
||||
|
||||
/* All operations on this arena require that lock be locked. */
|
||||
malloc_mutex_t mLock;
|
||||
Mutex mLock;
|
||||
|
||||
arena_stats_t mStats;
|
||||
|
||||
|
@ -1067,7 +1074,7 @@ struct ArenaTreeTrait
|
|||
static AddressRadixTree<(SIZEOF_PTR << 3) - CHUNK_2POW_DEFAULT> gChunkRTree;
|
||||
|
||||
/* Protects chunk-related data structures. */
|
||||
static malloc_mutex_t chunks_mtx;
|
||||
static Mutex chunks_mtx;
|
||||
|
||||
/*
|
||||
* Trees of chunks that were previously allocated (trees differ only in node
|
||||
|
@ -1079,7 +1086,7 @@ static RedBlackTree<extent_node_t, ExtentTreeSzTrait> chunks_szad_mmap;
|
|||
static RedBlackTree<extent_node_t, ExtentTreeTrait> chunks_ad_mmap;
|
||||
|
||||
/* Protects huge allocation-related data structures. */
|
||||
static malloc_mutex_t huge_mtx;
|
||||
static Mutex huge_mtx;
|
||||
|
||||
/* Tree of chunks that are stand-alone huge allocations. */
|
||||
static RedBlackTree<extent_node_t, ExtentTreeTrait> huge;
|
||||
|
@ -1105,7 +1112,7 @@ static void *base_next_addr;
|
|||
static void *base_next_decommitted;
|
||||
static void *base_past_addr; /* Addr immediately past base_pages. */
|
||||
static extent_node_t *base_nodes;
|
||||
static malloc_mutex_t base_mtx;
|
||||
static Mutex base_mtx;
|
||||
static size_t base_mapped;
|
||||
static size_t base_committed;
|
||||
|
||||
|
@ -1119,7 +1126,7 @@ static size_t base_committed;
|
|||
// the type being defined anymore.
|
||||
static RedBlackTree<arena_t, ArenaTreeTrait> gArenaTree;
|
||||
static unsigned narenas;
|
||||
static malloc_mutex_t arenas_lock; /* Protects arenas initialization. */
|
||||
static Mutex arenas_lock; /* Protects arenas initialization. */
|
||||
|
||||
/*
|
||||
* The arena associated with the current thread (per jemalloc_thread_local_arena)
|
||||
|
@ -1242,57 +1249,60 @@ int pthread_atfork(void (*)(void), void (*)(void), void(*)(void));
|
|||
/*
|
||||
* Begin mutex. We can't use normal pthread mutexes in all places, because
|
||||
* they require malloc()ed memory, which causes bootstrapping issues in some
|
||||
* cases.
|
||||
* cases. We also can't use constructors, because for statics, they would fire
|
||||
* after the first use of malloc, resetting the locks.
|
||||
*/
|
||||
|
||||
static bool
|
||||
malloc_mutex_init(malloc_mutex_t *mutex)
|
||||
// Initializes a mutex. Returns whether initialization succeeded.
|
||||
bool
|
||||
Mutex::Init()
|
||||
{
|
||||
#if defined(XP_WIN)
|
||||
if (!InitializeCriticalSectionAndSpinCount(mutex, _CRT_SPINCOUNT))
|
||||
return (true);
|
||||
if (!InitializeCriticalSectionAndSpinCount(&mMutex, _CRT_SPINCOUNT)) {
|
||||
return false;
|
||||
}
|
||||
#elif defined(XP_DARWIN)
|
||||
mutex->lock = OS_SPINLOCK_INIT;
|
||||
mMutex = OS_SPINLOCK_INIT;
|
||||
#elif defined(XP_LINUX) && !defined(ANDROID)
|
||||
pthread_mutexattr_t attr;
|
||||
if (pthread_mutexattr_init(&attr) != 0)
|
||||
return (true);
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP);
|
||||
if (pthread_mutex_init(mutex, &attr) != 0) {
|
||||
pthread_mutexattr_destroy(&attr);
|
||||
return (true);
|
||||
}
|
||||
pthread_mutexattr_destroy(&attr);
|
||||
pthread_mutexattr_t attr;
|
||||
if (pthread_mutexattr_init(&attr) != 0) {
|
||||
return false;
|
||||
}
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP);
|
||||
if (pthread_mutex_init(&mMutex, &attr) != 0) {
|
||||
pthread_mutexattr_destroy(&attr);
|
||||
return false;
|
||||
}
|
||||
pthread_mutexattr_destroy(&attr);
|
||||
#else
|
||||
if (pthread_mutex_init(mutex, nullptr) != 0)
|
||||
return (true);
|
||||
if (pthread_mutex_init(&mMutex, nullptr) != 0) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return (false);
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void
|
||||
malloc_mutex_lock(malloc_mutex_t *mutex)
|
||||
void
|
||||
Mutex::Lock()
|
||||
{
|
||||
|
||||
#if defined(XP_WIN)
|
||||
EnterCriticalSection(mutex);
|
||||
EnterCriticalSection(&mMutex);
|
||||
#elif defined(XP_DARWIN)
|
||||
OSSpinLockLock(&mutex->lock);
|
||||
OSSpinLockLock(&mMutex);
|
||||
#else
|
||||
pthread_mutex_lock(mutex);
|
||||
pthread_mutex_lock(&mMutex);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void
|
||||
malloc_mutex_unlock(malloc_mutex_t *mutex)
|
||||
void
|
||||
Mutex::Unlock()
|
||||
{
|
||||
|
||||
#if defined(XP_WIN)
|
||||
LeaveCriticalSection(mutex);
|
||||
LeaveCriticalSection(&mMutex);
|
||||
#elif defined(XP_DARWIN)
|
||||
OSSpinLockUnlock(&mutex->lock);
|
||||
OSSpinLockUnlock(&mMutex);
|
||||
#else
|
||||
pthread_mutex_unlock(mutex);
|
||||
pthread_mutex_unlock(&mMutex);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1449,11 +1459,11 @@ base_alloc(size_t size)
|
|||
/* Round size up to nearest multiple of the cacheline size. */
|
||||
csize = CACHELINE_CEILING(size);
|
||||
|
||||
malloc_mutex_lock(&base_mtx);
|
||||
base_mtx.Lock();
|
||||
/* Make sure there's enough space for the allocation. */
|
||||
if ((uintptr_t)base_next_addr + csize > (uintptr_t)base_past_addr) {
|
||||
if (base_pages_alloc(csize)) {
|
||||
malloc_mutex_unlock(&base_mtx);
|
||||
base_mtx.Unlock();
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -1473,7 +1483,7 @@ base_alloc(size_t size)
|
|||
base_committed += (uintptr_t)pbase_next_addr -
|
||||
(uintptr_t)base_next_decommitted;
|
||||
}
|
||||
malloc_mutex_unlock(&base_mtx);
|
||||
base_mtx.Unlock();
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
@ -1494,13 +1504,13 @@ base_node_alloc(void)
|
|||
{
|
||||
extent_node_t *ret;
|
||||
|
||||
malloc_mutex_lock(&base_mtx);
|
||||
base_mtx.Lock();
|
||||
if (base_nodes) {
|
||||
ret = base_nodes;
|
||||
base_nodes = *(extent_node_t **)ret;
|
||||
malloc_mutex_unlock(&base_mtx);
|
||||
base_mtx.Unlock();
|
||||
} else {
|
||||
malloc_mutex_unlock(&base_mtx);
|
||||
base_mtx.Unlock();
|
||||
ret = (extent_node_t *)base_alloc(sizeof(extent_node_t));
|
||||
}
|
||||
|
||||
|
@ -1511,10 +1521,10 @@ static void
|
|||
base_node_dealloc(extent_node_t *node)
|
||||
{
|
||||
|
||||
malloc_mutex_lock(&base_mtx);
|
||||
base_mtx.Lock();
|
||||
*(extent_node_t **)node = base_nodes;
|
||||
base_nodes = node;
|
||||
malloc_mutex_unlock(&base_mtx);
|
||||
base_mtx.Unlock();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1679,8 +1689,7 @@ template <size_t Bits>
|
|||
bool
|
||||
AddressRadixTree<Bits>::Init()
|
||||
{
|
||||
malloc_mutex_init(&mLock);
|
||||
|
||||
mLock.Init();
|
||||
mRoot = (void**)base_calloc(1 << kBitsAtLevel1, sizeof(void*));
|
||||
return mRoot;
|
||||
}
|
||||
|
@ -1733,7 +1742,7 @@ AddressRadixTree<Bits>::Get(void* aKey)
|
|||
ret = *slot;
|
||||
}
|
||||
#ifdef MOZ_DEBUG
|
||||
malloc_mutex_lock(&mlock);
|
||||
mlock.Lock();
|
||||
/*
|
||||
* Suppose that it were possible for a jemalloc-allocated chunk to be
|
||||
* munmap()ped, followed by a different allocator in another thread re-using
|
||||
|
@ -1748,13 +1757,13 @@ AddressRadixTree<Bits>::Get(void* aKey)
|
|||
slot = GetSlot(aKey);
|
||||
}
|
||||
if (slot) {
|
||||
// The malloc_mutex_lock call above should act as a memory barrier, forcing
|
||||
// The Lock() call above should act as a memory barrier, forcing
|
||||
// the compiler to emit a new read instruction for *slot.
|
||||
MOZ_ASSERT(ret == *slot);
|
||||
} else {
|
||||
MOZ_ASSERT(ret == nullptr);
|
||||
}
|
||||
malloc_mutex_unlock(&mlock);
|
||||
mlock.Unlock();
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
@ -1763,12 +1772,12 @@ template <size_t Bits>
|
|||
bool
|
||||
AddressRadixTree<Bits>::Set(void* aKey, void* aValue)
|
||||
{
|
||||
malloc_mutex_lock(&mLock);
|
||||
mLock.Lock();
|
||||
void** slot = GetSlot(aKey, /* create */ true);
|
||||
if (slot) {
|
||||
*slot = aValue;
|
||||
}
|
||||
malloc_mutex_unlock(&mLock);
|
||||
mLock.Unlock();
|
||||
return slot;
|
||||
}
|
||||
|
||||
|
@ -1946,10 +1955,10 @@ chunk_recycle(RedBlackTree<extent_node_t, ExtentTreeSzTrait>* chunks_szad,
|
|||
return nullptr;
|
||||
key.addr = nullptr;
|
||||
key.size = alloc_size;
|
||||
malloc_mutex_lock(&chunks_mtx);
|
||||
chunks_mtx.Lock();
|
||||
node = chunks_szad->SearchOrNext(&key);
|
||||
if (!node) {
|
||||
malloc_mutex_unlock(&chunks_mtx);
|
||||
chunks_mtx.Unlock();
|
||||
return nullptr;
|
||||
}
|
||||
leadsize = ALIGNMENT_CEILING((uintptr_t)node->addr, alignment) -
|
||||
|
@ -1981,13 +1990,13 @@ chunk_recycle(RedBlackTree<extent_node_t, ExtentTreeSzTrait>* chunks_szad,
|
|||
* deadlock, and if node allocation fails, deallocate
|
||||
* the result before returning an error.
|
||||
*/
|
||||
malloc_mutex_unlock(&chunks_mtx);
|
||||
chunks_mtx.Unlock();
|
||||
node = base_node_alloc();
|
||||
if (!node) {
|
||||
chunk_dealloc(ret, size, chunk_type);
|
||||
return nullptr;
|
||||
}
|
||||
malloc_mutex_lock(&chunks_mtx);
|
||||
chunks_mtx.Lock();
|
||||
}
|
||||
node->addr = (void *)((uintptr_t)(ret) + size);
|
||||
node->size = trailsize;
|
||||
|
@ -1999,7 +2008,7 @@ chunk_recycle(RedBlackTree<extent_node_t, ExtentTreeSzTrait>* chunks_szad,
|
|||
|
||||
recycled_size -= size;
|
||||
|
||||
malloc_mutex_unlock(&chunks_mtx);
|
||||
chunks_mtx.Unlock();
|
||||
|
||||
if (node)
|
||||
base_node_dealloc(node);
|
||||
|
@ -2109,7 +2118,7 @@ chunk_record(RedBlackTree<extent_node_t, ExtentTreeSzTrait>* chunks_szad,
|
|||
/* Use xprev to implement conditional deferred deallocation of prev. */
|
||||
xprev = nullptr;
|
||||
|
||||
malloc_mutex_lock(&chunks_mtx);
|
||||
chunks_mtx.Lock();
|
||||
key.addr = (void *)((uintptr_t)chunk + size);
|
||||
node = chunks_ad->SearchOrNext(&key);
|
||||
/* Try to coalesce forward. */
|
||||
|
@ -2172,7 +2181,7 @@ chunk_record(RedBlackTree<extent_node_t, ExtentTreeSzTrait>* chunks_szad,
|
|||
recycled_size += size;
|
||||
|
||||
label_return:
|
||||
malloc_mutex_unlock(&chunks_mtx);
|
||||
chunks_mtx.Unlock();
|
||||
/*
|
||||
* Deallocate xnode and/or xprev after unlocking chunks_mtx in order to
|
||||
* avoid potential deadlock.
|
||||
|
@ -3120,7 +3129,7 @@ arena_t::MallocSmall(size_t aSize, bool aZero)
|
|||
}
|
||||
MOZ_DIAGNOSTIC_ASSERT(aSize == bin->reg_size);
|
||||
|
||||
malloc_mutex_lock(&mLock);
|
||||
mLock.Lock();
|
||||
if ((run = bin->runcur) && run->nfree > 0) {
|
||||
ret = MallocBinEasy(bin, run);
|
||||
} else {
|
||||
|
@ -3128,12 +3137,12 @@ arena_t::MallocSmall(size_t aSize, bool aZero)
|
|||
}
|
||||
|
||||
if (!ret) {
|
||||
malloc_mutex_unlock(&mLock);
|
||||
mLock.Unlock();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
mStats.allocated_small += aSize;
|
||||
malloc_mutex_unlock(&mLock);
|
||||
mLock.Unlock();
|
||||
|
||||
if (aZero == false) {
|
||||
if (opt_junk) {
|
||||
|
@ -3154,14 +3163,14 @@ arena_t::MallocLarge(size_t aSize, bool aZero)
|
|||
|
||||
/* Large allocation. */
|
||||
aSize = PAGE_CEILING(aSize);
|
||||
malloc_mutex_lock(&mLock);
|
||||
mLock.Lock();
|
||||
ret = AllocRun(nullptr, aSize, true, aZero);
|
||||
if (!ret) {
|
||||
malloc_mutex_unlock(&mLock);
|
||||
mLock.Unlock();
|
||||
return nullptr;
|
||||
}
|
||||
mStats.allocated_large += aSize;
|
||||
malloc_mutex_unlock(&mLock);
|
||||
mLock.Unlock();
|
||||
|
||||
if (aZero == false) {
|
||||
if (opt_junk) {
|
||||
|
@ -3208,10 +3217,10 @@ arena_t::Palloc(size_t aAlignment, size_t aSize, size_t aAllocSize)
|
|||
MOZ_ASSERT((aSize & pagesize_mask) == 0);
|
||||
MOZ_ASSERT((aAlignment & pagesize_mask) == 0);
|
||||
|
||||
malloc_mutex_lock(&mLock);
|
||||
mLock.Lock();
|
||||
ret = AllocRun(nullptr, aAllocSize, true, false);
|
||||
if (!ret) {
|
||||
malloc_mutex_unlock(&mLock);
|
||||
mLock.Unlock();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -3240,7 +3249,7 @@ arena_t::Palloc(size_t aAlignment, size_t aSize, size_t aAllocSize)
|
|||
}
|
||||
|
||||
mStats.allocated_large += aSize;
|
||||
malloc_mutex_unlock(&mLock);
|
||||
mLock.Unlock();
|
||||
|
||||
if (opt_junk) {
|
||||
memset(ret, kAllocJunk, aSize);
|
||||
|
@ -3408,13 +3417,13 @@ isalloc_validate(const void* ptr)
|
|||
|
||||
/* Chunk. */
|
||||
key.addr = (void*)chunk;
|
||||
malloc_mutex_lock(&huge_mtx);
|
||||
huge_mtx.Lock();
|
||||
node = huge.Search(&key);
|
||||
if (node)
|
||||
ret = node->size;
|
||||
else
|
||||
ret = 0;
|
||||
malloc_mutex_unlock(&huge_mtx);
|
||||
huge_mtx.Unlock();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
@ -3438,7 +3447,7 @@ isalloc(const void *ptr)
|
|||
|
||||
/* Chunk (huge allocation). */
|
||||
|
||||
malloc_mutex_lock(&huge_mtx);
|
||||
huge_mtx.Lock();
|
||||
|
||||
/* Extract from tree of huge allocations. */
|
||||
key.addr = const_cast<void*>(ptr);
|
||||
|
@ -3447,7 +3456,7 @@ isalloc(const void *ptr)
|
|||
|
||||
ret = node->size;
|
||||
|
||||
malloc_mutex_unlock(&huge_mtx);
|
||||
huge_mtx.Unlock();
|
||||
}
|
||||
|
||||
return (ret);
|
||||
|
@ -3469,14 +3478,14 @@ MozJemalloc::jemalloc_ptr_info(const void* aPtr, jemalloc_ptr_info_t* aInfo)
|
|||
// the second or subsequent chunk in a huge allocation.
|
||||
extent_node_t* node;
|
||||
extent_node_t key;
|
||||
malloc_mutex_lock(&huge_mtx);
|
||||
huge_mtx.Lock();
|
||||
key.addr = const_cast<void*>(aPtr);
|
||||
node = reinterpret_cast<
|
||||
RedBlackTree<extent_node_t, ExtentTreeBoundsTrait>*>(&huge)->Search(&key);
|
||||
if (node) {
|
||||
*aInfo = { TagLiveHuge, node->addr, node->size };
|
||||
}
|
||||
malloc_mutex_unlock(&huge_mtx);
|
||||
huge_mtx.Unlock();
|
||||
if (node) {
|
||||
return;
|
||||
}
|
||||
|
@ -3681,7 +3690,7 @@ arena_dalloc(void *ptr, size_t offset)
|
|||
MOZ_ASSERT(arena);
|
||||
MOZ_DIAGNOSTIC_ASSERT(arena->mMagic == ARENA_MAGIC);
|
||||
|
||||
malloc_mutex_lock(&arena->mLock);
|
||||
arena->mLock.Lock();
|
||||
pageind = offset >> pagesize_2pow;
|
||||
mapelm = &chunk->map[pageind];
|
||||
MOZ_DIAGNOSTIC_ASSERT((mapelm->bits & CHUNK_MAP_ALLOCATED) != 0);
|
||||
|
@ -3692,7 +3701,7 @@ arena_dalloc(void *ptr, size_t offset)
|
|||
/* Large allocation. */
|
||||
arena->DallocLarge(chunk, ptr);
|
||||
}
|
||||
malloc_mutex_unlock(&arena->mLock);
|
||||
arena->mLock.Unlock();
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
@ -3719,10 +3728,10 @@ arena_t::RallocShrinkLarge(arena_chunk_t* aChunk, void* aPtr, size_t aSize,
|
|||
* Shrink the run, and make trailing pages available for other
|
||||
* allocations.
|
||||
*/
|
||||
malloc_mutex_lock(&mLock);
|
||||
mLock.Lock();
|
||||
TrimRunTail(aChunk, (arena_run_t*)aPtr, aOldSize, aSize, true);
|
||||
mStats.allocated_large -= aOldSize - aSize;
|
||||
malloc_mutex_unlock(&mLock);
|
||||
mLock.Unlock();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -3732,7 +3741,7 @@ arena_t::RallocGrowLarge(arena_chunk_t* aChunk, void* aPtr, size_t aSize,
|
|||
size_t pageind = (uintptr_t(aPtr) - uintptr_t(aChunk)) >> pagesize_2pow;
|
||||
size_t npages = aOldSize >> pagesize_2pow;
|
||||
|
||||
malloc_mutex_lock(&mLock);
|
||||
mLock.Lock();
|
||||
MOZ_DIAGNOSTIC_ASSERT(aOldSize == (aChunk->map[pageind].bits & ~pagesize_mask));
|
||||
|
||||
/* Try to extend the run. */
|
||||
|
@ -3755,10 +3764,10 @@ arena_t::RallocGrowLarge(arena_chunk_t* aChunk, void* aPtr, size_t aSize,
|
|||
CHUNK_MAP_ALLOCATED;
|
||||
|
||||
mStats.allocated_large += aSize - aOldSize;
|
||||
malloc_mutex_unlock(&mLock);
|
||||
mLock.Unlock();
|
||||
return false;
|
||||
}
|
||||
malloc_mutex_unlock(&mLock);
|
||||
mLock.Unlock();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -3882,6 +3891,7 @@ iralloc(void* aPtr, size_t aSize, arena_t* aArena)
|
|||
: huge_ralloc(aPtr, aSize, oldsize);
|
||||
}
|
||||
|
||||
// Returns whether initialization succeeded.
|
||||
bool
|
||||
arena_t::Init()
|
||||
{
|
||||
|
@ -3889,8 +3899,9 @@ arena_t::Init()
|
|||
arena_bin_t* bin;
|
||||
size_t prev_run_size;
|
||||
|
||||
if (malloc_mutex_init(&mLock))
|
||||
return true;
|
||||
if (!mLock.Init()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
memset(&mLink, 0, sizeof(mLink));
|
||||
memset(&mStats, 0, sizeof(arena_stats_t));
|
||||
|
@ -3955,7 +3966,7 @@ arena_t::Init()
|
|||
mMagic = ARENA_MAGIC;
|
||||
#endif
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline arena_t *
|
||||
|
@ -3982,19 +3993,19 @@ arenas_extend()
|
|||
arena_t* ret;
|
||||
|
||||
/* Allocate enough space for trailing bins. */
|
||||
ret = (arena_t *)base_alloc(sizeof(arena_t)
|
||||
+ (sizeof(arena_bin_t) * (ntbins + nqbins + nsbins - 1)));
|
||||
if (!ret || ret->Init()) {
|
||||
ret = (arena_t*)base_alloc(sizeof(arena_t) +
|
||||
(sizeof(arena_bin_t) * (ntbins + nqbins + nsbins - 1)));
|
||||
if (!ret || !ret->Init()) {
|
||||
return arenas_fallback();
|
||||
}
|
||||
|
||||
malloc_mutex_lock(&arenas_lock);
|
||||
arenas_lock.Lock();
|
||||
|
||||
// TODO: Use random Ids.
|
||||
ret->mId = narenas++;
|
||||
gArenaTree.Insert(ret);
|
||||
|
||||
malloc_mutex_unlock(&arenas_lock);
|
||||
arenas_lock.Unlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -4048,7 +4059,7 @@ huge_palloc(size_t size, size_t alignment, bool zero)
|
|||
psize = PAGE_CEILING(size);
|
||||
node->size = psize;
|
||||
|
||||
malloc_mutex_lock(&huge_mtx);
|
||||
huge_mtx.Lock();
|
||||
huge.Insert(node);
|
||||
huge_nmalloc++;
|
||||
|
||||
|
@ -4072,7 +4083,7 @@ huge_palloc(size_t size, size_t alignment, bool zero)
|
|||
* reasonably claim we never "allocated" them in the first place. */
|
||||
huge_allocated += psize;
|
||||
huge_mapped += csize;
|
||||
malloc_mutex_unlock(&huge_mtx);
|
||||
huge_mtx.Unlock();
|
||||
|
||||
#ifdef MALLOC_DECOMMIT
|
||||
if (csize - psize > 0)
|
||||
|
@ -4120,7 +4131,7 @@ huge_ralloc(void *ptr, size_t size, size_t oldsize)
|
|||
oldsize - psize);
|
||||
|
||||
/* Update recorded size. */
|
||||
malloc_mutex_lock(&huge_mtx);
|
||||
huge_mtx.Lock();
|
||||
key.addr = const_cast<void*>(ptr);
|
||||
node = huge.Search(&key);
|
||||
MOZ_ASSERT(node);
|
||||
|
@ -4129,7 +4140,7 @@ huge_ralloc(void *ptr, size_t size, size_t oldsize)
|
|||
/* No need to change huge_mapped, because we didn't
|
||||
* (un)map anything. */
|
||||
node->size = psize;
|
||||
malloc_mutex_unlock(&huge_mtx);
|
||||
huge_mtx.Unlock();
|
||||
} else if (psize > oldsize) {
|
||||
pages_commit((void *)((uintptr_t)ptr + oldsize),
|
||||
psize - oldsize);
|
||||
|
@ -4145,7 +4156,7 @@ huge_ralloc(void *ptr, size_t size, size_t oldsize)
|
|||
if (psize > oldsize) {
|
||||
/* Update recorded size. */
|
||||
extent_node_t *node, key;
|
||||
malloc_mutex_lock(&huge_mtx);
|
||||
huge_mtx.Lock();
|
||||
key.addr = const_cast<void*>(ptr);
|
||||
node = huge.Search(&key);
|
||||
MOZ_ASSERT(node);
|
||||
|
@ -4154,7 +4165,7 @@ huge_ralloc(void *ptr, size_t size, size_t oldsize)
|
|||
/* No need to change huge_mapped, because we didn't
|
||||
* (un)map anything. */
|
||||
node->size = psize;
|
||||
malloc_mutex_unlock(&huge_mtx);
|
||||
huge_mtx.Unlock();
|
||||
}
|
||||
|
||||
if (opt_zero && size > oldsize) {
|
||||
|
@ -4189,7 +4200,7 @@ huge_dalloc(void *ptr)
|
|||
{
|
||||
extent_node_t *node, key;
|
||||
|
||||
malloc_mutex_lock(&huge_mtx);
|
||||
huge_mtx.Lock();
|
||||
|
||||
/* Extract from tree of huge allocations. */
|
||||
key.addr = ptr;
|
||||
|
@ -4202,7 +4213,7 @@ huge_dalloc(void *ptr)
|
|||
huge_allocated -= node->size;
|
||||
huge_mapped -= CHUNK_CEILING(node->size);
|
||||
|
||||
malloc_mutex_unlock(&huge_mtx);
|
||||
huge_mtx.Unlock();
|
||||
|
||||
/* Unmap chunk. */
|
||||
chunk_dealloc(node->addr, CHUNK_CEILING(node->size), HUGE_CHUNK);
|
||||
|
@ -4257,16 +4268,16 @@ malloc_init_hard(void)
|
|||
long result;
|
||||
|
||||
#ifndef XP_WIN
|
||||
malloc_mutex_lock(&init_lock);
|
||||
gInitLock.Lock();
|
||||
#endif
|
||||
|
||||
if (malloc_initialized) {
|
||||
/*
|
||||
* Another thread initialized the allocator before this one
|
||||
* acquired init_lock.
|
||||
* acquired gInitLock.
|
||||
*/
|
||||
#ifndef XP_WIN
|
||||
malloc_mutex_unlock(&init_lock);
|
||||
gInitLock.Unlock();
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
@ -4381,12 +4392,12 @@ MALLOC_OUT:
|
|||
MOZ_ASSERT(quantum * 4 <= chunksize);
|
||||
|
||||
/* Initialize chunks data. */
|
||||
malloc_mutex_init(&chunks_mtx);
|
||||
chunks_mtx.Init();
|
||||
chunks_szad_mmap.Init();
|
||||
chunks_ad_mmap.Init();
|
||||
|
||||
/* Initialize huge allocation data. */
|
||||
malloc_mutex_init(&huge_mtx);
|
||||
huge_mtx.Init();
|
||||
huge.Init();
|
||||
huge_nmalloc = 0;
|
||||
huge_ndalloc = 0;
|
||||
|
@ -4397,9 +4408,9 @@ MALLOC_OUT:
|
|||
base_mapped = 0;
|
||||
base_committed = 0;
|
||||
base_nodes = nullptr;
|
||||
malloc_mutex_init(&base_mtx);
|
||||
base_mtx.Init();
|
||||
|
||||
malloc_mutex_init(&arenas_lock);
|
||||
arenas_lock.Init();
|
||||
|
||||
/*
|
||||
* Initialize one arena here.
|
||||
|
@ -4409,7 +4420,7 @@ MALLOC_OUT:
|
|||
gMainArena = gArenaTree.First();
|
||||
if (!gMainArena) {
|
||||
#ifndef XP_WIN
|
||||
malloc_mutex_unlock(&init_lock);
|
||||
gInitLock.Unlock();
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
@ -4434,7 +4445,7 @@ MALLOC_OUT:
|
|||
#endif
|
||||
|
||||
#ifndef XP_WIN
|
||||
malloc_mutex_unlock(&init_lock);
|
||||
gInitLock.Unlock();
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
@ -4751,20 +4762,20 @@ MozJemalloc::jemalloc_stats(jemalloc_stats_t* aStats)
|
|||
non_arena_mapped = 0;
|
||||
|
||||
/* Get huge mapped/allocated. */
|
||||
malloc_mutex_lock(&huge_mtx);
|
||||
huge_mtx.Lock();
|
||||
non_arena_mapped += huge_mapped;
|
||||
aStats->allocated += huge_allocated;
|
||||
MOZ_ASSERT(huge_mapped >= huge_allocated);
|
||||
malloc_mutex_unlock(&huge_mtx);
|
||||
huge_mtx.Unlock();
|
||||
|
||||
/* Get base mapped/allocated. */
|
||||
malloc_mutex_lock(&base_mtx);
|
||||
base_mtx.Lock();
|
||||
non_arena_mapped += base_mapped;
|
||||
aStats->bookkeeping += base_committed;
|
||||
MOZ_ASSERT(base_mapped >= base_committed);
|
||||
malloc_mutex_unlock(&base_mtx);
|
||||
base_mtx.Unlock();
|
||||
|
||||
malloc_mutex_lock(&arenas_lock);
|
||||
arenas_lock.Lock();
|
||||
/* Iterate over arenas. */
|
||||
for (auto arena : gArenaTree.iter()) {
|
||||
size_t arena_mapped, arena_allocated, arena_committed, arena_dirty, j,
|
||||
|
@ -4778,7 +4789,7 @@ MozJemalloc::jemalloc_stats(jemalloc_stats_t* aStats)
|
|||
arena_headers = 0;
|
||||
arena_unused = 0;
|
||||
|
||||
malloc_mutex_lock(&arena->mLock);
|
||||
arena->mLock.Lock();
|
||||
|
||||
arena_mapped = arena->mStats.mapped;
|
||||
|
||||
|
@ -4807,7 +4818,7 @@ MozJemalloc::jemalloc_stats(jemalloc_stats_t* aStats)
|
|||
arena_headers += bin->stats.curruns * bin->reg0_offset;
|
||||
}
|
||||
|
||||
malloc_mutex_unlock(&arena->mLock);
|
||||
arena->mLock.Unlock();
|
||||
|
||||
MOZ_ASSERT(arena_mapped >= arena_committed);
|
||||
MOZ_ASSERT(arena_committed >= arena_allocated + arena_dirty);
|
||||
|
@ -4822,7 +4833,7 @@ MozJemalloc::jemalloc_stats(jemalloc_stats_t* aStats)
|
|||
aStats->bin_unused += arena_unused;
|
||||
aStats->bookkeeping += arena_headers;
|
||||
}
|
||||
malloc_mutex_unlock(&arenas_lock);
|
||||
arenas_lock.Unlock();
|
||||
|
||||
/* Account for arena chunk headers in bookkeeping rather than waste. */
|
||||
chunk_header_size =
|
||||
|
@ -4872,24 +4883,24 @@ hard_purge_chunk(arena_chunk_t *chunk)
|
|||
void
|
||||
arena_t::HardPurge()
|
||||
{
|
||||
malloc_mutex_lock(&mLock);
|
||||
mLock.Lock();
|
||||
|
||||
while (!mChunksMAdvised.isEmpty()) {
|
||||
arena_chunk_t* chunk = mChunksMAdvised.popFront();
|
||||
hard_purge_chunk(chunk);
|
||||
}
|
||||
|
||||
malloc_mutex_unlock(&mLock);
|
||||
mLock.Unlock();
|
||||
}
|
||||
|
||||
template<> inline void
|
||||
MozJemalloc::jemalloc_purge_freed_pages()
|
||||
{
|
||||
malloc_mutex_lock(&arenas_lock);
|
||||
arenas_lock.Lock();
|
||||
for (auto arena : gArenaTree.iter()) {
|
||||
arena->HardPurge();
|
||||
}
|
||||
malloc_mutex_unlock(&arenas_lock);
|
||||
arenas_lock.Unlock();
|
||||
}
|
||||
|
||||
#else /* !defined MALLOC_DOUBLE_PURGE */
|
||||
|
@ -4906,13 +4917,13 @@ MozJemalloc::jemalloc_purge_freed_pages()
|
|||
template<> inline void
|
||||
MozJemalloc::jemalloc_free_dirty_pages(void)
|
||||
{
|
||||
malloc_mutex_lock(&arenas_lock);
|
||||
arenas_lock.Lock();
|
||||
for (auto arena : gArenaTree.iter()) {
|
||||
malloc_mutex_lock(&arena->mLock);
|
||||
arena->mLock.Lock();
|
||||
arena->Purge(true);
|
||||
malloc_mutex_unlock(&arena->mLock);
|
||||
arena->mLock.Unlock();
|
||||
}
|
||||
malloc_mutex_unlock(&arenas_lock);
|
||||
arenas_lock.Unlock();
|
||||
}
|
||||
|
||||
inline arena_t*
|
||||
|
@ -4920,9 +4931,9 @@ arena_t::GetById(arena_id_t aArenaId)
|
|||
{
|
||||
arena_t key;
|
||||
key.mId = aArenaId;
|
||||
malloc_mutex_lock(&arenas_lock);
|
||||
arenas_lock.Lock();
|
||||
arena_t* result = gArenaTree.Search(&key);
|
||||
malloc_mutex_unlock(&arenas_lock);
|
||||
arenas_lock.Unlock();
|
||||
MOZ_RELEASE_ASSERT(result);
|
||||
return result;
|
||||
}
|
||||
|
@ -4939,12 +4950,12 @@ template<> inline void
|
|||
MozJemalloc::moz_dispose_arena(arena_id_t aArenaId)
|
||||
{
|
||||
arena_t* arena = arena_t::GetById(aArenaId);
|
||||
malloc_mutex_lock(&arenas_lock);
|
||||
arenas_lock.Lock();
|
||||
gArenaTree.Remove(arena);
|
||||
// The arena is leaked, and remaining allocations in it still are alive
|
||||
// until they are freed. After that, the arena will be empty but still
|
||||
// taking have at least a chunk taking address space. TODO: bug 1364359.
|
||||
malloc_mutex_unlock(&arenas_lock);
|
||||
arenas_lock.Unlock();
|
||||
}
|
||||
|
||||
#define MALLOC_DECL(name, return_type, ...) \
|
||||
|
@ -4989,15 +5000,15 @@ _malloc_prefork(void)
|
|||
{
|
||||
/* Acquire all mutexes in a safe order. */
|
||||
|
||||
malloc_mutex_lock(&arenas_lock);
|
||||
arenas_lock.Lock();
|
||||
|
||||
for (auto arena : gArenaTree.iter()) {
|
||||
malloc_mutex_lock(&arena->mLock);
|
||||
arena->mLock.Lock();
|
||||
}
|
||||
|
||||
malloc_mutex_lock(&base_mtx);
|
||||
base_mtx.Lock();
|
||||
|
||||
malloc_mutex_lock(&huge_mtx);
|
||||
huge_mtx.Lock();
|
||||
}
|
||||
|
||||
#ifndef XP_DARWIN
|
||||
|
@ -5008,14 +5019,14 @@ _malloc_postfork_parent(void)
|
|||
{
|
||||
/* Release all mutexes, now that fork() has completed. */
|
||||
|
||||
malloc_mutex_unlock(&huge_mtx);
|
||||
huge_mtx.Unlock();
|
||||
|
||||
malloc_mutex_unlock(&base_mtx);
|
||||
base_mtx.Unlock();
|
||||
|
||||
for (auto arena : gArenaTree.iter()) {
|
||||
malloc_mutex_unlock(&arena->mLock);
|
||||
arena->mLock.Unlock();
|
||||
}
|
||||
malloc_mutex_unlock(&arenas_lock);
|
||||
arenas_lock.Unlock();
|
||||
}
|
||||
|
||||
#ifndef XP_DARWIN
|
||||
|
@ -5026,14 +5037,14 @@ _malloc_postfork_child(void)
|
|||
{
|
||||
/* Reinitialize all mutexes, now that fork() has completed. */
|
||||
|
||||
malloc_mutex_init(&huge_mtx);
|
||||
huge_mtx.Init();
|
||||
|
||||
malloc_mutex_init(&base_mtx);
|
||||
base_mtx.Init();
|
||||
|
||||
for (auto arena : gArenaTree.iter()) {
|
||||
malloc_mutex_init(&arena->mLock);
|
||||
arena->mLock.Init();
|
||||
}
|
||||
malloc_mutex_init(&arenas_lock);
|
||||
arenas_lock.Init();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -335,7 +335,7 @@ private:
|
|||
uint32_t mBitField;
|
||||
|
||||
#ifdef DEBUG
|
||||
uint64_t mVersion;
|
||||
uint64_t mVersion = 0;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
@ -5902,20 +5902,19 @@ pref("layers.mlgpu.enable-on-windows7", true);
|
|||
pref("layers.advanced.background-color", false);
|
||||
pref("layers.advanced.background-image", 2);
|
||||
pref("layers.advanced.border-layers", 2);
|
||||
pref("layers.advanced.boxshadow-inset-layers", 2);
|
||||
pref("layers.advanced.boxshadow-outer-layers", 2);
|
||||
pref("layers.advanced.boxshadow-inset-layers", false);
|
||||
pref("layers.advanced.boxshadow-outer-layers", false);
|
||||
pref("layers.advanced.bullet-layers", 2);
|
||||
pref("layers.advanced.button-foreground-layers", 2);
|
||||
pref("layers.advanced.canvas-background-color", 2);
|
||||
pref("layers.advanced.caret-layers", 2);
|
||||
pref("layers.advanced.caret-layers", false);
|
||||
pref("layers.advanced.columnRule-layers", 2);
|
||||
pref("layers.advanced.displaybuttonborder-layers", 2);
|
||||
pref("layers.advanced.image-layers", 2);
|
||||
pref("layers.advanced.outline-layers", 2);
|
||||
pref("layers.advanced.solid-color", 2);
|
||||
pref("layers.advanced.table", 2);
|
||||
pref("layers.advanced.solid-color", false);
|
||||
pref("layers.advanced.table", false);
|
||||
pref("layers.advanced.text-layers", 2);
|
||||
pref("layers.advanced.filter-layers", 2);
|
||||
|
||||
// Enable lowercased response header name
|
||||
pref("dom.xhr.lowercase_header.enabled", false);
|
||||
|
|
|
@ -23,7 +23,6 @@ LOCAL_INCLUDES += [
|
|||
'/netwerk/mime',
|
||||
'/netwerk/protocol/about',
|
||||
'/netwerk/protocol/data',
|
||||
'/netwerk/protocol/device',
|
||||
'/netwerk/protocol/file',
|
||||
'/netwerk/protocol/ftp',
|
||||
'/netwerk/protocol/http',
|
||||
|
|
|
@ -306,10 +306,6 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ExtensionProtocolHandler,
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR(SubstitutingURL)
|
||||
} // namespace mozilla
|
||||
|
||||
#include "nsDeviceProtocolHandler.h"
|
||||
typedef mozilla::net::nsDeviceProtocolHandler nsDeviceProtocolHandler;
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceProtocolHandler)
|
||||
|
||||
#include "nsViewSourceHandler.h"
|
||||
typedef mozilla::net::nsViewSourceHandler nsViewSourceHandler;
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsViewSourceHandler)
|
||||
|
@ -919,7 +915,6 @@ static const mozilla::Module::CIDEntry kNeckoCIDs[] = {
|
|||
{ &kNS_WIFI_MONITOR_COMPONENT_CID, false, nullptr, nsWifiMonitorConstructor },
|
||||
#endif
|
||||
{ &kNS_DATAPROTOCOLHANDLER_CID, false, nullptr, nsDataHandler::Create },
|
||||
{ &kNS_DEVICEPROTOCOLHANDLER_CID, false, nullptr, nsDeviceProtocolHandlerConstructor},
|
||||
{ &kNS_VIEWSOURCEHANDLER_CID, false, nullptr, nsViewSourceHandlerConstructor },
|
||||
{ &kNS_WYCIWYGPROTOCOLHANDLER_CID, false, nullptr, nsWyciwygProtocolHandlerConstructor },
|
||||
{ &kNS_WEBSOCKETPROTOCOLHANDLER_CID, false, nullptr,
|
||||
|
|
|
@ -1,302 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "AndroidCaptureProvider.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "nsStreamUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsMemory.h"
|
||||
#include "RawStructs.h"
|
||||
|
||||
// The maximum number of frames we keep in our queue. Don't live in the past.
|
||||
#define MAX_FRAMES_QUEUED 10
|
||||
|
||||
using namespace mozilla::net;
|
||||
|
||||
NS_IMPL_ISUPPORTS(AndroidCameraInputStream, nsIInputStream, nsIAsyncInputStream)
|
||||
|
||||
AndroidCameraInputStream::AndroidCameraInputStream() :
|
||||
mWidth(0), mHeight(0), mCamera(0), mHeaderSent(false), mClosed(true), mFrameSize(0),
|
||||
mMonitor("AndroidCamera.Monitor")
|
||||
{
|
||||
mAvailable = sizeof(RawVideoHeader);
|
||||
mFrameQueue = new nsDeque();
|
||||
}
|
||||
|
||||
AndroidCameraInputStream::~AndroidCameraInputStream() {
|
||||
// clear the frame queue
|
||||
while (mFrameQueue->GetSize() > 0) {
|
||||
free(mFrameQueue->PopFront());
|
||||
}
|
||||
delete mFrameQueue;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
AndroidCameraInputStream::Init(nsACString& aContentType, nsCaptureParams* aParams)
|
||||
{
|
||||
if (!XRE_IsParentProcess())
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
mContentType = aContentType;
|
||||
mWidth = aParams->width;
|
||||
mHeight = aParams->height;
|
||||
mCamera = aParams->camera;
|
||||
|
||||
CameraStreamImpl *impl = CameraStreamImpl::GetInstance(0);
|
||||
if (!impl)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
if (impl->Init(mContentType, mCamera, mWidth, mHeight, this)) {
|
||||
mWidth = impl->GetWidth();
|
||||
mHeight = impl->GetHeight();
|
||||
mClosed = false;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void AndroidCameraInputStream::ReceiveFrame(char* frame, uint32_t length) {
|
||||
{
|
||||
mozilla::ReentrantMonitorAutoEnter autoMonitor(mMonitor);
|
||||
if (mFrameQueue->GetSize() > MAX_FRAMES_QUEUED) {
|
||||
free(mFrameQueue->PopFront());
|
||||
mAvailable -= mFrameSize;
|
||||
}
|
||||
}
|
||||
|
||||
mFrameSize = sizeof(RawPacketHeader) + length;
|
||||
|
||||
char* fullFrame = (char*)moz_xmalloc(mFrameSize);
|
||||
|
||||
if (!fullFrame)
|
||||
return;
|
||||
|
||||
RawPacketHeader* header = (RawPacketHeader*) fullFrame;
|
||||
header->packetID = 0xFF;
|
||||
header->codecID = 0x595556; // "YUV"
|
||||
|
||||
// we copy the Y plane, and de-interlace the CrCb
|
||||
|
||||
uint32_t yFrameSize = mWidth * mHeight;
|
||||
uint32_t uvFrameSize = yFrameSize / 4;
|
||||
|
||||
memcpy(fullFrame + sizeof(RawPacketHeader), frame, yFrameSize);
|
||||
|
||||
char* uFrame = fullFrame + yFrameSize;
|
||||
char* vFrame = fullFrame + yFrameSize + uvFrameSize;
|
||||
char* yFrame = frame + yFrameSize;
|
||||
for (uint32_t i = 0; i < uvFrameSize; i++) {
|
||||
uFrame[i] = yFrame[2 * i + 1];
|
||||
vFrame[i] = yFrame[2 * i];
|
||||
}
|
||||
|
||||
{
|
||||
mozilla::ReentrantMonitorAutoEnter autoMonitor(mMonitor);
|
||||
mAvailable += mFrameSize;
|
||||
mFrameQueue->Push((void*)fullFrame);
|
||||
}
|
||||
|
||||
NotifyListeners();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
AndroidCameraInputStream::Available(uint64_t *aAvailable)
|
||||
{
|
||||
mozilla::ReentrantMonitorAutoEnter autoMonitor(mMonitor);
|
||||
|
||||
*aAvailable = mAvailable;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP AndroidCameraInputStream::IsNonBlocking(bool *aNonBlock) {
|
||||
*aNonBlock = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP AndroidCameraInputStream::Read(char *aBuffer, uint32_t aCount, uint32_t *aRead) {
|
||||
return ReadSegments(NS_CopySegmentToBuffer, aBuffer, aCount, aRead);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP AndroidCameraInputStream::ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, uint32_t aCount, uint32_t *aRead) {
|
||||
*aRead = 0;
|
||||
|
||||
nsresult rv;
|
||||
|
||||
if (mAvailable == 0)
|
||||
return NS_BASE_STREAM_WOULD_BLOCK;
|
||||
|
||||
if (aCount > mAvailable)
|
||||
aCount = mAvailable;
|
||||
|
||||
if (!mHeaderSent) {
|
||||
CameraStreamImpl *impl = CameraStreamImpl::GetInstance(0);
|
||||
RawVideoHeader header;
|
||||
header.headerPacketID = 0;
|
||||
header.codecID = 0x595556; // "YUV"
|
||||
header.majorVersion = 0;
|
||||
header.minorVersion = 1;
|
||||
header.options = 1 | 1 << 1; // color, 4:2:2
|
||||
|
||||
header.alphaChannelBpp = 0;
|
||||
header.lumaChannelBpp = 8;
|
||||
header.chromaChannelBpp = 4;
|
||||
header.colorspace = 1;
|
||||
|
||||
header.frameWidth = mWidth;
|
||||
header.frameHeight = mHeight;
|
||||
header.aspectNumerator = 1;
|
||||
header.aspectDenominator = 1;
|
||||
|
||||
header.framerateNumerator = impl->GetFps();
|
||||
header.framerateDenominator = 1;
|
||||
|
||||
rv = aWriter(this, aClosure, (const char*)&header, 0, sizeof(RawVideoHeader), aRead);
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
return NS_OK;
|
||||
|
||||
mHeaderSent = true;
|
||||
aCount -= sizeof(RawVideoHeader);
|
||||
mAvailable -= sizeof(RawVideoHeader);
|
||||
}
|
||||
|
||||
{
|
||||
mozilla::ReentrantMonitorAutoEnter autoMonitor(mMonitor);
|
||||
while ((mAvailable > 0) && (aCount >= mFrameSize)) {
|
||||
uint32_t readThisTime = 0;
|
||||
|
||||
char* frame = (char*)mFrameQueue->PopFront();
|
||||
rv = aWriter(this, aClosure, (const char*)frame, *aRead, mFrameSize, &readThisTime);
|
||||
|
||||
if (readThisTime != mFrameSize) {
|
||||
mFrameQueue->PushFront((void*)frame);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// RawReader does a copy when calling VideoData::Create()
|
||||
free(frame);
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
return NS_OK;
|
||||
|
||||
aCount -= readThisTime;
|
||||
mAvailable -= readThisTime;
|
||||
*aRead += readThisTime;
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP AndroidCameraInputStream::Close() {
|
||||
return CloseWithStatus(NS_OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* must be called on the main (java) thread
|
||||
*/
|
||||
void AndroidCameraInputStream::doClose() {
|
||||
NS_ASSERTION(!mClosed, "Camera is already closed");
|
||||
|
||||
CameraStreamImpl *impl = CameraStreamImpl::GetInstance(0);
|
||||
impl->Close();
|
||||
mClosed = true;
|
||||
}
|
||||
|
||||
|
||||
void AndroidCameraInputStream::NotifyListeners() {
|
||||
mozilla::ReentrantMonitorAutoEnter autoMonitor(mMonitor);
|
||||
|
||||
if (mCallback && (mAvailable > sizeof(RawVideoHeader))) {
|
||||
nsCOMPtr<nsIInputStreamCallback> callback;
|
||||
if (mCallbackTarget) {
|
||||
callback = NS_NewInputStreamReadyEvent("AndroidCameraInputStream::NotifyListeners",
|
||||
mCallback, mCallbackTarget);
|
||||
} else {
|
||||
callback = mCallback;
|
||||
}
|
||||
|
||||
NS_ASSERTION(callback, "Shouldn't fail to make the callback!");
|
||||
|
||||
// Null the callback first because OnInputStreamReady may reenter AsyncWait
|
||||
mCallback = nullptr;
|
||||
mCallbackTarget = nullptr;
|
||||
|
||||
callback->OnInputStreamReady(this);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP AndroidCameraInputStream::AsyncWait(nsIInputStreamCallback *aCallback, uint32_t aFlags, uint32_t aRequestedCount, nsIEventTarget *aTarget)
|
||||
{
|
||||
if (aFlags != 0)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
if (mCallback || mCallbackTarget)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
mCallbackTarget = aTarget;
|
||||
mCallback = aCallback;
|
||||
|
||||
// What we are being asked for may be present already
|
||||
NotifyListeners();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP AndroidCameraInputStream::CloseWithStatus(nsresult status)
|
||||
{
|
||||
AndroidCameraInputStream::doClose();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* AndroidCaptureProvider implementation
|
||||
*/
|
||||
|
||||
NS_IMPL_ISUPPORTS0(AndroidCaptureProvider)
|
||||
|
||||
AndroidCaptureProvider* AndroidCaptureProvider::sInstance = nullptr;
|
||||
|
||||
AndroidCaptureProvider::AndroidCaptureProvider() {
|
||||
}
|
||||
|
||||
AndroidCaptureProvider::~AndroidCaptureProvider() {
|
||||
AndroidCaptureProvider::sInstance = nullptr;
|
||||
}
|
||||
|
||||
nsresult AndroidCaptureProvider::Init(nsACString& aContentType,
|
||||
nsCaptureParams* aParams,
|
||||
nsIInputStream** aStream) {
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
|
||||
NS_ASSERTION(aParams->frameLimit == 0 || aParams->timeLimit == 0,
|
||||
"Cannot set both a frame limit and a time limit!");
|
||||
|
||||
RefPtr<AndroidCameraInputStream> stream;
|
||||
|
||||
if (aContentType.EqualsLiteral("video/x-raw-yuv")) {
|
||||
stream = new AndroidCameraInputStream();
|
||||
if (stream) {
|
||||
nsresult rv = stream->Init(aContentType, aParams);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
}
|
||||
else
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
} else {
|
||||
NS_NOTREACHED("Should not have asked Android for this type!");
|
||||
}
|
||||
stream.forget(aStream);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
already_AddRefed<AndroidCaptureProvider> GetAndroidCaptureProvider() {
|
||||
if (!AndroidCaptureProvider::sInstance) {
|
||||
AndroidCaptureProvider::sInstance = new AndroidCaptureProvider();
|
||||
}
|
||||
RefPtr<AndroidCaptureProvider> ret = AndroidCaptureProvider::sInstance;
|
||||
return ret.forget();
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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 AndroidDeviceCaptureProvide_h_
|
||||
#define AndroidDeviceCaptureProvide_h_
|
||||
|
||||
#include "nsDeviceCaptureProvider.h"
|
||||
#include "nsIAsyncInputStream.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsString.h"
|
||||
#include "mozilla/net/CameraStreamImpl.h"
|
||||
#include "nsIEventTarget.h"
|
||||
#include "nsDeque.h"
|
||||
#include "mozilla/ReentrantMonitor.h"
|
||||
|
||||
class AndroidCaptureProvider final : public nsDeviceCaptureProvider {
|
||||
private:
|
||||
~AndroidCaptureProvider();
|
||||
|
||||
public:
|
||||
AndroidCaptureProvider();
|
||||
|
||||
NS_DECL_THREADSAFE_ISUPPORTS
|
||||
|
||||
MOZ_MUST_USE nsresult Init(nsACString& aContentType, nsCaptureParams* aParams, nsIInputStream** aStream) override;
|
||||
static AndroidCaptureProvider* sInstance;
|
||||
};
|
||||
|
||||
class AndroidCameraInputStream final : public nsIAsyncInputStream, mozilla::net::CameraStreamImpl::FrameCallback {
|
||||
private:
|
||||
~AndroidCameraInputStream();
|
||||
|
||||
public:
|
||||
AndroidCameraInputStream();
|
||||
|
||||
NS_IMETHODIMP Init(nsACString& aContentType, nsCaptureParams* aParams);
|
||||
|
||||
NS_DECL_THREADSAFE_ISUPPORTS
|
||||
NS_DECL_NSIINPUTSTREAM
|
||||
NS_DECL_NSIASYNCINPUTSTREAM
|
||||
|
||||
void ReceiveFrame(char* frame, uint32_t length) override;
|
||||
|
||||
protected:
|
||||
void NotifyListeners();
|
||||
void doClose();
|
||||
|
||||
uint32_t mAvailable;
|
||||
nsCString mContentType;
|
||||
uint32_t mWidth;
|
||||
uint32_t mHeight;
|
||||
uint32_t mCamera;
|
||||
bool mHeaderSent;
|
||||
bool mClosed;
|
||||
nsDeque *mFrameQueue;
|
||||
uint32_t mFrameSize;
|
||||
mozilla::ReentrantMonitor mMonitor;
|
||||
|
||||
nsCOMPtr<nsIInputStreamCallback> mCallback;
|
||||
nsCOMPtr<nsIEventTarget> mCallbackTarget;
|
||||
};
|
||||
|
||||
already_AddRefed<AndroidCaptureProvider> GetAndroidCaptureProvider();
|
||||
|
||||
#endif
|
|
@ -1,114 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "CameraStreamImpl.h"
|
||||
#include "GeneratedJNINatives.h"
|
||||
#include "nsCRTGlue.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "mozilla/Monitor.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
static CameraStreamImpl* mCamera0 = nullptr;
|
||||
static CameraStreamImpl* mCamera1 = nullptr;
|
||||
|
||||
class CameraStreamImpl::Callback
|
||||
: public java::GeckoAppShell::CameraCallback::Natives<Callback>
|
||||
{
|
||||
public:
|
||||
static void OnFrameData(int32_t aCamera, jni::ByteArray::Param aData)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
CameraStreamImpl* impl = GetInstance(uint32_t(aCamera));
|
||||
if (impl) {
|
||||
impl->TransmitFrame(aData);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* CameraStreamImpl
|
||||
*/
|
||||
|
||||
void CameraStreamImpl::TransmitFrame(jni::ByteArray::Param aData) {
|
||||
if (!mCallback) {
|
||||
return;
|
||||
}
|
||||
|
||||
JNIEnv* const env = jni::GetGeckoThreadEnv();
|
||||
const size_t length = size_t(env->GetArrayLength(aData.Get()));
|
||||
|
||||
if (!length) {
|
||||
return;
|
||||
}
|
||||
|
||||
jbyte* const data = env->GetByteArrayElements(aData.Get(), nullptr);
|
||||
mCallback->ReceiveFrame(reinterpret_cast<char*>(data), length);
|
||||
env->ReleaseByteArrayElements(aData.Get(), data, JNI_ABORT);
|
||||
}
|
||||
|
||||
CameraStreamImpl* CameraStreamImpl::GetInstance(uint32_t aCamera) {
|
||||
CameraStreamImpl* res = nullptr;
|
||||
switch(aCamera) {
|
||||
case 0:
|
||||
if (mCamera0)
|
||||
res = mCamera0;
|
||||
else
|
||||
res = mCamera0 = new CameraStreamImpl(aCamera);
|
||||
break;
|
||||
case 1:
|
||||
if (mCamera1)
|
||||
res = mCamera1;
|
||||
else
|
||||
res = mCamera1 = new CameraStreamImpl(aCamera);
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
CameraStreamImpl::CameraStreamImpl(uint32_t aCamera) :
|
||||
mInit(false), mCamera(aCamera)
|
||||
{
|
||||
NS_WARNING("CameraStreamImpl::CameraStreamImpl()");
|
||||
mWidth = 0;
|
||||
mHeight = 0;
|
||||
mFps = 0;
|
||||
}
|
||||
|
||||
CameraStreamImpl::~CameraStreamImpl()
|
||||
{
|
||||
NS_WARNING("CameraStreamImpl::~CameraStreamImpl()");
|
||||
}
|
||||
|
||||
bool CameraStreamImpl::Init(const nsCString& contentType, const uint32_t& camera, const uint32_t& width, const uint32_t& height, FrameCallback* aCallback)
|
||||
{
|
||||
mCallback = aCallback;
|
||||
mWidth = width;
|
||||
mHeight = height;
|
||||
|
||||
Callback::Init();
|
||||
jni::IntArray::LocalRef retArray = java::GeckoAppShell::InitCamera(
|
||||
contentType, int32_t(camera), int32_t(width), int32_t(height));
|
||||
nsTArray<int32_t> ret = retArray->GetElements();
|
||||
|
||||
mWidth = uint32_t(ret[1]);
|
||||
mHeight = uint32_t(ret[2]);
|
||||
mFps = uint32_t(ret[3]);
|
||||
|
||||
return !!ret[0];
|
||||
}
|
||||
|
||||
void CameraStreamImpl::Close() {
|
||||
java::GeckoAppShell::CloseCamera();
|
||||
mCallback = nullptr;
|
||||
}
|
||||
|
||||
} // namespace net
|
||||
} // namespace mozilla
|
|
@ -1,71 +0,0 @@
|
|||
/* 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 __CAMERASTREAMIMPL_H__
|
||||
#define __CAMERASTREAMIMPL_H__
|
||||
|
||||
#include "mozilla/jni/Refs.h"
|
||||
|
||||
#include "nsString.h"
|
||||
|
||||
/**
|
||||
* This singleton class handles communication with the Android camera
|
||||
* through JNI. It is used by the IPDL parent or directly from the chrome process
|
||||
*/
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
class CameraStreamImpl {
|
||||
public:
|
||||
class FrameCallback {
|
||||
public:
|
||||
virtual void ReceiveFrame(char* frame, uint32_t length) = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* instance bound to a given camera
|
||||
*/
|
||||
static CameraStreamImpl* GetInstance(uint32_t aCamera);
|
||||
|
||||
bool initNeeded() {
|
||||
return !mInit;
|
||||
}
|
||||
|
||||
FrameCallback* GetFrameCallback() {
|
||||
return mCallback;
|
||||
}
|
||||
|
||||
MOZ_MUST_USE bool Init(const nsCString& contentType, const uint32_t& camera, const uint32_t& width, const uint32_t& height, FrameCallback* callback);
|
||||
void Close();
|
||||
|
||||
uint32_t GetWidth() { return mWidth; }
|
||||
uint32_t GetHeight() { return mHeight; }
|
||||
uint32_t GetFps() { return mFps; }
|
||||
|
||||
void takePicture(const nsAString& aFileName);
|
||||
|
||||
private:
|
||||
class Callback;
|
||||
|
||||
CameraStreamImpl(uint32_t aCamera);
|
||||
CameraStreamImpl(const CameraStreamImpl&);
|
||||
CameraStreamImpl& operator=(const CameraStreamImpl&);
|
||||
|
||||
~CameraStreamImpl();
|
||||
|
||||
void TransmitFrame(jni::ByteArray::Param aData);
|
||||
|
||||
bool mInit;
|
||||
uint32_t mCamera;
|
||||
uint32_t mWidth;
|
||||
uint32_t mHeight;
|
||||
uint32_t mFps;
|
||||
FrameCallback* mCallback;
|
||||
};
|
||||
|
||||
} // namespace net
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
|
@ -1,60 +0,0 @@
|
|||
/* 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/. */
|
||||
|
||||
#if !defined(RawStructs_h_)
|
||||
#define RawStructs_h_
|
||||
|
||||
static const uint32_t RAW_ID = 0x595556;
|
||||
|
||||
struct nsRawVideo_PRUint24 {
|
||||
operator uint32_t() const { return value[2] << 16 | value[1] << 8 | value[0]; }
|
||||
nsRawVideo_PRUint24& operator= (const uint32_t& rhs)
|
||||
{ value[2] = (rhs & 0x00FF0000) >> 16;
|
||||
value[1] = (rhs & 0x0000FF00) >> 8;
|
||||
value[0] = (rhs & 0x000000FF);
|
||||
return *this; }
|
||||
private:
|
||||
uint8_t value[3];
|
||||
};
|
||||
|
||||
struct RawPacketHeader {
|
||||
typedef nsRawVideo_PRUint24 PRUint24;
|
||||
uint8_t packetID;
|
||||
PRUint24 codecID;
|
||||
};
|
||||
|
||||
// This is Arc's draft from wiki.xiph.org/OggYUV
|
||||
struct RawVideoHeader {
|
||||
typedef nsRawVideo_PRUint24 PRUint24;
|
||||
uint8_t headerPacketID; // Header Packet ID (always 0)
|
||||
PRUint24 codecID; // Codec identifier (always "YUV")
|
||||
uint8_t majorVersion; // Version Major (breaks backwards compat)
|
||||
uint8_t minorVersion; // Version Minor (preserves backwards compat)
|
||||
uint16_t options; // Bit 1: Color (false = B/W)
|
||||
// Bits 2-4: Chroma Pixel Shape
|
||||
// Bit 5: 50% horizontal offset for Cr samples
|
||||
// Bit 6: 50% vertical ...
|
||||
// Bits 7-8: Chroma Blending
|
||||
// Bit 9: Packed (false = Planar)
|
||||
// Bit 10: Cr Staggered Horizontally
|
||||
// Bit 11: Cr Staggered Vertically
|
||||
// Bit 12: Unused (format is always little endian)
|
||||
// Bit 13: Interlaced (false = Progressive)
|
||||
// Bits 14-16: Interlace options (undefined)
|
||||
|
||||
uint8_t alphaChannelBpp;
|
||||
uint8_t lumaChannelBpp;
|
||||
uint8_t chromaChannelBpp;
|
||||
uint8_t colorspace;
|
||||
|
||||
PRUint24 frameWidth;
|
||||
PRUint24 frameHeight;
|
||||
PRUint24 aspectNumerator;
|
||||
PRUint24 aspectDenominator;
|
||||
|
||||
uint32_t framerateNumerator;
|
||||
uint32_t framerateDenominator;
|
||||
};
|
||||
|
||||
#endif // RawStructs_h_
|
|
@ -1,27 +0,0 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# 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/.
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
|
||||
EXPORTS.mozilla.net += [
|
||||
'CameraStreamImpl.h',
|
||||
]
|
||||
UNIFIED_SOURCES += [
|
||||
'AndroidCaptureProvider.cpp',
|
||||
'CameraStreamImpl.cpp',
|
||||
]
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'nsDeviceChannel.cpp',
|
||||
'nsDeviceProtocolHandler.cpp',
|
||||
]
|
||||
|
||||
include('/ipc/chromium/chromium-config.mozbuild')
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
'/netwerk/base/',
|
||||
]
|
|
@ -1,31 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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 nsDeviceCaptureProvider_h_
|
||||
#define nsDeviceCaptureProvider_h_
|
||||
|
||||
#include "nsIInputStream.h"
|
||||
|
||||
struct nsCaptureParams {
|
||||
bool captureAudio;
|
||||
bool captureVideo;
|
||||
uint32_t frameRate;
|
||||
uint32_t frameLimit;
|
||||
uint32_t timeLimit;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t bpp;
|
||||
uint32_t camera;
|
||||
};
|
||||
|
||||
class nsDeviceCaptureProvider : public nsISupports
|
||||
{
|
||||
public:
|
||||
virtual MOZ_MUST_USE nsresult Init(nsACString& aContentType,
|
||||
nsCaptureParams* aParams,
|
||||
nsIInputStream** aStream) = 0;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,152 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "plstr.h"
|
||||
#include "nsDeviceChannel.h"
|
||||
#include "nsDeviceCaptureProvider.h"
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "AndroidCaptureProvider.h"
|
||||
#endif
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
// Copied from image/decoders/icon/nsIconURI.cpp
|
||||
// takes a string like ?size=32&contentType=text/html and returns a new string
|
||||
// containing just the attribute values. i.e you could pass in this string with
|
||||
// an attribute name of "size=", this will return 32
|
||||
// Assumption: attribute pairs are separated by &
|
||||
void extractAttributeValue(const char* searchString, const char* attributeName, nsCString& result)
|
||||
{
|
||||
result.Truncate();
|
||||
|
||||
if (!searchString || !attributeName)
|
||||
return;
|
||||
|
||||
uint32_t attributeNameSize = strlen(attributeName);
|
||||
const char *startOfAttribute = PL_strcasestr(searchString, attributeName);
|
||||
if (!startOfAttribute ||
|
||||
!( *(startOfAttribute-1) == '?' || *(startOfAttribute-1) == '&') )
|
||||
return;
|
||||
|
||||
startOfAttribute += attributeNameSize; // Skip the attributeName
|
||||
if (!*startOfAttribute)
|
||||
return;
|
||||
|
||||
const char *endOfAttribute = strchr(startOfAttribute, '&');
|
||||
if (endOfAttribute) {
|
||||
result.Assign(Substring(startOfAttribute, endOfAttribute));
|
||||
} else {
|
||||
result.Assign(startOfAttribute);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED(nsDeviceChannel,
|
||||
nsBaseChannel,
|
||||
nsIChannel)
|
||||
|
||||
// nsDeviceChannel methods
|
||||
nsDeviceChannel::nsDeviceChannel()
|
||||
{
|
||||
SetContentType(NS_LITERAL_CSTRING("image/png"));
|
||||
}
|
||||
|
||||
nsDeviceChannel::~nsDeviceChannel()
|
||||
{
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDeviceChannel::Init(nsIURI* aUri)
|
||||
{
|
||||
nsBaseChannel::Init();
|
||||
nsBaseChannel::SetURI(aUri);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDeviceChannel::OpenContentStream(bool aAsync,
|
||||
nsIInputStream** aStream,
|
||||
nsIChannel** aChannel)
|
||||
{
|
||||
if (!aAsync)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
nsCOMPtr<nsIURI> uri = nsBaseChannel::URI();
|
||||
*aStream = nullptr;
|
||||
*aChannel = nullptr;
|
||||
|
||||
nsAutoCString spec;
|
||||
nsresult rv = uri->GetSpec(spec);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsAutoCString type;
|
||||
|
||||
RefPtr<nsDeviceCaptureProvider> capture;
|
||||
nsCaptureParams captureParams;
|
||||
captureParams.camera = 0;
|
||||
if (kNotFound != spec.Find(NS_LITERAL_CSTRING("type=image/png"),
|
||||
true,
|
||||
0,
|
||||
-1)) {
|
||||
type.AssignLiteral("image/png");
|
||||
SetContentType(type);
|
||||
captureParams.captureAudio = false;
|
||||
captureParams.captureVideo = true;
|
||||
captureParams.timeLimit = 0;
|
||||
captureParams.frameLimit = 1;
|
||||
nsAutoCString buffer;
|
||||
extractAttributeValue(spec.get(), "width=", buffer);
|
||||
nsresult err;
|
||||
captureParams.width = buffer.ToInteger(&err);
|
||||
if (!captureParams.width)
|
||||
captureParams.width = 640;
|
||||
extractAttributeValue(spec.get(), "height=", buffer);
|
||||
captureParams.height = buffer.ToInteger(&err);
|
||||
if (!captureParams.height)
|
||||
captureParams.height = 480;
|
||||
extractAttributeValue(spec.get(), "camera=", buffer);
|
||||
captureParams.camera = buffer.ToInteger(&err);
|
||||
captureParams.bpp = 32;
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
capture = GetAndroidCaptureProvider();
|
||||
#endif
|
||||
} else if (kNotFound != spec.Find(NS_LITERAL_CSTRING("type=video/x-raw-yuv"),
|
||||
true,
|
||||
0,
|
||||
-1)) {
|
||||
type.AssignLiteral("video/x-raw-yuv");
|
||||
SetContentType(type);
|
||||
captureParams.captureAudio = false;
|
||||
captureParams.captureVideo = true;
|
||||
nsAutoCString buffer;
|
||||
extractAttributeValue(spec.get(), "width=", buffer);
|
||||
nsresult err;
|
||||
captureParams.width = buffer.ToInteger(&err);
|
||||
if (!captureParams.width)
|
||||
captureParams.width = 640;
|
||||
extractAttributeValue(spec.get(), "height=", buffer);
|
||||
captureParams.height = buffer.ToInteger(&err);
|
||||
if (!captureParams.height)
|
||||
captureParams.height = 480;
|
||||
extractAttributeValue(spec.get(), "camera=", buffer);
|
||||
captureParams.camera = buffer.ToInteger(&err);
|
||||
captureParams.bpp = 32;
|
||||
captureParams.timeLimit = 0;
|
||||
captureParams.frameLimit = 60000;
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
// only enable if "device.camera.enabled" is true.
|
||||
if (Preferences::GetBool("device.camera.enabled", false) == true)
|
||||
capture = GetAndroidCaptureProvider();
|
||||
#endif
|
||||
} else {
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
if (!capture)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
return capture->Init(type, &captureParams, aStream);
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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 nsDeviceChannel_h_
|
||||
#define nsDeviceChannel_h_
|
||||
|
||||
#include "nsBaseChannel.h"
|
||||
|
||||
class nsDeviceChannel : public nsBaseChannel
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
nsDeviceChannel();
|
||||
|
||||
MOZ_MUST_USE nsresult Init(nsIURI* uri);
|
||||
MOZ_MUST_USE nsresult OpenContentStream(bool aAsync,
|
||||
nsIInputStream **aStream,
|
||||
nsIChannel **aChannel) override;
|
||||
|
||||
protected:
|
||||
~nsDeviceChannel();
|
||||
};
|
||||
#endif
|
|
@ -1,93 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsDeviceProtocolHandler.h"
|
||||
#include "nsDeviceChannel.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsSimpleURI.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
NS_IMPL_ISUPPORTS(nsDeviceProtocolHandler,
|
||||
nsIProtocolHandler)
|
||||
|
||||
nsresult
|
||||
nsDeviceProtocolHandler::Init(){
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDeviceProtocolHandler::GetScheme(nsACString &aResult)
|
||||
{
|
||||
aResult.AssignLiteral("moz-device");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDeviceProtocolHandler::GetDefaultPort(int32_t *aResult)
|
||||
{
|
||||
*aResult = -1; // no port for moz_device: URLs
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDeviceProtocolHandler::GetProtocolFlags(uint32_t *aResult)
|
||||
{
|
||||
*aResult = URI_NORELATIVE | URI_NOAUTH | URI_DANGEROUS_TO_LOAD;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDeviceProtocolHandler::NewURI(const nsACString &spec,
|
||||
const char *originCharset,
|
||||
nsIURI *baseURI,
|
||||
nsIURI **result)
|
||||
{
|
||||
RefPtr<nsSimpleURI> uri = new nsSimpleURI();
|
||||
|
||||
nsresult rv = uri->SetSpec(spec);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
uri.forget(result);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDeviceProtocolHandler::NewChannel2(nsIURI* aURI,
|
||||
nsILoadInfo* aLoadInfo,
|
||||
nsIChannel** aResult)
|
||||
{
|
||||
RefPtr<nsDeviceChannel> channel = new nsDeviceChannel();
|
||||
nsresult rv = channel->Init(aURI);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// set the loadInfo on the new channel
|
||||
rv = channel->SetLoadInfo(aLoadInfo);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
channel.forget(aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDeviceProtocolHandler::NewChannel(nsIURI* aURI, nsIChannel **aResult)
|
||||
{
|
||||
return NewChannel2(aURI, nullptr, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDeviceProtocolHandler::AllowPort(int32_t port,
|
||||
const char *scheme,
|
||||
bool *aResult)
|
||||
{
|
||||
// don't override anything.
|
||||
*aResult = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
} // namespace net
|
||||
} // namespace mozilla
|
|
@ -1,34 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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 nsDeviceProtocolHandler_h_
|
||||
#define nsDeviceProtocolHandler_h_
|
||||
|
||||
#include "nsIProtocolHandler.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
// {6b0ffe9e-d114-486b-aeb7-da62e7273ed5}
|
||||
#define NS_DEVICEPROTOCOLHANDLER_CID \
|
||||
{ 0x60ffe9e, 0xd114, 0x486b, \
|
||||
{0xae, 0xb7, 0xda, 0x62, 0xe7, 0x27, 0x3e, 0xd5} }
|
||||
|
||||
class nsDeviceProtocolHandler final : public nsIProtocolHandler {
|
||||
~nsDeviceProtocolHandler() {}
|
||||
|
||||
public:
|
||||
NS_DECL_THREADSAFE_ISUPPORTS
|
||||
NS_DECL_NSIPROTOCOLHANDLER
|
||||
|
||||
nsDeviceProtocolHandler() {}
|
||||
|
||||
MOZ_MUST_USE nsresult Init();
|
||||
};
|
||||
|
||||
} // namespace net
|
||||
} // namespace mozilla
|
||||
#endif
|
|
@ -4,7 +4,7 @@
|
|||
# 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/.
|
||||
|
||||
DIRS += ['about', 'data', 'device', 'file', 'ftp']
|
||||
DIRS += ['about', 'data', 'file', 'ftp']
|
||||
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
|
||||
DIRS += ['gio']
|
||||
DIRS += ['http', 'res', 'viewsource', 'websocket', 'wyciwyg']
|
||||
|
|
|
@ -1158,4 +1158,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
|
|||
|
||||
static const int32_t kUnknownId = -1;
|
||||
|
||||
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1516687405710000);
|
||||
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1516729268858000);
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
06se.com: could not connect to host
|
||||
0day.su: could not connect to host
|
||||
0xaa55.me: could not connect to host
|
||||
27728522.com: could not connect to host
|
||||
360live.fr: could not connect to host
|
||||
47tech.com: could not connect to host
|
||||
4d2.xyz: could not connect to host
|
||||
4loc.us: could not connect to host
|
||||
4x4.lk: could not connect to host
|
||||
68277.me: could not connect to host
|
||||
724go.com: could not connect to host
|
||||
8560.be: could not connect to host
|
||||
87577.com: could not connect to host
|
||||
|
@ -15,7 +12,6 @@
|
|||
8ack.de: could not connect to host
|
||||
8t88.biz: could not connect to host
|
||||
91-freedom.com: could not connect to host
|
||||
9ss6.com: could not connect to host
|
||||
aaronmcguire.me: could not connect to host
|
||||
abolition.co: could not connect to host
|
||||
accwing.com: could not connect to host
|
||||
|
@ -30,6 +26,7 @@ akoww.de: could not connect to host
|
|||
akul.co.in: could not connect to host
|
||||
alexmol.tk: could not connect to host
|
||||
alkel.info: could not connect to host
|
||||
allforyou.at: could not connect to host
|
||||
alrait.com: could not connect to host
|
||||
altahrim.net: could not connect to host
|
||||
ameho.me: could not connect to host
|
||||
|
@ -38,6 +35,7 @@ anoneko.com: could not connect to host
|
|||
anthropoid.ca: could not connect to host
|
||||
arent.kz: could not connect to host
|
||||
arksan.com.tr: could not connect to host
|
||||
arthermitage.org: could not connect to host
|
||||
artisense.de: could not connect to host
|
||||
askmagicconch.com: could not connect to host
|
||||
assdecoeur.org: could not connect to host
|
||||
|
@ -45,7 +43,6 @@ asta-bar.de: could not connect to host
|
|||
australiancattle.dog: could not connect to host
|
||||
autostop-occasions.be: could not connect to host
|
||||
auvernet.org: could not connect to host
|
||||
avi9526.pp.ua: could not connect to host
|
||||
awan.tech: could not connect to host
|
||||
awf0.xyz: could not connect to host
|
||||
azabani.com: could not connect to host
|
||||
|
@ -66,22 +63,18 @@ blumen-garage.de: could not connect to host
|
|||
blumiges-fischbachtal.de: could not connect to host
|
||||
bodrumfarm.com: could not connect to host
|
||||
bohan.co: could not connect to host
|
||||
bouncourseplanner.net: could not connect to host
|
||||
bowlsheet.com: could not connect to host
|
||||
brettabel.com: could not connect to host
|
||||
btcgo.nl: could not connect to host
|
||||
businessfurs.info: could not connect to host
|
||||
buyshoe.org: could not connect to host
|
||||
by1898.com: could not connect to host
|
||||
cais.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 119" data: no]
|
||||
cajio.ru: could not connect to host
|
||||
cake-time.co.uk: could not connect to host
|
||||
calculatoaresecondhand.xyz: could not connect to host
|
||||
callabs.net: could not connect to host
|
||||
cannarobotics.com: could not connect to host
|
||||
capellidipremoli.com: could not connect to host
|
||||
carloshmm.stream: could not connect to host
|
||||
casperpanel.com: could not connect to host
|
||||
cbdev.de: could not connect to host
|
||||
centos.pub: could not connect to host
|
||||
challengeskins.com: could not connect to host
|
||||
charuru.moe: could not connect to host
|
||||
|
@ -91,18 +84,20 @@ china-line.org: could not connect to host
|
|||
chloehorler.com: could not connect to host
|
||||
christiangaetano.com: could not connect to host
|
||||
christina-quast.de: could not connect to host
|
||||
chziyue.com: could not connect to host
|
||||
cielly.com: could not connect to host
|
||||
cinto.cc: could not connect to host
|
||||
clearviewwealthprojector.com.au: could not connect to host
|
||||
cloudbleed.info: could not connect to host
|
||||
cloudopt.net: could not connect to host
|
||||
cmpr.es: could not connect to host
|
||||
cnlic.com: could not connect to host
|
||||
codepult.com: could not connect to host
|
||||
codercross.com: could not connect to host
|
||||
coffeetocode.me: could not connect to host
|
||||
colleencornez.com: could not connect to host
|
||||
colo-tech.com: could not connect to host
|
||||
comff.net: could not connect to host
|
||||
comyuno.com: could not connect to host
|
||||
consejosdenutricion.com: could not connect to host
|
||||
corinnanese.de: could not connect to host
|
||||
correiodovale.com.br: could not connect to host
|
||||
|
@ -116,7 +111,6 @@ criticalaim.com: could not connect to host
|
|||
cselzer.com: could not connect to host
|
||||
csgo77.com: could not connect to host
|
||||
ctrld.me: could not connect to host
|
||||
cyber-perikarp.eu: could not connect to host
|
||||
cypherpunk.ws: could not connect to host
|
||||
d-bood.site: could not connect to host
|
||||
dahlberg.cologne: could not connect to host
|
||||
|
@ -124,20 +118,23 @@ dannyrohde.de: could not connect to host
|
|||
dataprotectionadvisors.com: could not connect to host
|
||||
datorb.com: could not connect to host
|
||||
dawnsonb.com: could not connect to host
|
||||
dbmteam.com: could not connect to host
|
||||
dcc.moe: could not connect to host
|
||||
de-servers.de: could not connect to host
|
||||
decoyrouting.com: could not connect to host
|
||||
derchris.me: could not connect to host
|
||||
derivativeshub.pro: could not connect to host
|
||||
derrickemery.com: could not connect to host
|
||||
dev-talk.eu: could not connect to host
|
||||
devkid.net: could not connect to host
|
||||
devops.moe: could not connect to host
|
||||
dick.red: could not connect to host
|
||||
digioccumss.ddns.net: could not connect to host
|
||||
digitalcloud.ovh: could not connect to host
|
||||
diguass.us: could not connect to host
|
||||
dijks.com: could not connect to host
|
||||
dingcc.org: could not connect to host
|
||||
dingcc.xyz: could not connect to host
|
||||
dirtycat.ru: could not connect to host
|
||||
disadattamentolavorativo.it: could not connect to host
|
||||
disco-crazy-world.de: could not connect to host
|
||||
djangogolf.com: could not connect to host
|
||||
|
@ -150,12 +147,10 @@ duelsow.eu: could not connect to host
|
|||
duo.money: could not connect to host
|
||||
dynts.pro: could not connect to host
|
||||
edit.yahoo.com: could not connect to host
|
||||
educatoys.com.br: could not connect to host
|
||||
eeb98.com: could not connect to host
|
||||
egbert.net: could not connect to host
|
||||
ehuber.info: could not connect to host
|
||||
el-soul.com: could not connect to host
|
||||
eliott.be: could not connect to host
|
||||
endlessdiy.ca: could not connect to host
|
||||
erinaceinae.com: could not connect to host
|
||||
eriser.fr: could not connect to host
|
||||
|
@ -176,15 +171,14 @@ first-time-offender.com: could not connect to host
|
|||
fixate.ru: could not connect to host
|
||||
fixmyglitch.com: could not connect to host
|
||||
flam.io: could not connect to host
|
||||
fmapplication.com: could not connect to host
|
||||
fossewayflowers.co.uk: could not connect to host
|
||||
fossewayflowers.com: could not connect to host
|
||||
foxmay.co.uk: could not connect to host
|
||||
frasys.cloud: could not connect to host
|
||||
freaksites.dk: could not connect to host
|
||||
fredliang.cn: could not connect to host
|
||||
freesounding.com: could not connect to host
|
||||
freesounding.ru: could not connect to host
|
||||
fromlemaytoz.com: could not connect to host
|
||||
fsck.cz: could not connect to host
|
||||
fsf.moe: could not connect to host
|
||||
fukuko.biz: could not connect to host
|
||||
|
@ -204,7 +198,6 @@ gautham.pro: could not connect to host
|
|||
gayforgenji.com: could not connect to host
|
||||
gaygeeks.de: could not connect to host
|
||||
gchq.wtf: could not connect to host
|
||||
gdhzcgs.com: could not connect to host
|
||||
geeks.berlin: could not connect to host
|
||||
geneve.guide: could not connect to host
|
||||
get-refer.com: could not connect to host
|
||||
|
@ -222,23 +215,21 @@ graffen.dk: could not connect to host
|
|||
gratisonlinesex.com: could not connect to host
|
||||
gregorykelleher.com: could not connect to host
|
||||
gritte.net: could not connect to host
|
||||
gtdgo.com: could not connect to host
|
||||
gvt2.com: could not connect to host
|
||||
gvt3.com: could not connect to host
|
||||
hajnzic.at: could not connect to host
|
||||
harald-pfeiffer.de: could not connect to host
|
||||
heijblok.com: could not connect to host
|
||||
hejahanif.se: could not connect to host
|
||||
helsingfors.guide: could not connect to host
|
||||
here.ml: could not connect to host
|
||||
hg881.com: could not connect to host
|
||||
hiraku.me: could not connect to host
|
||||
hloe0xff.ru: could not connect to host
|
||||
hoodoo.io: could not connect to host
|
||||
hoodoo.tech: could not connect to host
|
||||
hundter.com: could not connect to host
|
||||
hyper-matrix.org: could not connect to host
|
||||
ibase.com: could not connect to host
|
||||
icij.org: could not connect to host
|
||||
ifxnet.com: could not connect to host
|
||||
ileat.com: could not connect to host
|
||||
industreiler.com: could not connect to host
|
||||
|
@ -248,7 +239,6 @@ injust.me: could not connect to host
|
|||
installgentoo.net: could not connect to host
|
||||
integraelchen.de: could not connect to host
|
||||
integrationinc.com: could not connect to host
|
||||
interessiert-uns.net: could not connect to host
|
||||
ipv6.watch: could not connect to host
|
||||
islief.com: could not connect to host
|
||||
issuesofconcern.in: could not connect to host
|
||||
|
@ -266,8 +256,10 @@ joostbovee.nl: could not connect to host
|
|||
jstelecom.com.br: could not connect to host
|
||||
just-pools.co.za: could not connect to host
|
||||
justmy.website: could not connect to host
|
||||
jym.fit: could not connect to host
|
||||
k-wallet.com: could not connect to host
|
||||
k258059.net: could not connect to host
|
||||
kabus.org: could not connect to host
|
||||
kamikaichimaru.com: could not connect to host
|
||||
kapo.info: could not connect to host
|
||||
karanlyons.com: could not connect to host
|
||||
|
@ -296,6 +288,7 @@ lifenexto.com: could not connect to host
|
|||
lijero.co: could not connect to host
|
||||
linksanitizer.com: could not connect to host
|
||||
linksextremist.at: could not connect to host
|
||||
lirion.de: could not connect to host
|
||||
lissabon.guide: could not connect to host
|
||||
littleservice.cn: could not connect to host
|
||||
liukang.tech: could not connect to host
|
||||
|
@ -318,7 +311,6 @@ markprof.ru: could not connect to host
|
|||
markus-ullmann.de: could not connect to host
|
||||
martin-mattel.com: could not connect to host
|
||||
martinrogalla.com: could not connect to host
|
||||
mastd.me: could not connect to host
|
||||
mathijskingma.nl: could not connect to host
|
||||
mcdanieldevelopmentservices.com: could not connect to host
|
||||
mcea-hld.jp: could not connect to host
|
||||
|
@ -339,7 +331,6 @@ muh.io: could not connect to host
|
|||
muj-svet.cz: could not connect to host
|
||||
munduch.cz: could not connect to host
|
||||
murmel.it: could not connect to host
|
||||
mygreatjob.eu: could not connect to host
|
||||
naphex.rocks: could not connect to host
|
||||
narodsovety.ru: could not connect to host
|
||||
navdeep.ca: could not connect to host
|
||||
|
@ -356,6 +347,7 @@ nnote.net: could not connect to host
|
|||
norrkemi.se: could not connect to host
|
||||
nostraspace.com: could not connect to host
|
||||
notesforpebble.com: could not connect to host
|
||||
novelabs.eu: could not connect to host
|
||||
nsa.lol: could not connect to host
|
||||
nsa.wtf: could not connect to host
|
||||
nsbfalconacademy.org: could not connect to host
|
||||
|
@ -386,7 +378,6 @@ pinebaylibrary.org: could not connect to host
|
|||
pkautodesign.com: could not connect to host
|
||||
pkov.cz: could not connect to host
|
||||
plaasprodukte.com: could not connect to host
|
||||
playsharp.com: could not connect to host
|
||||
plussizereviews.com: could not connect to host
|
||||
pointagri.com: could not connect to host
|
||||
polit.im: could not connect to host
|
||||
|
@ -415,13 +406,14 @@ saferedirectlink.com: could not connect to host
|
|||
sallysubs.com: could not connect to host
|
||||
sanatrans.com: could not connect to host
|
||||
sarndipity.com: could not connect to host
|
||||
sectest.ml: could not connect to host
|
||||
securitymap.wiki: could not connect to host
|
||||
sellmoretires.com: could not connect to host
|
||||
semantheme.fr: could not connect to host
|
||||
servecrypt.com: could not connect to host
|
||||
servecrypt.net: could not connect to host
|
||||
servecrypt.ru: could not connect to host
|
||||
sgcaccounts.co.uk: could not connect to host
|
||||
servfefe.com: could not connect to host
|
||||
shadowplus.net: could not connect to host
|
||||
shadowrocket.net: could not connect to host
|
||||
sharevari.com: could not connect to host
|
||||
|
@ -435,10 +427,8 @@ simbolo.co.uk: could not connect to host
|
|||
simonwessel.net: could not connect to host
|
||||
simplerses.com: could not connect to host
|
||||
siqi.wang: could not connect to host
|
||||
sitesko.de: could not connect to host
|
||||
sky-aroma.com: could not connect to host
|
||||
skyasker.com: could not connect to host
|
||||
snille.com: could not connect to host
|
||||
socialworkout.com: could not connect to host
|
||||
socialworkout.net: could not connect to host
|
||||
socialworkout.org: could not connect to host
|
||||
|
@ -460,7 +450,6 @@ sussexwebdesigns.com: could not connect to host
|
|||
sviz.pro: could not connect to host
|
||||
techask.it: could not connect to host
|
||||
tenispopular.com: could not connect to host
|
||||
tetsai.com: could not connect to host
|
||||
texasllcpros.com: could not connect to host
|
||||
theprivacysolution.com: could not connect to host
|
||||
thesehighsandlows.com: could not connect to host
|
||||
|
@ -481,7 +470,6 @@ tyil.nl: could not connect to host
|
|||
tyil.work: could not connect to host
|
||||
umsapi.com: could not connect to host
|
||||
unicorn.li: could not connect to host
|
||||
unicorncloud.org: could not connect to host
|
||||
vadik.me: could not connect to host
|
||||
vanderstraeten.dynv6.net: could not connect to host
|
||||
varta.io: could not connect to host
|
||||
|
@ -489,12 +477,12 @@ vcelin-na-doliku.cz: could not connect to host
|
|||
venmos.com: could not connect to host
|
||||
viditut.com: could not connect to host
|
||||
vilog.me: could not connect to host
|
||||
vitalthings.de: could not connect to host
|
||||
vmgirls.com: could not connect to host
|
||||
vmug.pl: could not connect to host
|
||||
wachter.biz: could not connect to host
|
||||
wafa4hw.com: could not connect to host
|
||||
wantshow.com.br: could not connect to host
|
||||
warlions.info: could not connect to host
|
||||
watchweasel.com: could not connect to host
|
||||
weareincognito.org: could not connect to host
|
||||
webart-factory.de: could not connect to host
|
||||
|
@ -514,16 +502,22 @@ www-8887999.com: could not connect to host
|
|||
www.re: could not connect to host
|
||||
www.sb: could not connect to host
|
||||
www.simbolo.co.uk: could not connect to host
|
||||
xecureit.com: could not connect to host
|
||||
xia100.xyz: could not connect to host
|
||||
xiaoyu.net: could not connect to host
|
||||
xing.ml: could not connect to host
|
||||
xqin.net: could not connect to host
|
||||
xtremenutrition.com.br: could not connect to host
|
||||
yafuoku.ru: could not connect to host
|
||||
yarogneva.ru: could not connect to host
|
||||
yffengshi.ml: could not connect to host
|
||||
yux.fr: could not connect to host
|
||||
zaoext.com: could not connect to host
|
||||
zenfusion.fr: could not connect to host
|
||||
zenghx.tk: could not connect to host
|
||||
zerosource.net: could not connect to host
|
||||
zeug.co: could not connect to host
|
||||
zijung.me: could not connect to host
|
||||
zulu7.com: could not connect to host
|
||||
zuviel.space: could not connect to host
|
||||
zzw.ca: could not connect to host
|
||||
|
@ -531,8 +525,8 @@ zzw.ca: could not connect to host
|
|||
0005.com: could not connect to host
|
||||
0005aa.com: could not connect to host
|
||||
007sascha.de: did not receive HSTS header
|
||||
020wifi.nl: could not connect to host
|
||||
0222aa.com: did not receive HSTS header
|
||||
020wifi.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 119" data: no]
|
||||
0222aa.com: could not connect to host
|
||||
048.ag: could not connect to host
|
||||
050508.com: could not connect to host
|
||||
0f.io: could not connect to host
|
||||
|
@ -788,7 +782,6 @@ acuve.jp: could not connect to host
|
|||
ada.is: max-age too low: 2592000
|
||||
adajwells.me: could not connect to host
|
||||
adambryant.ca: could not connect to host
|
||||
adamradocz.com: could not connect to host
|
||||
adamricheimer.com: could not connect to host
|
||||
adamwk.com: did not receive HSTS header
|
||||
adastra.re: could not connect to host
|
||||
|
@ -799,6 +792,7 @@ adelevie.com: could not connect to host
|
|||
adelinlydia-coach.com: did not receive HSTS header
|
||||
adequatetechnology.com: could not connect to host
|
||||
aderal.io: could not connect to host
|
||||
adesa-asesoria.com: did not receive HSTS header
|
||||
adfa-1.com: could not connect to host
|
||||
adhs-chaoten.net: did not receive HSTS header
|
||||
adindexr.com: could not connect to host
|
||||
|
@ -926,7 +920,6 @@ alloffice.com.ua: did not receive HSTS header
|
|||
alloinformatique.net: could not connect to host
|
||||
allrealty.co.za: could not connect to host
|
||||
allstarswithus.com: could not connect to host
|
||||
almavios.com: did not receive HSTS header
|
||||
aloalabs.com: did not receive HSTS header
|
||||
alpha.irccloud.com: could not connect to host
|
||||
alphabit-secure.com: could not connect to host
|
||||
|
@ -1140,6 +1133,7 @@ ascamso.com: could not connect to host
|
|||
aschaefer.net: could not connect to host
|
||||
asdpress.cn: could not connect to host
|
||||
ashlane-cottages.com: could not connect to host
|
||||
asianbet77.net: did not receive HSTS header
|
||||
asianodor.com: could not connect to host
|
||||
ask.pe: did not receive HSTS header
|
||||
askfit.cz: did not receive HSTS header
|
||||
|
@ -1367,7 +1361,6 @@ bestcellular.com: did not receive HSTS header
|
|||
besthost.cz: did not receive HSTS header
|
||||
bestof1001.de: did not receive HSTS header
|
||||
bestorangeseo.com: could not connect to host
|
||||
bestschools.top: could not connect to host
|
||||
betaclean.fr: did not receive HSTS header
|
||||
betafive.net: could not connect to host
|
||||
betakah.net: could not connect to host
|
||||
|
@ -1474,6 +1467,7 @@ blendlecdn.com: could not connect to host
|
|||
blenheimchalcot.com: did not receive HSTS header
|
||||
blessnet.jp: did not receive HSTS header
|
||||
blha303.com.au: could not connect to host
|
||||
blidz.com: did not receive HSTS header
|
||||
blitzprog.org: did not receive HSTS header
|
||||
blmiller.com: could not connect to host
|
||||
blocksatz-medien.de: did not receive HSTS header
|
||||
|
@ -1584,7 +1578,6 @@ bsdtips.com: could not connect to host
|
|||
bsociabl.com: could not connect to host
|
||||
btc-e.com: did not receive HSTS header
|
||||
btcdlc.com: could not connect to host
|
||||
btxiaobai.com: did not receive HSTS header
|
||||
buben.tech: did not receive HSTS header
|
||||
bubulazi.com: did not receive HSTS header
|
||||
bubulazy.com: did not receive HSTS header
|
||||
|
@ -1808,7 +1801,7 @@ chancat.blog: max-age too low: 2592000
|
|||
chandlerredding.com: did not receive HSTS header
|
||||
changetip.com: did not receive HSTS header
|
||||
chaos.fail: could not connect to host
|
||||
chaoswebs.net: did not receive HSTS header
|
||||
chaoswebs.net: could not connect to host
|
||||
charityclear.com: did not receive HSTS header
|
||||
charitystreet.co.uk: could not connect to host
|
||||
charlipopkids.com.au: could not connect to host
|
||||
|
@ -1935,6 +1928,7 @@ cloudimproved.com: could not connect to host
|
|||
cloudimprovedtest.com: could not connect to host
|
||||
cloudlink.club: could not connect to host
|
||||
cloudns.com.au: could not connect to host
|
||||
cloudopt.net: did not receive HSTS header
|
||||
clouds.webcam: could not connect to host
|
||||
cloudspotterapp.com: did not receive HSTS header
|
||||
cloudstoragemaus.com: could not connect to host
|
||||
|
@ -2179,7 +2173,6 @@ cucc.date: did not receive HSTS header
|
|||
cujanovic.com: did not receive HSTS header
|
||||
cujba.com: could not connect to host
|
||||
culinae.nl: could not connect to host
|
||||
culture-school.top: could not connect to host
|
||||
cumshots-video.ru: could not connect to host
|
||||
cuntflaps.me: could not connect to host
|
||||
cuongquach.com: did not receive HSTS header
|
||||
|
@ -2317,7 +2310,6 @@ deepcovelabs.net: could not connect to host
|
|||
deepearth.uk: could not connect to host
|
||||
deeprecce.link: could not connect to host
|
||||
deeprecce.tech: could not connect to host
|
||||
deepvalley.tech: could not connect to host
|
||||
deetz.nl: did not receive HSTS header
|
||||
deetzen.de: did not receive HSTS header
|
||||
defcon.org: did not receive HSTS header
|
||||
|
@ -2393,6 +2385,7 @@ diannaobos.com: did not receive HSTS header
|
|||
dicando.com: max-age too low: 2592000
|
||||
dicelab.co.uk: could not connect to host
|
||||
dicionariofinanceiro.com: did not receive HSTS header
|
||||
die-partei-reutlingen.de: did not receive HSTS header
|
||||
dieb.photo: could not connect to host
|
||||
dierenkruiden.nl: could not connect to host
|
||||
diewebstube.de: could not connect to host
|
||||
|
@ -2562,7 +2555,7 @@ dubik.su: did not receive HSTS header
|
|||
duelysthub.com: could not connect to host
|
||||
duerls.de: did not receive HSTS header
|
||||
dukec.me: could not connect to host
|
||||
dullsir.com: could not connect to host
|
||||
dullsir.com: did not receive HSTS header
|
||||
dungi.org: could not connect to host
|
||||
duongpho.com: did not receive HSTS header
|
||||
duskopy.top: could not connect to host
|
||||
|
@ -2641,6 +2634,7 @@ edmodo.com: did not receive HSTS header
|
|||
edpubs.gov: did not receive HSTS header
|
||||
eduardnikolenko.ru: could not connect to host
|
||||
educatio.tech: could not connect to host
|
||||
educatoys.com.br: did not receive HSTS header
|
||||
educourse.ga: could not connect to host
|
||||
eduvance.in: did not receive HSTS header
|
||||
eengezinswoning-in-alphen-aan-den-rijn-kopen.nl: could not connect to host
|
||||
|
@ -2658,6 +2652,7 @@ eengezinswoningverkopen.nl: could not connect to host
|
|||
eenhoorn.ga: could not connect to host
|
||||
eeqj.com: could not connect to host
|
||||
eesistumine2017.ee: could not connect to host
|
||||
effectivecoffee.com: max-age too low: 2628000
|
||||
effectiveosgi.com: could not connect to host
|
||||
efficienthealth.com: did not receive HSTS header
|
||||
effortlesshr.com: did not receive HSTS header
|
||||
|
@ -2789,7 +2784,7 @@ erichalv.com: did not receive HSTS header
|
|||
ericyl.com: could not connect to host
|
||||
eridanus.uk: could not connect to host
|
||||
eriel.com.br: could not connect to host
|
||||
erikwalther.eu: could not connect to host
|
||||
erikwalther.eu: did not receive HSTS header
|
||||
ernaehrungsberatung-zurich.ch: could not connect to host
|
||||
ernesto.at: could not connect to host
|
||||
eromixx.com: did not receive HSTS header
|
||||
|
@ -2901,7 +2896,6 @@ f-rickroll-g.pw: could not connect to host
|
|||
f-s-u.co.uk: could not connect to host
|
||||
f00.ca: did not receive HSTS header
|
||||
f2f.cash: could not connect to host
|
||||
f5nu.com: did not receive HSTS header
|
||||
faber.io: could not connect to host
|
||||
fabhub.io: could not connect to host
|
||||
fabianfischer.de: did not receive HSTS header
|
||||
|
@ -2932,6 +2926,7 @@ fanflow.com: did not receive HSTS header
|
|||
fantasyfootballpundit.com: did not receive HSTS header
|
||||
fanyl.cn: could not connect to host
|
||||
farces.com: did not receive HSTS header
|
||||
farhadexchange.com: did not receive HSTS header
|
||||
fashion.net: did not receive HSTS header
|
||||
fashioncare.cz: did not receive HSTS header
|
||||
fashionholic.my: did not receive HSTS header
|
||||
|
@ -3106,7 +3101,7 @@ fralef.me: did not receive HSTS header
|
|||
francevpn.xyz: could not connect to host
|
||||
francois-vidit.com: did not receive HSTS header
|
||||
frangor.info: did not receive HSTS header
|
||||
frank.fyi: did not receive HSTS header
|
||||
frank.fyi: could not connect to host
|
||||
frankierprofi.de: did not receive HSTS header
|
||||
frankwei.xyz: did not receive HSTS header
|
||||
franta.biz: did not receive HSTS header
|
||||
|
@ -3403,7 +3398,6 @@ govillemo.ca: did not receive HSTS header
|
|||
gparent.org: did not receive HSTS header
|
||||
gpsfix.cz: did not receive HSTS header
|
||||
gpstuner.com: did not receive HSTS header
|
||||
gpsvideocanada.com: did not receive HSTS header
|
||||
graavaapi.elasticbeanstalk.com: could not connect to host
|
||||
gracesofgrief.com: could not connect to host
|
||||
grachtenpandverkopen.nl: could not connect to host
|
||||
|
@ -3627,6 +3621,8 @@ heartyme.net: could not connect to host
|
|||
heathmanners.com: could not connect to host
|
||||
heavystresser.com: could not connect to host
|
||||
hebaus.com: could not connect to host
|
||||
hegen.sk: did not receive HSTS header
|
||||
hegenshop.de: did not receive HSTS header
|
||||
heidilein.info: did not receive HSTS header
|
||||
heimnetze.org: could not connect to host
|
||||
heimonen.eu: did not receive HSTS header
|
||||
|
@ -3675,6 +3671,7 @@ hillcity.org.nz: did not receive HSTS header
|
|||
hilnu.tk: could not connect to host
|
||||
hintergedanken.com: did not receive HSTS header
|
||||
hipercultura.com: did not receive HSTS header
|
||||
hiphop.ren: did not receive HSTS header
|
||||
hiphopconvention.nl: could not connect to host
|
||||
hipnos.net: did not receive HSTS header
|
||||
hiqhub.co.uk: could not connect to host
|
||||
|
@ -3814,6 +3811,7 @@ ich-find-den-g.net: could not connect to host
|
|||
ich-mach-druck.eu: did not receive HSTS header
|
||||
ichnichtskaufmann.de: could not connect to host
|
||||
ichoosebtec.com: did not receive HSTS header
|
||||
icij.org: did not receive HSTS header
|
||||
icity.ly: did not receive HSTS header
|
||||
icloud.net: could not connect to host
|
||||
icntorrent.download: could not connect to host
|
||||
|
@ -3832,6 +3830,7 @@ idedr.com: could not connect to host
|
|||
identitylabs.uk: could not connect to host
|
||||
identitysandbox.gov: could not connect to host
|
||||
idgsupply.com: did not receive HSTS header
|
||||
idinby.dk: did not receive HSTS header
|
||||
idisplay.es: did not receive HSTS header
|
||||
idlekernel.com: could not connect to host
|
||||
idontexist.me: did not receive HSTS header
|
||||
|
@ -3956,7 +3955,6 @@ instinctiveads.com: did not receive HSTS header
|
|||
institutoflordelavida.com: could not connect to host
|
||||
instruktor.io: could not connect to host
|
||||
intel.li: could not connect to host
|
||||
interasistmen.se: did not receive HSTS header
|
||||
interboursegeneva.ch: did not receive HSTS header
|
||||
interference.io: could not connect to host
|
||||
interhosts.co.za: could not connect to host
|
||||
|
@ -3984,7 +3982,6 @@ inverselink.com: could not connect to host
|
|||
investorloanshub.com: could not connect to host
|
||||
invictusmc.uk: could not connect to host
|
||||
invite24.pro: could not connect to host
|
||||
iodice.org: did not receive HSTS header
|
||||
iolife.dk: could not connect to host
|
||||
ionas-law.ro: did not receive HSTS header
|
||||
ionx.co.uk: did not receive HSTS header
|
||||
|
@ -4204,6 +4201,7 @@ johannes-sprink.de: could not connect to host
|
|||
johnbrownphotography.ch: did not receive HSTS header
|
||||
johncardell.com: did not receive HSTS header
|
||||
johners.me: could not connect to host
|
||||
johngaltgroup.com: did not receive HSTS header
|
||||
johnhgaunt.com: did not receive HSTS header
|
||||
johnkastler.net: could not connect to host
|
||||
johnmcgovern.com: max-age too low: 43200
|
||||
|
@ -4271,6 +4269,7 @@ juwairen.cn: could not connect to host
|
|||
jvoice.net: could not connect to host
|
||||
jwilsson.me: could not connect to host
|
||||
jxm.in: could not connect to host
|
||||
jysperm.me: did not receive HSTS header
|
||||
jznet.org: could not connect to host
|
||||
k-dev.de: could not connect to host
|
||||
k-rickroll-g.pw: could not connect to host
|
||||
|
@ -4886,7 +4885,6 @@ manageall.de: could not connect to host
|
|||
manageforall.com: could not connect to host
|
||||
manageforall.de: could not connect to host
|
||||
managemynetsuite.com: did not receive HSTS header
|
||||
manageprojects.com: did not receive HSTS header
|
||||
manantial.mx: did not receive HSTS header
|
||||
mandpress.com: did not receive HSTS header
|
||||
maniadeprazer.com.br: could not connect to host
|
||||
|
@ -4953,7 +4951,6 @@ mastimtibetano.com: could not connect to host
|
|||
mastod.life: could not connect to host
|
||||
mastodon.direct: could not connect to host
|
||||
mastodon.engineering: could not connect to host
|
||||
mastodon.host: did not receive HSTS header
|
||||
mastodon.pl: could not connect to host
|
||||
mastodones.club: could not connect to host
|
||||
masty.nl: did not receive HSTS header
|
||||
|
@ -4977,6 +4974,7 @@ matthewprenger.com: could not connect to host
|
|||
matthiassteen.be: max-age too low: 0
|
||||
mattressinsider.com: max-age too low: 3153600
|
||||
mattsvensson.com: max-age too low: 0
|
||||
mattwservices.co.uk: did not receive HSTS header
|
||||
matty.digital: did not receive HSTS header
|
||||
maultrom.ml: could not connect to host
|
||||
maupiknik.com: did not receive HSTS header
|
||||
|
@ -5005,7 +5003,6 @@ mclist.it: could not connect to host
|
|||
mclyr.com: max-age too low: 7776000
|
||||
mcooperlaw.com: did not receive HSTS header
|
||||
mdfnet.se: did not receive HSTS header
|
||||
mdkr.nl: did not receive HSTS header
|
||||
mdscomp.net: did not receive HSTS header
|
||||
meadowfen.farm: could not connect to host
|
||||
meadowfenfarm.com: could not connect to host
|
||||
|
@ -5463,7 +5460,7 @@ nedwave.com: could not connect to host
|
|||
nedzad.me: could not connect to host
|
||||
neftaly.com: did not receive HSTS header
|
||||
negativzinsen.info: did not receive HSTS header
|
||||
neilgreen.net: could not connect to host
|
||||
neilgreen.net: did not receive HSTS header
|
||||
neko-life.com: did not receive HSTS header
|
||||
neko-system.com: did not receive HSTS header
|
||||
nemno.de: could not connect to host
|
||||
|
@ -5546,7 +5543,6 @@ nightwinds.tk: could not connect to host
|
|||
niho.jp: did not receive HSTS header
|
||||
nikcub.com: could not connect to host
|
||||
niklaslindblad.se: did not receive HSTS header
|
||||
nikobradshaw.com: did not receive HSTS header
|
||||
niloxy.com: did not receive HSTS header
|
||||
ninchisho-online.com: did not receive HSTS header
|
||||
ninhs.org: could not connect to host
|
||||
|
@ -5814,7 +5810,6 @@ orionrebellion.com: could not connect to host
|
|||
orleika.ml: could not connect to host
|
||||
oroweatorganic.com: could not connect to host
|
||||
orthodoxy.lt: did not receive HSTS header
|
||||
orz.uno: did not receive HSTS header
|
||||
osaiyuwu.com: could not connect to host
|
||||
oscloud.com: could not connect to host
|
||||
oscloud.com.ua: could not connect to host
|
||||
|
@ -5998,6 +5993,7 @@ personalizedtouch.co: could not connect to host
|
|||
perthdevicelab.com: did not receive HSTS header
|
||||
pet-life.top: could not connect to host
|
||||
pet-nsk.ru: could not connect to host
|
||||
petcarvers.com: did not receive HSTS header
|
||||
petchart.net: could not connect to host
|
||||
peterkshultz.com: did not receive HSTS header
|
||||
petersmark.com: could not connect to host
|
||||
|
@ -6384,6 +6380,7 @@ rannseier.org: did not receive HSTS header
|
|||
rany.duckdns.org: could not connect to host
|
||||
rany.io: could not connect to host
|
||||
rany.pw: could not connect to host
|
||||
rapido.nu: did not receive HSTS header
|
||||
rapidresearch.me: could not connect to host
|
||||
rapidthunder.io: could not connect to host
|
||||
rasing.me: did not receive HSTS header
|
||||
|
@ -6427,11 +6424,11 @@ readr.pw: could not connect to host
|
|||
reagir43.fr: did not receive HSTS header
|
||||
realmic.net: could not connect to host
|
||||
realmofespionage.com: could not connect to host
|
||||
realraghavgupta.com: could not connect to host
|
||||
reaper.rip: could not connect to host
|
||||
reardenporn.com: could not connect to host
|
||||
rebekaesgabor.online: could not connect to host
|
||||
rebootmc.com: did not receive HSTS header
|
||||
recepty.eu: did not receive HSTS header
|
||||
recommended.reviews: could not connect to host
|
||||
redar.xyz: could not connect to host
|
||||
reddit.com: did not receive HSTS header
|
||||
|
@ -6635,6 +6632,7 @@ runtl.com: did not receive HSTS header
|
|||
runtondev.com: did not receive HSTS header
|
||||
ruqu.nl: could not connect to host
|
||||
rusadmin.biz: did not receive HSTS header
|
||||
rushball.net: did not receive HSTS header
|
||||
ruska-modra.cz: did not receive HSTS header
|
||||
ruskamodra.cz: did not receive HSTS header
|
||||
rusl.me: could not connect to host
|
||||
|
@ -6771,7 +6769,7 @@ scribbleserver.com: could not connect to host
|
|||
scribe.systems: could not connect to host
|
||||
scrion.com: could not connect to host
|
||||
script.google.com: did not receive HSTS header (error ignored - included regardless)
|
||||
scriptenforcer.net: could not connect to host
|
||||
scriptenforcer.net: did not receive HSTS header
|
||||
scriptict.nl: could not connect to host
|
||||
scrollstory.com: did not receive HSTS header
|
||||
sdhmanagementgroup.com: could not connect to host
|
||||
|
@ -7168,6 +7166,7 @@ spencerbaer.com: could not connect to host
|
|||
sperohub.io: could not connect to host
|
||||
spiegels.nl: could not connect to host
|
||||
spielcasinos.com: did not receive HSTS header
|
||||
spiff.eu: did not receive HSTS header
|
||||
spikeykc.me: did not receive HSTS header
|
||||
spillmaker.no: did not receive HSTS header
|
||||
spilsbury.io: could not connect to host
|
||||
|
@ -7189,7 +7188,7 @@ spr.id.au: did not receive HSTS header
|
|||
spreadsheets.google.com: did not receive HSTS header (error ignored - included regardless)
|
||||
spresso.me: did not receive HSTS header
|
||||
sprk.fitness: did not receive HSTS header
|
||||
sproutconnections.com: did not receive HSTS header
|
||||
sproutconnections.com: could not connect to host
|
||||
sprutech.de: did not receive HSTS header
|
||||
spyroszarzonis.com: did not receive HSTS header
|
||||
square.gs: could not connect to host
|
||||
|
@ -7199,7 +7198,6 @@ srevilak.net: did not receive HSTS header
|
|||
srmaximo.com: could not connect to host
|
||||
srna.sk: could not connect to host
|
||||
srpdb.com: did not receive HSTS header
|
||||
srrdb.com: did not receive HSTS header
|
||||
srrr.ca: could not connect to host
|
||||
ss-free.net: could not connect to host
|
||||
ss.wtf: could not connect to host
|
||||
|
@ -7361,6 +7359,7 @@ supweb.ovh: did not receive HSTS header
|
|||
surfeasy.com: did not receive HSTS header
|
||||
surfone-leucate.com: did not receive HSTS header
|
||||
survivalistplanet.com: could not connect to host
|
||||
suspiciousdarknet.xyz: did not receive HSTS header
|
||||
sussexwebdesigns.info: could not connect to host
|
||||
suzukikenichi.com: did not receive HSTS header
|
||||
sv.search.yahoo.com: did not receive HSTS header
|
||||
|
@ -7375,7 +7374,6 @@ sweetair.com: did not receive HSTS header
|
|||
sweetstreats.ca: could not connect to host
|
||||
swfloshatraining.com: could not connect to host
|
||||
swimming.ca: did not receive HSTS header
|
||||
swissid.ch: max-age too low: 60
|
||||
swisstranslate.ch: did not receive HSTS header
|
||||
swisstranslate.fr: did not receive HSTS header
|
||||
swite.com: did not receive HSTS header
|
||||
|
@ -7406,6 +7404,7 @@ syspen.space: did not receive HSTS header
|
|||
sysrq.tech: could not connect to host
|
||||
syss.de: did not receive HSTS header
|
||||
systemd.me: could not connect to host
|
||||
syy.im: did not receive HSTS header
|
||||
szaszm.tk: max-age too low: 0
|
||||
t-complex.space: could not connect to host
|
||||
t-ken.xyz: could not connect to host
|
||||
|
@ -7415,7 +7414,6 @@ t4c-rebirth.com: could not connect to host
|
|||
t4x.org: could not connect to host
|
||||
taabe.xyz: could not connect to host
|
||||
taberu-fujitsubo.com: did not receive HSTS header
|
||||
tabino.top: could not connect to host
|
||||
tacomafia.net: did not receive HSTS header
|
||||
tadigitalstore.com: could not connect to host
|
||||
tafoma.com: did not receive HSTS header
|
||||
|
@ -7513,7 +7511,7 @@ tecture.de: did not receive HSTS header
|
|||
tedovo.com: did not receive HSTS header
|
||||
tedxkmitl.com: could not connect to host
|
||||
tefl.io: could not connect to host
|
||||
tegelsensanitaironline.nl: could not connect to host
|
||||
tegelsensanitaironline.nl: did not receive HSTS header
|
||||
tehotuotanto.net: could not connect to host
|
||||
teknologi.or.id: max-age too low: 0
|
||||
teknotes.co.uk: could not connect to host
|
||||
|
@ -7542,7 +7540,7 @@ terra.by: did not receive HSTS header
|
|||
terrax.berlin: could not connect to host
|
||||
terrax.info: could not connect to host
|
||||
testandroid.xyz: could not connect to host
|
||||
tetramax.eu: could not connect to host
|
||||
tetramax.eu: did not receive HSTS header
|
||||
teufelsystem.de: could not connect to host
|
||||
teulon.eu: could not connect to host
|
||||
texte-zur-taufe.de: did not receive HSTS header
|
||||
|
@ -7687,7 +7685,7 @@ tiliaze.biz: could not connect to host
|
|||
tiliaze.eu: did not receive HSTS header
|
||||
tilient.eu: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 119" data: no]
|
||||
tilikum.io: did not receive HSTS header
|
||||
tilkah.com.au: did not receive HSTS header
|
||||
tilkah.com.au: could not connect to host
|
||||
tillcraft.com: could not connect to host
|
||||
timbeilby.com: could not connect to host
|
||||
timbuktutimber.com: did not receive HSTS header
|
||||
|
@ -7725,7 +7723,6 @@ tjeckien.guide: could not connect to host
|
|||
tjullrich.de: could not connect to host
|
||||
tkappertjedemetamorfose.nl: could not connect to host
|
||||
tkonstantopoulos.tk: could not connect to host
|
||||
tlach.cz: did not receive HSTS header
|
||||
tlcdn.net: could not connect to host
|
||||
tlo.hosting: could not connect to host
|
||||
tlo.link: could not connect to host
|
||||
|
@ -7760,6 +7757,7 @@ tokobungadijambi.com: did not receive HSTS header
|
|||
tokoone.com: did not receive HSTS header
|
||||
tokotamz.net: could not connect to host
|
||||
tokotimbangandigitalmurah.web.id: did not receive HSTS header
|
||||
tokototech.com: did not receive HSTS header
|
||||
tokoyo.biz: could not connect to host
|
||||
tollmanz.com: did not receive HSTS header
|
||||
tolud.com: did not receive HSTS header
|
||||
|
@ -7803,7 +7801,7 @@ touchbasemail.com: did not receive HSTS header
|
|||
touchpointidg.us: could not connect to host
|
||||
touchscreen-handy.de: did not receive HSTS header
|
||||
touchstonefms.co.uk: did not receive HSTS header
|
||||
touchtable.nl: could not connect to host
|
||||
touchtable.nl: did not receive HSTS header
|
||||
tourpeer.com: did not receive HSTS header
|
||||
toxme.se: could not connect to host
|
||||
toyotamotala.se: could not connect to host
|
||||
|
@ -7963,7 +7961,7 @@ ultimate-glow-skin.com: could not connect to host
|
|||
ultimate-memoryplus.com: could not connect to host
|
||||
ultimate-neuroplus.com: could not connect to host
|
||||
ultros.io: did not receive HSTS header
|
||||
umaimise.info: could not connect to host
|
||||
umaimise.info: did not receive HSTS header
|
||||
umgardi.ca: could not connect to host
|
||||
umidev.com: did not receive HSTS header
|
||||
umie.cc: did not receive HSTS header
|
||||
|
@ -8016,6 +8014,7 @@ unplugg3r.dk: could not connect to host
|
|||
unravel.ie: could not connect to host
|
||||
unsystem.net: could not connect to host
|
||||
unwiredbrain.com: could not connect to host
|
||||
unwomen.is: did not receive HSTS header
|
||||
unyq.me: could not connect to host
|
||||
uonstaffhub.com: could not connect to host
|
||||
uow.ninja: could not connect to host
|
||||
|
@ -8286,6 +8285,7 @@ waterforlife.net.au: did not receive HSTS header
|
|||
waterpoint.com.br: did not receive HSTS header
|
||||
watersportmarkt.net: did not receive HSTS header
|
||||
watsonhall.uk: could not connect to host
|
||||
wattechweb.com: did not receive HSTS header
|
||||
wave.is: could not connect to host
|
||||
wavefloatrooms.com: did not receive HSTS header
|
||||
wavefrontsystemstech.com: could not connect to host
|
||||
|
@ -8340,7 +8340,7 @@ weddingibiza.nl: could not connect to host
|
|||
weddywood.ru: max-age too low: 0
|
||||
weekly.fyi: could not connect to host
|
||||
wegenaer.nl: could not connect to host
|
||||
weiji.ga: did not receive HSTS header
|
||||
weiji.ga: could not connect to host
|
||||
welkers.org: could not connect to host
|
||||
wellastore.ru: did not receive HSTS header
|
||||
wellcomp.com.br: did not receive HSTS header
|
||||
|
@ -8351,7 +8351,6 @@ weltentreff.com: could not connect to host
|
|||
weltmeisterschaft.net: could not connect to host
|
||||
weme.eu: could not connect to host
|
||||
wendalyncheng.com: did not receive HSTS header
|
||||
wepay.in.th: did not receive HSTS header
|
||||
werdeeintimo.de: did not receive HSTS header
|
||||
werkenbijkfc.nl: did not receive HSTS header
|
||||
werkplaatsoost.nl: did not receive HSTS header
|
||||
|
@ -8724,6 +8723,7 @@ zao.fi: could not connect to host
|
|||
zaoshanghao-dajia.rhcloud.com: did not receive HSTS header
|
||||
zap.yt: did not receive HSTS header
|
||||
zarooba.com: could not connect to host
|
||||
zary.me: did not receive HSTS header
|
||||
zavca.com: did not receive HSTS header
|
||||
zbigniewgalucki.eu: did not receive HSTS header
|
||||
zcon.nl: could not connect to host
|
||||
|
@ -8751,6 +8751,7 @@ zeroday.sk: did not receive HSTS header
|
|||
zerofox.gq: could not connect to host
|
||||
zeroml.ml: could not connect to host
|
||||
zerudi.com: did not receive HSTS header
|
||||
zeto365.pl: did not receive HSTS header
|
||||
zett4.me: could not connect to host
|
||||
zeytin.pro: could not connect to host
|
||||
zh.search.yahoo.com: did not receive HSTS header
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
const PRTime gPreloadListExpirationTime = INT64_C(1519106595411000);
|
||||
const PRTime gPreloadListExpirationTime = INT64_C(1519148458824000);
|
||||
%%
|
||||
0.me.uk, 1
|
||||
00001.am, 1
|
||||
|
@ -669,6 +669,7 @@ adamh.us, 1
|
|||
adamkaminski.com, 1
|
||||
adamkostecki.de, 1
|
||||
adamoutler.com, 1
|
||||
adamradocz.com, 1
|
||||
adams.dk, 1
|
||||
adamstas.com, 1
|
||||
adamwallington.co.uk, 1
|
||||
|
@ -698,7 +699,6 @@ adelebeals.com, 1
|
|||
adelightfulglow.com, 1
|
||||
adeline.mobi, 1
|
||||
adentalsolution.com, 1
|
||||
adesa-asesoria.com, 1
|
||||
adevel.eu, 1
|
||||
adhesivelaundry.co.uk, 1
|
||||
adhigamindia.com, 1
|
||||
|
@ -1200,6 +1200,7 @@ allurescarves.com, 1
|
|||
alluvion.studio, 1
|
||||
almaatlantica.com, 1
|
||||
almatinki.com, 1
|
||||
almavios.com, 1
|
||||
almstrom.org, 1
|
||||
alnitech.com, 0
|
||||
alocato.com, 1
|
||||
|
@ -1959,7 +1960,6 @@ ashutoshmishra.org, 1
|
|||
asia-gazette.com, 1
|
||||
asia.dating, 1
|
||||
asialeonding.at, 1
|
||||
asianbet77.net, 1
|
||||
asianshops.net, 1
|
||||
asinetasima.com, 1
|
||||
asisee.co.il, 1
|
||||
|
@ -2877,6 +2877,7 @@ bestleftwild.com, 1
|
|||
bestmodels.su, 1
|
||||
bestmotherfucking.website, 1
|
||||
bestperfumebrands.com, 1
|
||||
bestschools.top, 1
|
||||
bestseries.tv, 1
|
||||
bestwarezone.com, 1
|
||||
bestwebsite.gallery, 1
|
||||
|
@ -3308,7 +3309,6 @@ blessedguy.com, 1
|
|||
blessedguy.net, 1
|
||||
blewebprojects.com, 1
|
||||
blichmann.eu, 1
|
||||
blidz.com, 1
|
||||
blieque.co.uk, 1
|
||||
blindaryproduction.tk, 1
|
||||
blindsexdate.nl, 1
|
||||
|
@ -3837,6 +3837,7 @@ btserv.de, 1
|
|||
btsoft.eu, 1
|
||||
btsow.com, 1
|
||||
btth.pl, 1
|
||||
btxiaobai.com, 1
|
||||
bubba.cc, 1
|
||||
bubblegumblog.com, 1
|
||||
bubblespetspa.com, 1
|
||||
|
@ -5091,7 +5092,6 @@ cloudia.org, 1
|
|||
cloudily.com, 1
|
||||
cloudlight.biz, 1
|
||||
cloudmigrator365.com, 1
|
||||
cloudopt.net, 0
|
||||
cloudoptimizedsmb.com, 1
|
||||
cloudoptimus.com, 1
|
||||
cloudpagesforwork.com, 1
|
||||
|
@ -5930,6 +5930,7 @@ cuisinezest.com, 1
|
|||
cultiv.nl, 1
|
||||
cultivo.bio, 1
|
||||
cultofperf.org.uk, 1
|
||||
culture-school.top, 1
|
||||
culturedcode.com, 1
|
||||
cultureroll.com, 1
|
||||
cunha.be, 1
|
||||
|
@ -6510,6 +6511,7 @@ deeprecce.com, 1
|
|||
deepserve.info, 1
|
||||
deepsouthsounds.com, 1
|
||||
deepspace.dedyn.io, 1
|
||||
deepvalley.tech, 1
|
||||
deepvision.com.ua, 1
|
||||
deepzz.com, 1
|
||||
deer.team, 1
|
||||
|
@ -6849,7 +6851,6 @@ die-besten-weisheiten.de, 1
|
|||
die-blahuts.de, 1
|
||||
die-borts.ch, 1
|
||||
die-gruenen-teufel.de, 1
|
||||
die-partei-reutlingen.de, 1
|
||||
die-sinlosen.de, 1
|
||||
die-speisekammer-reutlingen.de, 1
|
||||
diedrich.co, 0
|
||||
|
@ -7816,7 +7817,6 @@ educationevolving.org, 1
|
|||
educationunlimited.com, 1
|
||||
educator-one.com, 1
|
||||
educators.co.nz, 1
|
||||
educatoys.com.br, 1
|
||||
eductf.org, 1
|
||||
edudrugs.com, 1
|
||||
eduid.se, 1
|
||||
|
@ -7855,7 +7855,6 @@ eff.org, 1
|
|||
effdocs.com, 1
|
||||
effe.ch, 1
|
||||
effective-altruist.com, 1
|
||||
effectivecoffee.com, 1
|
||||
effectivepapers.com, 1
|
||||
effex.ru, 1
|
||||
effishiency.com, 1
|
||||
|
@ -8288,7 +8287,7 @@ epistas.de, 1
|
|||
epizentrum.work, 1
|
||||
epizentrum.works, 1
|
||||
epmcentroitalia.it, 1
|
||||
epoch.com, 0
|
||||
epoch.com, 1
|
||||
epolitiker.com, 1
|
||||
eposkent.co.uk, 1
|
||||
eposleeds.co.uk, 1
|
||||
|
@ -8779,6 +8778,7 @@ f1minute.com, 1
|
|||
f42.net, 1
|
||||
f43.me, 1
|
||||
f5movies.top, 1
|
||||
f5nu.com, 1
|
||||
f5w.de, 1
|
||||
f8842.com, 1
|
||||
fa-works.com, 1
|
||||
|
@ -8916,7 +8916,6 @@ faretravel.co.uk, 1
|
|||
farfallapets.com.br, 1
|
||||
farfetchos.com, 1
|
||||
fargtorget.se, 1
|
||||
farhadexchange.com, 1
|
||||
farhood.org, 1
|
||||
farid.is, 1
|
||||
farkas.bz, 1
|
||||
|
@ -10696,6 +10695,7 @@ gpo.gov, 0
|
|||
gprs.uk.com, 1
|
||||
gps.com.br, 1
|
||||
gpsarena.ro, 1
|
||||
gpsvideocanada.com, 1
|
||||
gpws.ovh, 1
|
||||
gr.search.yahoo.com, 0
|
||||
gra2.com, 1
|
||||
|
@ -11368,8 +11368,6 @@ hefengautoparts.com, 1
|
|||
heftkaufen.de, 1
|
||||
hegen.com.pl, 1
|
||||
hegen.cz, 1
|
||||
hegen.sk, 1
|
||||
hegenshop.de, 1
|
||||
heh.ee, 1
|
||||
heha.co, 0
|
||||
heiaheia.com, 1
|
||||
|
@ -11600,7 +11598,6 @@ hinterhofbu.de, 1
|
|||
hintermeier-rae.at, 1
|
||||
hinterposemuckel.de, 1
|
||||
hintss.pw, 1
|
||||
hiphop.ren, 1
|
||||
hipi.jp, 1
|
||||
hippies.com.br, 1
|
||||
hippo.ge, 1
|
||||
|
@ -12133,7 +12130,6 @@ ich-tanke.de, 1
|
|||
ichasco.com, 1
|
||||
ichbinkeinreh.de, 1
|
||||
ichronos.net, 1
|
||||
icij.org, 0
|
||||
iclinic.ua, 1
|
||||
icmhd.ch, 1
|
||||
icmp2018.org, 1
|
||||
|
@ -12187,7 +12183,6 @@ idexxpublicationportal.com, 1
|
|||
idgard.de, 1
|
||||
idhosts.co.id, 1
|
||||
idid.tk, 1
|
||||
idinby.dk, 0
|
||||
idiopolis.org, 1
|
||||
idiotentruppe.de, 1
|
||||
idmanagement.gov, 1
|
||||
|
@ -12652,6 +12647,7 @@ intencje.pl, 1
|
|||
inter-corporate.com, 1
|
||||
inter-culinarium.com, 1
|
||||
interaffairs.com, 1
|
||||
interasistmen.se, 1
|
||||
interchangedesign.com, 1
|
||||
interchanges.io, 1
|
||||
intercom.com, 1
|
||||
|
@ -12751,6 +12747,7 @@ invoicefinance.nl, 1
|
|||
inwestcorp.se, 1
|
||||
inzdr.com, 1
|
||||
iocheck.com, 0
|
||||
iodice.org, 1
|
||||
iodu.re, 1
|
||||
ioiart.eu, 1
|
||||
iojo.net, 1
|
||||
|
@ -13508,7 +13505,6 @@ johnblackbourn.com, 1
|
|||
johndong.net, 0
|
||||
johnfulgenzi.com, 1
|
||||
johngallias.com, 1
|
||||
johngaltgroup.com, 1
|
||||
johnguant.com, 1
|
||||
johnmalloneemd.com, 0
|
||||
johnmcintosh.pro, 1
|
||||
|
@ -13763,7 +13759,6 @@ jxir.de, 1
|
|||
jyggen.com, 1
|
||||
jym.fit, 1
|
||||
jyoti-fairworks.org, 1
|
||||
jysperm.me, 1
|
||||
jzbk.org, 1
|
||||
k-netz.de, 1
|
||||
k-pan.com, 1
|
||||
|
@ -16128,6 +16123,7 @@ management-companie.ro, 1
|
|||
management-ethics.com, 1
|
||||
managementboek.nl, 1
|
||||
managementfeedback.com, 1
|
||||
manageprojects.com, 0
|
||||
manager-efficacement.com, 1
|
||||
manager.linode.com, 0
|
||||
managewp.org, 1
|
||||
|
@ -16380,6 +16376,7 @@ mastodon.blue, 0
|
|||
mastodon.co.nz, 1
|
||||
mastodon.expert, 1
|
||||
mastodon.fun, 1
|
||||
mastodon.host, 1
|
||||
mastodon.my, 1
|
||||
mastodon.org.uk, 1
|
||||
mastodon.rocks, 1
|
||||
|
@ -16440,7 +16437,6 @@ mattli.us, 1
|
|||
mattmccutchen.net, 1
|
||||
mattonline.me, 1
|
||||
mattwb65.com, 1
|
||||
mattwservices.co.uk, 1
|
||||
matviet.vn, 1
|
||||
matze.co, 1
|
||||
matze.org, 1
|
||||
|
@ -16571,6 +16567,7 @@ mdcloudps.com, 1
|
|||
mdek.at, 1
|
||||
mdewendt.de, 1
|
||||
mdf-bis.com, 1
|
||||
mdkr.nl, 1
|
||||
mdma.net, 1
|
||||
mdmed.clinic, 1
|
||||
mdosch.de, 1
|
||||
|
@ -18552,6 +18549,7 @@ nikklassen.ca, 1
|
|||
nikksno.io, 1
|
||||
niklas.pw, 1
|
||||
niklasbabel.com, 1
|
||||
nikobradshaw.com, 1
|
||||
nikolaichik.photo, 1
|
||||
nikolasbradshaw.com, 1
|
||||
nikolasgrottendieck.com, 1
|
||||
|
@ -19372,6 +19370,7 @@ orthotictransfers.com, 1
|
|||
ortlepp.eu, 1
|
||||
orui.com.br, 1
|
||||
orwell1984.today, 1
|
||||
orz.uno, 1
|
||||
os-chrome.ru, 1
|
||||
os-s.net, 1
|
||||
osacrypt.studio, 1
|
||||
|
@ -20011,7 +20010,6 @@ pet-hotel-mura.net, 1
|
|||
petabits.de, 1
|
||||
petangen.se, 1
|
||||
petbooking.it, 1
|
||||
petcarvers.com, 1
|
||||
petelew.is, 1
|
||||
peter.org.ua, 1
|
||||
peterandjoelle.co.uk, 1
|
||||
|
@ -21411,7 +21409,6 @@ rapenroer.nl, 1
|
|||
raphael.li, 1
|
||||
raphaelcasazza.ch, 1
|
||||
rapidapp.io, 1
|
||||
rapido.nu, 1
|
||||
rapidshit.net, 1
|
||||
rapidstone.com, 1
|
||||
raraflora.com.au, 1
|
||||
|
@ -21522,6 +21519,7 @@ really.ai, 1
|
|||
really.io, 1
|
||||
reallyreally.io, 1
|
||||
realmofespionage.xyz, 1
|
||||
realraghavgupta.com, 1
|
||||
realum.com, 1
|
||||
realum.de, 1
|
||||
realum.eu, 1
|
||||
|
@ -21546,7 +21544,6 @@ recapp.ch, 1
|
|||
receitas-de-bolos.pt, 1
|
||||
receitasdebacalhau.pt, 1
|
||||
receptionsbook.com, 1
|
||||
recepty.eu, 0
|
||||
recetasdecocinaideal.com, 1
|
||||
recetasfacilesdehacer.com, 1
|
||||
rechat.com, 1
|
||||
|
@ -22348,7 +22345,6 @@ runzen.de, 0
|
|||
ruobiyi.com, 1
|
||||
rus-trip.ru, 0
|
||||
rusempire.ru, 1
|
||||
rushball.net, 1
|
||||
rushiiworks.com, 1
|
||||
rushpoppershop.co.uk, 1
|
||||
rusi-ns.ca, 1
|
||||
|
@ -24350,7 +24346,6 @@ spielezar.ch, 1
|
|||
spielland.ch, 1
|
||||
spiellawine.de, 1
|
||||
spiet.nl, 1
|
||||
spiff.eu, 1
|
||||
spiga.ch, 1
|
||||
spillersfamily.net, 1
|
||||
spinalien.net, 1
|
||||
|
@ -24463,6 +24458,7 @@ srinivasan.io, 1
|
|||
sritest.io, 1
|
||||
sro.center, 1
|
||||
srolim.com, 1
|
||||
srrdb.com, 1
|
||||
srroddy.com, 1
|
||||
srv.so, 1
|
||||
srvc.io, 1
|
||||
|
@ -25028,7 +25024,6 @@ sushifrick.de, 1
|
|||
sushikatze.de, 1
|
||||
susosudon.com, 1
|
||||
suspension-shop.com, 1
|
||||
suspiciousdarknet.xyz, 1
|
||||
sussexwebdesigns.co.uk, 1
|
||||
sussexwebdesigns.com, 1
|
||||
sustainability.gov, 1
|
||||
|
@ -25103,6 +25098,7 @@ swisselement365.com, 1
|
|||
swissentreprises.ch, 1
|
||||
swissfreshaircan.ch, 1
|
||||
swissfreshaircan.com, 1
|
||||
swissid.ch, 1
|
||||
swisslinux.org, 1
|
||||
swisswebhelp.ch, 1
|
||||
swissxperts.ch, 1
|
||||
|
@ -25182,7 +25178,6 @@ systoolbox.net, 1
|
|||
sysystems.cz, 1
|
||||
syt3.net, 1
|
||||
syy.hk, 1
|
||||
syy.im, 1
|
||||
syzygy-tables.info, 1
|
||||
szagun.net, 1
|
||||
szamitogepdepo.com, 1
|
||||
|
@ -25216,6 +25211,7 @@ taartenfeesies.nl, 1
|
|||
tab.watch, 1
|
||||
tabelfirme.ro, 1
|
||||
tabernadovinho.com.br, 1
|
||||
tabino.top, 1
|
||||
tabithawebb.co.uk, 1
|
||||
tabla-periodica.com, 1
|
||||
tablescraps.com, 1
|
||||
|
@ -26183,6 +26179,7 @@ tkn.tokyo, 1
|
|||
tkts.cl, 1
|
||||
tkusano.jp, 1
|
||||
tkw01536.de, 1
|
||||
tlach.cz, 1
|
||||
tlca.org, 1
|
||||
tlcnet.info, 1
|
||||
tlehseasyads.com, 1
|
||||
|
@ -26281,7 +26278,6 @@ tokio.fi, 1
|
|||
tokke.dk, 1
|
||||
tokkee.org, 1
|
||||
tokoindo.top, 1
|
||||
tokototech.com, 1
|
||||
tokumei.co, 1
|
||||
tokyo-powerstation.com, 1
|
||||
tokyo.dating, 1
|
||||
|
@ -27179,7 +27175,6 @@ untoldstory.eu, 1
|
|||
unun.fi, 1
|
||||
unusualhatclub.com, 1
|
||||
unveiledgnosis.com, 1
|
||||
unwomen.is, 1
|
||||
unx.dk, 1
|
||||
unxicdellum.cat, 1
|
||||
upandclear.org, 1
|
||||
|
@ -28049,7 +28044,6 @@ watermonitor.gov, 1
|
|||
watersb.org, 1
|
||||
watertrails.io, 1
|
||||
watsonwork.me, 1
|
||||
wattechweb.com, 1
|
||||
wave-ola.es, 1
|
||||
wavesboardshop.com, 1
|
||||
wavesoftime.com, 1
|
||||
|
@ -28295,6 +28289,7 @@ wenjs.me, 1
|
|||
wenode.net, 1
|
||||
wenz.io, 1
|
||||
wepay.com, 0
|
||||
wepay.in.th, 1
|
||||
weplaynaked.dk, 1
|
||||
wer-kommt-her.de, 1
|
||||
werally.com, 1
|
||||
|
@ -29555,7 +29550,6 @@ zappbuildapps.com, 1
|
|||
zaratan.fr, 1
|
||||
zarmarket.org, 1
|
||||
zarpo.com.br, 1
|
||||
zary.me, 1
|
||||
zaufanatrzeciastrona.pl, 1
|
||||
zavec.com.ec, 1
|
||||
zavetaji.lv, 1
|
||||
|
@ -29629,7 +29623,6 @@ zeryn.net, 1
|
|||
zespia.tw, 0
|
||||
zestylemon.co.uk, 1
|
||||
zetamode.com, 1
|
||||
zeto365.pl, 1
|
||||
zetorzeszow.pl, 0
|
||||
zetrov.pl, 1
|
||||
zettaplan.ru, 1
|
||||
|
@ -29807,7 +29800,7 @@ zxity.uk, 1
|
|||
zxtcode.com, 1
|
||||
zybbo.com, 1
|
||||
zyciedlazwierzat.pl, 1
|
||||
zymmm.com, 1
|
||||
zymmm.com, 0
|
||||
zypern-firma.com, 1
|
||||
zypr.pw, 1
|
||||
zyria.de, 1
|
||||
|
|
|
@ -68,7 +68,7 @@ use style::attr::AttrValue;
|
|||
use style::computed_values::display;
|
||||
use style::context::SharedStyleContext;
|
||||
use style::data::ElementData;
|
||||
use style::dom::{LayoutIterator, NodeInfo, OpaqueNode};
|
||||
use style::dom::{DomChildren, LayoutIterator, NodeInfo, OpaqueNode};
|
||||
use style::dom::{PresentationalHintsSynthesizer, TElement, TNode};
|
||||
use style::element_state::*;
|
||||
use style::font_metrics::ServoMetricsProvider;
|
||||
|
@ -159,7 +159,6 @@ impl<'ln> NodeInfo for ServoLayoutNode<'ln> {
|
|||
|
||||
impl<'ln> TNode for ServoLayoutNode<'ln> {
|
||||
type ConcreteElement = ServoLayoutElement<'ln>;
|
||||
type ConcreteChildrenIterator = ServoChildrenIterator<'ln>;
|
||||
|
||||
fn parent_node(&self) -> Option<Self> {
|
||||
unsafe {
|
||||
|
@ -167,20 +166,34 @@ impl<'ln> TNode for ServoLayoutNode<'ln> {
|
|||
}
|
||||
}
|
||||
|
||||
fn children(&self) -> LayoutIterator<ServoChildrenIterator<'ln>> {
|
||||
LayoutIterator(ServoChildrenIterator {
|
||||
current: self.first_child(),
|
||||
})
|
||||
fn first_child(&self) -> Option<Self> {
|
||||
unsafe {
|
||||
self.node.first_child_ref().map(|node| self.new_with_this_lifetime(&node))
|
||||
}
|
||||
}
|
||||
|
||||
fn last_child(&self) -> Option<Self> {
|
||||
unsafe {
|
||||
self.node.last_child_ref().map(|node| self.new_with_this_lifetime(&node))
|
||||
}
|
||||
}
|
||||
|
||||
fn prev_sibling(&self) -> Option<Self> {
|
||||
unsafe {
|
||||
self.node.prev_sibling_ref().map(|node| self.new_with_this_lifetime(&node))
|
||||
}
|
||||
}
|
||||
|
||||
fn next_sibling(&self) -> Option<Self> {
|
||||
unsafe {
|
||||
self.node.next_sibling_ref().map(|node| self.new_with_this_lifetime(&node))
|
||||
}
|
||||
}
|
||||
|
||||
fn traversal_parent(&self) -> Option<ServoLayoutElement<'ln>> {
|
||||
self.parent_element()
|
||||
}
|
||||
|
||||
fn traversal_children(&self) -> LayoutIterator<ServoChildrenIterator<'ln>> {
|
||||
self.children()
|
||||
}
|
||||
|
||||
fn opaque(&self) -> OpaqueNode {
|
||||
unsafe { self.get_jsmanaged().opaque() }
|
||||
}
|
||||
|
@ -200,23 +213,6 @@ impl<'ln> TNode for ServoLayoutNode<'ln> {
|
|||
unsafe fn set_can_be_fragmented(&self, value: bool) {
|
||||
self.node.set_flag(CAN_BE_FRAGMENTED, value)
|
||||
}
|
||||
|
||||
fn is_in_doc(&self) -> bool {
|
||||
unsafe { (*self.node.unsafe_get()).is_in_doc() }
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ServoChildrenIterator<'a> {
|
||||
current: Option<ServoLayoutNode<'a>>,
|
||||
}
|
||||
|
||||
impl<'a> Iterator for ServoChildrenIterator<'a> {
|
||||
type Item = ServoLayoutNode<'a>;
|
||||
fn next(&mut self) -> Option<ServoLayoutNode<'a>> {
|
||||
let node = self.current;
|
||||
self.current = node.and_then(|node| node.next_sibling());
|
||||
node
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ln> LayoutNode for ServoLayoutNode<'ln> {
|
||||
|
@ -248,30 +244,6 @@ impl<'ln> LayoutNode for ServoLayoutNode<'ln> {
|
|||
unsafe fn take_style_and_layout_data(&self) -> OpaqueStyleAndLayoutData {
|
||||
self.get_jsmanaged().take_style_and_layout_data()
|
||||
}
|
||||
|
||||
fn first_child(&self) -> Option<ServoLayoutNode<'ln>> {
|
||||
unsafe {
|
||||
self.node.first_child_ref().map(|node| self.new_with_this_lifetime(&node))
|
||||
}
|
||||
}
|
||||
|
||||
fn last_child(&self) -> Option<ServoLayoutNode<'ln>> {
|
||||
unsafe {
|
||||
self.node.last_child_ref().map(|node| self.new_with_this_lifetime(&node))
|
||||
}
|
||||
}
|
||||
|
||||
fn prev_sibling(&self) -> Option<ServoLayoutNode<'ln>> {
|
||||
unsafe {
|
||||
self.node.prev_sibling_ref().map(|node| self.new_with_this_lifetime(&node))
|
||||
}
|
||||
}
|
||||
|
||||
fn next_sibling(&self) -> Option<ServoLayoutNode<'ln>> {
|
||||
unsafe {
|
||||
self.node.next_sibling_ref().map(|node| self.new_with_this_lifetime(&node))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ln> GetLayoutData for ServoLayoutNode<'ln> {
|
||||
|
@ -320,8 +292,8 @@ impl<'ld> ServoLayoutDocument<'ld> {
|
|||
ServoLayoutNode::from_layout_js(self.document.upcast())
|
||||
}
|
||||
|
||||
pub fn root_node(&self) -> Option<ServoLayoutNode<'ld>> {
|
||||
self.as_node().children().find(ServoLayoutNode::is_element)
|
||||
pub fn root_element(&self) -> Option<ServoLayoutElement<'ld>> {
|
||||
self.as_node().dom_children().flat_map(|n| n.as_element()).next()
|
||||
}
|
||||
|
||||
pub fn drain_pending_restyles(&self) -> Vec<(ServoLayoutElement<'ld>, PendingRestyle)> {
|
||||
|
@ -380,6 +352,7 @@ impl<'le> PresentationalHintsSynthesizer for ServoLayoutElement<'le> {
|
|||
|
||||
impl<'le> TElement for ServoLayoutElement<'le> {
|
||||
type ConcreteNode = ServoLayoutNode<'le>;
|
||||
type TraversalChildrenIterator = DomChildren<Self::ConcreteNode>;
|
||||
|
||||
type FontMetricsProvider = ServoMetricsProvider;
|
||||
|
||||
|
@ -387,6 +360,10 @@ impl<'le> TElement for ServoLayoutElement<'le> {
|
|||
ServoLayoutNode::from_layout_js(self.element.upcast())
|
||||
}
|
||||
|
||||
fn traversal_children(&self) -> LayoutIterator<Self::TraversalChildrenIterator> {
|
||||
LayoutIterator(self.as_node().dom_children())
|
||||
}
|
||||
|
||||
fn style_attribute(&self) -> Option<ArcBorrow<StyleLocked<PropertyDeclarationBlock>>> {
|
||||
unsafe {
|
||||
(*self.element.style_attribute()).as_ref().map(|x| x.borrow_arc())
|
||||
|
@ -629,7 +606,7 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> {
|
|||
}
|
||||
|
||||
fn first_child_element(&self) -> Option<ServoLayoutElement<'le>> {
|
||||
self.as_node().children().filter_map(|n| n.as_element()).next()
|
||||
self.as_node().dom_children().filter_map(|n| n.as_element()).next()
|
||||
}
|
||||
|
||||
fn last_child_element(&self) -> Option<ServoLayoutElement<'le>> {
|
||||
|
@ -690,7 +667,7 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> {
|
|||
}
|
||||
|
||||
fn is_empty(&self) -> bool {
|
||||
self.as_node().children().all(|node| match node.script_type_id() {
|
||||
self.as_node().dom_children().all(|node| match node.script_type_id() {
|
||||
NodeTypeId::Element(..) => false,
|
||||
NodeTypeId::CharacterData(CharacterDataTypeId::Text) => unsafe {
|
||||
node.node.downcast().unwrap().data_for_layout().is_empty()
|
||||
|
@ -850,20 +827,14 @@ impl<'ln> ServoThreadSafeLayoutNode<'ln> {
|
|||
}
|
||||
}
|
||||
|
||||
// NB: The implementation here is a bit tricky because elements implementing
|
||||
// pseudos are supposed to return false for is_element().
|
||||
impl<'ln> NodeInfo for ServoThreadSafeLayoutNode<'ln> {
|
||||
fn is_element(&self) -> bool {
|
||||
self.pseudo == PseudoElementType::Normal && self.node.is_element()
|
||||
self.node.is_element()
|
||||
}
|
||||
|
||||
fn is_text_node(&self) -> bool {
|
||||
self.node.is_text_node()
|
||||
}
|
||||
|
||||
fn needs_layout(&self) -> bool {
|
||||
self.node.is_text_node() || self.node.is_element()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ln> ThreadSafeLayoutNode for ServoThreadSafeLayoutNode<'ln> {
|
||||
|
@ -883,11 +854,6 @@ impl<'ln> ThreadSafeLayoutNode for ServoThreadSafeLayoutNode<'ln> {
|
|||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn type_id_without_excluding_pseudo_elements(&self) -> LayoutNodeType {
|
||||
self.node.type_id()
|
||||
}
|
||||
|
||||
fn parent_style(&self) -> Arc<ComputedValues> {
|
||||
let parent = self.node.parent_node().unwrap().as_element().unwrap();
|
||||
let parent_data = parent.get_data().unwrap().borrow();
|
||||
|
|
|
@ -1067,7 +1067,7 @@ impl LayoutThread {
|
|||
|
||||
let mut rw_data = possibly_locked_rw_data.lock();
|
||||
|
||||
let element: ServoLayoutElement = match document.root_node() {
|
||||
let element = match document.root_element() {
|
||||
None => {
|
||||
// Since we cannot compute anything, give spec-required placeholders.
|
||||
debug!("layout: No root node: bailing");
|
||||
|
@ -1112,7 +1112,7 @@ impl LayoutThread {
|
|||
}
|
||||
return;
|
||||
},
|
||||
Some(x) => x.as_element().unwrap(),
|
||||
Some(x) => x,
|
||||
};
|
||||
|
||||
debug!("layout: processing reflow request for: {:?} ({}) (query={:?})",
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче