зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to autoland. a=merge CLOSED TREE
This commit is contained in:
Коммит
608de3193c
|
@ -2,4 +2,21 @@
|
|||
* 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/. */
|
||||
|
||||
/* aboutconfig.css */
|
||||
#list {
|
||||
margin: 0;
|
||||
padding: 2em;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
#list > li {
|
||||
padding: 5px;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#list > li:nth-child(even) {
|
||||
background-color: rgba(0, 0, 0, .06);
|
||||
}
|
||||
|
||||
#list > li:nth-child(odd) {
|
||||
background-color: rgba(0, 0, 0, .03);
|
||||
}
|
||||
|
|
|
@ -2,20 +2,21 @@
|
|||
- 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/. -->
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" media="screen, projection" type="text/css"
|
||||
href="chrome://global/skin/in-content/common.css"/>
|
||||
href="chrome://global/skin/in-content/common.css">
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="chrome://browser/content/aboutconfig/aboutconfig.css"/>
|
||||
href="chrome://browser/content/aboutconfig/aboutconfig.css">
|
||||
<link rel="localization" href="browser/aboutConfig.ftl">
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/aboutconfig/aboutconfig.js"></script>
|
||||
<title data-l10n-id="about-config-title"></title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<body onload="onLoad();">
|
||||
<ul id="list"></ul>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -2,4 +2,28 @@
|
|||
* 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/. */
|
||||
|
||||
/* aboutconfig.js */
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Preferences.jsm");
|
||||
|
||||
let gPrefArray;
|
||||
|
||||
function onLoad() {
|
||||
gPrefArray = Services.prefs.getChildList("").map(name => ({
|
||||
name,
|
||||
value: Preferences.get(name),
|
||||
hasUserValue: Services.prefs.prefHasUserValue(name),
|
||||
}));
|
||||
|
||||
gPrefArray.sort((a, b) => a.name > b.name);
|
||||
|
||||
let fragment = document.createDocumentFragment();
|
||||
|
||||
for (let pref of gPrefArray) {
|
||||
let listItem = document.createElement("li");
|
||||
listItem.textContent = pref.name + " || " +
|
||||
(pref.hasUserValue ? "Modified" : "Default") + " || " +
|
||||
pref.value.constructor.name + " || " + pref.value;
|
||||
fragment.appendChild(listItem);
|
||||
}
|
||||
document.getElementById("list").appendChild(fragment);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const PAGE_URL = "chrome://browser/content/aboutconfig/aboutconfig.html";
|
||||
|
||||
add_task(async function test_load_title() {
|
||||
await BrowserTestUtils.withNewTab({
|
||||
gBrowser,
|
||||
url: "chrome://browser/content/aboutconfig/aboutconfig.html",
|
||||
url: PAGE_URL,
|
||||
}, browser => {
|
||||
info("about:config loaded");
|
||||
return ContentTask.spawn(browser, null, async () => {
|
||||
|
@ -13,3 +15,21 @@ add_task(async function test_load_title() {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_load_settings() {
|
||||
await BrowserTestUtils.withNewTab({
|
||||
gBrowser,
|
||||
url: PAGE_URL,
|
||||
}, browser => {
|
||||
return ContentTask.spawn(browser, null, () => {
|
||||
let list = [...content.document.getElementById("list")
|
||||
.getElementsByTagName("li")];
|
||||
function findPref(name) {
|
||||
return list.some(e => e.textContent.trim().startsWith(name + " "));
|
||||
}
|
||||
Assert.ok(findPref("plugins.testmode"));
|
||||
Assert.ok(findPref("dom.vr.enabled"));
|
||||
Assert.ok(findPref("accessibility.AOM.enabled"));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
This is the debugger.html project output.
|
||||
See https://github.com/devtools-html/debugger.html
|
||||
|
||||
Version 96
|
||||
Version 97
|
||||
|
||||
Comparison: https://github.com/devtools-html/debugger.html/compare/release-95...release-96
|
||||
Comparison: https://github.com/devtools-html/debugger.html/compare/release-96...release-97
|
||||
|
||||
Packages:
|
||||
- babel-plugin-transform-es2015-modules-commonjs @6.26.2
|
||||
|
|
|
@ -2666,49 +2666,54 @@ menuseparator {
|
|||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
.call-site {
|
||||
background: #f0f9ff;
|
||||
position: relative;
|
||||
border-bottom: 2px solid lightgrey;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.call-site::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: calc(100% - 2px);
|
||||
border-bottom: 2px solid #aed3ef;
|
||||
mask: url("chrome://devtools/skin/images/debugger/column-marker.svg") no-repeat 100% 100%;
|
||||
mask-size: contain;
|
||||
display: inline-block;
|
||||
background-color: var(--blue-55);
|
||||
opacity: 0.5;
|
||||
width: 9px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.call-site-bp {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.debug-expression.call-site-bp,
|
||||
.call-site-bp {
|
||||
background-color: #fce7e7;
|
||||
border-bottom: 2px solid #aed3ef;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.call-site-bp::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: calc(100% - 2px);
|
||||
border-bottom: 2px solid red;
|
||||
mask: url("chrome://devtools/skin/images/debugger/column-marker.svg") no-repeat 100% 100%;
|
||||
mask-size: contain;
|
||||
display: inline-block;
|
||||
background-color: var(--blue-55);
|
||||
width: 9px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.theme-dark .call-site {
|
||||
background-color: #4b5462;
|
||||
}
|
||||
|
||||
.theme-dark .call-site::before {
|
||||
border-bottom-color: #5f78a4;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.theme-dark .call-site-bp {
|
||||
background-color: #4b3f3f;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.theme-dark .call-site::before {
|
||||
background-color: var(--blue-60);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.theme-dark .call-site-bp::before {
|
||||
border-bottom-color: #dd4d4d;
|
||||
background-color: var(--blue-50);
|
||||
opacity: 0.5;
|
||||
}
|
||||
/* 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
|
||||
|
@ -3418,6 +3423,12 @@ html[dir="rtl"] .breakpoints-list .breakpoint .breakpoint-line {
|
|||
.frames ul .frames-group .group .location {
|
||||
font-weight: 500;
|
||||
cursor: default;
|
||||
/*
|
||||
* direction:rtl is set in Frames.css to overflow the location text from the
|
||||
* start. Here we need to reset it in order to display the framework icon
|
||||
* after the framework name.
|
||||
*/
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.frames ul .frames-group.expanded .group,
|
||||
|
@ -3500,13 +3511,16 @@ html[dir="rtl"] .breakpoints-list .breakpoint .breakpoint-line {
|
|||
}
|
||||
|
||||
.frames ul li {
|
||||
padding: 0 10px 0 21px;
|
||||
padding: 7px 10px 7px 21px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
column-gap: 0.5em;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
max-width: 100%;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.frames ul li * {
|
||||
|
@ -3521,12 +3535,15 @@ html[dir="rtl"] .breakpoints-list .breakpoint .breakpoint-line {
|
|||
|
||||
.frames .location {
|
||||
font-weight: normal;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 1;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
/* Trick to get the ellipsis at the start of the string */
|
||||
text-overflow: ellipsis;
|
||||
direction: rtl;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.theme-light .frames .location {
|
||||
|
@ -3541,7 +3558,6 @@ html[dir="rtl"] .breakpoints-list .breakpoint .breakpoint-line {
|
|||
.frames .title {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
margin: 7px 0.5em 7px 0;
|
||||
}
|
||||
|
||||
.frames ul li:hover,
|
||||
|
@ -3587,9 +3603,9 @@ html[dir="rtl"] .breakpoints-list .breakpoint .breakpoint-line {
|
|||
}
|
||||
|
||||
.annotation-logo {
|
||||
display: inline-block;
|
||||
width: 12px;
|
||||
margin-left: 3px;
|
||||
line-height: 8px;
|
||||
margin-inline-start: 4px;
|
||||
}
|
||||
|
||||
:root.theme-dark .annotation-logo svg path {
|
||||
|
|
|
@ -2201,6 +2201,7 @@ const svg = {
|
|||
breadcrumb: __webpack_require__(3603),
|
||||
breakpoint: __webpack_require__(350),
|
||||
"column-breakpoint": __webpack_require__(998),
|
||||
"column-marker": __webpack_require__(3801),
|
||||
"case-match": __webpack_require__(351),
|
||||
choo: __webpack_require__(1290),
|
||||
close: __webpack_require__(352),
|
||||
|
@ -7528,6 +7529,13 @@ function createStructuredSelector(selectors) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3801:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = "<svg viewBox=\"0 0 9 12\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><g id=\"columnmarkergroup\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"><polygon id=\"columnmarker\" fill=\"#1B1B1D\" points=\"0 0 4 0 9 6 4 12 0 12\"></polygon></g></svg>"
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 4:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
|
|
|
@ -255,7 +255,9 @@ function debuggeeCommand(script) {
|
|||
}
|
||||
|
||||
function navigate(url) {
|
||||
return tabTarget.activeTab.navigateTo({ url });
|
||||
return tabTarget.activeTab.navigateTo({
|
||||
url
|
||||
});
|
||||
}
|
||||
|
||||
function reload() {
|
||||
|
@ -465,4 +467,4 @@ const clientCommands = {
|
|||
setSkipPausing
|
||||
};
|
||||
exports.setupCommands = setupCommands;
|
||||
exports.clientCommands = clientCommands;
|
||||
exports.clientCommands = clientCommands;
|
|
@ -41,8 +41,8 @@ function setupEvents(dependencies) {
|
|||
});
|
||||
|
||||
if (threadClient._parent) {
|
||||
// Parent may be BrowsingContextTargetFront/WorkerTargetFront and be protocol.js.
|
||||
// Or DebuggerClient and still be old fashion actor.
|
||||
// Parent may be BrowsingContextTargetFront/WorkerTargetFront and
|
||||
// be protocol.js. Or DebuggerClient and still be old fashion actor.
|
||||
if (threadClient._parent.on) {
|
||||
threadClient._parent.on("workerListChanged", workerListChanged);
|
||||
} else {
|
||||
|
@ -119,4 +119,4 @@ const clientEvents = {
|
|||
newSource
|
||||
};
|
||||
exports.setupEvents = setupEvents;
|
||||
exports.clientEvents = clientEvents;
|
||||
exports.clientEvents = clientEvents;
|
|
@ -223,10 +223,16 @@ class SearchBar extends _react.Component {
|
|||
});
|
||||
return _react2.default.createElement("button", {
|
||||
className: preppedClass,
|
||||
onClick: () => {
|
||||
onMouseDown: () => {
|
||||
toggleFileSearchModifier(modVal);
|
||||
doSearch(query);
|
||||
},
|
||||
onKeyDown: e => {
|
||||
if (e.key === "Enter") {
|
||||
toggleFileSearchModifier(modVal);
|
||||
doSearch(query);
|
||||
}
|
||||
},
|
||||
title: tooltip
|
||||
}, _react2.default.createElement(_Svg2.default, {
|
||||
name: svgName
|
||||
|
|
|
@ -31,9 +31,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
function FrameTitle({
|
||||
frame,
|
||||
options
|
||||
options = {}
|
||||
}) {
|
||||
const displayName = (0, _frames.formatDisplayName)(frame, options);
|
||||
const displayName = (0, _frames.formatDisplayName)(frame, { ...options,
|
||||
maxLength: null
|
||||
});
|
||||
return _react2.default.createElement("div", {
|
||||
className: "title"
|
||||
}, displayName);
|
||||
|
|
|
@ -125,7 +125,9 @@ class Group extends _react.Component {
|
|||
|
||||
renderDescription() {
|
||||
const frame = this.props.group[0];
|
||||
const displayName = (0, _frames.formatDisplayName)(frame);
|
||||
const displayName = (0, _frames.formatDisplayName)(frame, {
|
||||
maxLength: null
|
||||
});
|
||||
return _react2.default.createElement("li", {
|
||||
key: frame.id,
|
||||
className: (0, _classnames2.default)("group"),
|
||||
|
|
|
@ -40,6 +40,10 @@ async function getGeneratedLocation(state, source, location, sourceMaps) {
|
|||
async function getMappedLocation(state, sourceMaps, location) {
|
||||
const source = (0, _selectors.getSource)(state, location.sourceId);
|
||||
|
||||
if (!source) {
|
||||
throw new Error("Unknown source for location");
|
||||
}
|
||||
|
||||
if ((0, _devtoolsSourceMap.isOriginalId)(location.sourceId)) {
|
||||
return getGeneratedLocation(state, source, location, sourceMaps);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ function truncateMiddleText(sourceText, maxLength) {
|
|||
let truncatedText = sourceText;
|
||||
|
||||
if (sourceText.length > maxLength) {
|
||||
truncatedText = `${sourceText.substring(0, Math.round(maxLength / 2) - 2)}...${sourceText.substring(sourceText.length - Math.round(maxLength / 2 - 1))}`;
|
||||
truncatedText = `${sourceText.substring(0, Math.round(maxLength / 2) - 2)}…${sourceText.substring(sourceText.length - Math.round(maxLength / 2 - 1))}`;
|
||||
}
|
||||
|
||||
return truncatedText;
|
||||
|
|
|
@ -50,7 +50,7 @@ function promisify(context, method, ...args) {
|
|||
|
||||
function endTruncateStr(str, size) {
|
||||
if (str.length > size) {
|
||||
return `...${str.slice(str.length - size)}`;
|
||||
return `…${str.slice(str.length - size)}`;
|
||||
}
|
||||
|
||||
return str;
|
||||
|
|
|
@ -255,6 +255,7 @@ devtools.jar:
|
|||
skin/images/debugger/breakpoint.svg (themes/images/debugger/breakpoint.svg)
|
||||
skin/images/debugger/close.svg (themes/images/debugger/close.svg)
|
||||
skin/images/debugger/coffeescript.svg (themes/images/debugger/coffeescript.svg)
|
||||
skin/images/debugger/column-marker.svg (themes/images/debugger/column-marker.svg)
|
||||
skin/images/debugger/disable-pausing.svg (themes/images/debugger/disable-pausing.svg)
|
||||
skin/images/debugger/domain.svg (themes/images/debugger/domain.svg)
|
||||
skin/images/debugger/extension.svg (themes/images/debugger/extension.svg)
|
||||
|
|
|
@ -1877,7 +1877,9 @@ const IGNORED_SOURCE_URLS = ["debugger eval code"];
|
|||
ErrorRep.propTypes = {
|
||||
object: PropTypes.object.isRequired,
|
||||
// @TODO Change this to Object.values when supported in Node's version of V8
|
||||
mode: PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key]))
|
||||
mode: PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])),
|
||||
// An optional function that will be used to render the Error stacktrace.
|
||||
renderStacktrace: PropTypes.func
|
||||
};
|
||||
|
||||
function ErrorRep(props) {
|
||||
|
@ -1909,7 +1911,8 @@ function ErrorRep(props) {
|
|||
}
|
||||
|
||||
if (preview.stack && props.mode !== MODE.TINY) {
|
||||
content.push("\n", getStacktraceElements(props, preview));
|
||||
const stacktrace = props.renderStacktrace ? props.renderStacktrace(parseStackString(preview.stack)) : getStacktraceElements(props, preview);
|
||||
content.push("\n", stacktrace);
|
||||
}
|
||||
|
||||
return span({
|
||||
|
@ -1940,8 +1943,65 @@ function getStacktraceElements(props, preview) {
|
|||
return stack;
|
||||
}
|
||||
|
||||
const isStacktraceALongString = isLongString(preview.stack);
|
||||
const stackString = isStacktraceALongString ? preview.stack.initial : preview.stack;
|
||||
parseStackString(preview.stack).forEach((frame, index, frames) => {
|
||||
let onLocationClick;
|
||||
const {
|
||||
filename,
|
||||
lineNumber,
|
||||
columnNumber,
|
||||
functionName,
|
||||
location
|
||||
} = frame;
|
||||
|
||||
if (props.onViewSourceInDebugger && !IGNORED_SOURCE_URLS.includes(filename)) {
|
||||
onLocationClick = e => {
|
||||
// Don't trigger ObjectInspector expand/collapse.
|
||||
e.stopPropagation();
|
||||
props.onViewSourceInDebugger({
|
||||
url: filename,
|
||||
line: lineNumber,
|
||||
column: columnNumber
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
stack.push("\t", span({
|
||||
key: `fn${index}`,
|
||||
className: "objectBox-stackTrace-fn"
|
||||
}, cleanFunctionName(functionName)), " ", span({
|
||||
key: `location${index}`,
|
||||
className: "objectBox-stackTrace-location",
|
||||
onClick: onLocationClick,
|
||||
title: onLocationClick ? `View source in debugger → ${location}` : undefined
|
||||
}, location), "\n");
|
||||
});
|
||||
|
||||
return span({
|
||||
key: "stack",
|
||||
className: "objectBox-stackTrace-grid"
|
||||
}, stack);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a string that should represent a stack trace and returns an array of
|
||||
* the frames. The shape of the frames are extremely important as they can then
|
||||
* be processed here or in the toolbox by other components.
|
||||
* @param {String} stack
|
||||
* @returns {Array} Array of frames, which are object with the following shape:
|
||||
* - {String} filename
|
||||
* - {String} functionName
|
||||
* - {String} location
|
||||
* - {Number} columnNumber
|
||||
* - {Number} lineNumber
|
||||
*/
|
||||
function parseStackString(stack) {
|
||||
const res = [];
|
||||
if (!stack) {
|
||||
return res;
|
||||
}
|
||||
|
||||
const isStacktraceALongString = isLongString(stack);
|
||||
const stackString = isStacktraceALongString ? stack.initial : stack;
|
||||
|
||||
stackString.split("\n").forEach((frame, index, frames) => {
|
||||
if (!frame) {
|
||||
|
@ -1980,40 +2040,24 @@ function getStacktraceElements(props, preview) {
|
|||
functionName = "<anonymous>";
|
||||
}
|
||||
|
||||
let onLocationClick;
|
||||
// Given the input: "scriptLocation:2:100"
|
||||
// Result:
|
||||
// ["scriptLocation:2:100", "scriptLocation", "2", "100"]
|
||||
const locationParts = location.match(/^(.*):(\d+):(\d+)$/);
|
||||
|
||||
if (props.onViewSourceInDebugger && location && locationParts && !IGNORED_SOURCE_URLS.includes(locationParts[1])) {
|
||||
const [, url, line, column] = locationParts;
|
||||
onLocationClick = e => {
|
||||
// Don't trigger ObjectInspector expand/collapse.
|
||||
e.stopPropagation();
|
||||
props.onViewSourceInDebugger({
|
||||
url,
|
||||
line: Number(line),
|
||||
column: Number(column)
|
||||
});
|
||||
};
|
||||
if (location && locationParts) {
|
||||
const [, filename, line, column] = locationParts;
|
||||
res.push({
|
||||
filename,
|
||||
functionName,
|
||||
location,
|
||||
columnNumber: Number(column),
|
||||
lineNumber: Number(line)
|
||||
});
|
||||
}
|
||||
|
||||
stack.push("\t", span({
|
||||
key: `fn${index}`,
|
||||
className: "objectBox-stackTrace-fn"
|
||||
}, cleanFunctionName(functionName)), " ", span({
|
||||
key: `location${index}`,
|
||||
className: "objectBox-stackTrace-location",
|
||||
onClick: onLocationClick,
|
||||
title: onLocationClick ? `View source in debugger → ${location}` : undefined
|
||||
}, location), "\n");
|
||||
});
|
||||
|
||||
return span({
|
||||
key: "stack",
|
||||
className: "objectBox-stackTrace-grid"
|
||||
}, stack);
|
||||
return res;
|
||||
}
|
||||
|
||||
// Registration
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<svg width="9px" height="12px" viewBox="0 0 9 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="columnmarkergroup" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<polygon id="columnmarker" fill="#1B1B1D" points="0 0 4 0 9 6 4 12 0 12"></polygon>
|
||||
</g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 344 B |
|
@ -88,33 +88,6 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class FileReader::AsyncWaitRunnable final : public CancelableRunnable
|
||||
{
|
||||
public:
|
||||
explicit AsyncWaitRunnable(FileReader* aReader)
|
||||
: CancelableRunnable("FileReader::AsyncWaitRunnable")
|
||||
, mReader(aReader)
|
||||
{}
|
||||
|
||||
NS_IMETHOD
|
||||
Run() override
|
||||
{
|
||||
if (mReader) {
|
||||
mReader->InitialAsyncWait();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
Abort()
|
||||
{
|
||||
mReader = nullptr;
|
||||
}
|
||||
|
||||
public:
|
||||
RefPtr<FileReader> mReader;
|
||||
};
|
||||
|
||||
void
|
||||
FileReader::RootResultArrayBuffer()
|
||||
{
|
||||
|
@ -473,8 +446,7 @@ FileReader::ReadFileContent(Blob& aBlob,
|
|||
}
|
||||
}
|
||||
|
||||
mAsyncWaitRunnable = new AsyncWaitRunnable(this);
|
||||
aRv = NS_DispatchToCurrentThread(mAsyncWaitRunnable);
|
||||
aRv = DoAsyncWait();
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
FreeFileData();
|
||||
return;
|
||||
|
@ -482,20 +454,6 @@ FileReader::ReadFileContent(Blob& aBlob,
|
|||
|
||||
//FileReader should be in loading state here
|
||||
mReadyState = LOADING;
|
||||
}
|
||||
|
||||
void
|
||||
FileReader::InitialAsyncWait()
|
||||
{
|
||||
mAsyncWaitRunnable = nullptr;
|
||||
|
||||
nsresult rv = DoAsyncWait();
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
mReadyState = EMPTY;
|
||||
FreeFileData();
|
||||
return;
|
||||
}
|
||||
|
||||
DispatchProgressEvent(NS_LITERAL_STRING(LOADSTART_STR));
|
||||
}
|
||||
|
||||
|
@ -816,11 +774,6 @@ FileReader::Abort()
|
|||
|
||||
ClearProgressEventTimer();
|
||||
|
||||
if (mAsyncWaitRunnable) {
|
||||
mAsyncWaitRunnable->Abort();
|
||||
mAsyncWaitRunnable = nullptr;
|
||||
}
|
||||
|
||||
mReadyState = DONE;
|
||||
|
||||
// XXX The spec doesn't say this
|
||||
|
@ -830,19 +783,7 @@ FileReader::Abort()
|
|||
SetDOMStringToNull(mResult);
|
||||
mResultArrayBuffer = nullptr;
|
||||
|
||||
if (mAsyncStream) {
|
||||
if (mBusyCount) {
|
||||
// This will abort any pending reading. See nsIAsyncInputStream.idl.
|
||||
mAsyncStream->AsyncWait(/* callback */ nullptr,
|
||||
/* aFlags*/ 0,
|
||||
/* aRequestedCount */ 0,
|
||||
mTarget);
|
||||
DecreaseBusyCounter();
|
||||
MOZ_ASSERT(mBusyCount == 0);
|
||||
}
|
||||
mAsyncStream = nullptr;
|
||||
}
|
||||
|
||||
mAsyncStream = nullptr;
|
||||
mBlob = nullptr;
|
||||
|
||||
//Clean up memory buffer
|
||||
|
@ -890,11 +831,6 @@ FileReader::Shutdown()
|
|||
{
|
||||
mReadyState = DONE;
|
||||
|
||||
if (mAsyncWaitRunnable) {
|
||||
mAsyncWaitRunnable->Abort();
|
||||
mAsyncWaitRunnable = nullptr;
|
||||
}
|
||||
|
||||
if (mAsyncStream) {
|
||||
mAsyncStream->Close();
|
||||
mAsyncStream = nullptr;
|
||||
|
|
|
@ -128,8 +128,6 @@ public:
|
|||
eDataFormat DataFormat() const { return mDataFormat; }
|
||||
const nsString& Result() const { return mResult; }
|
||||
|
||||
void InitialAsyncWait();
|
||||
|
||||
private:
|
||||
virtual ~FileReader();
|
||||
|
||||
|
@ -209,10 +207,6 @@ private:
|
|||
// This value is set when the reading starts in order to keep the worker alive
|
||||
// during the process.
|
||||
RefPtr<StrongWorkerRef> mStrongWorkerRef;
|
||||
|
||||
// Runnable to start the reading asynchronous.
|
||||
class AsyncWaitRunnable;
|
||||
RefPtr<AsyncWaitRunnable> mAsyncWaitRunnable;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(FileReader, FILEREADER_ID)
|
||||
|
|
|
@ -257,7 +257,7 @@ function test_readAsText(blob, text) {
|
|||
|
||||
is(r.readyState, FileReader.LOADING, "correct loading text readyState");
|
||||
is(onloadHasRun, false, "text loading must be async");
|
||||
is(onloadStartHasRun, false, "text loadstart should fire async");
|
||||
is(onloadStartHasRun, true, "text loadstart should fire sync");
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -280,7 +280,7 @@ function test_readAsBinaryString(blob, text) {
|
|||
|
||||
is(r.readyState, FileReader.LOADING, "correct loading binary readyState");
|
||||
is(onloadHasRun, false, "binary loading must be async");
|
||||
is(onloadStartHasRun, false, "binary loadstart should fire async");
|
||||
is(onloadStartHasRun, true, "binary loadstart should fire sync");
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -303,7 +303,7 @@ function test_readAsArrayBuffer(blob, text) {
|
|||
|
||||
is(r.readyState, FileReader.LOADING, "correct loading arrayBuffer readyState");
|
||||
is(onloadHasRun, false, "arrayBuffer loading must be async");
|
||||
is(onloadStartHasRun, false, "arrayBuffer loadstart should fire sync");
|
||||
is(onloadStartHasRun, true, "arrayBuffer loadstart should fire sync");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -91,17 +91,19 @@ subjectToCSP(nsIURI* aURI, nsContentPolicyType aContentType) {
|
|||
// hence we use protocol flags to accomplish that, but we also
|
||||
// want resource:, chrome: and moz-icon to be subject to CSP
|
||||
// (which also use URI_IS_LOCAL_RESOURCE).
|
||||
// Exception to the rule are images, styles, and localization DTDs
|
||||
// using a scheme of resource: or chrome:
|
||||
bool isImgOrStyleOrDTD = contentType == nsIContentPolicy::TYPE_IMAGE ||
|
||||
contentType == nsIContentPolicy::TYPE_STYLESHEET ||
|
||||
contentType == nsIContentPolicy::TYPE_DTD;
|
||||
// Exception to the rule are images, styles, localization DTDs,
|
||||
// and XBLs using a scheme of resource: or chrome:
|
||||
bool isImgOrStyleOrDTDorXBL =
|
||||
contentType == nsIContentPolicy::TYPE_IMAGE ||
|
||||
contentType == nsIContentPolicy::TYPE_STYLESHEET ||
|
||||
contentType == nsIContentPolicy::TYPE_DTD ||
|
||||
contentType == nsIContentPolicy::TYPE_XBL;
|
||||
rv = aURI->SchemeIs("resource", &match);
|
||||
if (NS_SUCCEEDED(rv) && match && !isImgOrStyleOrDTD) {
|
||||
if (NS_SUCCEEDED(rv) && match && !isImgOrStyleOrDTDorXBL) {
|
||||
return true;
|
||||
}
|
||||
rv = aURI->SchemeIs("chrome", &match);
|
||||
if (NS_SUCCEEDED(rv) && match && !isImgOrStyleOrDTD) {
|
||||
if (NS_SUCCEEDED(rv) && match && !isImgOrStyleOrDTDorXBL) {
|
||||
return true;
|
||||
}
|
||||
rv = aURI->SchemeIs("moz-icon", &match);
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'nsAuthFactory.cpp',
|
||||
'nsAuthGSSAPI.cpp',
|
||||
]
|
||||
|
||||
SOURCES += [
|
||||
'nsAuthSASL.cpp',
|
||||
'nsHttpNegotiateAuth.cpp', # contains constants whose names conflict with constants in other files
|
||||
'nsIAuthModule.cpp', # includes windows.h recursively which conflicts with TimeStamp.h
|
||||
]
|
||||
|
||||
if CONFIG['OS_ARCH'] == 'WINNT':
|
||||
|
@ -26,7 +26,6 @@ else:
|
|||
|
||||
LOCAL_INCLUDES += [
|
||||
'/netwerk/dns', # For nsDNSService2.h
|
||||
'/security/manager/ssl',
|
||||
]
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
|
|
@ -0,0 +1,247 @@
|
|||
/* 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 "mozilla/ModuleUtils.h"
|
||||
#include "nsAuth.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define NS_HTTPNEGOTIATEAUTH_CID \
|
||||
{ /* 75c80fd0-accb-432c-af59-ec60668c3990 */ \
|
||||
0x75c80fd0, \
|
||||
0xaccb, \
|
||||
0x432c, \
|
||||
{0xaf, 0x59, 0xec, 0x60, 0x66, 0x8c, 0x39, 0x90} \
|
||||
}
|
||||
|
||||
#include "nsHttpNegotiateAuth.h"
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpNegotiateAuth)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define NS_NEGOTIATEAUTH_CID \
|
||||
{ /* 96ec4163-efc8-407a-8735-007fb26be4e8 */ \
|
||||
0x96ec4163, \
|
||||
0xefc8, \
|
||||
0x407a, \
|
||||
{0x87, 0x35, 0x00, 0x7f, 0xb2, 0x6b, 0xe4, 0xe8} \
|
||||
}
|
||||
#define NS_GSSAUTH_CID \
|
||||
{ /* dc8e21a0-03e4-11da-8cd6-0800200c9a66 */ \
|
||||
0xdc8e21a0, \
|
||||
0x03e4, \
|
||||
0x11da, \
|
||||
{0x8c, 0xd6, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66} \
|
||||
}
|
||||
|
||||
#include "nsAuthGSSAPI.h"
|
||||
|
||||
#if defined( USE_SSPI )
|
||||
#include "nsAuthSSPI.h"
|
||||
|
||||
static nsresult
|
||||
nsSysNTLMAuthConstructor(nsISupports *outer, REFNSIID iid, void **result)
|
||||
{
|
||||
if (outer)
|
||||
return NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
nsAuthSSPI *auth = new nsAuthSSPI(PACKAGE_TYPE_NTLM);
|
||||
if (!auth)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(auth);
|
||||
nsresult rv = auth->QueryInterface(iid, result);
|
||||
NS_RELEASE(auth);
|
||||
return rv;
|
||||
}
|
||||
|
||||
static nsresult
|
||||
nsKerbSSPIAuthConstructor(nsISupports *outer, REFNSIID iid, void **result)
|
||||
{
|
||||
if (outer)
|
||||
return NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
nsAuthSSPI *auth = new nsAuthSSPI(PACKAGE_TYPE_KERBEROS);
|
||||
if (!auth)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(auth);
|
||||
nsresult rv = auth->QueryInterface(iid, result);
|
||||
NS_RELEASE(auth);
|
||||
return rv;
|
||||
}
|
||||
|
||||
#define NS_SYSNTLMAUTH_CID \
|
||||
{ /* dc195987-6e9a-47bc-b1fd-ab895d398833 */ \
|
||||
0xdc195987, \
|
||||
0x6e9a, \
|
||||
0x47bc, \
|
||||
{0xb1, 0xfd, 0xab, 0x89, 0x5d, 0x39, 0x88, 0x33} \
|
||||
}
|
||||
|
||||
#define NS_NEGOTIATEAUTHSSPI_CID \
|
||||
{ /* 78d3b0c0-0241-11da-8cd6-0800200c9a66 */ \
|
||||
0x78d3b0c0, \
|
||||
0x0241, \
|
||||
0x11da, \
|
||||
{0x8c, 0xd6, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66} \
|
||||
}
|
||||
|
||||
#define NS_KERBAUTHSSPI_CID \
|
||||
{ /* 8c3a0e20-03e5-11da-8cd6-0800200c9a66 */ \
|
||||
0x8c3a0e20, \
|
||||
0x03e5, \
|
||||
0x11da, \
|
||||
{0x8c, 0xd6, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66} \
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define NS_SAMBANTLMAUTH_CID \
|
||||
{ /* bc54f001-6eb0-4e32-9f49-7e064d8e70ef */ \
|
||||
0xbc54f001, \
|
||||
0x6eb0, \
|
||||
0x4e32, \
|
||||
{0x9f, 0x49, 0x7e, 0x06, 0x4d, 0x8e, 0x70, 0xef} \
|
||||
}
|
||||
|
||||
#include "nsAuthSambaNTLM.h"
|
||||
static nsresult
|
||||
nsSambaNTLMAuthConstructor(nsISupports *outer, REFNSIID iid, void **result)
|
||||
{
|
||||
if (outer)
|
||||
return NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
RefPtr<nsAuthSambaNTLM> auth = new nsAuthSambaNTLM();
|
||||
if (!auth)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
nsresult rv = auth->SpawnNTLMAuthHelper();
|
||||
if (NS_FAILED(rv)) {
|
||||
// Failure here probably means that cached credentials were not available
|
||||
return rv;
|
||||
}
|
||||
|
||||
return auth->QueryInterface(iid, result);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static nsresult
|
||||
nsKerbGSSAPIAuthConstructor(nsISupports *outer, REFNSIID iid, void **result)
|
||||
{
|
||||
if (outer)
|
||||
return NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
nsAuthGSSAPI *auth = new nsAuthGSSAPI(PACKAGE_TYPE_KERBEROS);
|
||||
if (!auth)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(auth);
|
||||
nsresult rv = auth->QueryInterface(iid, result);
|
||||
NS_RELEASE(auth);
|
||||
return rv;
|
||||
}
|
||||
|
||||
static nsresult
|
||||
nsGSSAPIAuthConstructor(nsISupports *outer, REFNSIID iid, void **result)
|
||||
{
|
||||
if (outer)
|
||||
return NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
nsAuthGSSAPI *auth = new nsAuthGSSAPI(PACKAGE_TYPE_NEGOTIATE);
|
||||
if (!auth)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(auth);
|
||||
nsresult rv = auth->QueryInterface(iid, result);
|
||||
NS_RELEASE(auth);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
#if defined( USE_SSPI )
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAuthSSPI)
|
||||
#endif
|
||||
|
||||
#define NS_AUTHSASL_CID \
|
||||
{ /* 815e42e0-72cc-480f-934b-148e33c228a6 */ \
|
||||
0x815e42e0, \
|
||||
0x72cc, \
|
||||
0x480f, \
|
||||
{0x93, 0x4b, 0x14, 0x8e, 0x33, 0xc2, 0x28, 0xa6} \
|
||||
}
|
||||
|
||||
#include "nsAuthSASL.h"
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAuthSASL)
|
||||
|
||||
NS_DEFINE_NAMED_CID(NS_GSSAUTH_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_NEGOTIATEAUTH_CID);
|
||||
#if defined( USE_SSPI )
|
||||
NS_DEFINE_NAMED_CID(NS_NEGOTIATEAUTHSSPI_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_KERBAUTHSSPI_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_SYSNTLMAUTH_CID);
|
||||
#else
|
||||
NS_DEFINE_NAMED_CID(NS_SAMBANTLMAUTH_CID);
|
||||
#endif
|
||||
NS_DEFINE_NAMED_CID(NS_HTTPNEGOTIATEAUTH_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_AUTHSASL_CID);
|
||||
|
||||
|
||||
static const mozilla::Module::CIDEntry kAuthCIDs[] = {
|
||||
{ &kNS_GSSAUTH_CID, false, nullptr, nsKerbGSSAPIAuthConstructor },
|
||||
{ &kNS_NEGOTIATEAUTH_CID, false, nullptr, nsGSSAPIAuthConstructor },
|
||||
#if defined( USE_SSPI )
|
||||
{ &kNS_NEGOTIATEAUTHSSPI_CID, false, nullptr, nsAuthSSPIConstructor },
|
||||
{ &kNS_KERBAUTHSSPI_CID, false, nullptr, nsKerbSSPIAuthConstructor },
|
||||
{ &kNS_SYSNTLMAUTH_CID, false, nullptr, nsSysNTLMAuthConstructor },
|
||||
#else
|
||||
{ &kNS_SAMBANTLMAUTH_CID, false, nullptr, nsSambaNTLMAuthConstructor },
|
||||
#endif
|
||||
{ &kNS_HTTPNEGOTIATEAUTH_CID, false, nullptr, nsHttpNegotiateAuthConstructor },
|
||||
{ &kNS_AUTHSASL_CID, false, nullptr, nsAuthSASLConstructor },
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
static const mozilla::Module::ContractIDEntry kAuthContracts[] = {
|
||||
{ NS_AUTH_MODULE_CONTRACTID_PREFIX "kerb-gss", &kNS_GSSAUTH_CID },
|
||||
{ NS_AUTH_MODULE_CONTRACTID_PREFIX "negotiate-gss", &kNS_NEGOTIATEAUTH_CID },
|
||||
#if defined( USE_SSPI )
|
||||
{ NS_AUTH_MODULE_CONTRACTID_PREFIX "negotiate-sspi", &kNS_NEGOTIATEAUTHSSPI_CID },
|
||||
{ NS_AUTH_MODULE_CONTRACTID_PREFIX "kerb-sspi", &kNS_KERBAUTHSSPI_CID },
|
||||
{ NS_AUTH_MODULE_CONTRACTID_PREFIX "sys-ntlm", &kNS_SYSNTLMAUTH_CID },
|
||||
#elif !defined(XP_MACOSX)
|
||||
{ NS_AUTH_MODULE_CONTRACTID_PREFIX "sys-ntlm", &kNS_SAMBANTLMAUTH_CID },
|
||||
#endif
|
||||
{ NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX "negotiate", &kNS_HTTPNEGOTIATEAUTH_CID },
|
||||
{ NS_AUTH_MODULE_CONTRACTID_PREFIX "sasl-gssapi", &kNS_AUTHSASL_CID },
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
mozilla::LazyLogModule gNegotiateLog("negotiateauth");
|
||||
|
||||
// setup nspr logging ...
|
||||
static nsresult
|
||||
InitNegotiateAuth()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static void
|
||||
DestroyNegotiateAuth()
|
||||
{
|
||||
nsAuthGSSAPI::Shutdown();
|
||||
}
|
||||
|
||||
static const mozilla::Module kAuthModule = {
|
||||
mozilla::Module::kVersion,
|
||||
kAuthCIDs,
|
||||
kAuthContracts,
|
||||
nullptr,
|
||||
nullptr,
|
||||
InitNegotiateAuth,
|
||||
DestroyNegotiateAuth
|
||||
};
|
||||
|
||||
NSMODULE_DEFN(nsAuthModule) = &kAuthModule;
|
|
@ -43,17 +43,19 @@ nsAuthSASL::Init(const char *serviceName,
|
|||
serviceFlags |= REQ_MUTUAL_AUTH;
|
||||
|
||||
// Find out whether we should be trying SSPI or not
|
||||
const char *authType = "kerb-gss";
|
||||
const char *contractID = NS_AUTH_MODULE_CONTRACTID_PREFIX "kerb-gss";
|
||||
|
||||
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||
if (prefs) {
|
||||
bool val;
|
||||
rv = prefs->GetBoolPref(kNegotiateAuthSSPI, &val);
|
||||
if (NS_SUCCEEDED(rv) && val)
|
||||
authType = "kerb-sspi";
|
||||
contractID = NS_AUTH_MODULE_CONTRACTID_PREFIX "kerb-sspi";
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_TRUE(mInnerModule = nsIAuthModule::CreateInstance(authType));
|
||||
mInnerModule = do_CreateInstance(contractID, &rv);
|
||||
// if we can't create the GSSAPI module, then bail
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mInnerModule->Init(serviceName, serviceFlags, nullptr, nullptr, nullptr);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ private:
|
|||
|
||||
void Reset();
|
||||
|
||||
typedef ::TimeStamp MS_TimeStamp;
|
||||
typedef TimeStamp MS_TimeStamp;
|
||||
|
||||
private:
|
||||
nsresult MakeSN(const char *principal, nsCString &result);
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
#include "nsICancelable.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "mozilla/net/HttpAuthUtils.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
|
||||
using mozilla::Base64Decode;
|
||||
|
||||
|
@ -63,8 +62,6 @@ static const char kNegotiateAuthAllowNonFqdn[] = "network.negotiate-auth.allow-n
|
|||
static const char kNegotiateAuthSSPI[] = "network.auth.use-sspi";
|
||||
static const char kSSOinPBmode[] = "network.auth.private-browsing-sso";
|
||||
|
||||
mozilla::StaticRefPtr<nsHttpNegotiateAuth> nsHttpNegotiateAuth::gSingleton;
|
||||
|
||||
#define kNegotiateLen (sizeof(kNegotiate)-1)
|
||||
#define DEFAULT_THREAD_TIMEOUT_MS 30000
|
||||
|
||||
|
@ -108,21 +105,6 @@ TestNotInPBMode(nsIHttpAuthenticableChannel *authChannel, bool proxyAuth)
|
|||
return false;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIHttpAuthenticator>
|
||||
nsHttpNegotiateAuth::GetOrCreate()
|
||||
{
|
||||
nsCOMPtr<nsIHttpAuthenticator> authenticator;
|
||||
if (gSingleton) {
|
||||
authenticator = gSingleton;
|
||||
} else {
|
||||
gSingleton = new nsHttpNegotiateAuth();
|
||||
mozilla::ClearOnShutdown(&gSingleton);
|
||||
authenticator = gSingleton;
|
||||
}
|
||||
|
||||
return authenticator.forget();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHttpNegotiateAuth::GetAuthFlags(uint32_t *flags)
|
||||
{
|
||||
|
@ -154,14 +136,13 @@ nsHttpNegotiateAuth::ChallengeReceived(nsIHttpAuthenticableChannel *authChannel,
|
|||
nsISupports **continuationState,
|
||||
bool *identityInvalid)
|
||||
{
|
||||
nsIAuthModule *rawModule = (nsIAuthModule *) *continuationState;
|
||||
nsIAuthModule *module = (nsIAuthModule *) *continuationState;
|
||||
|
||||
*identityInvalid = false;
|
||||
if (rawModule)
|
||||
if (module)
|
||||
return NS_OK;
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIAuthModule> module;
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
rv = authChannel->GetURI(getter_AddRefs(uri));
|
||||
|
@ -216,25 +197,31 @@ nsHttpNegotiateAuth::ChallengeReceived(nsIHttpAuthenticableChannel *authChannel,
|
|||
//
|
||||
service.InsertLiteral("HTTP@", 0);
|
||||
|
||||
const char *authType;
|
||||
const char *contractID;
|
||||
if (TestBoolPref(kNegotiateAuthSSPI)) {
|
||||
LOG((" using negotiate-sspi\n"));
|
||||
authType = "negotiate-sspi";
|
||||
contractID = NS_AUTH_MODULE_CONTRACTID_PREFIX "negotiate-sspi";
|
||||
}
|
||||
else {
|
||||
LOG((" using negotiate-gss\n"));
|
||||
authType = "negotiate-gss";
|
||||
contractID = NS_AUTH_MODULE_CONTRACTID_PREFIX "negotiate-gss";
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_TRUE(module = nsIAuthModule::CreateInstance(authType));
|
||||
rv = CallCreateInstance(contractID, &module);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
LOG((" Failed to load Negotiate Module \n"));
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = module->Init(service.get(), req_flags, nullptr, nullptr, nullptr);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(module);
|
||||
return rv;
|
||||
}
|
||||
|
||||
module.forget(continuationState);
|
||||
*continuationState = module;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -395,8 +382,12 @@ class GetNextTokenRunnable final : public mozilla::Runnable
|
|||
nsresult rv;
|
||||
|
||||
// Use negotiate service to call GenerateCredentials outside of main thread
|
||||
nsAutoCString contractId;
|
||||
contractId.AssignLiteral(NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX);
|
||||
contractId.AppendLiteral("negotiate");
|
||||
nsCOMPtr<nsIHttpAuthenticator> authenticator =
|
||||
new nsHttpNegotiateAuth();
|
||||
do_GetService(contractId.get(), &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsISupports *sessionState = mSessionState;
|
||||
nsISupports *continuationState = mContinuationState;
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "nsIURI.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/LazyIdleThread.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
|
||||
// The nsHttpNegotiateAuth class provides responses for the GSS-API Negotiate method
|
||||
// as specified by Microsoft in draft-brezak-spnego-http-04.txt
|
||||
|
@ -21,8 +20,6 @@ public:
|
|||
NS_DECL_THREADSAFE_ISUPPORTS
|
||||
NS_DECL_NSIHTTPAUTHENTICATOR
|
||||
|
||||
static already_AddRefed<nsIHttpAuthenticator> GetOrCreate();
|
||||
|
||||
private:
|
||||
~nsHttpNegotiateAuth() {}
|
||||
|
||||
|
@ -34,8 +31,5 @@ private:
|
|||
|
||||
// Thread for GenerateCredentialsAsync
|
||||
RefPtr<mozilla::LazyIdleThread> mNegotiateThread;
|
||||
|
||||
// Singleton pointer
|
||||
static mozilla::StaticRefPtr<nsHttpNegotiateAuth> gSingleton;
|
||||
};
|
||||
#endif /* nsHttpNegotiateAuth_h__ */
|
||||
|
|
|
@ -1,65 +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 "nsIAuthModule.h"
|
||||
#if defined( USE_SSPI )
|
||||
#include "nsAuthSSPI.h"
|
||||
#else
|
||||
#include "nsAuthSambaNTLM.h"
|
||||
#endif
|
||||
#include "nsCRT.h"
|
||||
#include "nsAuthGSSAPI.h"
|
||||
#include "nsAuthSASL.h"
|
||||
#include "nsNTLMAuthModule.h"
|
||||
#include "nsNSSComponent.h"
|
||||
|
||||
// static
|
||||
already_AddRefed<nsIAuthModule>
|
||||
nsIAuthModule::CreateInstance(const char* aType)
|
||||
{
|
||||
nsCOMPtr<nsIAuthModule> auth;
|
||||
if (!nsCRT::strcmp(aType, "kerb-gss")) {
|
||||
auth = new nsAuthGSSAPI(PACKAGE_TYPE_KERBEROS);
|
||||
} else if (!nsCRT::strcmp(aType, "negotiate-gss")) {
|
||||
auth = new nsAuthGSSAPI(PACKAGE_TYPE_NEGOTIATE);
|
||||
#if defined( USE_SSPI )
|
||||
} else if (!nsCRT::strcmp(aType, "negotiate-sspi")) {
|
||||
auth = new nsAuthSSPI();
|
||||
} else if (!nsCRT::strcmp(aType, "kerb-sspi")) {
|
||||
auth = new nsAuthSSPI(PACKAGE_TYPE_KERBEROS);
|
||||
} else if (!nsCRT::strcmp(aType, "sys-ntlm")) {
|
||||
auth = new nsAuthSSPI(PACKAGE_TYPE_NTLM);
|
||||
#elif !defined(XP_MACOSX)
|
||||
} else if (!nsCRT::strcmp(aType, "sys-ntlm")) {
|
||||
RefPtr<nsAuthSambaNTLM> sambaAuth = new nsAuthSambaNTLM();
|
||||
|
||||
nsresult rv = sambaAuth->SpawnNTLMAuthHelper();
|
||||
if (NS_FAILED(rv)) {
|
||||
// Failure here probably means that cached credentials were not available
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auth = sambaAuth.forget();
|
||||
#endif
|
||||
} else if (!nsCRT::strcmp(aType, "sasl-gssapi")) {
|
||||
auth = new nsAuthSASL();
|
||||
} else if (!nsCRT::strcmp(aType, "ntlm") &&
|
||||
XRE_IsParentProcess() &&
|
||||
EnsureNSSInitializedChromeOrContent()) {
|
||||
RefPtr<nsNTLMAuthModule> ntlmAuth = new nsNTLMAuthModule();
|
||||
|
||||
nsresult rv = ntlmAuth->InitTest();
|
||||
if (NS_FAILED(rv)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auth = ntlmAuth.forget();
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return auth.forget();
|
||||
}
|
||||
|
||||
mozilla::LazyLogModule gNegotiateLog("negotiateauth");
|
|
@ -4112,17 +4112,13 @@ AsyncPanZoomController::UpdateCheckerboardEvent(const MutexAutoLock& aProofOfLoc
|
|||
uint32_t aMagnitude)
|
||||
{
|
||||
if (mCheckerboardEvent && mCheckerboardEvent->RecordFrameInfo(aMagnitude)) {
|
||||
// This checkerboard event is done. Report some metrics to telemetry, but
|
||||
// skip reporting if the sanity checker window is running, because we get
|
||||
// checkerboarding reported on that window that we don't really care about.
|
||||
if (!gfxPrefs::SanityTestRunning()) {
|
||||
mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_SEVERITY,
|
||||
mCheckerboardEvent->GetSeverity());
|
||||
mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_PEAK,
|
||||
mCheckerboardEvent->GetPeak());
|
||||
mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_DURATION,
|
||||
(uint32_t)mCheckerboardEvent->GetDuration().ToMilliseconds());
|
||||
}
|
||||
// This checkerboard event is done. Report some metrics to telemetry.
|
||||
mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_SEVERITY,
|
||||
mCheckerboardEvent->GetSeverity());
|
||||
mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_PEAK,
|
||||
mCheckerboardEvent->GetPeak());
|
||||
mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_DURATION,
|
||||
(uint32_t)mCheckerboardEvent->GetDuration().ToMilliseconds());
|
||||
|
||||
mPotentialCheckerboardTracker.CheckerboardDone();
|
||||
|
||||
|
|
|
@ -742,8 +742,6 @@ private:
|
|||
|
||||
DECL_GFX_PREF(Live, "print.font-variations-as-paths", PrintFontVariationsAsPaths, bool, true);
|
||||
|
||||
DECL_GFX_PREF(Live, "sanity-test.running", SanityTestRunning, bool, false);
|
||||
|
||||
DECL_GFX_PREF(Once, "slider.snapMultiplier", SliderSnapMultiplier, int32_t, 0);
|
||||
|
||||
DECL_GFX_PREF(Live, "test.events.async.enabled", TestEventsAsyncEnabled, bool, false);
|
||||
|
|
|
@ -1862,7 +1862,9 @@ js::StartDynamicModuleImport(JSContext* cx, HandleValue referencingPrivate, Hand
|
|||
}
|
||||
|
||||
if (!importHook(cx, referencingPrivate, specifier, promise)) {
|
||||
if (!RejectPromiseWithPendingError(cx, promise)) {
|
||||
// If there's no exception pending then the script is terminating
|
||||
// anyway, so just return nullptr.
|
||||
if (!cx->isExceptionPending() || !RejectPromiseWithPendingError(cx, promise)) {
|
||||
return nullptr;
|
||||
}
|
||||
return promise;
|
||||
|
|
107
js/src/gc/GC.cpp
107
js/src/gc/GC.cpp
|
@ -6115,28 +6115,19 @@ GCRuntime::beginSweepingSweepGroup(FreeOp* fop, SliceBudget& budget)
|
|||
}
|
||||
|
||||
#ifdef JS_GC_ZEAL
|
||||
|
||||
bool
|
||||
GCRuntime::shouldYieldForZeal(ZealMode mode)
|
||||
{
|
||||
return useZeal && isIncremental && hasZealMode(mode);
|
||||
}
|
||||
bool yield = useZeal && isIncremental && hasZealMode(mode);
|
||||
|
||||
IncrementalProgress
|
||||
GCRuntime::maybeYieldForSweepingZeal(FreeOp* fop, SliceBudget& budget)
|
||||
{
|
||||
/*
|
||||
* Check whether we need to yield for GC zeal. We always yield when running
|
||||
* in incremental multi-slice zeal mode so RunDebugGC can reset the slice
|
||||
* budget.
|
||||
*/
|
||||
if (initialState != State::Sweep && shouldYieldForZeal(ZealMode::IncrementalMultipleSlices)) {
|
||||
return NotFinished;
|
||||
// Only yield on the first sweep slice for this mode.
|
||||
bool firstSweepSlice = initialState != State::Sweep;
|
||||
if (mode == ZealMode::IncrementalMultipleSlices && !firstSweepSlice) {
|
||||
yield = false;
|
||||
}
|
||||
|
||||
return Finished;
|
||||
return yield;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
IncrementalProgress
|
||||
|
@ -6689,37 +6680,41 @@ class SweepActionCall final : public SweepAction<GCRuntime*, Args...>
|
|||
void assertFinished() const override { }
|
||||
};
|
||||
|
||||
#ifdef JS_GC_ZEAL
|
||||
// Implementation of the SweepAction interface that yields in a specified zeal
|
||||
// mode and then calls another action.
|
||||
// mode.
|
||||
template <typename... Args>
|
||||
class SweepActionMaybeYield final : public SweepAction<GCRuntime*, Args...>
|
||||
{
|
||||
using Action = SweepAction<GCRuntime*, Args...>;
|
||||
|
||||
ZealMode mode;
|
||||
UniquePtr<Action> action;
|
||||
bool triggered;
|
||||
bool isYielding;
|
||||
|
||||
public:
|
||||
SweepActionMaybeYield(UniquePtr<Action> action, ZealMode mode)
|
||||
: mode(mode), action(std::move(action)), triggered(false) {}
|
||||
explicit SweepActionMaybeYield(ZealMode mode)
|
||||
: mode(mode), isYielding(false) {}
|
||||
|
||||
IncrementalProgress run(GCRuntime* gc, Args... args) override {
|
||||
if (!triggered && gc->shouldYieldForZeal(mode)) {
|
||||
triggered = true;
|
||||
#ifdef JS_GC_ZEAL
|
||||
if (!isYielding && gc->shouldYieldForZeal(mode)) {
|
||||
isYielding = true;
|
||||
return NotFinished;
|
||||
}
|
||||
|
||||
triggered = false;
|
||||
return action->run(gc, args...);
|
||||
isYielding = false;
|
||||
#endif
|
||||
return Finished;
|
||||
}
|
||||
|
||||
void assertFinished() const override {
|
||||
MOZ_ASSERT(!triggered);
|
||||
MOZ_ASSERT(!isYielding);
|
||||
}
|
||||
|
||||
// These actions should be skipped if GC zeal is not configured.
|
||||
#ifndef JS_GC_ZEAL
|
||||
bool shouldSkip() override {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
// Implementation of the SweepAction interface that calls a list of actions in
|
||||
// sequence.
|
||||
|
@ -6736,7 +6731,11 @@ class SweepActionSequence final : public SweepAction<Args...>
|
|||
public:
|
||||
bool init(UniquePtr<Action>* acts, size_t count) {
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
if (!actions.emplaceBack(std::move(acts[i]))) {
|
||||
auto& action = acts[i];
|
||||
if (action->shouldSkip()) {
|
||||
continue;
|
||||
}
|
||||
if (!actions.emplaceBack(std::move(action))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -6865,14 +6864,14 @@ Call(IncrementalProgress (GCRuntime::*method)(Args...)) {
|
|||
return MakeUnique<SweepActionCall<Args...>>(method);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
static UniquePtr<SweepAction<GCRuntime*, Args...>>
|
||||
MaybeYield(ZealMode zealMode, UniquePtr<SweepAction<GCRuntime*, Args...>> action) {
|
||||
#ifdef JS_GC_ZEAL
|
||||
return js::MakeUnique<SweepActionMaybeYield<Args...>>(std::move(action), zealMode);
|
||||
#else
|
||||
return action;
|
||||
#endif
|
||||
static UniquePtr<SweepAction<GCRuntime*, FreeOp*, SliceBudget&>>
|
||||
MaybeYield(ZealMode zealMode) {
|
||||
return js::MakeUnique<SweepActionMaybeYield<FreeOp*, SliceBudget&>>(zealMode);
|
||||
}
|
||||
|
||||
static UniquePtr<SweepAction<GCRuntime*, FreeOp*, SliceBudget&, Zone*>>
|
||||
MaybeYieldInZoneLoop(ZealMode zealMode) {
|
||||
return js::MakeUnique<SweepActionMaybeYield<FreeOp*, SliceBudget&, Zone*>>(zealMode);
|
||||
}
|
||||
|
||||
template <typename... Args, typename... Rest>
|
||||
|
@ -6939,25 +6938,23 @@ GCRuntime::initSweepActions()
|
|||
Sequence(
|
||||
Call(&GCRuntime::endMarkingSweepGroup),
|
||||
Call(&GCRuntime::beginSweepingSweepGroup),
|
||||
#ifdef JS_GC_ZEAL
|
||||
Call(&GCRuntime::maybeYieldForSweepingZeal),
|
||||
#endif
|
||||
MaybeYield(ZealMode::YieldBeforeSweepingAtoms,
|
||||
Call(&GCRuntime::sweepAtomsTable)),
|
||||
MaybeYield(ZealMode::YieldBeforeSweepingCaches,
|
||||
Call(&GCRuntime::sweepWeakCaches)),
|
||||
MaybeYield(ZealMode::IncrementalMultipleSlices),
|
||||
MaybeYield(ZealMode::YieldBeforeSweepingAtoms),
|
||||
Call(&GCRuntime::sweepAtomsTable),
|
||||
MaybeYield(ZealMode::YieldBeforeSweepingCaches),
|
||||
Call(&GCRuntime::sweepWeakCaches),
|
||||
ForEachZoneInSweepGroup(rt,
|
||||
Sequence(
|
||||
MaybeYield(ZealMode::YieldBeforeSweepingTypes,
|
||||
Call(&GCRuntime::sweepTypeInformation)),
|
||||
MaybeYield(ZealMode::YieldBeforeSweepingObjects,
|
||||
ForEachAllocKind(ForegroundObjectFinalizePhase.kinds,
|
||||
Call(&GCRuntime::finalizeAllocKind))),
|
||||
MaybeYield(ZealMode::YieldBeforeSweepingNonObjects,
|
||||
ForEachAllocKind(ForegroundNonObjectFinalizePhase.kinds,
|
||||
Call(&GCRuntime::finalizeAllocKind))),
|
||||
MaybeYield(ZealMode::YieldBeforeSweepingShapeTrees,
|
||||
Call(&GCRuntime::sweepShapeTree)),
|
||||
MaybeYieldInZoneLoop(ZealMode::YieldBeforeSweepingTypes),
|
||||
Call(&GCRuntime::sweepTypeInformation),
|
||||
MaybeYieldInZoneLoop(ZealMode::YieldBeforeSweepingObjects),
|
||||
ForEachAllocKind(ForegroundObjectFinalizePhase.kinds,
|
||||
Call(&GCRuntime::finalizeAllocKind)),
|
||||
MaybeYieldInZoneLoop(ZealMode::YieldBeforeSweepingNonObjects),
|
||||
ForEachAllocKind(ForegroundNonObjectFinalizePhase.kinds,
|
||||
Call(&GCRuntime::finalizeAllocKind)),
|
||||
MaybeYieldInZoneLoop(ZealMode::YieldBeforeSweepingShapeTrees),
|
||||
Call(&GCRuntime::sweepShapeTree),
|
||||
Call(&GCRuntime::releaseSweptEmptyArenas))),
|
||||
Call(&GCRuntime::endSweepingSweepGroup)));
|
||||
|
||||
|
|
|
@ -64,6 +64,7 @@ struct SweepAction
|
|||
virtual ~SweepAction() {}
|
||||
virtual IncrementalProgress run(Args... args) = 0;
|
||||
virtual void assertFinished() const = 0;
|
||||
virtual bool shouldSkip() { return false; }
|
||||
};
|
||||
|
||||
class ChunkPool
|
||||
|
@ -631,9 +632,6 @@ class GCRuntime
|
|||
IncrementalProgress endMarkingSweepGroup(FreeOp* fop, SliceBudget& budget);
|
||||
void markIncomingCrossCompartmentPointers(MarkColor color);
|
||||
IncrementalProgress beginSweepingSweepGroup(FreeOp* fop, SliceBudget& budget);
|
||||
#ifdef JS_GC_ZEAL
|
||||
IncrementalProgress maybeYieldForSweepingZeal(FreeOp* fop, SliceBudget& budget);
|
||||
#endif
|
||||
bool shouldReleaseObservedTypes();
|
||||
void sweepDebuggerOnMainThread(FreeOp* fop);
|
||||
void sweepJitDataOnMainThread(FreeOp* fop);
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
// |jit-test| error: ReferenceError
|
||||
var g = newGlobal();
|
||||
g.parent = this;
|
||||
g.eval("new Debugger(parent).onExceptionUnwind = function () { hits++; };");
|
||||
import('')();
|
|
@ -234,12 +234,21 @@ DefaultJitOptions::DefaultJitOptions()
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
|
||||
SET_DEFAULT(spectreIndexMasking, false);
|
||||
SET_DEFAULT(spectreObjectMitigationsBarriers, false);
|
||||
SET_DEFAULT(spectreObjectMitigationsMisc, false);
|
||||
SET_DEFAULT(spectreStringMitigations, false);
|
||||
SET_DEFAULT(spectreValueMasking, false);
|
||||
SET_DEFAULT(spectreJitToCxxCalls, false);
|
||||
#else
|
||||
SET_DEFAULT(spectreIndexMasking, true);
|
||||
SET_DEFAULT(spectreObjectMitigationsBarriers, true);
|
||||
SET_DEFAULT(spectreObjectMitigationsMisc, true);
|
||||
SET_DEFAULT(spectreStringMitigations, true);
|
||||
SET_DEFAULT(spectreValueMasking, true);
|
||||
SET_DEFAULT(spectreJitToCxxCalls, true);
|
||||
#endif
|
||||
|
||||
// Toggles whether unboxed plain objects can be created by the VM.
|
||||
SET_DEFAULT(disableUnboxedObjects, false);
|
||||
|
|
|
@ -4986,11 +4986,7 @@ ShellModuleDynamicImportHook(JSContext* cx, HandleValue referencingPrivate, Hand
|
|||
args[2].setObject(*promise);
|
||||
|
||||
RootedValue result(cx);
|
||||
if (!JS_CallFunctionValue(cx, nullptr, hookValue, args, &result)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return JS_CallFunctionValue(cx, nullptr, hookValue, args, &result);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
@ -3717,6 +3717,22 @@ nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext, nsIFrame* aFrame,
|
|||
if (dom::Element* element = presShell->GetDocument()->GetDocumentElement()) {
|
||||
id = nsLayoutUtils::FindOrCreateIDFor(element);
|
||||
}
|
||||
// In some cases we get a root document here on an APZ-enabled window
|
||||
// that doesn't have the root displayport initialized yet, even though
|
||||
// the ChromeProcessController is supposed to do it when the widget is
|
||||
// created. This can happen simply because the ChromeProcessController
|
||||
// does it on the next spin of the event loop, and we can trigger a paint
|
||||
// synchronously after window creation but before that runs. In that case
|
||||
// we should initialize the root displayport here before we do the paint.
|
||||
} else if (XRE_IsParentProcess() && presContext->IsRoot()
|
||||
&& presShell->GetDocument() != nullptr
|
||||
&& presShell->GetRootScrollFrame() != nullptr
|
||||
&& nsLayoutUtils::UsesAsyncScrolling(presShell->GetRootScrollFrame())) {
|
||||
if (dom::Element* element = presShell->GetDocument()->GetDocumentElement()) {
|
||||
if (!nsLayoutUtils::HasDisplayPort(element)) {
|
||||
APZCCallbackHelper::InitializeRootDisplayport(presShell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nsDisplayListBuilder::AutoCurrentScrollParentIdSetter idSetter(&builder, id);
|
||||
|
|
|
@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system.
|
|||
|
||||
The cubeb git repository is: git://github.com/kinetiknz/cubeb.git
|
||||
|
||||
The git commit ID used was 04d58b66057171d25413498b3a4d0607fd500bb8 (2018-10-24 08:43:52 +1300)
|
||||
The git commit ID used was 9a7a55153e7f9b9e0036ab023909c7bc4a41688b (2018-10-30 09:05:26 +1300)
|
||||
|
|
|
@ -3413,7 +3413,7 @@ audiounit_get_devices_of_type(cubeb_device_type devtype)
|
|||
// Remove the aggregate device from the list of devices (if any).
|
||||
for (auto it = devices.begin(); it != devices.end();) {
|
||||
CFStringRef name = get_device_name(*it);
|
||||
if (CFStringFind(name, CFSTR("CubebAggregateDevice"), 0).location !=
|
||||
if (name && CFStringFind(name, CFSTR("CubebAggregateDevice"), 0).location !=
|
||||
kCFNotFound) {
|
||||
it = devices.erase(it);
|
||||
} else {
|
||||
|
|
|
@ -861,29 +861,23 @@ public class GeckoPreferences
|
|||
pref.setEnabled(isHealthReportEnabled);
|
||||
|
||||
// Instruct the user on how to enable Health Report
|
||||
final String healthReportSettingPath =
|
||||
getString(R.string.pref_feature_tips_notification_enabling_path);
|
||||
final String enableHealthReportHint =
|
||||
getString(R.string.pref_feature_tips_notification_enabling_hint);
|
||||
|
||||
final int healthReportPathFirstCharIndex =
|
||||
enableHealthReportHint.indexOf(healthReportSettingPath);
|
||||
if (healthReportPathFirstCharIndex < 0) {
|
||||
return;
|
||||
}
|
||||
final int healthReportPathLastCharIndex =
|
||||
healthReportPathFirstCharIndex + healthReportSettingPath.length();
|
||||
|
||||
final SpannableString enableHealthReportBoldedHint =
|
||||
new SpannableString(enableHealthReportHint);
|
||||
enableHealthReportBoldedHint.setSpan(new StyleSpan(Typeface.BOLD),
|
||||
healthReportPathFirstCharIndex, healthReportPathLastCharIndex,
|
||||
Spannable.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
final String RIGHT_CHEVRON_SPACE_PADDED = " > ";
|
||||
StringBuilder healthReportSettingPath = new StringBuilder()
|
||||
.append(getString(R.string.pref_category_privacy_short))
|
||||
.append(RIGHT_CHEVRON_SPACE_PADDED)
|
||||
.append(getString(R.string.pref_category_datareporting))
|
||||
.append(RIGHT_CHEVRON_SPACE_PADDED)
|
||||
.append(getString(R.string.datareporting_fhr_title));
|
||||
SpannableString boldSettingsLocation = new SpannableString(healthReportSettingPath);
|
||||
boldSettingsLocation.setSpan(new StyleSpan(Typeface.BOLD),
|
||||
0, healthReportSettingPath.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
|
||||
SpannableStringBuilder summaryTextBuilder = new SpannableStringBuilder()
|
||||
.append(getString(R.string.pref_feature_tips_notification_summary))
|
||||
.append("\n\n")
|
||||
.append(enableHealthReportBoldedHint);
|
||||
.append(getString(R.string.pref_feature_tips_notification_enabling_hint))
|
||||
.append(" ")
|
||||
.append(boldSettingsLocation);
|
||||
|
||||
pref.setSummary(summaryTextBuilder);
|
||||
}
|
||||
|
|
|
@ -290,12 +290,10 @@
|
|||
<!-- Localization note (pref_feature_tips_notification_summary): Description of a new toggleable setting in Settings-Notifications screen.
|
||||
Similar to the already existing "pref_whats_new_notification_summary"-->
|
||||
<!ENTITY pref_feature_tips_notification_summary "Learn more about using &brandShortName; and other &vendorShortName; products">
|
||||
<!-- Localization note (pref_feature_tips_notification_enabling_path):
|
||||
Nothing to translate. Simple concatenation of already localized strings. Result is used below. -->
|
||||
<!ENTITY pref_feature_tips_notification_enabling_path "&pref_category_privacy_short; > &pref_category_datareporting; > &datareporting_fhr_title;">
|
||||
<!-- Localization note (pref_feature_tips_notification_enabling_hint):
|
||||
Describe the action the user should do to enable this preference. -->
|
||||
<!ENTITY pref_feature_tips_notification_enabling_hint2 "Turn on &pref_feature_tips_notification_enabling_path;">
|
||||
Describe the action the user should do to enable this preference
|
||||
Will be used in the context "<Turn on> ... to enable this feature" -->
|
||||
<!ENTITY pref_feature_tips_notification_enabling_hint "Turn on">
|
||||
|
||||
<!-- Localization note (pref_category_experimental): Title of a sub category in the 'advanced' category
|
||||
for experimental features. -->
|
||||
|
|
|
@ -224,8 +224,7 @@
|
|||
|
||||
<string name="pref_feature_tips_notification">&pref_feature_tips_notification;</string>
|
||||
<string name="pref_feature_tips_notification_summary">&pref_feature_tips_notification_summary;</string>
|
||||
<string name="pref_feature_tips_notification_enabling_path">&pref_feature_tips_notification_enabling_path;</string>
|
||||
<string name="pref_feature_tips_notification_enabling_hint">&pref_feature_tips_notification_enabling_hint2;</string>
|
||||
<string name="pref_feature_tips_notification_enabling_hint">&pref_feature_tips_notification_enabling_hint;</string>
|
||||
|
||||
<string name="pref_category_experimental">&pref_category_experimental;</string>
|
||||
|
||||
|
|
|
@ -1537,12 +1537,21 @@ pref("javascript.options.throw_on_debuggee_would_run", false);
|
|||
pref("javascript.options.dump_stack_on_debuggee_would_run", false);
|
||||
|
||||
// Spectre security vulnerability mitigations.
|
||||
#if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
|
||||
pref("javascript.options.spectre.index_masking", false);
|
||||
pref("javascript.options.spectre.object_mitigations.barriers", false);
|
||||
pref("javascript.options.spectre.object_mitigations.misc", false);
|
||||
pref("javascript.options.spectre.string_mitigations", false);
|
||||
pref("javascript.options.spectre.value_masking", false);
|
||||
pref("javascript.options.spectre.jit_to_C++_calls", false);
|
||||
#else
|
||||
pref("javascript.options.spectre.index_masking", true);
|
||||
pref("javascript.options.spectre.object_mitigations.barriers", true);
|
||||
pref("javascript.options.spectre.object_mitigations.misc", true);
|
||||
pref("javascript.options.spectre.string_mitigations", true);
|
||||
pref("javascript.options.spectre.value_masking", true);
|
||||
pref("javascript.options.spectre.jit_to_C++_calls", true);
|
||||
#endif
|
||||
|
||||
// Streams API
|
||||
pref("javascript.options.streams", false);
|
||||
|
|
|
@ -133,14 +133,13 @@ interface nsIAuthModule : nsISupports
|
|||
in unsigned long aInTokenLength,
|
||||
out voidPtr aOutToken,
|
||||
out unsigned long aOutTokenLength);
|
||||
};
|
||||
|
||||
%{C++
|
||||
/**
|
||||
* Create a new instance of an auth module.
|
||||
*
|
||||
* @param aType
|
||||
* The type of the auth module to be constructed.
|
||||
*/
|
||||
static already_AddRefed<nsIAuthModule> CreateInstance(const char* aType);
|
||||
/**
|
||||
* nsIAuthModule implementations are registered under the following contract
|
||||
* ID prefix:
|
||||
*/
|
||||
#define NS_AUTH_MODULE_CONTRACTID_PREFIX \
|
||||
"@mozilla.org/network/auth-module;1?name="
|
||||
%}
|
||||
};
|
||||
|
|
|
@ -17,7 +17,6 @@ include('/ipc/chromium/chromium-config.mozbuild')
|
|||
FINAL_LIBRARY = 'xul'
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
'/extensions/auth',
|
||||
'/netwerk/base',
|
||||
'/netwerk/cache',
|
||||
'/netwerk/dns',
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "mozilla/net/BackgroundChannelRegistrar.h"
|
||||
#include "mozilla/net/NeckoChild.h"
|
||||
#include "RedirectChannelRegistrar.h"
|
||||
#include "nsAuthGSSAPI.h"
|
||||
|
||||
#include "nsNetCID.h"
|
||||
|
||||
|
@ -234,16 +233,22 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFtpProtocolHandler, Init)
|
|||
#undef LOG
|
||||
#undef LOG_ENABLED
|
||||
#include "nsHttpAuthManager.h"
|
||||
#include "nsHttpBasicAuth.h"
|
||||
#include "nsHttpDigestAuth.h"
|
||||
#include "nsHttpNTLMAuth.h"
|
||||
#include "nsHttpActivityDistributor.h"
|
||||
#include "ThrottleQueue.h"
|
||||
#undef LOG
|
||||
#undef LOG_ENABLED
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpNTLMAuth)
|
||||
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsHttpHandler, nsHttpHandler::GetInstance)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHttpsHandler, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHttpAuthManager, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpActivityDistributor)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpBasicAuth)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpDigestAuth)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(ThrottleQueue)
|
||||
} // namespace net
|
||||
} // namespace mozilla
|
||||
|
@ -621,8 +626,6 @@ static void nsNetShutdown()
|
|||
|
||||
mozilla::net::BackgroundChannelRegistrar::Shutdown();
|
||||
|
||||
nsAuthGSSAPI::Shutdown();
|
||||
|
||||
delete gNetSniffers;
|
||||
gNetSniffers = nullptr;
|
||||
delete gDataSniffers;
|
||||
|
@ -681,6 +684,9 @@ NS_DEFINE_NAMED_CID(NS_MIMEHEADERPARAM_CID);
|
|||
NS_DEFINE_NAMED_CID(NS_FILEPROTOCOLHANDLER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_HTTPPROTOCOLHANDLER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_HTTPSPROTOCOLHANDLER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_HTTPBASICAUTH_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_HTTPDIGESTAUTH_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_HTTPNTLMAUTH_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_HTTPAUTHMANAGER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_HTTPACTIVITYDISTRIBUTOR_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_THROTTLEQUEUE_CID);
|
||||
|
@ -785,6 +791,9 @@ static const mozilla::Module::CIDEntry kNeckoCIDs[] = {
|
|||
{ &kNS_FILEPROTOCOLHANDLER_CID, false, nullptr, nsFileProtocolHandlerConstructor },
|
||||
{ &kNS_HTTPPROTOCOLHANDLER_CID, false, nullptr, mozilla::net::nsHttpHandlerConstructor },
|
||||
{ &kNS_HTTPSPROTOCOLHANDLER_CID, false, nullptr, mozilla::net::nsHttpsHandlerConstructor },
|
||||
{ &kNS_HTTPBASICAUTH_CID, false, nullptr, mozilla::net::nsHttpBasicAuthConstructor },
|
||||
{ &kNS_HTTPDIGESTAUTH_CID, false, nullptr, mozilla::net::nsHttpDigestAuthConstructor },
|
||||
{ &kNS_HTTPNTLMAUTH_CID, false, nullptr, mozilla::net::nsHttpNTLMAuthConstructor },
|
||||
{ &kNS_HTTPAUTHMANAGER_CID, false, nullptr, mozilla::net::nsHttpAuthManagerConstructor },
|
||||
{ &kNS_HTTPACTIVITYDISTRIBUTOR_CID, false, nullptr, mozilla::net::nsHttpActivityDistributorConstructor },
|
||||
{ &kNS_THROTTLEQUEUE_CID, false, nullptr, mozilla::net::ThrottleQueueConstructor },
|
||||
|
@ -896,6 +905,9 @@ static const mozilla::Module::ContractIDEntry kNeckoContracts[] = {
|
|||
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "file", &kNS_FILEPROTOCOLHANDLER_CID },
|
||||
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &kNS_HTTPPROTOCOLHANDLER_CID },
|
||||
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "https", &kNS_HTTPSPROTOCOLHANDLER_CID },
|
||||
{ NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX "basic", &kNS_HTTPBASICAUTH_CID },
|
||||
{ NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX "digest", &kNS_HTTPDIGESTAUTH_CID },
|
||||
{ NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX "ntlm", &kNS_HTTPNTLMAUTH_CID },
|
||||
{ NS_HTTPAUTHMANAGER_CONTRACTID, &kNS_HTTPAUTHMANAGER_CID },
|
||||
{ NS_HTTPACTIVITYDISTRIBUTOR_CONTRACTID, &kNS_HTTPACTIVITYDISTRIBUTOR_CID },
|
||||
{ NS_THROTTLEQUEUE_CONTRACTID, &kNS_THROTTLEQUEUE_CID },
|
||||
|
|
|
@ -133,7 +133,6 @@ FINAL_LIBRARY = 'xul'
|
|||
|
||||
LOCAL_INCLUDES += [
|
||||
'/dom/base',
|
||||
'/extensions/auth',
|
||||
'/netwerk/base',
|
||||
'/netwerk/cookie',
|
||||
]
|
||||
|
|
|
@ -10,28 +10,10 @@
|
|||
#include "plstr.h"
|
||||
#include "nsString.h"
|
||||
#include "mozilla/Base64.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
StaticRefPtr<nsHttpBasicAuth> nsHttpBasicAuth::gSingleton;
|
||||
|
||||
already_AddRefed<nsIHttpAuthenticator>
|
||||
nsHttpBasicAuth::GetOrCreate()
|
||||
{
|
||||
nsCOMPtr<nsIHttpAuthenticator> authenticator;
|
||||
if (gSingleton) {
|
||||
authenticator = gSingleton;
|
||||
} else {
|
||||
gSingleton = new nsHttpBasicAuth();
|
||||
ClearOnShutdown(&gSingleton);
|
||||
authenticator = gSingleton;
|
||||
}
|
||||
|
||||
return authenticator.forget();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// nsHttpBasicAuth::nsISupports
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#define nsBasicAuth_h__
|
||||
|
||||
#include "nsIHttpAuthenticator.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
|
||||
namespace mozilla { namespace net {
|
||||
|
||||
|
@ -24,13 +22,8 @@ public:
|
|||
NS_DECL_NSIHTTPAUTHENTICATOR
|
||||
|
||||
nsHttpBasicAuth() = default;
|
||||
|
||||
static already_AddRefed<nsIHttpAuthenticator> GetOrCreate();
|
||||
|
||||
private:
|
||||
virtual ~nsHttpBasicAuth() = default;
|
||||
|
||||
static StaticRefPtr<nsHttpBasicAuth> gSingleton;
|
||||
};
|
||||
|
||||
} // namespace net
|
||||
|
|
|
@ -25,10 +25,6 @@
|
|||
#include "nsIHttpAuthenticableChannel.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsHttpBasicAuth.h"
|
||||
#include "nsHttpDigestAuth.h"
|
||||
#include "nsHttpNegotiateAuth.h"
|
||||
#include "nsHttpNTLMAuth.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsILoadContext.h"
|
||||
#include "nsIURL.h"
|
||||
|
@ -1099,23 +1095,11 @@ nsHttpChannelAuthProvider::GetAuthenticator(const char *challenge,
|
|||
// normalize to lowercase
|
||||
ToLowerCase(authType);
|
||||
|
||||
nsCOMPtr<nsIHttpAuthenticator> authenticator;
|
||||
if (authType.EqualsLiteral("negotiate")) {
|
||||
authenticator = nsHttpNegotiateAuth::GetOrCreate();
|
||||
} else if (authType.EqualsLiteral("basic")) {
|
||||
authenticator = nsHttpBasicAuth::GetOrCreate();
|
||||
} else if (authType.EqualsLiteral("digest")) {
|
||||
authenticator = nsHttpDigestAuth::GetOrCreate();
|
||||
} else if (authType.EqualsLiteral("ntlm")) {
|
||||
authenticator = nsHttpNTLMAuth::GetOrCreate();
|
||||
} else {
|
||||
return NS_ERROR_SERVICE_NOT_FOUND;
|
||||
}
|
||||
nsAutoCString contractid;
|
||||
contractid.AssignLiteral(NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX);
|
||||
contractid.Append(authType);
|
||||
|
||||
MOZ_ASSERT(authenticator);
|
||||
authenticator.forget(auth);
|
||||
|
||||
return NS_OK;
|
||||
return CallGetService(contractid.get(), auth);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
// HttpLog.h should generally be included first
|
||||
#include "HttpLog.h"
|
||||
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "mozilla/Unused.h"
|
||||
|
||||
|
@ -26,23 +25,6 @@
|
|||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
StaticRefPtr<nsHttpDigestAuth> nsHttpDigestAuth::gSingleton;
|
||||
|
||||
already_AddRefed<nsIHttpAuthenticator>
|
||||
nsHttpDigestAuth::GetOrCreate()
|
||||
{
|
||||
nsCOMPtr<nsIHttpAuthenticator> authenticator;
|
||||
if (gSingleton) {
|
||||
authenticator = gSingleton;
|
||||
} else {
|
||||
gSingleton = new nsHttpDigestAuth();
|
||||
ClearOnShutdown(&gSingleton);
|
||||
authenticator = gSingleton;
|
||||
}
|
||||
|
||||
return authenticator.forget();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// nsHttpDigestAuth::nsISupports
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "nsStringFwd.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
|
||||
class nsICryptoHash;
|
||||
|
||||
|
@ -39,8 +38,6 @@ class nsHttpDigestAuth final : public nsIHttpAuthenticator
|
|||
|
||||
nsHttpDigestAuth() = default;
|
||||
|
||||
static already_AddRefed<nsIHttpAuthenticator> GetOrCreate();
|
||||
|
||||
protected:
|
||||
~nsHttpDigestAuth() = default;
|
||||
|
||||
|
@ -90,8 +87,6 @@ class nsHttpDigestAuth final : public nsIHttpAuthenticator
|
|||
protected:
|
||||
nsCOMPtr<nsICryptoHash> mVerifier;
|
||||
char mHashBuf[DIGEST_LENGTH];
|
||||
|
||||
static StaticRefPtr<nsHttpDigestAuth> gSingleton;
|
||||
};
|
||||
|
||||
} // namespace net
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "nsIChannel.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "mozilla/net/HttpAuthUtils.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
@ -46,8 +45,6 @@ static const char kTrustedURIs[] = "network.automatic-ntlm-auth.trusted-uris";
|
|||
static const char kForceGeneric[] = "network.auth.force-generic-ntlm";
|
||||
static const char kSSOinPBmode[] = "network.auth.private-browsing-sso";
|
||||
|
||||
StaticRefPtr<nsHttpNTLMAuth> nsHttpNTLMAuth::gSingleton;
|
||||
|
||||
static bool
|
||||
IsNonFqdn(nsIURI *uri)
|
||||
{
|
||||
|
@ -147,21 +144,6 @@ NS_IMPL_ISUPPORTS0(nsNTLMSessionState)
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
already_AddRefed<nsIHttpAuthenticator>
|
||||
nsHttpNTLMAuth::GetOrCreate()
|
||||
{
|
||||
nsCOMPtr<nsIHttpAuthenticator> authenticator;
|
||||
if (gSingleton) {
|
||||
authenticator = gSingleton;
|
||||
} else {
|
||||
gSingleton = new nsHttpNTLMAuth();
|
||||
ClearOnShutdown(&gSingleton);
|
||||
authenticator = gSingleton;
|
||||
}
|
||||
|
||||
return authenticator.forget();
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsHttpNTLMAuth, nsIHttpAuthenticator)
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -186,7 +168,7 @@ nsHttpNTLMAuth::ChallengeReceived(nsIHttpAuthenticableChannel *channel,
|
|||
// If native NTLM auth apis are available and enabled through prefs,
|
||||
// try to use them.
|
||||
if (PL_strcasecmp(challenge, "NTLM") == 0) {
|
||||
nsCOMPtr<nsIAuthModule> module;
|
||||
nsCOMPtr<nsISupports> module;
|
||||
|
||||
// Check to see if we should default to our generic NTLM auth module
|
||||
// through UseGenericNTLM. (We use native auth by default if the
|
||||
|
@ -201,7 +183,7 @@ nsHttpNTLMAuth::ChallengeReceived(nsIHttpAuthenticableChannel *channel,
|
|||
// Try logging in with the user's default credentials. If
|
||||
// successful, |identityInvalid| is false, which will trigger
|
||||
// a default credentials attempt once we return.
|
||||
module = nsIAuthModule::CreateInstance("sys-ntlm");
|
||||
module = do_CreateInstance(NS_AUTH_MODULE_CONTRACTID_PREFIX "sys-ntlm");
|
||||
}
|
||||
#ifdef XP_WIN
|
||||
else {
|
||||
|
@ -210,7 +192,7 @@ nsHttpNTLMAuth::ChallengeReceived(nsIHttpAuthenticableChannel *channel,
|
|||
// Note, for servers that use LMv1 a weak hash of the user's password
|
||||
// will be sent. We rely on windows internal apis to decide whether
|
||||
// we should support this older, less secure version of the protocol.
|
||||
module = nsIAuthModule::CreateInstance("sys-ntlm");
|
||||
module = do_CreateInstance(NS_AUTH_MODULE_CONTRACTID_PREFIX "sys-ntlm");
|
||||
*identityInvalid = true;
|
||||
}
|
||||
#endif // XP_WIN
|
||||
|
@ -238,7 +220,7 @@ nsHttpNTLMAuth::ChallengeReceived(nsIHttpAuthenticableChannel *channel,
|
|||
// Use our internal NTLM implementation. Note, this is less secure,
|
||||
// see bug 520607 for details.
|
||||
LOG(("Trying to fall back on internal ntlm auth.\n"));
|
||||
module = nsIAuthModule::CreateInstance("ntlm");
|
||||
module = do_CreateInstance(NS_AUTH_MODULE_CONTRACTID_PREFIX "ntlm");
|
||||
|
||||
mUseNative = false;
|
||||
|
||||
|
@ -254,7 +236,7 @@ nsHttpNTLMAuth::ChallengeReceived(nsIHttpAuthenticableChannel *channel,
|
|||
|
||||
// A non-null continuation state implies that we failed to authenticate.
|
||||
// Blow away the old authentication state, and use the new one.
|
||||
module.forget(continuationState);
|
||||
module.swap(*continuationState);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#define nsHttpNTLMAuth_h__
|
||||
|
||||
#include "nsIHttpAuthenticator.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
|
||||
namespace mozilla { namespace net {
|
||||
|
||||
|
@ -18,16 +17,12 @@ public:
|
|||
|
||||
nsHttpNTLMAuth() : mUseNative(false) {}
|
||||
|
||||
static already_AddRefed<nsIHttpAuthenticator> GetOrCreate();
|
||||
|
||||
private:
|
||||
virtual ~nsHttpNTLMAuth() = default;
|
||||
|
||||
// This flag indicates whether we are using the native NTLM implementation
|
||||
// or the internal one.
|
||||
bool mUseNative;
|
||||
|
||||
static StaticRefPtr<nsHttpNTLMAuth> gSingleton;
|
||||
};
|
||||
|
||||
} // namespace net
|
||||
|
|
|
@ -9,15 +9,11 @@
|
|||
|
||||
#include "base/basictypes.h"
|
||||
|
||||
#include "nsHttpBasicAuth.h"
|
||||
#include "nsHttpChunkedDecoder.h"
|
||||
#include "nsHttpDigestAuth.h"
|
||||
#include "nsHttpHandler.h"
|
||||
#include "nsHttpNegotiateAuth.h"
|
||||
#include "nsHttpNTLMAuth.h"
|
||||
#include "nsHttpTransaction.h"
|
||||
#include "nsHttpRequestHead.h"
|
||||
#include "nsHttpResponseHead.h"
|
||||
#include "nsHttpTransaction.h"
|
||||
#include "nsHttpChunkedDecoder.h"
|
||||
#include "nsTransportUtils.h"
|
||||
#include "nsNetCID.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
@ -2026,17 +2022,12 @@ nsHttpTransaction::CheckForStickyAuthSchemeAt(nsHttpAtom const& header)
|
|||
while (p.ReadWord(schema)) {
|
||||
ToLowerCase(schema);
|
||||
|
||||
nsAutoCString contractid;
|
||||
contractid.AssignLiteral(NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX);
|
||||
contractid.Append(schema);
|
||||
|
||||
// using a new instance because of thread safety of auth modules refcnt
|
||||
nsCOMPtr<nsIHttpAuthenticator> authenticator;
|
||||
if (schema.EqualsLiteral("negotiate")) {
|
||||
authenticator = new nsHttpNegotiateAuth();
|
||||
} else if (schema.EqualsLiteral("basic")) {
|
||||
authenticator = new nsHttpBasicAuth();
|
||||
} else if (schema.EqualsLiteral("digest")) {
|
||||
authenticator = new nsHttpDigestAuth();
|
||||
} else if (schema.EqualsLiteral("ntlm")) {
|
||||
authenticator = new nsHttpNTLMAuth();
|
||||
}
|
||||
nsCOMPtr<nsIHttpAuthenticator> authenticator(do_CreateInstance(contractid.get()));
|
||||
if (authenticator) {
|
||||
uint32_t flags;
|
||||
nsresult rv = authenticator->GetAuthFlags(&flags);
|
||||
|
|
|
@ -219,3 +219,8 @@ interface nsIHttpAuthenticator : nsISupports
|
|||
*/
|
||||
const unsigned long IDENTITY_ENCRYPTED = (1<<12);
|
||||
};
|
||||
|
||||
%{C++
|
||||
#define NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX \
|
||||
"@mozilla.org/network/http-authenticator;1?scheme="
|
||||
%}
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "nsNSSCertificateDB.h"
|
||||
#include "nsNSSComponent.h"
|
||||
#include "nsNSSVersion.h"
|
||||
#include "nsNTLMAuthModule.h"
|
||||
#include "nsNetCID.h"
|
||||
#include "nsPK11TokenDB.h"
|
||||
#include "nsPKCS11Slot.h"
|
||||
|
@ -143,6 +144,7 @@ NS_DEFINE_NAMED_CID(NS_CERTTREE_CID);
|
|||
#endif
|
||||
NS_DEFINE_NAMED_CID(NS_CRYPTO_HASH_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_CRYPTO_HMAC_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_NTLMAUTHMODULE_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_KEYMODULEOBJECT_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_KEYMODULEOBJECTFACTORY_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_CONTENTSIGNATUREVERIFIER_CID);
|
||||
|
@ -181,6 +183,8 @@ static const mozilla::Module::CIDEntry kNSSCIDs[] = {
|
|||
Constructor<nsCryptoHash, nullptr, ProcessRestriction::AnyProcess> },
|
||||
{ &kNS_CRYPTO_HMAC_CID, false, nullptr,
|
||||
Constructor<nsCryptoHMAC, nullptr, ProcessRestriction::AnyProcess> },
|
||||
{ &kNS_NTLMAUTHMODULE_CID, false, nullptr,
|
||||
Constructor<nsNTLMAuthModule, &nsNTLMAuthModule::InitTest> },
|
||||
{ &kNS_KEYMODULEOBJECT_CID, false, nullptr,
|
||||
Constructor<nsKeyObject, nullptr, ProcessRestriction::AnyProcess> },
|
||||
{ &kNS_KEYMODULEOBJECTFACTORY_CID, false, nullptr,
|
||||
|
@ -235,6 +239,7 @@ static const mozilla::Module::ContractIDEntry kNSSContracts[] = {
|
|||
{ NS_CRYPTO_HASH_CONTRACTID, &kNS_CRYPTO_HASH_CID },
|
||||
{ NS_CRYPTO_HMAC_CONTRACTID, &kNS_CRYPTO_HMAC_CID },
|
||||
{ "@mozilla.org/uriloader/psm-external-content-listener;1", &kNS_PSMCONTENTLISTEN_CID },
|
||||
{ NS_NTLMAUTHMODULE_CONTRACTID, &kNS_NTLMAUTHMODULE_CID },
|
||||
{ NS_KEYMODULEOBJECT_CONTRACTID, &kNS_KEYMODULEOBJECT_CID },
|
||||
{ NS_KEYMODULEOBJECTFACTORY_CONTRACTID, &kNS_KEYMODULEOBJECTFACTORY_CID },
|
||||
{ NS_CONTENTSIGNATUREVERIFIER_CONTRACTID, &kNS_CONTENTSIGNATUREVERIFIER_CID },
|
||||
|
|
|
@ -31,4 +31,14 @@ private:
|
|||
bool mNTLMNegotiateSent;
|
||||
};
|
||||
|
||||
#define NS_NTLMAUTHMODULE_CONTRACTID \
|
||||
NS_AUTH_MODULE_CONTRACTID_PREFIX "ntlm"
|
||||
#define NS_NTLMAUTHMODULE_CID \
|
||||
{ /* a4e5888f-4fe4-4632-8e7e-745196ea7c70 */ \
|
||||
0xa4e5888f, \
|
||||
0x4fe4, \
|
||||
0x4632, \
|
||||
{0x8e, 0x7e, 0x74, 0x51, 0x96, 0xea, 0x7c, 0x70} \
|
||||
}
|
||||
|
||||
#endif // nsNTLMAuthModule_h__
|
||||
|
|
|
@ -2351,10 +2351,21 @@ impl Animate for ComputedRotate {
|
|||
let from = ComputedRotate::resolve(self);
|
||||
let to = ComputedRotate::resolve(other);
|
||||
|
||||
let (fx, fy, fz, fa) =
|
||||
let (mut fx, mut fy, mut fz, fa) =
|
||||
transform::get_normalized_vector_and_angle(from.0, from.1, from.2, from.3);
|
||||
let (tx, ty, tz, ta) =
|
||||
let (mut tx, mut ty, mut tz, ta) =
|
||||
transform::get_normalized_vector_and_angle(to.0, to.1, to.2, to.3);
|
||||
|
||||
if fa == Angle::from_degrees(0.) {
|
||||
fx = tx;
|
||||
fy = ty;
|
||||
fz = tz;
|
||||
} else if ta == Angle::from_degrees(0.) {
|
||||
tx = fx;
|
||||
ty = fy;
|
||||
tz = fz;
|
||||
}
|
||||
|
||||
if (fx, fy, fz) == (tx, ty, tz) {
|
||||
return Ok(Rotate::Rotate3D(fx, fy, fz, fa.animate(&ta, procedure)?));
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[filereader_abort.html]
|
||||
[Aborting after read]
|
||||
expected: FAIL
|
||||
|
|
@ -1,6 +1,3 @@
|
|||
[abs-pos-non-replaced-icb-vlr-021.xht]
|
||||
expected:
|
||||
if debug and not webrender and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
|
||||
if not debug and not webrender and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
|
||||
if debug and not webrender and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
|
||||
if not debug and not webrender and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
|
||||
disabled:
|
||||
if (os == "win"): https://bugzilla.mozilla.org/show_bug.cgi?id=1500276
|
||||
|
|
|
@ -11,57 +11,56 @@
|
|||
</head>
|
||||
<body>
|
||||
<script>
|
||||
// none -> none
|
||||
test_interpolation(
|
||||
{
|
||||
property: 'transform',
|
||||
from: 'none',
|
||||
to: 'none',
|
||||
},
|
||||
[{ at: 0.25, expect: 'none' }]
|
||||
[{ at: 0.25, expect: 'none' }],
|
||||
'none -> none'
|
||||
);
|
||||
|
||||
// none -> something
|
||||
test_interpolation(
|
||||
{
|
||||
property: 'transform',
|
||||
from: 'none',
|
||||
to: 'translate(200px) rotate(720deg)',
|
||||
},
|
||||
[{ at: 0.25, expect: 'translate(50px) rotate(180deg)' }]
|
||||
[{ at: 0.25, expect: 'translate(50px) rotate(180deg)' }],
|
||||
'none -> something'
|
||||
);
|
||||
|
||||
// something -> none
|
||||
test_interpolation(
|
||||
{
|
||||
property: 'transform',
|
||||
from: 'translate(200px) rotate(720deg)',
|
||||
to: 'none',
|
||||
},
|
||||
[{ at: 0.25, expect: 'translate(150px) rotate(540deg)' }]
|
||||
[{ at: 0.25, expect: 'translate(150px) rotate(540deg)' }],
|
||||
'something -> none'
|
||||
);
|
||||
|
||||
// Mismatched lengths (from is shorter), common part matches
|
||||
test_interpolation(
|
||||
{
|
||||
property: 'transform',
|
||||
from: 'translate(100px)',
|
||||
to: 'translate(200px) rotate(720deg)',
|
||||
},
|
||||
[{ at: 0.25, expect: 'translate(125px) rotate(180deg)' }]
|
||||
[{ at: 0.25, expect: 'translate(125px) rotate(180deg)' }],
|
||||
'Mismatched lengths (from is shorter), common part matches'
|
||||
);
|
||||
|
||||
// Mismatched lengths (to is shorter), common part matches
|
||||
test_interpolation(
|
||||
{
|
||||
property: 'transform',
|
||||
from: 'translate(100px) rotate(720deg)',
|
||||
to: 'translate(200px)',
|
||||
},
|
||||
[{ at: 0.25, expect: 'translate(125px) rotate(540deg)' }]
|
||||
[{ at: 0.25, expect: 'translate(125px) rotate(540deg)' }],
|
||||
'Mismatched lengths (to is shorter), common part matches'
|
||||
);
|
||||
|
||||
// Perfect match
|
||||
test_interpolation(
|
||||
{
|
||||
property: 'transform',
|
||||
|
@ -73,47 +72,68 @@ test_interpolation(
|
|||
at: 0.25,
|
||||
expect: 'scale(2.25) rotate(540deg) translate(125px) matrix(1, 0, 0, 1, 75, 50) skew(180deg)',
|
||||
},
|
||||
]
|
||||
],
|
||||
'Perfect match'
|
||||
);
|
||||
|
||||
// Matches on primitives
|
||||
test_interpolation(
|
||||
{
|
||||
property: 'transform',
|
||||
from: 'translateX(100px) scaleX(3) translate(500px) scale(2)',
|
||||
to: 'translateY(200px) scale(5) translateX(100px) scaleY(3)',
|
||||
},
|
||||
[{ at: 0.25, expect: 'translate(75px, 50px) scale(3.5, 2) translate(400px, 0px) scale(1.75, 2.25)' }]
|
||||
[{ at: 0.25, expect: 'translate(75px, 50px) scale(3.5, 2) translate(400px, 0px) scale(1.75, 2.25)' }],
|
||||
'Matches on primitives'
|
||||
);
|
||||
|
||||
test_interpolation(
|
||||
{
|
||||
property: 'transform',
|
||||
from: 'rotateX(90deg) translateX(100px)',
|
||||
to: 'rotate3d(50, 0, 0, 180deg) translateY(200px)',
|
||||
},
|
||||
[{ at: 0.25, expect: 'rotateX(112.5deg) translate(75px, 50px)' }],
|
||||
'Match on rotation vector'
|
||||
);
|
||||
|
||||
test_interpolation(
|
||||
{
|
||||
property: 'transform',
|
||||
from: 'rotateX(90deg) translateX(100px)',
|
||||
to: 'rotateY(0deg) translateY(200px)',
|
||||
},
|
||||
[{ at: 0.25, expect: 'rotateX(67.5deg) translate(75px, 50px)' }],
|
||||
'Match on rotation due to 0deg angle'
|
||||
);
|
||||
|
||||
// Common prefix
|
||||
test_interpolation(
|
||||
{
|
||||
property: 'transform',
|
||||
from: 'rotate(0deg) translate(100px)',
|
||||
to: 'rotate(720deg) scale(2) translate(200px)',
|
||||
},
|
||||
[{ at: 0.25, expect: 'rotate(180deg) matrix(1.25, 0, 0, 1.25, 175, 0)' }]
|
||||
[{ at: 0.25, expect: 'rotate(180deg) matrix(1.25, 0, 0, 1.25, 175, 0)' }],
|
||||
'Common prefix'
|
||||
);
|
||||
|
||||
// Complete mismatch (except length)
|
||||
test_interpolation(
|
||||
{
|
||||
property: 'transform',
|
||||
from: 'scale(2) rotate(0deg) translate(100px)',
|
||||
to: 'rotate(720deg) scale(2) translate(200px)',
|
||||
},
|
||||
[{ at: 0.25, expect: 'matrix(2, 0, 0, 2, 250, 0)' }]
|
||||
[{ at: 0.25, expect: 'matrix(2, 0, 0, 2, 250, 0)' }],
|
||||
'Complete mismatch (except length)'
|
||||
);
|
||||
|
||||
// Complete mismatch including length
|
||||
test_interpolation(
|
||||
{
|
||||
property: 'transform',
|
||||
from: 'scale(2) rotate(0deg)',
|
||||
to: 'rotate(720deg) scale(2) translate(200px)',
|
||||
},
|
||||
[{ at: 0.25, expect: 'matrix(2, 0, 0, 2, 100, 0)' }]
|
||||
[{ at: 0.25, expect: 'matrix(2, 0, 0, 2, 100, 0)' }],
|
||||
'Complete mismatch including length'
|
||||
);
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
'use strict';
|
||||
function test_interpolation(settings, expectations) {
|
||||
function test_interpolation(settings, expectations, name) {
|
||||
var message_prefix = name ? name + ': ' : '';
|
||||
// Returns a timing function that at 0.5 evaluates to progress.
|
||||
function timingFunction(progress) {
|
||||
if (progress === 0)
|
||||
|
@ -13,7 +14,7 @@ function test_interpolation(settings, expectations) {
|
|||
test(function(){
|
||||
assert_true(CSS.supports(settings.property, settings.from), 'Value "' + settings.from + '" is supported by ' + settings.property);
|
||||
assert_true(CSS.supports(settings.property, settings.to), 'Value "' + settings.to + '" is supported by ' + settings.property);
|
||||
}, '"' + settings.from + '" and "' + settings.to + '" are valid ' + settings.property + ' values');
|
||||
}, message_prefix + '"' + settings.from + '" and "' + settings.to + '" are valid ' + settings.property + ' values');
|
||||
|
||||
for (var i = 0; i < expectations.length; ++i) {
|
||||
var progress = expectations[i].at;
|
||||
|
@ -49,6 +50,6 @@ function test_interpolation(settings, expectations) {
|
|||
reference.style = '';
|
||||
|
||||
assert_equals(getComputedStyle(target)[settings.property], getComputedStyle(reference)[settings.property]);
|
||||
}, 'Animation between "' + settings.from + '" and "' + settings.to + '" at progress ' + progress);
|
||||
}, message_prefix + 'Animation between "' + settings.from + '" and "' + settings.to + '" at progress ' + progress);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче