author | Gurzau Raul <rgurzau@mozilla.com> |
Wed, 13 Jun 2018 00:51:20 +0300 | |
changeset 422359 | 49efc43b14387db6c68d70bbf5e9b8195dd7f80f |
parent 422349 | 5ba3ea055cc3735cbd7358cb4bc00bd4dff5dcbe (current diff) |
parent 422358 | eeeb53577ef4ecd240b84ece656fa69ab4a2edc9 (diff) |
child 422383 | 4814ea693428a01640dc90ce1e56524c3393da86 |
child 422390 | 33407b8862a5a726639ba9760624fd47fd449d62 |
push id | 34130 |
push user | rgurzau@mozilla.com |
push date | Tue, 12 Jun 2018 21:51:50 +0000 |
treeherder | mozilla-central@49efc43b1438 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | merge |
milestone | 62.0a1 |
first release with | nightly linux32
49efc43b1438
/
62.0a1
/
20180612220131
/
files
nightly linux64
49efc43b1438
/
62.0a1
/
20180612220131
/
files
nightly mac
49efc43b1438
/
62.0a1
/
20180612220131
/
files
nightly win32
49efc43b1438
/
62.0a1
/
20180612220131
/
files
nightly win64
49efc43b1438
/
62.0a1
/
20180612220131
/
files
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
releases | nightly linux32
62.0a1
/
20180612220131
/
pushlog to previous
nightly linux64
62.0a1
/
20180612220131
/
pushlog to previous
nightly mac
62.0a1
/
20180612220131
/
pushlog to previous
nightly win32
62.0a1
/
20180612220131
/
pushlog to previous
nightly win64
62.0a1
/
20180612220131
/
pushlog to previous
|
--- a/browser/extensions/pdfjs/README.mozilla +++ b/browser/extensions/pdfjs/README.mozilla @@ -1,5 +1,5 @@ This is the PDF.js project output, https://github.com/mozilla/pdf.js -Current extension version is: 2.0.550 +Current extension version is: 2.0.575 -Taken from upstream commit: 76337fdc +Taken from upstream commit: 2030d171
--- a/browser/extensions/pdfjs/content/build/pdf.js +++ b/browser/extensions/pdfjs/content/build/pdf.js @@ -118,18 +118,18 @@ return /******/ (function(modules) { // /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; -var pdfjsVersion = '2.0.550'; -var pdfjsBuild = '76337fdc'; +var pdfjsVersion = '2.0.575'; +var pdfjsBuild = '2030d171'; var pdfjsSharedUtil = __w_pdfjs_require__(1); var pdfjsDisplayAPI = __w_pdfjs_require__(6); var pdfjsDisplayTextLayer = __w_pdfjs_require__(18); var pdfjsDisplayAnnotationLayer = __w_pdfjs_require__(19); var pdfjsDisplayDOMUtils = __w_pdfjs_require__(7); var pdfjsDisplaySVG = __w_pdfjs_require__(20); let pdfjsDisplayWorkerOptions = __w_pdfjs_require__(12); let pdfjsDisplayAPICompatibility = __w_pdfjs_require__(9); @@ -157,16 +157,17 @@ exports.createObjectURL = pdfjsSharedUti exports.removeNullCharacters = pdfjsSharedUtil.removeNullCharacters; exports.shadow = pdfjsSharedUtil.shadow; exports.createBlob = pdfjsSharedUtil.createBlob; exports.Util = pdfjsSharedUtil.Util; exports.RenderingCancelledException = pdfjsDisplayDOMUtils.RenderingCancelledException; exports.getFilenameFromUrl = pdfjsDisplayDOMUtils.getFilenameFromUrl; exports.LinkTarget = pdfjsDisplayDOMUtils.LinkTarget; exports.addLinkAttributes = pdfjsDisplayDOMUtils.addLinkAttributes; +exports.loadScript = pdfjsDisplayDOMUtils.loadScript; exports.GlobalWorkerOptions = pdfjsDisplayWorkerOptions.GlobalWorkerOptions; exports.apiCompatibilityParams = pdfjsDisplayAPICompatibility.apiCompatibilityParams; /***/ }), /* 1 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -819,48 +820,28 @@ var Util = function UtilClosure() { romanBuf.push(ROMAN_NUMBER_MAP[pos]); pos = number / 10 | 0; number %= 10; romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]); romanBuf.push(ROMAN_NUMBER_MAP[20 + number]); var romanStr = romanBuf.join(''); return lowerCase ? romanStr.toLowerCase() : romanStr; }; - Util.appendToArray = function Util_appendToArray(arr1, arr2) { - Array.prototype.push.apply(arr1, arr2); - }; - Util.prependToArray = function Util_prependToArray(arr1, arr2) { - Array.prototype.unshift.apply(arr1, arr2); - }; Util.extendObj = function extendObj(obj1, obj2) { for (var key in obj2) { obj1[key] = obj2[key]; } }; Util.inherit = function Util_inherit(sub, base, prototype) { sub.prototype = Object.create(base.prototype); sub.prototype.constructor = sub; for (var prop in prototype) { sub.prototype[prop] = prototype[prop]; } }; - Util.loadScript = function Util_loadScript(src, callback) { - var script = document.createElement('script'); - var loaded = false; - script.setAttribute('src', src); - if (callback) { - script.onload = function () { - if (!loaded) { - callback(); - } - loaded = true; - }; - } - document.getElementsByTagName('head')[0].appendChild(script); - }; return Util; }(); var PDFStringTranslateTable = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C, 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160, 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC]; function stringToPDFString(str) { var i, n = str.length, strBuf = []; if (str[0] === '\xFE' && str[1] === '\xFF') { @@ -4126,17 +4107,16 @@ function getDocument(src) { if (!src.url && !src.data && !src.range) { throw new Error('Invalid parameter object: need either .data, .range or .url'); } source = src; } let params = Object.create(null); var rangeTransport = null; let worker = null; - let CMapReaderFactory = _dom_utils.DOMCMapReaderFactory; for (var key in source) { if (key === 'url' && typeof window !== 'undefined') { params[key] = new URL(source[key], window.location).href; continue; } else if (key === 'range') { rangeTransport = source[key]; continue; } else if (key === 'worker') { @@ -4149,23 +4129,21 @@ function getDocument(src) { } else if (typeof pdfBytes === 'object' && pdfBytes !== null && !isNaN(pdfBytes.length)) { params[key] = new Uint8Array(pdfBytes); } else if ((0, _util.isArrayBuffer)(pdfBytes)) { params[key] = new Uint8Array(pdfBytes); } else { throw new Error('Invalid PDF binary data: either typed array, ' + 'string or array-like object is expected in the ' + 'data property.'); } continue; - } else if (key === 'CMapReaderFactory') { - CMapReaderFactory = source[key]; - continue; } params[key] = source[key]; } params.rangeChunkSize = params.rangeChunkSize || DEFAULT_RANGE_CHUNK_SIZE; + params.CMapReaderFactory = params.CMapReaderFactory || _dom_utils.DOMCMapReaderFactory; params.ignoreErrors = params.stopAtErrors !== true; params.pdfBug = params.pdfBug === true; const NativeImageDecoderValues = Object.values(_util.NativeImageDecoding); if (params.nativeImageDecoderSupport === undefined || !NativeImageDecoderValues.includes(params.nativeImageDecoderSupport)) { params.nativeImageDecoderSupport = _api_compatibility.apiCompatibilityParams.nativeImageDecoderSupport || _util.NativeImageDecoding.DECODE; } if (!Number.isInteger(params.maxImageSize)) { params.maxImageSize = -1; @@ -4228,34 +4206,34 @@ function getDocument(src) { withCredentials: params.withCredentials, rangeChunkSize: params.rangeChunkSize, disableRange: params.disableRange, disableStream: params.disableStream }); } var messageHandler = new _message_handler.MessageHandler(docId, workerId, worker.port); messageHandler.postMessageTransfers = worker.postMessageTransfers; - var transport = new WorkerTransport(messageHandler, task, networkStream, params, CMapReaderFactory); + var transport = new WorkerTransport(messageHandler, task, networkStream, params); task._transport = transport; messageHandler.send('Ready', null); }); }).catch(task._capability.reject); return task; } function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { if (worker.destroyed) { return Promise.reject(new Error('Worker was destroyed')); } if (pdfDataRangeTransport) { source.length = pdfDataRangeTransport.length; source.initialData = pdfDataRangeTransport.initialData; } return worker.messageHandler.sendWithPromise('GetDocRequest', { docId, - apiVersion: '2.0.550', + apiVersion: '2.0.575', source: { data: source.data, url: source.url, password: source.password, disableAutoFetch: source.disableAutoFetch, rangeChunkSize: source.rangeChunkSize, length: source.length }, @@ -4355,26 +4333,26 @@ var PDFDataRangeTransport = function pdf (0, _util.unreachable)('Abstract method PDFDataRangeTransport.requestDataRange'); }, abort: function PDFDataRangeTransport_abort() {} }; return PDFDataRangeTransport; }(); var PDFDocumentProxy = function PDFDocumentProxyClosure() { function PDFDocumentProxy(pdfInfo, transport, loadingTask) { - this.pdfInfo = pdfInfo; + this._pdfInfo = pdfInfo; this.transport = transport; this.loadingTask = loadingTask; } PDFDocumentProxy.prototype = { get numPages() { - return this.pdfInfo.numPages; + return this._pdfInfo.numPages; }, get fingerprint() { - return this.pdfInfo.fingerprint; + return this._pdfInfo.fingerprint; }, getPage(pageNumber) { return this.transport.getPage(pageNumber); }, getPageIndex: function PDFDocumentProxy_getPageIndex(ref) { return this.transport.getPageIndex(ref); }, getDestinations: function PDFDocumentProxy_getDestinations() { @@ -4420,42 +4398,42 @@ var PDFDocumentProxy = function PDFDocum return this.transport.loadingParams; } }; return PDFDocumentProxy; }(); var PDFPageProxy = function PDFPageProxyClosure() { function PDFPageProxy(pageIndex, pageInfo, transport, pdfBug = false) { this.pageIndex = pageIndex; - this.pageInfo = pageInfo; + this._pageInfo = pageInfo; this.transport = transport; this._stats = pdfBug ? new _dom_utils.StatTimer() : _dom_utils.DummyStatTimer; this._pdfBug = pdfBug; this.commonObjs = transport.commonObjs; this.objs = new PDFObjects(); this.cleanupAfterRender = false; this.pendingCleanup = false; this.intentStates = Object.create(null); this.destroyed = false; } PDFPageProxy.prototype = { get pageNumber() { return this.pageIndex + 1; }, get rotate() { - return this.pageInfo.rotate; + return this._pageInfo.rotate; }, get ref() { - return this.pageInfo.ref; + return this._pageInfo.ref; }, get userUnit() { - return this.pageInfo.userUnit; + return this._pageInfo.userUnit; }, get view() { - return this.pageInfo.view; + return this._pageInfo.view; }, getViewport(scale, rotate = this.rotate, dontFlip = false) { return new _dom_utils.PageViewport({ viewBox: this.view, scale, rotation: rotate, dontFlip }); @@ -4583,17 +4561,17 @@ var PDFPageProxy = function PDFPageProxy return new Promise(function (resolve, reject) { function pump() { reader.read().then(function ({ value, done }) { if (done) { resolve(textContent); return; } _util.Util.extendObj(textContent.styles, value.styles); - _util.Util.appendToArray(textContent.items, value.items); + textContent.items.push(...value.items); pump(); }, reject); } let reader = readableStream.getReader(); let textContent = { items: [], styles: Object.create(null) }; @@ -4761,36 +4739,36 @@ var PDFWorker = function PDFWorkerClosur } fakeWorkerFilesLoadedCapability = (0, _util.createPromiseCapability)(); let mainWorkerMessageHandler = getMainThreadWorkerMessageHandler(); if (mainWorkerMessageHandler) { fakeWorkerFilesLoadedCapability.resolve(mainWorkerMessageHandler); return fakeWorkerFilesLoadedCapability.promise; } let loader = fakeWorkerFilesLoader || function (callback) { - _util.Util.loadScript(getWorkerSrc(), function () { + (0, _dom_utils.loadScript)(getWorkerSrc()).then(function () { callback(window.pdfjsWorker.WorkerMessageHandler); }); }; loader(fakeWorkerFilesLoadedCapability.resolve); return fakeWorkerFilesLoadedCapability.promise; } function createCDNWrapper(url) { var wrapper = 'importScripts(\'' + url + '\');'; return URL.createObjectURL(new Blob([wrapper])); } let pdfWorkerPorts = new WeakMap(); - function PDFWorker({ name = null, port = null, postMessageTransfers = true, verbosity = null } = {}) { + function PDFWorker({ name = null, port = null, postMessageTransfers = true, verbosity = (0, _util.getVerbosityLevel)() } = {}) { if (port && pdfWorkerPorts.has(port)) { throw new Error('Cannot use more than one PDFWorker per port'); } this.name = name; this.destroyed = false; this.postMessageTransfers = postMessageTransfers !== false; - this.verbosity = (0, _util.isNum)(verbosity) ? verbosity : (0, _util.getVerbosityLevel)(); + this.verbosity = verbosity; this._readyCapability = (0, _util.createPromiseCapability)(); this._port = null; this._webWorker = null; this._messageHandler = null; if (port) { pdfWorkerPorts.set(port, this); this._initializeFromPort(port); return; @@ -4836,18 +4814,17 @@ var PDFWorker = function PDFWorkerClosur }; worker.addEventListener('error', onWorkerError); messageHandler.on('test', data => { worker.removeEventListener('error', onWorkerError); if (this.destroyed) { terminateEarly(); return; } - var supportTypedArray = data && data.supportTypedArray; - if (supportTypedArray) { + if (data && data.supportTypedArray) { this._messageHandler = messageHandler; this._port = worker; this._webWorker = worker; if (!data.supportTransfers) { this.postMessageTransfers = false; } this._readyCapability.resolve(); messageHandler.send('configure', { verbosity: this.verbosity }); @@ -4892,18 +4869,17 @@ var PDFWorker = function PDFWorkerClosur (0, _util.warn)('Setting up fake worker.'); isWorkerDisabled = true; } setupFakeWorkerGlobal().then(WorkerMessageHandler => { if (this.destroyed) { this._readyCapability.reject(new Error('Worker was destroyed')); return; } - var isTypedArraysPresent = Uint8Array !== Float32Array; - var port = new LoopbackPort(isTypedArraysPresent); + let port = new LoopbackPort(); this._port = port; var id = 'fake' + nextFakeWorkerId++; var workerHandler = new _message_handler.MessageHandler(id + '_worker', id, port); WorkerMessageHandler.setup(workerHandler, port); var messageHandler = new _message_handler.MessageHandler(id, id + '_worker', port); this._messageHandler = messageHandler; this._readyCapability.resolve(); }); @@ -4918,34 +4894,37 @@ var PDFWorker = function PDFWorkerClosur this._port = null; if (this._messageHandler) { this._messageHandler.destroy(); this._messageHandler = null; } } }; PDFWorker.fromPort = function (params) { + if (!params || !params.port) { + throw new Error('PDFWorker.fromPort - invalid method signature.'); + } if (pdfWorkerPorts.has(params.port)) { return pdfWorkerPorts.get(params.port); } return new PDFWorker(params); }; PDFWorker.getWorkerSrc = function () { return getWorkerSrc(); }; return PDFWorker; }(); var WorkerTransport = function WorkerTransportClosure() { - function WorkerTransport(messageHandler, loadingTask, networkStream, params, CMapReaderFactory) { + function WorkerTransport(messageHandler, loadingTask, networkStream, params) { this.messageHandler = messageHandler; this.loadingTask = loadingTask; this.commonObjs = new PDFObjects(); this.fontLoader = new _font_loader.FontLoader(loadingTask.docId); this._params = params; - this.CMapReaderFactory = new CMapReaderFactory({ + this.CMapReaderFactory = new params.CMapReaderFactory({ baseUrl: params.cMapUrl, isCompressed: params.cMapPacked }); this.destroyed = false; this.destroyCapability = null; this._passwordCapability = null; this._networkStream = networkStream; this._fullReader = null; @@ -5100,17 +5079,16 @@ var WorkerTransport = function WorkerTra this.loadingTask._capability.reject(new _util.UnexpectedResponseException(exception.message, exception.status)); }, this); messageHandler.on('UnknownError', function transportUnknownError(exception) { this.loadingTask._capability.reject(new _util.UnknownErrorException(exception.message, exception.details)); }, this); messageHandler.on('DataLoaded', function transportPage(data) { this.downloadInfoCapability.resolve(data); }, this); - messageHandler.on('PDFManagerReady', function transportPage(data) {}, this); messageHandler.on('StartRenderPage', function transportRender(data) { if (this.destroyed) { return; } var page = this.pageCache[data.pageIndex]; page._stats.timeEnd('Page Request'); page._startRenderPage(data.transparency, data.intent); }, this); @@ -5257,17 +5235,17 @@ var WorkerTransport = function WorkerTra } return new Promise(function (resolve, reject) { var img = new Image(); img.onload = function () { var width = img.width; var height = img.height; var size = width * height; var rgbaLength = size * 4; - var buf = new Uint8Array(size * components); + var buf = new Uint8ClampedArray(size * components); var tmpCanvas = document.createElement('canvas'); tmpCanvas.width = width; tmpCanvas.height = height; var tmpCtx = tmpCanvas.getContext('2d'); tmpCtx.drawImage(img, 0, 0); var data = tmpCtx.getImageData(0, 0, width, height).data; var i, j; if (components === 3) { @@ -5555,17 +5533,17 @@ var InternalRenderTask = function Intern } else { this._scheduleNext(); } }, _scheduleNext: function InternalRenderTask__scheduleNext() { if (this.useRequestAnimationFrame && typeof window !== 'undefined') { window.requestAnimationFrame(this._nextBound); } else { - Promise.resolve(undefined).then(this._nextBound); + Promise.resolve().then(this._nextBound).catch(this.callback); } }, _next: function InternalRenderTask__next() { if (this.cancelled) { return; } this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper); if (this.operatorListIdx === this.operatorList.argsArray.length) { @@ -5579,18 +5557,18 @@ var InternalRenderTask = function Intern } } } }; return InternalRenderTask; }(); var version, build; { - exports.version = version = '2.0.550'; - exports.build = build = '76337fdc'; + exports.version = version = '2.0.575'; + exports.build = build = '2030d171'; } exports.getDocument = getDocument; exports.LoopbackPort = LoopbackPort; exports.PDFDataRangeTransport = PDFDataRangeTransport; exports.PDFWorker = PDFWorker; exports.PDFDocumentProxy = PDFDocumentProxy; exports.PDFPageProxy = PDFPageProxy; exports.setPDFNetworkStreamFactory = setPDFNetworkStreamFactory; @@ -5602,17 +5580,17 @@ exports.build = build; /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.DummyStatTimer = exports.StatTimer = exports.DOMSVGFactory = exports.DOMCMapReaderFactory = exports.DOMCanvasFactory = exports.DEFAULT_LINK_REL = exports.LinkTarget = exports.getFilenameFromUrl = exports.addLinkAttributes = exports.RenderingCancelledException = exports.PageViewport = undefined; +exports.loadScript = exports.DummyStatTimer = exports.StatTimer = exports.DOMSVGFactory = exports.DOMCMapReaderFactory = exports.DOMCanvasFactory = exports.DEFAULT_LINK_REL = exports.LinkTarget = exports.getFilenameFromUrl = exports.addLinkAttributes = exports.RenderingCancelledException = exports.PageViewport = undefined; var _util = __w_pdfjs_require__(1); const DEFAULT_LINK_REL = 'noopener noreferrer nofollow'; const SVG_NS = 'http://www.w3.org/2000/svg'; class DOMCanvasFactory { create(width, height) { if (width <= 0 || height <= 0) { @@ -5873,27 +5851,39 @@ class DummyStatTimer { (0, _util.unreachable)('Cannot initialize DummyStatTimer.'); } static time(name) {} static timeEnd(name) {} static toString() { return ''; } } +function loadScript(src) { + return new Promise((resolve, reject) => { + let script = document.createElement('script'); + script.src = src; + script.onload = resolve; + script.onerror = function () { + reject(new Error(`Cannot load script at: ${script.src}`)); + }; + (document.head || document.documentElement).appendChild(script); + }); +} exports.PageViewport = PageViewport; exports.RenderingCancelledException = RenderingCancelledException; exports.addLinkAttributes = addLinkAttributes; exports.getFilenameFromUrl = getFilenameFromUrl; exports.LinkTarget = LinkTarget; exports.DEFAULT_LINK_REL = DEFAULT_LINK_REL; exports.DOMCanvasFactory = DOMCanvasFactory; exports.DOMCMapReaderFactory = DOMCMapReaderFactory; exports.DOMSVGFactory = DOMSVGFactory; exports.StatTimer = StatTimer; exports.DummyStatTimer = DummyStatTimer; +exports.loadScript = loadScript; /***/ }), /* 8 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict";
--- a/browser/extensions/pdfjs/content/build/pdf.worker.js +++ b/browser/extensions/pdfjs/content/build/pdf.worker.js @@ -118,18 +118,18 @@ return /******/ (function(modules) { // /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; -var pdfjsVersion = '2.0.550'; -var pdfjsBuild = '76337fdc'; +var pdfjsVersion = '2.0.575'; +var pdfjsBuild = '2030d171'; var pdfjsCoreWorker = __w_pdfjs_require__(1); exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler; /***/ }), /* 1 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -288,17 +288,17 @@ var WorkerMessageHandler = { setup(handler, port) { var testMessageProcessed = false; handler.on('test', function wphSetupTest(data) { if (testMessageProcessed) { return; } testMessageProcessed = true; if (!(data instanceof Uint8Array)) { - handler.send('test', 'main', false); + handler.send('test', false); return; } var supportTransfers = data[0] === 255; handler.postMessageTransfers = supportTransfers; var xhr = new XMLHttpRequest(); var responseExists = 'response' in xhr; try { xhr.responseType; @@ -322,17 +322,17 @@ var WorkerMessageHandler = { }); }, createDocumentHandler(docParams, port) { var pdfManager; var terminated = false; var cancelXHRs = null; var WorkerTasks = []; let apiVersion = docParams.apiVersion; - let workerVersion = '2.0.550'; + let workerVersion = '2.0.575'; if (apiVersion !== null && apiVersion !== workerVersion) { throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); } var docId = docParams.docId; var docBaseUrl = docParams.docBaseUrl; var workerHandlerName = docParams.docId + '_worker'; var handler = new _message_handler.MessageHandler(workerHandlerName, docId, port); handler.postMessageTransfers = docParams.postMessageTransfers; @@ -521,34 +521,29 @@ var WorkerMessageHandler = { isEvalSupported: data.isEvalSupported }; getPdfManager(data, evaluatorOptions).then(function (newPdfManager) { if (terminated) { newPdfManager.terminate(); throw new Error('Worker was terminated'); } pdfManager = newPdfManager; - handler.send('PDFManagerReady', null); pdfManager.onLoadedStream().then(function (stream) { handler.send('DataLoaded', { length: stream.bytes.byteLength }); }); }).then(pdfManagerReady, onFailure); } handler.on('GetPage', function wphSetupGetPage(data) { return pdfManager.getPage(data.pageIndex).then(function (page) { - var rotatePromise = pdfManager.ensure(page, 'rotate'); - var refPromise = pdfManager.ensure(page, 'ref'); - var userUnitPromise = pdfManager.ensure(page, 'userUnit'); - var viewPromise = pdfManager.ensure(page, 'view'); - return Promise.all([rotatePromise, refPromise, userUnitPromise, viewPromise]).then(function (results) { + return Promise.all([pdfManager.ensure(page, 'rotate'), pdfManager.ensure(page, 'ref'), pdfManager.ensure(page, 'userUnit'), pdfManager.ensure(page, 'view')]).then(function ([rotate, ref, userUnit, view]) { return { - rotate: results[0], - ref: results[1], - userUnit: results[2], - view: results[3] + rotate, + ref, + userUnit, + view }; }); }); }); handler.on('GetPageIndex', function wphSetupGetPageIndex(data) { var ref = new _primitives.Ref(data.ref.num, data.ref.gen); var catalog = pdfManager.pdfDocument.catalog; return catalog.getPageIndex(ref); @@ -1364,48 +1359,28 @@ var Util = function UtilClosure() { romanBuf.push(ROMAN_NUMBER_MAP[pos]); pos = number / 10 | 0; number %= 10; romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]); romanBuf.push(ROMAN_NUMBER_MAP[20 + number]); var romanStr = romanBuf.join(''); return lowerCase ? romanStr.toLowerCase() : romanStr; }; - Util.appendToArray = function Util_appendToArray(arr1, arr2) { - Array.prototype.push.apply(arr1, arr2); - }; - Util.prependToArray = function Util_prependToArray(arr1, arr2) { - Array.prototype.unshift.apply(arr1, arr2); - }; Util.extendObj = function extendObj(obj1, obj2) { for (var key in obj2) { obj1[key] = obj2[key]; } }; Util.inherit = function Util_inherit(sub, base, prototype) { sub.prototype = Object.create(base.prototype); sub.prototype.constructor = sub; for (var prop in prototype) { sub.prototype[prop] = prototype[prop]; } }; - Util.loadScript = function Util_loadScript(src, callback) { - var script = document.createElement('script'); - var loaded = false; - script.setAttribute('src', src); - if (callback) { - script.onload = function () { - if (!loaded) { - callback(); - } - loaded = true; - }; - } - document.getElementsByTagName('head')[0].appendChild(script); - }; return Util; }(); var PDFStringTranslateTable = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C, 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160, 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC]; function stringToPDFString(str) { var i, n = str.length, strBuf = []; if (str[0] === '\xFE' && str[1] === '\xFF') { @@ -8784,17 +8759,17 @@ var StreamsSequenceStream = function Str buffer.set(chunk, bufferLength); this.bufferLength = newLength; }; StreamsSequenceStream.prototype.getBaseStreams = function StreamsSequenceStream_getBaseStreams() { var baseStreams = []; for (var i = 0, ii = this.streams.length; i < ii; i++) { var stream = this.streams[i]; if (stream.getBaseStreams) { - _util.Util.appendToArray(baseStreams, stream.getBaseStreams()); + baseStreams.push(...stream.getBaseStreams()); } } return baseStreams; }; return StreamsSequenceStream; }(); var FlateStream = function FlateStreamClosure() { var codeLenCodeMap = new Int32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
--- a/browser/extensions/pdfjs/content/web/viewer.js +++ b/browser/extensions/pdfjs/content/web/viewer.js @@ -1332,45 +1332,26 @@ let PDFViewerApplication = { _boundEvents.windowHashChange = null; _boundEvents.windowBeforePrint = null; _boundEvents.windowAfterPrint = null; } }; let validateFileURL; ; function loadFakeWorker() { - return new Promise(function (resolve, reject) { - if (!_pdfjsLib.GlobalWorkerOptions.workerSrc) { - _pdfjsLib.GlobalWorkerOptions.workerSrc = _app_options.AppOptions.get('workerSrc'); - } - let script = document.createElement('script'); - script.src = _pdfjsLib.PDFWorker.getWorkerSrc(); - script.onload = function () { - resolve(); - }; - script.onerror = function () { - reject(new Error(`Cannot load fake worker at: ${script.src}`)); - }; - (document.head || document.documentElement).appendChild(script); - }); + if (!_pdfjsLib.GlobalWorkerOptions.workerSrc) { + _pdfjsLib.GlobalWorkerOptions.workerSrc = _app_options.AppOptions.get('workerSrc'); + } + return (0, _pdfjsLib.loadScript)(_pdfjsLib.PDFWorker.getWorkerSrc()); } function loadAndEnablePDFBug(enabledTabs) { - return new Promise(function (resolve, reject) { - let appConfig = PDFViewerApplication.appConfig; - let script = document.createElement('script'); - script.src = appConfig.debuggerScriptPath; - script.onload = function () { - PDFBug.enable(enabledTabs); - PDFBug.init({ OPS: _pdfjsLib.OPS }, appConfig.mainContainer); - resolve(); - }; - script.onerror = function () { - reject(new Error('Cannot load debugger at ' + script.src)); - }; - (document.getElementsByTagName('head')[0] || document.body).appendChild(script); + let appConfig = PDFViewerApplication.appConfig; + return (0, _pdfjsLib.loadScript)(appConfig.debuggerScriptPath).then(function () { + PDFBug.enable(enabledTabs); + PDFBug.init({ OPS: _pdfjsLib.OPS }, appConfig.mainContainer); }); } function webViewerInitialized() { let appConfig = PDFViewerApplication.appConfig; let file; file = window.location.href.split('#')[0]; appConfig.toolbar.openFile.setAttribute('hidden', 'true'); appConfig.secondaryToolbar.openFileButton.setAttribute('hidden', 'true');
--- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -2598,23 +2598,18 @@ WarnIfSandboxIneffective(nsIDocShell* aD nsContentUtils::eSECURITY_PROPERTIES, "BothAllowScriptsAndSameOriginPresent", nullptr, 0, iframeUri); } } bool nsIDocument::IsSynthesized() { - nsCOMPtr<nsIHttpChannelInternal> internalChan = do_QueryInterface(mChannel); - bool synthesized = false; - if (internalChan) { - DebugOnly<nsresult> rv = internalChan->GetResponseSynthesized(&synthesized); - MOZ_ASSERT(NS_SUCCEEDED(rv), "GetResponseSynthesized shouldn't fail."); - } - return synthesized; + nsCOMPtr<nsILoadInfo> loadInfo = mChannel ? mChannel->GetLoadInfo() : nullptr; + return loadInfo && loadInfo->GetServiceWorkerTaintingSynthesized(); } bool nsDocument::IsShadowDOMEnabled(JSContext* aCx, JSObject* aObject) { JS::Rooted<JSObject*> obj(aCx, aObject); JSAutoRealm ar(aCx, obj);
--- a/layout/generic/CSSAlignUtils.cpp +++ b/layout/generic/CSSAlignUtils.cpp @@ -10,18 +10,17 @@ #include "ReflowInput.h" namespace mozilla { static nscoord SpaceToFill(WritingMode aWM, const LogicalSize& aSize, nscoord aMargin, LogicalAxis aAxis, nscoord aCBSize) { - nscoord size = aAxis == eLogicalAxisBlock ? aSize.BSize(aWM) - : aSize.ISize(aWM); + nscoord size = aSize.Size(aAxis, aWM); return aCBSize - (size + aMargin); } nscoord CSSAlignUtils::AlignJustifySelf(uint8_t aAlignment, LogicalAxis aAxis, AlignJustifyFlags aFlags, nscoord aBaselineAdjust, nscoord aCBSize, const ReflowInput& aRI, @@ -124,35 +123,32 @@ CSSAlignUtils::AlignJustifySelf(uint8_t // achieve the requested alignment. nscoord offset = 0; switch (aAlignment) { case NS_STYLE_ALIGN_BASELINE: case NS_STYLE_ALIGN_LAST_BASELINE: if (MOZ_LIKELY(isSameSide == (aAlignment == NS_STYLE_ALIGN_BASELINE))) { offset = marginStart + aBaselineAdjust; } else { - nscoord size = aAxis == eLogicalAxisBlock ? aChildSize.BSize(wm) - : aChildSize.ISize(wm); + nscoord size = aChildSize.Size(aAxis, wm); offset = aCBSize - (size + marginEnd) - aBaselineAdjust; } break; case NS_STYLE_ALIGN_STRETCH: MOZ_FALLTHROUGH; // ComputeSize() deals with it case NS_STYLE_ALIGN_START: offset = marginStart; break; case NS_STYLE_ALIGN_END: { - nscoord size = aAxis == eLogicalAxisBlock ? aChildSize.BSize(wm) - : aChildSize.ISize(wm); + nscoord size = aChildSize.Size(aAxis, wm); offset = aCBSize - (size + marginEnd); break; } case NS_STYLE_ALIGN_CENTER: { - nscoord size = aAxis == eLogicalAxisBlock ? aChildSize.BSize(wm) - : aChildSize.ISize(wm); + nscoord size = aChildSize.Size(aAxis, wm); offset = (aCBSize - size + marginStart - marginEnd) / 2; break; } default: MOZ_ASSERT_UNREACHABLE("unknown align-/justify-self value"); } return offset;
--- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -467,31 +467,16 @@ HttpBaseChannel::GetLoadFlags(nsLoadFlag NS_ENSURE_ARG_POINTER(aLoadFlags); *aLoadFlags = mLoadFlags; return NS_OK; } NS_IMETHODIMP HttpBaseChannel::SetLoadFlags(nsLoadFlags aLoadFlags) { - bool synthesized = false; - nsresult rv = GetResponseSynthesized(&synthesized); - NS_ENSURE_SUCCESS(rv, rv); - - // If this channel is marked as awaiting a synthesized response, - // modifying certain load flags can interfere with the implementation - // of the network interception logic. This takes care of a couple - // known cases that attempt to mark channels as anonymous due - // to cross-origin redirects; since the response is entirely synthesized - // this is an unnecessary precaution. - // This should be removed when bug 1201683 is fixed. - if (synthesized && aLoadFlags != mLoadFlags) { - aLoadFlags &= ~LOAD_ANONYMOUS; - } - mLoadFlags = aLoadFlags; return NS_OK; } NS_IMETHODIMP HttpBaseChannel::SetDocshellUserAgentOverride() { // This sets the docshell specific user agent override, it will be overwritten
--- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -3633,24 +3633,16 @@ HttpChannelChild::ResetInterception() // Continue with the original cross-process request nsresult rv = ContinueAsyncOpen(); if (NS_WARN_IF(NS_FAILED(rv))) { Unused << Cancel(rv); } } -NS_IMETHODIMP -HttpChannelChild::GetResponseSynthesized(bool* aSynthesized) -{ - NS_ENSURE_ARG_POINTER(aSynthesized); - *aSynthesized = mSynthesizedResponse; - return NS_OK; -} - void HttpChannelChild::TrySendDeletingChannel() { if (!mDeletingChannelSent.compareExchange(false, true)) { // SendDeletingChannel is already sent. return; }
--- a/netwerk/protocol/http/HttpChannelChild.h +++ b/netwerk/protocol/http/HttpChannelChild.h @@ -177,18 +177,16 @@ protected: virtual void ActorDestroy(ActorDestroyReason aWhy) override; MOZ_MUST_USE bool GetAssociatedContentSecurity(nsIAssociatedContentSecurity** res = nullptr); virtual void DoNotifyListenerCleanup() override; virtual void DoAsyncAbort(nsresult aStatus) override; - NS_IMETHOD GetResponseSynthesized(bool* aSynthesized) override; - nsresult AsyncCall(void (HttpChannelChild::*funcPtr)(), nsRunnableMethod<HttpChannelChild> **retval = nullptr) override; // Get event target for processing network events. already_AddRefed<nsIEventTarget> GetNeckoTarget() override; virtual mozilla::ipc::IPCResult RecvLogBlockedCORSRequest(const nsString& aMessage) override;
--- a/netwerk/protocol/http/InterceptedHttpChannel.cpp +++ b/netwerk/protocol/http/InterceptedHttpChannel.cpp @@ -603,23 +603,16 @@ NS_IMETHODIMP InterceptedHttpChannel::SetupFallbackChannel(const char* aFallbackKey) { // AppCache should not be used with service worker intercepted channels. // This should never be called. return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -InterceptedHttpChannel::GetResponseSynthesized(bool* aResponseSynthesized) -{ - *aResponseSynthesized = mResponseHead || mBodyReader; - return NS_OK; -} - -NS_IMETHODIMP InterceptedHttpChannel::SetPriority(int32_t aPriority) { mPriority = clamped<int32_t>(aPriority, INT16_MIN, INT16_MAX); return NS_OK; } NS_IMETHODIMP InterceptedHttpChannel::SetClassFlags(uint32_t aClassFlags)
--- a/netwerk/protocol/http/InterceptedHttpChannel.h +++ b/netwerk/protocol/http/InterceptedHttpChannel.h @@ -169,19 +169,16 @@ public: NS_IMETHOD LogBlockedCORSRequest(const nsAString & aMessage) override; NS_IMETHOD SetupFallbackChannel(const char * aFallbackKey) override; NS_IMETHOD - GetResponseSynthesized(bool *aResponseSynthesized) override; - - NS_IMETHOD SetPriority(int32_t aPriority) override; NS_IMETHOD SetClassFlags(uint32_t aClassFlags) override; NS_IMETHOD ClearClassFlags(uint32_t flags) override;
--- a/netwerk/protocol/http/nsCORSListenerProxy.cpp +++ b/netwerk/protocol/http/nsCORSListenerProxy.cpp @@ -561,21 +561,18 @@ nsCORSListenerProxy::CheckRequestApprove // Test that things worked on a HTTP level nsCOMPtr<nsIHttpChannel> http = do_QueryInterface(aRequest); if (!http) { LogBlockedRequest(aRequest, "CORSRequestNotHttp", nullptr, topChannel); return NS_ERROR_DOM_BAD_URI; } - nsCOMPtr<nsIHttpChannelInternal> internal = do_QueryInterface(aRequest); - NS_ENSURE_STATE(internal); - bool responseSynthesized = false; - if (NS_SUCCEEDED(internal->GetResponseSynthesized(&responseSynthesized)) && - responseSynthesized) { + nsCOMPtr<nsILoadInfo> loadInfo = http->GetLoadInfo(); + if (loadInfo && loadInfo->GetServiceWorkerTaintingSynthesized()) { // For synthesized responses, we don't need to perform any checks. // Note: This would be unsafe if we ever changed our behavior to allow // service workers to intercept CORS preflights. return NS_OK; } // Check the Access-Control-Allow-Origin header RefPtr<CheckOriginHeader> visitor = new CheckOriginHeader(); @@ -1265,25 +1262,19 @@ nsCORSPreflightListener::AddResultToCach } NS_IMETHODIMP nsCORSPreflightListener::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) { #ifdef DEBUG { - nsCOMPtr<nsIHttpChannelInternal> internal = do_QueryInterface(aRequest); - bool responseSynthesized = false; - if (internal && - NS_SUCCEEDED(internal->GetResponseSynthesized(&responseSynthesized))) { - // For synthesized responses, we don't need to perform any checks. - // This would be unsafe if we ever changed our behavior to allow - // service workers to intercept CORS preflights. - MOZ_ASSERT(!responseSynthesized); - } + nsCOMPtr<nsIChannel> channel = do_QueryInterface(aRequest); + nsCOMPtr<nsILoadInfo> loadInfo = channel ? channel->GetLoadInfo() : nullptr; + MOZ_ASSERT(!loadInfo || !loadInfo->GetServiceWorkerTaintingSynthesized()); } #endif nsresult rv = CheckPreflightRequestApproved(aRequest); if (NS_SUCCEEDED(rv)) { // Everything worked, try to cache and then fire off the actual request. AddResultToCache(aRequest);
--- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -8464,24 +8464,16 @@ nsHttpChannel::SetNotificationCallbacks( nsresult rv = HttpBaseChannel::SetNotificationCallbacks(aCallbacks); if (NS_SUCCEEDED(rv)) { UpdateAggregateCallbacks(); } return rv; } -NS_IMETHODIMP -nsHttpChannel::GetResponseSynthesized(bool* aSynthesized) -{ - NS_ENSURE_ARG_POINTER(aSynthesized); - *aSynthesized = false; - return NS_OK; -} - bool nsHttpChannel::AwaitingCacheCallbacks() { return mCacheEntriesToWaitFor != 0; } void nsHttpChannel::SetPushedStream(Http2PushedStream *stream)
--- a/netwerk/protocol/http/nsHttpChannel.h +++ b/netwerk/protocol/http/nsHttpChannel.h @@ -252,17 +252,16 @@ public: /* internal necko use only */ mChannel->mCacheEntriesToWaitFor &= mKeep; } private: nsHttpChannel* mChannel; uint32_t mKeep : 2; }; - NS_IMETHOD GetResponseSynthesized(bool* aSynthesized) override; bool AwaitingCacheCallbacks(); void SetCouldBeSynthesized(); // Return true if the latest ODA is invoked by mCachePump. // Should only be called on the same thread as ODA. bool IsReadingFromCache() const { return mIsReadingFromCache; } base::ProcessId ProcessId();
--- a/netwerk/protocol/http/nsIHttpChannelInternal.idl +++ b/netwerk/protocol/http/nsIHttpChannelInternal.idl @@ -226,18 +226,16 @@ interface nsIHttpChannelInternal : nsISu * An opaque flags for non-standard behavior of the TLS system. * It is unlikely this will need to be set outside of telemetry studies * relating to the TLS implementation. */ [must_use] attribute unsigned long tlsFlags; [must_use] readonly attribute PRTime lastModifiedTime; - [must_use] readonly attribute boolean responseSynthesized; - /** * Set by nsCORSListenerProxy if credentials should be included in * cross-origin requests. false indicates "same-origin", users should still * check flag LOAD_ANONYMOUS! */ [must_use] attribute boolean corsIncludeCredentials; const unsigned long CORS_MODE_SAME_ORIGIN = 0;
--- a/servo/components/style/values/animated/color.rs +++ b/servo/components/style/values/animated/color.rs @@ -87,26 +87,16 @@ impl ComputeSquaredDistance for RGBA { start .iter() .zip(&end) .map(|(this, other)| this.compute_squared_distance(other)) .sum() } } -impl Animate for ComplexColorRatios { - #[inline] - fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> { - let bg = self.bg.animate(&other.bg, procedure)?; - let fg = self.fg.animate(&other.fg, procedure)?; - - Ok(ComplexColorRatios { bg, fg }) - } -} - /// An animated value for `<color>`. pub type Color = GenericColor<RGBA>; impl Color { fn effective_intermediate_rgba(&self) -> RGBA { match *self { GenericColor::Numeric(color) => color, GenericColor::Foreground => RGBA::transparent(),
--- a/servo/components/style/values/generics/color.rs +++ b/servo/components/style/values/generics/color.rs @@ -1,17 +1,17 @@ /* 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/. */ //! Generic types for color properties. /// Ratios representing the contribution of color and currentcolor to /// the final color value. -#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToAnimatedValue)] +#[derive(Animate, Clone, Copy, Debug, MallocSizeOf, PartialEq, ToAnimatedValue)] pub struct ComplexColorRatios { /// Numeric color contribution. pub bg: f32, /// Foreground color, aka currentcolor, contribution. pub fg: f32, } impl ComplexColorRatios {
--- a/xpcom/io/FilePreferences.cpp +++ b/xpcom/io/FilePreferences.cpp @@ -94,55 +94,57 @@ bool Normalizer::Get(nsAString& aNormali if (Check(mSeparator)) { aNormalizedFilePath.Append(mSeparator.AsChar()); } if (Check(mSeparator)) { aNormalizedFilePath.Append(mSeparator.AsChar()); } - if (!ConsumeName()) { - return false; + while (HasInput()) { + if (!ConsumeName()) { + return false; + } } for (auto const& name : mStack) { aNormalizedFilePath.Append(name); } return true; } bool Normalizer::ConsumeName() { - if (!HasInput() || CheckEOF()) { + if (CheckEOF()) { return true; } if (CheckCurrentDir()) { - return ConsumeName(); + return true; } if (CheckParentDir()) { if (!mStack.Length()) { // This means there are more \.. than valid names return false; } mStack.RemoveLastElement(); - return ConsumeName(); + return true; } nsDependentSubstring name; if (ReadUntil(mSeparator, name, INCLUDE_LAST) && name.Length() == 1) { // this means and empty name (a lone slash), which is illegal return false; } mStack.AppendElement(name); - return ConsumeName(); + return true; } bool Normalizer::CheckCurrentDir() { nsString::const_char_iterator cursor = mCursor; if (CheckChar('.') && CheckSeparator()) { return true; }
--- a/xpcom/threads/IdleTaskRunner.cpp +++ b/xpcom/threads/IdleTaskRunner.cpp @@ -37,16 +37,17 @@ IdleTaskRunner::IdleTaskRunner(const Cal const MayStopProcessingCallbackType& aMayStopProcessing, TaskCategory aTaskCategory) : IdleRunnable(aRunnableName) , mCallback(aCallback), mDelay(aDelay) , mBudget(TimeDuration::FromMilliseconds(aBudget)) , mRepeating(aRepeating), mTimerActive(false) , mMayStopProcessing(aMayStopProcessing) , mTaskCategory(aTaskCategory) + , mName(aRunnableName) { } NS_IMETHODIMP IdleTaskRunner::Run() { if (!mCallback) { return NS_OK; @@ -154,17 +155,17 @@ IdleTaskRunner::Schedule(bool aAllowIdle } if (TaskCategory::Count != mTaskCategory) { mScheduleTimer->SetTarget(SystemGroup::EventTargetFor(mTaskCategory)); } // We weren't allowed to do idle dispatch immediately, do it after a // short timeout. mScheduleTimer->InitWithNamedFuncCallback(ScheduleTimedOut, this, 16, nsITimer::TYPE_ONE_SHOT_LOW_PRIORITY, - "IdleTaskRunner"); + mName); } } } IdleTaskRunner::~IdleTaskRunner() { CancelTimer(); } @@ -196,14 +197,14 @@ IdleTaskRunner::SetTimerInternal(uint32_ } if (mTimer) { if (TaskCategory::Count != mTaskCategory) { mTimer->SetTarget(SystemGroup::EventTargetFor(mTaskCategory)); } mTimer->InitWithNamedFuncCallback(TimedOut, this, aDelay, nsITimer::TYPE_ONE_SHOT, - "IdleTaskRunner"); + mName); mTimerActive = true; } } } // end of namespace mozilla
--- a/xpcom/threads/IdleTaskRunner.h +++ b/xpcom/threads/IdleTaskRunner.h @@ -62,13 +62,14 @@ private: CallbackType mCallback; uint32_t mDelay; TimeStamp mDeadline; TimeDuration mBudget; bool mRepeating; bool mTimerActive; MayStopProcessingCallbackType mMayStopProcessing; TaskCategory mTaskCategory; + const char* mName; }; } // end of namespace mozilla. #endif