merge mozilla-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2016-07-25 15:50:41 +02:00
Родитель 42933ba381 1408fa9074
Коммит b9a6c687fa
463 изменённых файлов: 6962 добавлений и 4314 удалений

Просмотреть файл

@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please # changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more. # don't change CLOBBER for WebIDL changes any more.
Bug 1287946 - clobber due to generated SDK headers changing (bug 1182840) Bug 1285541 - Clobber needed because this patch renames a file.

Просмотреть файл

@ -39,29 +39,33 @@ function tabEventsFor(window) {
return merge(channels); return merge(channels);
} }
// Filter DOMContentLoaded events from all the browser events. // Create our event channels. We do this in a separate function to
var readyEvents = filter(events, e => e.type === "DOMContentLoaded"); // minimize the chance of leaking intermediate objects on the global.
// Map DOMContentLoaded events to it's target browser windows. function makeEvents() {
var futureWindows = map(readyEvents, e => e.target); // Filter DOMContentLoaded events from all the browser events.
// Expand all browsers that will become interactive to supported tab events var readyEvents = filter(events, e => e.type === "DOMContentLoaded");
// on these windows. Result will be a tab events from all tabs of all windows // Map DOMContentLoaded events to it's target browser windows.
// that will become interactive. var futureWindows = map(readyEvents, e => e.target);
var eventsFromFuture = expand(futureWindows, tabEventsFor); // Expand all browsers that will become interactive to supported tab events
// on these windows. Result will be a tab events from all tabs of all windows
// that will become interactive.
var eventsFromFuture = expand(futureWindows, tabEventsFor);
// Above covers only windows that will become interactive in a future, but some // Above covers only windows that will become interactive in a future, but some
// windows may already be interactive so we pick those and expand to supported // windows may already be interactive so we pick those and expand to supported
// tab events for them too. // tab events for them too.
var interactiveWindows = windows("navigator:browser", { includePrivate: true }). var interactiveWindows = windows("navigator:browser", { includePrivate: true }).
filter(isInteractive); filter(isInteractive);
var eventsFromInteractive = merge(interactiveWindows.map(tabEventsFor)); var eventsFromInteractive = merge(interactiveWindows.map(tabEventsFor));
// Finally merge stream of tab events from future windows and current windows // Finally merge stream of tab events from future windows and current windows
// to cover all tab events on all windows that will open. // to cover all tab events on all windows that will open.
var allEvents = merge([eventsFromInteractive, eventsFromFuture]); return merge([eventsFromInteractive, eventsFromFuture]);
}
// Map events to Fennec format if necessary // Map events to Fennec format if necessary
exports.events = map(allEvents, function (event) { exports.events = map(makeEvents(), function (event) {
return !isFennec ? event : { return !isFennec ? event : {
type: event.type, type: event.type,
target: event.target.ownerDocument.defaultView.BrowserApp target: event.target.ownerDocument.defaultView.BrowserApp

Просмотреть файл

@ -43,22 +43,26 @@ function eventsFor(window) {
return map(changes, toEventWithDefaultViewTarget); return map(changes, toEventWithDefaultViewTarget);
} }
// In addition to observing windows that are open we also observe windows // Create our event channels. We do this in a separate function to
// that are already already opened in case they're in process of loading. // minimize the chance of leaking intermediate objects on the global.
var opened = windows(null, { includePrivate: true }); function makeEvents() {
var currentEvents = merge(opened.map(eventsFor)); // In addition to observing windows that are open we also observe windows
// that are already already opened in case they're in process of loading.
var opened = windows(null, { includePrivate: true });
var currentEvents = merge(opened.map(eventsFor));
// Register system event listeners for top level window open / close. // Register system event listeners for top level window open / close.
function rename({type, target, data}) { function rename({type, target, data}) {
return { type: rename[type], target: target, data: data } return { type: rename[type], target: target, data: data }
}
rename.domwindowopened = "open";
rename.domwindowclosed = "close";
var openEvents = map(observe("domwindowopened"), rename);
var closeEvents = map(observe("domwindowclosed"), rename);
var futureEvents = expand(openEvents, ({target}) => eventsFor(target));
return merge([currentEvents, futureEvents, openEvents, closeEvents]);
} }
rename.domwindowopened = "open";
rename.domwindowclosed = "close";
var openEvents = map(observe("domwindowopened"), rename); exports.events = makeEvents();
var closeEvents = map(observe("domwindowclosed"), rename);
var futureEvents = expand(openEvents, ({target}) => eventsFor(target));
var channel = merge([currentEvents, futureEvents,
openEvents, closeEvents]);
exports.events = channel;

Просмотреть файл

@ -4,4 +4,5 @@ support-files =
[test-leak-window-events.js] [test-leak-window-events.js]
[test-leak-event-dom-closed-window.js] [test-leak-event-dom-closed-window.js]
[test-leak-tab-events.js]
[test-leak-event-chrome.js] [test-leak-event-chrome.js]

Просмотреть файл

@ -0,0 +1,46 @@
/* 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/. */
'use strict';
const { asyncWindowLeakTest } = require("./leak-utils");
const { Loader } = require('sdk/test/loader');
const openWindow = require("sdk/window/utils").open;
exports["test sdk/tab/events does not leak new window"] = function*(assert) {
yield asyncWindowLeakTest(assert, _ => {
return new Promise(resolve => {
let loader = Loader(module);
let { events } = loader.require('sdk/tab/events');
let w = openWindow();
w.addEventListener("load", function windowLoaded(evt) {
w.removeEventListener("load", windowLoaded);
w.addEventListener("DOMWindowClose", function windowClosed(evt) {
w.removeEventListener("DOMWindowClose", windowClosed);
resolve(loader);
});
w.close();
});
});
});
}
exports["test sdk/tab/events does not leak when attached to existing window"] = function*(assert) {
yield asyncWindowLeakTest(assert, _ => {
return new Promise(resolve => {
let loader = Loader(module);
let w = openWindow();
w.addEventListener("load", function windowLoaded(evt) {
w.removeEventListener("load", windowLoaded);
let { events } = loader.require('sdk/tab/events');
w.addEventListener("DOMWindowClose", function windowClosed(evt) {
w.removeEventListener("DOMWindowClose", windowClosed);
resolve(loader);
});
w.close();
});
});
});
}
require("sdk/test").run(exports);

Просмотреть файл

@ -44,4 +44,22 @@ exports["test window/events for leaks"] = function*(assert) {
}); });
}; };
exports["test window/events for leaks with existing window"] = function*(assert) {
yield asyncWindowLeakTest(assert, _ => {
return new Promise((resolve, reject) => {
let loader = Loader(module);
let w = open();
w.addEventListener("load", function windowLoaded(evt) {
w.removeEventListener("load", windowLoaded);
let { events } = loader.require("sdk/window/events");
w.addEventListener("DOMWindowClose", function windowClosed(evt) {
w.removeEventListener("DOMWindowClose", windowClosed);
resolve(loader);
});
w.close();
});
});
});
};
require("sdk/test").run(exports); require("sdk/test").run(exports);

Просмотреть файл

@ -80,6 +80,9 @@ if CONFIG['MOZ_LINKER']:
if CONFIG['HAVE_CLOCK_MONOTONIC']: if CONFIG['HAVE_CLOCK_MONOTONIC']:
OS_LIBS += CONFIG['REALTIME_LIBS'] OS_LIBS += CONFIG['REALTIME_LIBS']
if CONFIG['MOZ_GPSD']:
DEFINES['MOZ_GPSD'] = True
for icon in ('firefox', 'document', 'newwindow', 'newtab', 'pbmode'): for icon in ('firefox', 'document', 'newwindow', 'newtab', 'pbmode'):
DEFINES[icon.upper() + '_ICO'] = '"%s/dist/branding/%s.ico"' % ( DEFINES[icon.upper() + '_ICO'] = '"%s/dist/branding/%s.ico"' % (
TOPOBJDIR, icon) TOPOBJDIR, icon)

Просмотреть файл

@ -1240,6 +1240,16 @@ pref("geo.provider.use_corelocation", true);
pref("geo.provider.ms-windows-location", false); pref("geo.provider.ms-windows-location", false);
#endif #endif
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_GPSD
#ifdef RELEASE_BUILD
pref("geo.provider.use_gpsd", false);
#else
pref("geo.provider.use_gpsd", true);
#endif
#endif
#endif
// Necko IPC security checks only needed for app isolation for cookies/cache/etc: // Necko IPC security checks only needed for app isolation for cookies/cache/etc:
// currently irrelevant for desktop e10s // currently irrelevant for desktop e10s
pref("network.disable.ipc.security", true); pref("network.disable.ipc.security", true);

Просмотреть файл

@ -8,6 +8,7 @@ var Cu = Components.utils;
var Cc = Components.classes; var Cc = Components.classes;
Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/ContextualIdentityService.jsm");
Cu.import("resource://gre/modules/NotificationDB.jsm"); Cu.import("resource://gre/modules/NotificationDB.jsm");
Cu.import("resource:///modules/RecentWindow.jsm"); Cu.import("resource:///modules/RecentWindow.jsm");
@ -56,8 +57,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "WindowsUIUtils",
"@mozilla.org/windows-ui-utils;1", "nsIWindowsUIUtils"); "@mozilla.org/windows-ui-utils;1", "nsIWindowsUIUtils");
XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager", XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
"resource://gre/modules/LightweightThemeManager.jsm"); "resource://gre/modules/LightweightThemeManager.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
"resource://gre/modules/ContextualIdentityService.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "gAboutNewTabService", XPCOMUtils.defineLazyServiceGetter(this, "gAboutNewTabService",
"@mozilla.org/browser/aboutnewtab-service;1", "@mozilla.org/browser/aboutnewtab-service;1",
"nsIAboutNewTabService"); "nsIAboutNewTabService");

Просмотреть файл

@ -4,6 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm");
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
Components.utils.import("resource://gre/modules/InlineSpellChecker.jsm"); Components.utils.import("resource://gre/modules/InlineSpellChecker.jsm");
Components.utils.import("resource://gre/modules/LoginManagerContextMenu.jsm"); Components.utils.import("resource://gre/modules/LoginManagerContextMenu.jsm");
@ -11,8 +12,6 @@ Components.utils.import("resource://gre/modules/BrowserUtils.jsm");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
"resource://gre/modules/ContextualIdentityService.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper", XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
"resource://gre/modules/LoginHelper.jsm"); "resource://gre/modules/LoginHelper.jsm");

Просмотреть файл

@ -5,6 +5,7 @@
// Services = object with smart getters for common XPCOM services // Services = object with smart getters for common XPCOM services
Components.utils.import("resource://gre/modules/AppConstants.jsm"); Components.utils.import("resource://gre/modules/AppConstants.jsm");
Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm");
Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
@ -13,9 +14,6 @@ Components.utils.import("resource:///modules/RecentWindow.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ShellService", XPCOMUtils.defineLazyModuleGetter(this, "ShellService",
"resource:///modules/ShellService.jsm"); "resource:///modules/ShellService.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
"resource://gre/modules/ContextualIdentityService.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService", XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
"@mozilla.org/browser/aboutnewtab-service;1", "@mozilla.org/browser/aboutnewtab-service;1",
"nsIAboutNewTabService"); "nsIAboutNewTabService");
@ -447,8 +445,12 @@ function createUserContextMenu(event, addCommandAttribute = true, excludeUserCon
let menuitem = document.createElement("menuitem"); let menuitem = document.createElement("menuitem");
menuitem.setAttribute("usercontextid", identity.userContextId); menuitem.setAttribute("usercontextid", identity.userContextId);
menuitem.setAttribute("label", bundle.getString(identity.label)); menuitem.setAttribute("label", ContextualIdentityService.getUserContextLabel(identity.userContextId));
menuitem.setAttribute("accesskey", bundle.getString(identity.accessKey));
if (identity.accessKey) {
menuitem.setAttribute("accesskey", bundle.getString(identity.accessKey));
}
menuitem.classList.add("menuitem-iconic"); menuitem.classList.add("menuitem-iconic");
if (addCommandAttribute) { if (addCommandAttribute) {

Просмотреть файл

@ -1148,7 +1148,7 @@ const CustomizableWidgets = [
ContextualIdentityService.getIdentities().forEach(identity => { ContextualIdentityService.getIdentities().forEach(identity => {
let bundle = doc.getElementById("bundle_browser"); let bundle = doc.getElementById("bundle_browser");
let label = bundle.getString(identity.label); let label = ContextualIdentityService.getUserContextLabel(identity.userContextId);
let item = doc.createElementNS(kNSXUL, "toolbarbutton"); let item = doc.createElementNS(kNSXUL, "toolbarbutton");
item.setAttribute("label", label); item.setAttribute("label", label);

Просмотреть файл

@ -24,6 +24,14 @@
"unpack": true "unpack": true
}, },
{ {
"version": "cargo 0.13.0-nightly (664125b 2016-07-19)",
"size": 3123796,
"digest": "4b9d2bcb8488b6649ba6c748e19d33bfceb25c7566e882fc7e00322392e424a5a9c5878c11c61d57cdaecf67bcc110842c6eff95e49736e8f3c83d9ce1677122",
"algorithm": "sha512",
"filename": "cargo.tar.xz",
"unpack": true
},
{
"size": 167175, "size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512", "algorithm": "sha512",

Просмотреть файл

@ -24,6 +24,14 @@
"unpack": true "unpack": true
}, },
{ {
"version": "cargo 0.13.0-nightly (664125b 2016-07-19)",
"size": 3123796,
"digest": "4b9d2bcb8488b6649ba6c748e19d33bfceb25c7566e882fc7e00322392e424a5a9c5878c11c61d57cdaecf67bcc110842c6eff95e49736e8f3c83d9ce1677122",
"algorithm": "sha512",
"filename": "cargo.tar.xz",
"unpack": true
},
{
"size": 167175, "size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512", "algorithm": "sha512",

Просмотреть файл

@ -24,6 +24,14 @@
"filename": "MacOSX10.7.sdk.tar.bz2" "filename": "MacOSX10.7.sdk.tar.bz2"
}, },
{ {
"version": "cargo 0.13.0-nightly (664125b 2016-07-19)",
"size": 2571167,
"digest": "b2616459fbf15c75b54628a6bfe8cf89c0841ea08431f5096e72be4fac4c685785dfc7a2f18a03a5f7bd377e78d3c108e5029b12616842cbbd0497ff7363fdaf",
"algorithm": "sha512",
"filename": "cargo.tar.bz2",
"unpack": true
},
{
"size": 167175, "size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512", "algorithm": "sha512",

Просмотреть файл

@ -15,6 +15,14 @@
"unpack": true "unpack": true
}, },
{ {
"version": "cargo 0.13.0-nightly (664125b 2016-07-19)",
"size": 2571167,
"digest": "b2616459fbf15c75b54628a6bfe8cf89c0841ea08431f5096e72be4fac4c685785dfc7a2f18a03a5f7bd377e78d3c108e5029b12616842cbbd0497ff7363fdaf",
"algorithm": "sha512",
"filename": "cargo.tar.bz2",
"unpack": true
},
{
"size": 167175, "size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512", "algorithm": "sha512",

Просмотреть файл

@ -14,6 +14,14 @@
"unpack": true "unpack": true
}, },
{ {
"version": "cargo 0.13.0-nightly (664125b 2016-07-19)",
"size": 2298848,
"digest": "d3d1f7b6d195248550f98eb8ce87aa314d36a8a667c110ff2058777fe5a97b7007a41dc1c8a4605c4230e9105972768918222352d5e0fdebbc49639671de38ca",
"algorithm": "sha512",
"filename": "cargo.tar.bz2",
"unpack": true
},
{
"size": 167175, "size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512", "algorithm": "sha512",

Просмотреть файл

@ -15,6 +15,14 @@
"unpack": true "unpack": true
}, },
{ {
"version": "cargo 0.13.0-nightly (664125b 2016-07-19)",
"size": 2561498,
"digest": "d300fd06b16efe49bdb1a238d516c8797d2de0edca7efadd55249401e1dd1d775fb84649630e273f95d9e8b956d87d1f75726c0a68294d25fafe078c3b2b9ba9",
"algorithm": "sha512",
"filename": "cargo.tar.bz2",
"unpack": true
},
{
"size": 167175, "size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512", "algorithm": "sha512",

Просмотреть файл

@ -46,6 +46,7 @@ PluginContent.prototype = {
global.addEventListener("pagehide", this, true); global.addEventListener("pagehide", this, true);
global.addEventListener("pageshow", this, true); global.addEventListener("pageshow", this, true);
global.addEventListener("unload", this); global.addEventListener("unload", this);
global.addEventListener("HiddenPlugin", this, true);
global.addMessageListener("BrowserPlugins:ActivatePlugins", this); global.addMessageListener("BrowserPlugins:ActivatePlugins", this);
global.addMessageListener("BrowserPlugins:NotificationShown", this); global.addMessageListener("BrowserPlugins:NotificationShown", this);
@ -66,6 +67,7 @@ PluginContent.prototype = {
global.removeEventListener("pagehide", this, true); global.removeEventListener("pagehide", this, true);
global.removeEventListener("pageshow", this, true); global.removeEventListener("pageshow", this, true);
global.removeEventListener("unload", this); global.removeEventListener("unload", this);
global.removeEventListener("HiddenPlugin", this, true);
global.removeMessageListener("BrowserPlugins:ActivatePlugins", this); global.removeMessageListener("BrowserPlugins:ActivatePlugins", this);
global.removeMessageListener("BrowserPlugins:NotificationShown", this); global.removeMessageListener("BrowserPlugins:NotificationShown", this);
@ -194,6 +196,45 @@ PluginContent.prototype = {
}; };
}, },
_getPluginInfoForTag: function (pluginTag, tagMimetype) {
let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
let pluginName = gNavigatorBundle.GetStringFromName("pluginInfo.unknownPlugin");
let permissionString = null;
let blocklistState = null;
if (pluginTag) {
pluginName = BrowserUtils.makeNicePluginName(pluginTag.name);
permissionString = pluginHost.getPermissionStringForTag(pluginTag);
blocklistState = pluginTag.blocklistState;
// Convert this from nsIPluginTag so it can be serialized.
let properties = ["name", "description", "filename", "version", "enabledState", "niceName"];
let pluginTagCopy = {};
for (let prop of properties) {
pluginTagCopy[prop] = pluginTag[prop];
}
pluginTag = pluginTagCopy;
// Make state-softblocked == state-notblocked for our purposes,
// they have the same UI. STATE_OUTDATED should not exist for plugin
// items, but let's alias it anyway, just in case.
if (blocklistState == Ci.nsIBlocklistService.STATE_SOFTBLOCKED ||
blocklistState == Ci.nsIBlocklistService.STATE_OUTDATED) {
blocklistState = Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
}
}
return { mimetype: tagMimetype,
pluginName: pluginName,
pluginTag: pluginTag,
permissionString: permissionString,
fallbackType: null,
blocklistState: blocklistState,
};
},
/** /**
* Update the visibility of the plugin overlay. * Update the visibility of the plugin overlay.
*/ */
@ -353,6 +394,14 @@ PluginContent.prototype = {
return; return;
} }
if (eventType == "HiddenPlugin") {
let pluginTag = event.tag.QueryInterface(Ci.nsIPluginTag);
if (event.target.defaultView.top.document != this.content.document) {
return;
}
this._showClickToPlayNotification(pluginTag, true);
}
let plugin = event.target; let plugin = event.target;
let doc = plugin.ownerDocument; let doc = plugin.ownerDocument;
@ -713,7 +762,13 @@ PluginContent.prototype = {
let location = this.content.document.location.href; let location = this.content.document.location.href;
for (let p of plugins) { for (let p of plugins) {
let pluginInfo = this._getPluginInfo(p); let pluginInfo;
if (p instanceof Ci.nsIPluginTag) {
let mimeType = p.getMimeTypes() > 0 ? p.getMimeTypes()[0] : null;
pluginInfo = this._getPluginInfoForTag(p, mimeType);
} else {
pluginInfo = this._getPluginInfo(p);
}
if (pluginInfo.permissionString === null) { if (pluginInfo.permissionString === null) {
Cu.reportError("No permission string for active plugin."); Cu.reportError("No permission string for active plugin.");
continue; continue;

Просмотреть файл

@ -4,6 +4,7 @@
# Assume this is compiled with --enable-rpath so we don't # Assume this is compiled with --enable-rpath so we don't
# have to set LD_LIBRARY_PATH. # have to set LD_LIBRARY_PATH.
RUSTC="$topsrcdir/rustc/bin/rustc" RUSTC="$topsrcdir/rustc/bin/rustc"
CARGO="$topsrcdir/cargo/bin/cargo"
# Enable rust in the build. # Enable rust in the build.
ac_add_options --enable-rust ac_add_options --enable-rust

Просмотреть файл

@ -498,6 +498,7 @@ glib-object.h
gmodule.h gmodule.h
gnome.h gnome.h
gnu/libc-version.h gnu/libc-version.h
gps.h
grp.h grp.h
gssapi_generic.h gssapi_generic.h
gssapi/gssapi_generic.h gssapi/gssapi_generic.h

Просмотреть файл

@ -7,6 +7,14 @@
overflow: hidden; overflow: hidden;
} }
/**
* Collapsed details pane needs to be truly hidden to prevent both accessibility
* tools and keyboard from accessing its contents.
*/
#details-pane.pane-collapsed {
visibility: hidden;
}
#details-pane-toggle[disabled] { #details-pane-toggle[disabled] {
display: none; display: none;
} }
@ -36,7 +44,6 @@
@media (max-width: 700px) { @media (max-width: 700px) {
#toolbar-spacer, #toolbar-spacer,
#details-pane-toggle, #details-pane-toggle,
#details-pane.pane-collapsed,
.requests-menu-waterfall, .requests-menu-waterfall,
#requests-menu-network-summary-button > .toolbarbutton-text { #requests-menu-network-summary-button > .toolbarbutton-text {
display: none; display: none;

Просмотреть файл

@ -55,30 +55,24 @@ define(function (require, exports, module) {
return ( return (
type == "boolean" || type == "boolean" ||
type == "number" || type == "number" ||
type == "string" || (type == "string" && value.length != 0)
type == "object"
); );
}; };
// Object members with non-empty values are preferred since it gives the let ownProperties = object.preview ? object.preview.ownProperties : [];
// user a better overview of the object. let indexes = this.getPropIndexes(ownProperties, max, isInterestingProp);
let props = this.getProps(object, max, isInterestingProp); if (indexes.length < max && indexes.length < object.ownPropertyLength) {
// There are not enough props yet. Then add uninteresting props to display them.
if (props.length <= max) { indexes = indexes.concat(
// There are not enough props yet (or at least, not enough props to this.getPropIndexes(ownProperties, max - indexes.length, (t, value) => {
// be able to know whether we should print "more…" or not). return !isInterestingProp(t, value);
// Let's display also empty members and functions. })
props = props.concat(this.getProps(object, max, (t, value) => { );
return !isInterestingProp(t, value);
}));
} }
// getProps() can return max+1 properties (it can't return more) let props = this.getProps(ownProperties, indexes);
// to indicate that there is more props than allowed. Remove the last if (props.length < object.ownPropertyLength) {
// one and append 'more…' postfix in such case. // There are some undisplayed props. Then display "more...".
if (props.length > max) {
props.pop();
let objectLink = this.props.objectLink || span; let objectLink = this.props.objectLink || span;
props.push(Caption({ props.push(Caption({
@ -100,46 +94,73 @@ define(function (require, exports, module) {
return props; return props;
}, },
getProps: function (object, max, filter) { /**
* Get props ordered by index.
*
* @param {Object} ownProperties Props object.
* @param {Array} indexes Indexes of props.
* @return {Array} Props.
*/
getProps: function (ownProperties, indexes) {
let props = []; let props = [];
max = max || 3; // Make indexes ordered by ascending.
if (!object) { indexes.sort(function (a, b) {
return props; return a - b;
} });
indexes.forEach((i) => {
let name = Object.keys(ownProperties)[i];
let value = ownProperties[name].value;
props.push(PropRep(Object.assign({}, this.props, {
key: name,
mode: "tiny",
name: name,
object: value,
equal: ": ",
delim: ", ",
})));
});
return props;
},
/**
* Get the indexes of props in the object.
*
* @param {Object} ownProperties Props object.
* @param {Number} max The maximum length of indexes array.
* @param {Function} filter Filter the props you want.
* @return {Array} Indexes of interesting props in the object.
*/
getPropIndexes: function (ownProperties, max, filter) {
let indexes = [];
try { try {
let ownProperties = object.preview ? object.preview.ownProperties : []; let i = 0;
for (let name in ownProperties) { for (let name in ownProperties) {
if (props.length > max) { if (indexes.length >= max) {
return props; return indexes;
} }
let prop = ownProperties[name]; let prop = ownProperties[name];
let value = prop.value || {}; let value = prop.value;
// Type is specified in grip's "class" field and for primitive // Type is specified in grip's "class" field and for primitive
// values use typeof. // values use typeof.
let type = (value.class || typeof value); let type = (value.class || typeof value);
type = type.toLowerCase(); type = type.toLowerCase();
// Show only interesting properties.
if (filter(type, value)) { if (filter(type, value)) {
props.push(PropRep(Object.assign({}, this.props, { indexes.push(i);
key: name,
mode: "tiny",
name: name,
object: value,
equal: ": ",
delim: ", ",
})));
} }
i++;
} }
} catch (err) { } catch (err) {
console.error(err); console.error(err);
} }
return props; return indexes;
}, },
render: function () { render: function () {

Просмотреть файл

@ -380,4 +380,23 @@
.toolbox-panel[selected] { .toolbox-panel[selected] {
visibility: visible; visibility: visible;
} }
/**
* When panels are collapsed or hidden, making sure that they are also
* inaccessible by keyboard. This is not the case by default because the are
* predominantly hidden using visibility: collapse; style or collapsed
* attribute.
*/
.toolbox-panel *,
#toolbox-panel-webconsole[collapsed] * {
-moz-user-focus: ignore;
}
/**
* Enrure that selected toolbox panel's contents are keyboard accessible as they
* are explicitly made not to be when hidden (default).
*/
.toolbox-panel[selected] * {
-moz-user-focus: normal;
}

Просмотреть файл

@ -121,7 +121,7 @@ Concrete<DeserializedNode>::allocationStack() const
js::UniquePtr<EdgeRange> js::UniquePtr<EdgeRange>
Concrete<DeserializedNode>::edges(JSRuntime* rt, bool) const Concrete<DeserializedNode>::edges(JSContext* cx, bool) const
{ {
js::UniquePtr<DeserializedEdgeRange> range(js_new<DeserializedEdgeRange>(get())); js::UniquePtr<DeserializedEdgeRange> range(js_new<DeserializedEdgeRange>(get()));

Просмотреть файл

@ -270,7 +270,7 @@ public:
// We ignore the `bool wantNames` parameter because we can't control whether // We ignore the `bool wantNames` parameter because we can't control whether
// the core dump was serialized with edge names or not. // the core dump was serialized with edge names or not.
js::UniquePtr<EdgeRange> edges(JSRuntime* rt, bool) const override; js::UniquePtr<EdgeRange> edges(JSContext* cx, bool) const override;
static const char16_t concreteTypeName[]; static const char16_t concreteTypeName[];
}; };

Просмотреть файл

@ -15,7 +15,8 @@ FileDescriptorOutputStream::Create(const ipc::FileDescriptor& fileDescriptor)
if (NS_WARN_IF(!fileDescriptor.IsValid())) if (NS_WARN_IF(!fileDescriptor.IsValid()))
return nullptr; return nullptr;
PRFileDesc* prfd = PR_ImportFile(PROsfd(fileDescriptor.PlatformHandle())); auto rawFD = fileDescriptor.ClonePlatformHandle();
PRFileDesc* prfd = PR_ImportFile(PROsfd(rawFD.release()));
if (NS_WARN_IF(!prfd)) if (NS_WARN_IF(!prfd))
return nullptr; return nullptr;

Просмотреть файл

@ -489,7 +489,7 @@ HeapSnapshot::TakeCensus(JSContext* cx, JS::HandleObject options,
{ {
JS::AutoCheckCannotGC nogc; JS::AutoCheckCannotGC nogc;
JS::ubi::CensusTraversal traversal(JS_GetRuntime(cx), handler, nogc); JS::ubi::CensusTraversal traversal(cx, handler, nogc);
if (NS_WARN_IF(!traversal.init())) { if (NS_WARN_IF(!traversal.init())) {
rv.Throw(NS_ERROR_OUT_OF_MEMORY); rv.Throw(NS_ERROR_OUT_OF_MEMORY);
return; return;
@ -556,10 +556,10 @@ HeapSnapshot::ComputeDominatorTree(ErrorResult& rv)
{ {
auto ccrt = CycleCollectedJSRuntime::Get(); auto ccrt = CycleCollectedJSRuntime::Get();
MOZ_ASSERT(ccrt); MOZ_ASSERT(ccrt);
auto rt = ccrt->Runtime(); auto cx = ccrt->Context();
MOZ_ASSERT(rt); MOZ_ASSERT(cx);
JS::AutoCheckCannotGC nogc(rt); JS::AutoCheckCannotGC nogc(cx);
maybeTree = JS::ubi::DominatorTree::Create(rt, nogc, getRoot()); maybeTree = JS::ubi::DominatorTree::Create(cx, nogc, getRoot());
} }
if (NS_WARN_IF(maybeTree.isNothing())) { if (NS_WARN_IF(maybeTree.isNothing())) {
@ -621,12 +621,8 @@ HeapSnapshot::ComputeShortestPaths(JSContext*cx, uint64_t start,
Maybe<ShortestPaths> maybeShortestPaths; Maybe<ShortestPaths> maybeShortestPaths;
{ {
auto ccrt = CycleCollectedJSRuntime::Get(); JS::AutoCheckCannotGC nogc(cx);
MOZ_ASSERT(ccrt); maybeShortestPaths = ShortestPaths::Create(cx, nogc, maxNumPaths, *startNode,
auto rt = ccrt->Runtime();
MOZ_ASSERT(rt);
JS::AutoCheckCannotGC nogc(rt);
maybeShortestPaths = ShortestPaths::Create(rt, nogc, maxNumPaths, *startNode,
Move(targetsSet)); Move(targetsSet));
} }
@ -1238,7 +1234,7 @@ public:
protobufNode.set_size(ubiNode.size(mallocSizeOf)); protobufNode.set_size(ubiNode.size(mallocSizeOf));
if (includeEdges) { if (includeEdges) {
auto edges = ubiNode.edges(JS_GetRuntime(cx), wantNames); auto edges = ubiNode.edges(cx, wantNames);
if (NS_WARN_IF(!edges)) if (NS_WARN_IF(!edges))
return false; return false;
@ -1380,7 +1376,7 @@ WriteHeapGraph(JSContext* cx,
// core dump. // core dump.
HeapSnapshotHandler handler(writer, compartments); HeapSnapshotHandler handler(writer, compartments);
HeapSnapshotHandler::Traversal traversal(JS_GetRuntime(cx), handler, noGC); HeapSnapshotHandler::Traversal traversal(cx, handler, noGC);
if (!traversal.init()) if (!traversal.init())
return false; return false;
traversal.wantNames = wantNames; traversal.wantNames = wantNames;
@ -1545,7 +1541,7 @@ ThreadSafeChromeUtils::SaveHeapSnapshot(GlobalObject& global,
{ {
Maybe<AutoCheckCannotGC> maybeNoGC; Maybe<AutoCheckCannotGC> maybeNoGC;
ubi::RootList rootList(JS_GetRuntime(cx), maybeNoGC, wantNames); ubi::RootList rootList(cx, maybeNoGC, wantNames);
if (!EstablishBoundaries(cx, rv, boundaries, rootList, compartments)) if (!EstablishBoundaries(cx, rv, boundaries, rootList, compartments))
return; return;

Просмотреть файл

@ -90,7 +90,7 @@ DEF_TEST(DeserializedNodeUbiNodes, {
.Times(1) .Times(1)
.WillOnce(Return(JS::ubi::Node(referent3.get()))); .WillOnce(Return(JS::ubi::Node(referent3.get())));
auto range = ubi.edges(rt); auto range = ubi.edges(cx);
ASSERT_TRUE(!!range); ASSERT_TRUE(!!range);
for ( ; !range->empty(); range->popFront()) { for ( ; !range->empty(); range->popFront()) {

Просмотреть файл

@ -158,7 +158,7 @@ class Concrete<FakeNode> : public Base
return concreteTypeName; return concreteTypeName;
} }
js::UniquePtr<EdgeRange> edges(JSRuntime*, bool) const override { js::UniquePtr<EdgeRange> edges(JSContext*, bool) const override {
return js::UniquePtr<EdgeRange>(js_new<PreComputedEdgeRange>(get().edges)); return js::UniquePtr<EdgeRange>(js_new<PreComputedEdgeRange>(get().edges));
} }
@ -209,8 +209,8 @@ void AddEdge(FakeNode& node, FakeNode& referent, const char16_t* edgeName = null
namespace testing { namespace testing {
// Ensure that given node has the expected number of edges. // Ensure that given node has the expected number of edges.
MATCHER_P2(EdgesLength, rt, expectedLength, "") { MATCHER_P2(EdgesLength, cx, expectedLength, "") {
auto edges = arg.edges(rt); auto edges = arg.edges(cx);
if (!edges) if (!edges)
return false; return false;
@ -223,8 +223,8 @@ MATCHER_P2(EdgesLength, rt, expectedLength, "") {
} }
// Get the nth edge and match it with the given matcher. // Get the nth edge and match it with the given matcher.
MATCHER_P3(Edge, rt, n, matcher, "") { MATCHER_P3(Edge, cx, n, matcher, "") {
auto edges = arg.edges(rt); auto edges = arg.edges(cx);
if (!edges) if (!edges)
return false; return false;

Просмотреть файл

@ -61,7 +61,7 @@ DEF_TEST(DoesCrossCompartmentBoundaries, {
// However, should not serialize nodeD because nodeB doesn't belong to one // However, should not serialize nodeD because nodeB doesn't belong to one
// of our target compartments and so its edges are excluded from serialization. // of our target compartments and so its edges are excluded from serialization.
JS::AutoCheckCannotGC noGC(rt); JS::AutoCheckCannotGC noGC(cx);
ASSERT_TRUE(WriteHeapGraph(cx, ASSERT_TRUE(WriteHeapGraph(cx,
JS::ubi::Node(&nodeA), JS::ubi::Node(&nodeA),

Просмотреть файл

@ -53,7 +53,7 @@ DEF_TEST(DoesntCrossCompartmentBoundaries, {
// But we shouldn't ever serialize nodeC. // But we shouldn't ever serialize nodeC.
JS::AutoCheckCannotGC noGC(rt); JS::AutoCheckCannotGC noGC(cx);
ASSERT_TRUE(WriteHeapGraph(cx, ASSERT_TRUE(WriteHeapGraph(cx,
JS::ubi::Node(&nodeA), JS::ubi::Node(&nodeA),

Просмотреть файл

@ -28,12 +28,12 @@ DEF_TEST(SerializesEdgeNames, {
// Should get the node with edges once. // Should get the node with edges once.
EXPECT_CALL( EXPECT_CALL(
writer, writer,
writeNode(AllOf(EdgesLength(rt, 3), writeNode(AllOf(EdgesLength(cx, 3),
Edge(rt, 0, Field(&JS::ubi::Edge::name, Edge(cx, 0, Field(&JS::ubi::Edge::name,
UniqueUTF16StrEq(edgeName))), UniqueUTF16StrEq(edgeName))),
Edge(rt, 1, Field(&JS::ubi::Edge::name, Edge(cx, 1, Field(&JS::ubi::Edge::name,
UniqueUTF16StrEq(emptyStr))), UniqueUTF16StrEq(emptyStr))),
Edge(rt, 2, Field(&JS::ubi::Edge::name, Edge(cx, 2, Field(&JS::ubi::Edge::name,
UniqueIsNull()))), UniqueIsNull()))),
_) _)
) )
@ -43,7 +43,7 @@ DEF_TEST(SerializesEdgeNames, {
// Should get the referent node that doesn't have any edges once. // Should get the referent node that doesn't have any edges once.
ExpectWriteNode(writer, referent); ExpectWriteNode(writer, referent);
JS::AutoCheckCannotGC noGC(rt); JS::AutoCheckCannotGC noGC(cx);
ASSERT_TRUE(WriteHeapGraph(cx, ASSERT_TRUE(WriteHeapGraph(cx,
JS::ubi::Node(&node), JS::ubi::Node(&node),
writer, writer,

Просмотреть файл

@ -26,7 +26,7 @@ DEF_TEST(SerializesEverythingInHeapGraphOnce, {
ExpectWriteNode(writer, nodeC); ExpectWriteNode(writer, nodeC);
ExpectWriteNode(writer, nodeD); ExpectWriteNode(writer, nodeD);
JS::AutoCheckCannotGC noGC(rt); JS::AutoCheckCannotGC noGC(cx);
ASSERT_TRUE(WriteHeapGraph(cx, ASSERT_TRUE(WriteHeapGraph(cx,
JS::ubi::Node(&nodeA), JS::ubi::Node(&nodeA),

Просмотреть файл

@ -20,7 +20,7 @@ DEF_TEST(SerializesTypeNames, {
.Times(1) .Times(1)
.WillOnce(Return(true)); .WillOnce(Return(true));
JS::AutoCheckCannotGC noGC(rt); JS::AutoCheckCannotGC noGC(cx);
ASSERT_TRUE(WriteHeapGraph(cx, ASSERT_TRUE(WriteHeapGraph(cx,
JS::ubi::Node(&node), JS::ubi::Node(&node),
writer, writer,

Просмотреть файл

@ -1310,7 +1310,8 @@ private:
mFileSize = aFileSize; mFileSize = aFileSize;
mFileDesc = PR_ImportFile(PROsfd(aFileDesc.PlatformHandle())); auto rawFD = aFileDesc.ClonePlatformHandle();
mFileDesc = PR_ImportFile(PROsfd(rawFD.release()));
if (!mFileDesc) { if (!mFileDesc) {
return false; return false;
} }

Просмотреть файл

@ -324,6 +324,7 @@ private:
ErrorResult rv; ErrorResult rv;
mFormData->Append(name, *file, dummy, rv); mFormData->Append(name, *file, dummy, rv);
if (NS_WARN_IF(rv.Failed())) { if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
return false; return false;
} }
} }

Просмотреть файл

@ -924,7 +924,9 @@ BlobImplFile::GetType(nsAString& aType)
ErrorResult rv; ErrorResult rv;
runnable->Dispatch(rv); runnable->Dispatch(rv);
NS_WARN_IF(rv.Failed()); if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
}
return; return;
} }

Просмотреть файл

@ -2586,18 +2586,30 @@ Navigator::GetUserAgent(nsPIDOMWindowInner* aWindow, nsIURI* aURI,
static nsCString static nsCString
ToCString(const nsString& aString) ToCString(const nsString& aString)
{ {
return NS_ConvertUTF16toUTF8(aString); nsCString str("'");
str.Append(NS_ConvertUTF16toUTF8(aString));
str.AppendLiteral("'");
return str;
}
static nsCString
ToCString(const MediaKeysRequirement aValue)
{
nsCString str("'");
str.Append(nsDependentCString(MediaKeysRequirementValues::strings[static_cast<uint32_t>(aValue)].value));
str.AppendLiteral("'");
return str;
} }
static nsCString static nsCString
ToCString(const MediaKeySystemMediaCapability& aValue) ToCString(const MediaKeySystemMediaCapability& aValue)
{ {
nsCString str; nsCString str;
str.AppendLiteral("{contentType='"); str.AppendLiteral("{contentType=");
if (!aValue.mContentType.IsEmpty()) { str.Append(ToCString(aValue.mContentType));
str.Append(ToCString(aValue.mContentType)); str.AppendLiteral(", robustness=");
} str.Append(ToCString(aValue.mRobustness));
str.AppendLiteral("'}"); str.AppendLiteral("}");
return str; return str;
} }
@ -2605,38 +2617,55 @@ template<class Type>
static nsCString static nsCString
ToCString(const Sequence<Type>& aSequence) ToCString(const Sequence<Type>& aSequence)
{ {
nsCString s; nsCString str;
s.AppendLiteral("["); str.AppendLiteral("[");
for (size_t i = 0; i < aSequence.Length(); i++) { for (size_t i = 0; i < aSequence.Length(); i++) {
if (i != 0) { if (i != 0) {
s.AppendLiteral(","); str.AppendLiteral(",");
} }
s.Append(ToCString(aSequence[i])); str.Append(ToCString(aSequence[i]));
} }
s.AppendLiteral("]"); str.AppendLiteral("]");
return s; return str;
}
template<class Type>
static nsCString
ToCString(const Optional<Sequence<Type>>& aOptional)
{
nsCString str;
if (aOptional.WasPassed()) {
str.Append(ToCString(aOptional.Value()));
} else {
str.AppendLiteral("[]");
}
return str;
} }
static nsCString static nsCString
ToCString(const MediaKeySystemConfiguration& aConfig) ToCString(const MediaKeySystemConfiguration& aConfig)
{ {
nsCString str; nsCString str;
str.AppendLiteral("{"); str.AppendLiteral("{label=");
str.AppendPrintf("label='%s'", NS_ConvertUTF16toUTF8(aConfig.mLabel).get()); str.Append(ToCString(aConfig.mLabel));
if (aConfig.mInitDataTypes.WasPassed()) { str.AppendLiteral(", initDataTypes=");
str.AppendLiteral(", initDataTypes="); str.Append(ToCString(aConfig.mInitDataTypes));
str.Append(ToCString(aConfig.mInitDataTypes.Value()));
}
if (aConfig.mAudioCapabilities.WasPassed()) { str.AppendLiteral(", audioCapabilities=");
str.AppendLiteral(", audioCapabilities="); str.Append(ToCString(aConfig.mAudioCapabilities));
str.Append(ToCString(aConfig.mAudioCapabilities.Value()));
} str.AppendLiteral(", videoCapabilities=");
if (aConfig.mVideoCapabilities.WasPassed()) { str.Append(ToCString(aConfig.mVideoCapabilities));
str.AppendLiteral(", videoCapabilities=");
str.Append(ToCString(aConfig.mVideoCapabilities.Value())); str.AppendLiteral(", distinctiveIdentifier=");
} str.Append(ToCString(aConfig.mDistinctiveIdentifier));
str.AppendLiteral(", persistentState=");
str.Append(ToCString(aConfig.mPersistentState));
str.AppendLiteral(", sessionTypes=");
str.Append(ToCString(aConfig.mSessionTypes));
str.AppendLiteral("}"); str.AppendLiteral("}");

Просмотреть файл

@ -1803,9 +1803,12 @@ nsContentUtils::IsControlledByServiceWorker(nsIDocument* aDocument)
ErrorResult rv; ErrorResult rv;
bool controlled = swm->IsControlled(aDocument, rv); bool controlled = swm->IsControlled(aDocument, rv);
NS_WARN_IF(rv.Failed()); if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
return false;
}
return !rv.Failed() && controlled; return controlled;
} }
/* static */ /* static */

Просмотреть файл

@ -1742,10 +1742,6 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsDocument)
if (elm) { if (elm) {
elm->MarkForCC(); elm->MarkForCC();
} }
if (tmp->mExpandoAndGeneration.expando.isObject()) {
JS::ExposeObjectToActiveJS(
&(tmp->mExpandoAndGeneration.expando.toObject()));
}
return true; return true;
} }
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
@ -1931,13 +1927,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDocument) NS_IMPL_CYCLE_COLLECTION_CLASS(nsDocument)
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDocument) NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsDocument)
if (tmp->PreservingWrapper()) {
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mExpandoAndGeneration.expando)
}
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
tmp->mInUnlinkOrDeletion = true; tmp->mInUnlinkOrDeletion = true;
@ -2010,7 +2000,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
// else, and not unlink an awful lot here. // else, and not unlink an awful lot here.
tmp->mIdentifierMap.Clear(); tmp->mIdentifierMap.Clear();
tmp->mExpandoAndGeneration.Unlink(); tmp->mExpandoAndGeneration.OwnerUnlinked();
if (tmp->mAnimationController) { if (tmp->mAnimationController) {
tmp->mAnimationController->Unlink(); tmp->mAnimationController->Unlink();

Просмотреть файл

@ -792,6 +792,7 @@ nsFrameMessageManager::SendMessage(const nsAString& aMessageName,
retval[i].Read(aCx, &ret, rv); retval[i].Read(aCx, &ret, rv);
if (rv.Failed()) { if (rv.Failed()) {
MOZ_ASSERT(false, "Unable to read structured clone in SendMessage"); MOZ_ASSERT(false, "Unable to read structured clone in SendMessage");
rv.SuppressException();
return NS_ERROR_UNEXPECTED; return NS_ERROR_UNEXPECTED;
} }

Просмотреть файл

@ -75,6 +75,7 @@ GK_ATOM(after_start, "after_start")
GK_ATOM(align, "align") GK_ATOM(align, "align")
GK_ATOM(alink, "alink") GK_ATOM(alink, "alink")
GK_ATOM(all, "all") GK_ATOM(all, "all")
GK_ATOM(allowdirs, "allowdirs")
GK_ATOM(allowevents, "allowevents") GK_ATOM(allowevents, "allowevents")
GK_ATOM(allownegativeassertions, "allownegativeassertions") GK_ATOM(allownegativeassertions, "allownegativeassertions")
GK_ATOM(allowforms,"allow-forms") GK_ATOM(allowforms,"allow-forms")

Просмотреть файл

@ -2745,8 +2745,16 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
aDocument->NodePrincipal()->Equals(existing, &sameOrigin); aDocument->NodePrincipal()->Equals(existing, &sameOrigin);
MOZ_ASSERT(sameOrigin); MOZ_ASSERT(sameOrigin);
#endif #endif
JS_SetCompartmentPrincipals(compartment, MOZ_ASSERT_IF(aDocument == oldDoc,
nsJSPrincipals::get(aDocument->NodePrincipal())); xpc::GetCompartmentPrincipal(compartment) ==
aDocument->NodePrincipal());
if (aDocument != oldDoc) {
JS_SetCompartmentPrincipals(compartment,
nsJSPrincipals::get(aDocument->NodePrincipal()));
// Make sure we clear out the old content XBL scope, so the new one will
// get created with a principal that subsumes our new principal.
xpc::ClearContentXBLScope(newInnerGlobal);
}
} else { } else {
if (aState) { if (aState) {
newInnerWindow = wsh->GetInnerWindow(); newInnerWindow = wsh->GetInnerWindow();

Просмотреть файл

@ -2076,7 +2076,7 @@ NotifyGCEndRunnable::Run()
} }
static void static void
DOMGCSliceCallback(JSRuntime *aRt, JS::GCProgress aProgress, const JS::GCDescription &aDesc) DOMGCSliceCallback(JSContext* aCx, JS::GCProgress aProgress, const JS::GCDescription &aDesc)
{ {
NS_ASSERTION(NS_IsMainThread(), "GCs must run on the main thread"); NS_ASSERTION(NS_IsMainThread(), "GCs must run on the main thread");
@ -2093,7 +2093,7 @@ DOMGCSliceCallback(JSRuntime *aRt, JS::GCProgress aProgress, const JS::GCDescrip
if (sPostGCEventsToConsole) { if (sPostGCEventsToConsole) {
NS_NAMED_LITERAL_STRING(kFmt, "GC(T+%.1f)[%s] "); NS_NAMED_LITERAL_STRING(kFmt, "GC(T+%.1f)[%s] ");
nsString prefix, gcstats; nsString prefix, gcstats;
gcstats.Adopt(aDesc.formatSummaryMessage(aRt)); gcstats.Adopt(aDesc.formatSummaryMessage(aCx));
prefix.Adopt(nsTextFormatter::smprintf(kFmt.get(), prefix.Adopt(nsTextFormatter::smprintf(kFmt.get(),
double(delta) / PR_USEC_PER_SEC, double(delta) / PR_USEC_PER_SEC,
ProcessNameForCollectorLog())); ProcessNameForCollectorLog()));
@ -2106,7 +2106,7 @@ DOMGCSliceCallback(JSRuntime *aRt, JS::GCProgress aProgress, const JS::GCDescrip
if (sPostGCEventsToObserver) { if (sPostGCEventsToObserver) {
nsString json; nsString json;
json.Adopt(aDesc.formatJSON(aRt, PR_Now())); json.Adopt(aDesc.formatJSON(aCx, PR_Now()));
RefPtr<NotifyGCEndRunnable> notify = new NotifyGCEndRunnable(json); RefPtr<NotifyGCEndRunnable> notify = new NotifyGCEndRunnable(json);
NS_DispatchToMainThread(notify); NS_DispatchToMainThread(notify);
} }
@ -2167,7 +2167,7 @@ DOMGCSliceCallback(JSRuntime *aRt, JS::GCProgress aProgress, const JS::GCDescrip
if (sPostGCEventsToConsole) { if (sPostGCEventsToConsole) {
nsString gcstats; nsString gcstats;
gcstats.Adopt(aDesc.formatSliceMessage(aRt)); gcstats.Adopt(aDesc.formatSliceMessage(aCx));
nsCOMPtr<nsIConsoleService> cs = do_GetService(NS_CONSOLESERVICE_CONTRACTID); nsCOMPtr<nsIConsoleService> cs = do_GetService(NS_CONSOLESERVICE_CONTRACTID);
if (cs) { if (cs) {
cs->LogStringMessage(gcstats.get()); cs->LogStringMessage(gcstats.get());
@ -2181,7 +2181,7 @@ DOMGCSliceCallback(JSRuntime *aRt, JS::GCProgress aProgress, const JS::GCDescrip
} }
if (sPrevGCSliceCallback) { if (sPrevGCSliceCallback) {
(*sPrevGCSliceCallback)(aRt, aProgress, aDesc); (*sPrevGCSliceCallback)(aCx, aProgress, aDesc);
} }
} }

Просмотреть файл

@ -8,6 +8,7 @@
#include "mozilla/dom/PluginArrayBinding.h" #include "mozilla/dom/PluginArrayBinding.h"
#include "mozilla/dom/PluginBinding.h" #include "mozilla/dom/PluginBinding.h"
#include "mozilla/dom/HiddenPluginEvent.h"
#include "nsMimeTypeArray.h" #include "nsMimeTypeArray.h"
#include "Navigator.h" #include "Navigator.h"
@ -20,6 +21,8 @@
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "nsIInterfaceRequestorUtils.h" #include "nsIInterfaceRequestorUtils.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsIPermissionManager.h"
#include "nsIDocument.h"
using namespace mozilla; using namespace mozilla;
using namespace mozilla::dom; using namespace mozilla::dom;
@ -73,7 +76,8 @@ NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsPluginArray, NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsPluginArray,
mWindow, mWindow,
mPlugins) mPlugins,
mCTPPlugins)
static void static void
GetPluginMimeTypes(const nsTArray<RefPtr<nsPluginElement> >& aPlugins, GetPluginMimeTypes(const nsTArray<RefPtr<nsPluginElement> >& aPlugins,
@ -153,6 +157,7 @@ nsPluginArray::Refresh(bool aReloadDocuments)
} }
mPlugins.Clear(); mPlugins.Clear();
mCTPPlugins.Clear();
nsCOMPtr<nsIDOMNavigator> navigator = mWindow->GetNavigator(); nsCOMPtr<nsIDOMNavigator> navigator = mWindow->GetNavigator();
@ -228,6 +233,21 @@ nsPluginArray::NamedGetter(const nsAString& aName, bool &aFound)
nsPluginElement* plugin = FindPlugin(mPlugins, aName); nsPluginElement* plugin = FindPlugin(mPlugins, aName);
aFound = (plugin != nullptr); aFound = (plugin != nullptr);
if (!aFound) {
nsPluginElement* hiddenPlugin = FindPlugin(mCTPPlugins, aName);
if (hiddenPlugin) {
HiddenPluginEventInit init;
init.mTag = hiddenPlugin->PluginTag();
nsCOMPtr<nsIDocument> doc = hiddenPlugin->GetParentObject()->GetDoc();
RefPtr<HiddenPluginEvent> event =
HiddenPluginEvent::Constructor(doc, NS_LITERAL_STRING("HiddenPlugin"), init);
event->SetTarget(doc);
event->SetTrusted(true);
event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
bool dummy;
doc->DispatchEvent(event, &dummy);
}
}
return plugin; return plugin;
} }
@ -289,7 +309,7 @@ operator<(const RefPtr<nsPluginElement>& lhs,
void void
nsPluginArray::EnsurePlugins() nsPluginArray::EnsurePlugins()
{ {
if (!mPlugins.IsEmpty()) { if (!mPlugins.IsEmpty() || !mCTPPlugins.IsEmpty()) {
// We already have an array of plugin elements. // We already have an array of plugin elements.
return; return;
} }
@ -306,7 +326,31 @@ nsPluginArray::EnsurePlugins()
// need to wrap each of these with a nsPluginElement, which is // need to wrap each of these with a nsPluginElement, which is
// scriptable. // scriptable.
for (uint32_t i = 0; i < pluginTags.Length(); ++i) { for (uint32_t i = 0; i < pluginTags.Length(); ++i) {
mPlugins.AppendElement(new nsPluginElement(mWindow, pluginTags[i])); nsCOMPtr<nsPluginTag> pluginTag = do_QueryInterface(pluginTags[i]);
if (!pluginTag) {
mPlugins.AppendElement(new nsPluginElement(mWindow, pluginTags[i]));
} else if (pluginTag->IsActive()) {
uint32_t permission = nsIPermissionManager::ALLOW_ACTION;
if (pluginTag->IsClicktoplay()) {
nsCString name;
pluginTag->GetName(name);
if (NS_LITERAL_CSTRING("Shockwave Flash").Equals(name)) {
RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
nsCString permString;
nsresult rv = pluginHost->GetPermissionStringForTag(pluginTag, 0, permString);
if (rv == NS_OK) {
nsIPrincipal* principal = mWindow->GetExtantDoc()->NodePrincipal();
nsCOMPtr<nsIPermissionManager> permMgr = services::GetPermissionManager();
permMgr->TestPermissionFromPrincipal(principal, permString.get(), &permission);
}
}
}
if (permission == nsIPermissionManager::ALLOW_ACTION) {
mPlugins.AppendElement(new nsPluginElement(mWindow, pluginTags[i]));
} else {
mCTPPlugins.AppendElement(new nsPluginElement(mWindow, pluginTags[i]));
}
}
} }
// Alphabetize the enumeration order of non-hidden plugins to reduce // Alphabetize the enumeration order of non-hidden plugins to reduce

Просмотреть файл

@ -60,6 +60,10 @@ private:
nsCOMPtr<nsPIDOMWindowInner> mWindow; nsCOMPtr<nsPIDOMWindowInner> mWindow;
nsTArray<RefPtr<nsPluginElement> > mPlugins; nsTArray<RefPtr<nsPluginElement> > mPlugins;
/* A separate list of click-to-play plugins that we don't tell content
* about but keep track of so we can still prompt the user to click to play.
*/
nsTArray<RefPtr<nsPluginElement> > mCTPPlugins;
}; };
class nsPluginElement final : public nsISupports, class nsPluginElement final : public nsISupports,

Просмотреть файл

@ -87,7 +87,7 @@ add_task(function* () {
function waitForDestroyedDocuments() { function waitForDestroyedDocuments() {
let deferred = promise.defer(); let deferred = promise.defer();
SpecialPowers.exactGC(window, deferred.resolve); SpecialPowers.exactGC(deferred.resolve);
return deferred.promise; return deferred.promise;
} }

Просмотреть файл

@ -195,7 +195,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=889335
document.body.removeChild(frame); document.body.removeChild(frame);
frame = null; frame = null;
SpecialPowers.exactGC(window, function() { SpecialPowers.exactGC(function() {
// This should not crash. // This should not crash.
SpecialPowers.pushPrefEnv({"set": [['intl.accept_languages', 'en-GB']]}, nextTest); SpecialPowers.pushPrefEnv({"set": [['intl.accept_languages', 'en-GB']]}, nextTest);
}); });

Просмотреть файл

@ -845,6 +845,10 @@ DOMInterfaces = {
'nativeType': 'nsPluginArray', 'nativeType': 'nsPluginArray',
}, },
'PluginTag': {
'nativeType': 'nsIPluginTag',
},
'PopupBoxObject': { 'PopupBoxObject': {
'resultNotAddRefed': ['triggerNode', 'anchorNode'], 'resultNotAddRefed': ['triggerNode', 'anchorNode'],
}, },

Просмотреть файл

@ -11723,8 +11723,13 @@ class CGDOMJSProxyHandler(CGClass):
methods.append(CGDOMJSProxyHandler_call()) methods.append(CGDOMJSProxyHandler_call())
methods.append(CGDOMJSProxyHandler_isCallable()) methods.append(CGDOMJSProxyHandler_isCallable())
if descriptor.interface.getExtendedAttribute('OverrideBuiltins'):
parentClass = 'ShadowingDOMProxyHandler'
else:
parentClass = 'mozilla::dom::DOMProxyHandler'
CGClass.__init__(self, 'DOMProxyHandler', CGClass.__init__(self, 'DOMProxyHandler',
bases=[ClassBase('mozilla::dom::DOMProxyHandler')], bases=[ClassBase(parentClass)],
constructors=constructors, constructors=constructors,
methods=methods) methods=methods)

Просмотреть файл

@ -297,5 +297,26 @@ DOMProxyHandler::GetExpandoObject(JSObject *obj)
return v.isUndefined() ? nullptr : &v.toObject(); return v.isUndefined() ? nullptr : &v.toObject();
} }
void
ShadowingDOMProxyHandler::trace(JSTracer* trc, JSObject* proxy) const
{
DOMProxyHandler::trace(trc, proxy);
MOZ_ASSERT(IsDOMProxy(proxy), "expected a DOM proxy object");
JS::Value v = js::GetProxyExtra(proxy, JSPROXYSLOT_EXPANDO);
MOZ_ASSERT(!v.isObject(), "Should not have expando object directly!");
if (v.isUndefined()) {
// This can happen if we GC while creating our object, before we get a
// chance to set up its JSPROXYSLOT_EXPANDO slot.
return;
}
js::ExpandoAndGeneration* expandoAndGeneration =
static_cast<js::ExpandoAndGeneration*>(v.toPrivate());
JS::TraceEdge(trc, &expandoAndGeneration->expando,
"Shadowing DOM proxy expando");
}
} // namespace dom } // namespace dom
} // namespace mozilla } // namespace mozilla

Просмотреть файл

@ -32,7 +32,9 @@ enum {
* *
* If it is, the proxy is initialized with a PrivateValue, which contains a * If it is, the proxy is initialized with a PrivateValue, which contains a
* pointer to a js::ExpandoAndGeneration object; this contains a pointer to * pointer to a js::ExpandoAndGeneration object; this contains a pointer to
* the actual expando object as well as the "generation" of the object. * the actual expando object as well as the "generation" of the object. The
* proxy handler will trace the expando object stored in the
* js::ExpandoAndGeneration while the proxy itself is alive.
* *
* If it is not, the proxy is initialized with an UndefinedValue. In * If it is not, the proxy is initialized with an UndefinedValue. In
* EnsureExpandoObject, it is set to an ObjectValue that points to the * EnsureExpandoObject, it is set to an ObjectValue that points to the
@ -140,6 +142,13 @@ public:
static const char family; static const char family;
}; };
// Class used by shadowing handlers (the ones that have [OverrideBuiltins].
// This handles tracing the expando in ExpandoAndGeneration.
class ShadowingDOMProxyHandler : public DOMProxyHandler
{
virtual void trace(JSTracer* trc, JSObject* proxy) const override;
};
inline bool IsDOMProxy(JSObject *obj) inline bool IsDOMProxy(JSObject *obj)
{ {
const js::Class* clasp = js::GetObjectClass(obj); const js::Class* clasp = js::GetObjectClass(obj);

Просмотреть файл

@ -29,7 +29,7 @@ function callback() {
} }
delete window.XMLHttpRequestUpload; delete window.XMLHttpRequestUpload;
SpecialPowers.exactGC(window, callback); SpecialPowers.exactGC(callback);
</script> </script>
</pre> </pre>

Просмотреть файл

@ -99,6 +99,7 @@ BroadcastChannelChild::RecvNotify(const ClonedMessageData& aData)
ErrorResult rv; ErrorResult rv;
cloneData.Read(cx, &value, rv); cloneData.Read(cx, &value, rv);
if (NS_WARN_IF(rv.Failed())) { if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
return true; return true;
} }
} }
@ -112,8 +113,8 @@ BroadcastChannelChild::RecvNotify(const ClonedMessageData& aData)
ErrorResult rv; ErrorResult rv;
RefPtr<MessageEvent> event = RefPtr<MessageEvent> event =
MessageEvent::Constructor(mBC, NS_LITERAL_STRING("message"), init, rv); MessageEvent::Constructor(mBC, NS_LITERAL_STRING("message"), init, rv);
if (rv.Failed()) { if (NS_WARN_IF(rv.Failed())) {
NS_WARNING("Failed to create a MessageEvent object."); rv.SuppressException();
return true; return true;
} }

Просмотреть файл

@ -54,7 +54,7 @@ function resetStorage() {
function gc() { function gc() {
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
SpecialPowers.exactGC(window, resolve); SpecialPowers.exactGC(resolve);
}); });
} }

Просмотреть файл

@ -54,7 +54,7 @@ function resetStorage() {
function gc() { function gc() {
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
SpecialPowers.exactGC(window, resolve); SpecialPowers.exactGC(resolve);
}); });
} }

Просмотреть файл

@ -54,7 +54,7 @@ function resetStorage() {
function gc() { function gc() {
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
SpecialPowers.exactGC(window, resolve); SpecialPowers.exactGC(resolve);
}); });
} }

Просмотреть файл

@ -1252,15 +1252,15 @@ nsGonkCameraControl::StartRecordingImpl(DeviceStorageFileDescriptor* aFileDescri
closer = new CloseFileRunnable(aFileDescriptor->mFileDescriptor); closer = new CloseFileRunnable(aFileDescriptor->mFileDescriptor);
} }
nsresult rv; nsresult rv;
int fd = aFileDescriptor->mFileDescriptor.PlatformHandle(); auto rawFD = aFileDescriptor->mFileDescriptor.ClonePlatformHandle();
if (aOptions) { if (aOptions) {
rv = SetupRecording(fd, aOptions->rotation, aOptions->maxFileSizeBytes, rv = SetupRecording(rawFD.get(), aOptions->rotation, aOptions->maxFileSizeBytes,
aOptions->maxVideoLengthMs); aOptions->maxVideoLengthMs);
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
rv = SetupRecordingFlash(aOptions->autoEnableLowLightTorch); rv = SetupRecordingFlash(aOptions->autoEnableLowLightTorch);
} }
} else { } else {
rv = SetupRecording(fd, 0, 0, 0); rv = SetupRecording(rawFD.get(), 0, 0, 0);
} }
if (NS_WARN_IF(NS_FAILED(rv))) { if (NS_WARN_IF(NS_FAILED(rv))) {
return rv; return rv;

Просмотреть файл

@ -1055,9 +1055,6 @@ DrawTarget* CanvasRenderingContext2D::sErrorTarget = nullptr;
CanvasRenderingContext2D::CanvasRenderingContext2D() CanvasRenderingContext2D::CanvasRenderingContext2D()
: mRenderingMode(RenderingMode::OpenGLBackendMode) : mRenderingMode(RenderingMode::OpenGLBackendMode)
#ifdef USE_SKIA_GPU
, mVideoTexture(0)
#endif
// these are the default values from the Canvas spec // these are the default values from the Canvas spec
, mWidth(0), mHeight(0) , mWidth(0), mHeight(0)
, mZero(false), mOpaque(false) , mZero(false), mOpaque(false)
@ -1099,15 +1096,6 @@ CanvasRenderingContext2D::~CanvasRenderingContext2D()
if (!sNumLivingContexts) { if (!sNumLivingContexts) {
NS_IF_RELEASE(sErrorTarget); NS_IF_RELEASE(sErrorTarget);
} }
#ifdef USE_SKIA_GPU
if (mVideoTexture) {
SkiaGLGlue* glue = gfxPlatform::GetPlatform()->GetSkiaGLGlue();
MOZ_ASSERT(glue);
glue->GetGLContext()->MakeCurrent();
glue->GetGLContext()->fDeleteTextures(1, &mVideoTexture);
}
#endif
RemoveDemotableContext(this); RemoveDemotableContext(this);
} }
@ -1344,15 +1332,6 @@ bool CanvasRenderingContext2D::SwitchRenderingMode(RenderingMode aRenderingMode)
!gfxPlatform::GetPlatform()->UseAcceleratedCanvas()) { !gfxPlatform::GetPlatform()->UseAcceleratedCanvas()) {
return false; return false;
} }
if (mRenderingMode == RenderingMode::OpenGLBackendMode) {
if (mVideoTexture) {
gfxPlatform::GetPlatform()->GetSkiaGLGlue()->GetGLContext()->MakeCurrent();
gfxPlatform::GetPlatform()->GetSkiaGLGlue()->GetGLContext()->fDeleteTextures(1, &mVideoTexture);
}
mCurrentVideoSize.width = 0;
mCurrentVideoSize.height = 0;
}
#endif #endif
RefPtr<SourceSurface> snapshot; RefPtr<SourceSurface> snapshot;
@ -4650,46 +4629,44 @@ CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage,
} }
gl->MakeCurrent(); gl->MakeCurrent();
if (!mVideoTexture) { GLuint videoTexture = 0;
gl->fGenTextures(1, &mVideoTexture); gl->fGenTextures(1, &videoTexture);
}
// skiaGL expect upload on drawing, and uses texture 0 for texturing, // skiaGL expect upload on drawing, and uses texture 0 for texturing,
// so we must active texture 0 and bind the texture for it. // so we must active texture 0 and bind the texture for it.
gl->fActiveTexture(LOCAL_GL_TEXTURE0); gl->fActiveTexture(LOCAL_GL_TEXTURE0);
gl->fBindTexture(LOCAL_GL_TEXTURE_2D, mVideoTexture); gl->fBindTexture(LOCAL_GL_TEXTURE_2D, videoTexture);
gl->fTexImage2D(LOCAL_GL_TEXTURE_2D, 0, LOCAL_GL_RGB, srcImage->GetSize().width, srcImage->GetSize().height, 0, LOCAL_GL_RGB, LOCAL_GL_UNSIGNED_SHORT_5_6_5, nullptr);
gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_S, LOCAL_GL_CLAMP_TO_EDGE);
gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_T, LOCAL_GL_CLAMP_TO_EDGE);
gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MAG_FILTER, LOCAL_GL_LINEAR);
gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MIN_FILTER, LOCAL_GL_LINEAR);
bool dimensionsMatch = mCurrentVideoSize.width == srcImage->GetSize().width &&
mCurrentVideoSize.height == srcImage->GetSize().height;
if (!dimensionsMatch) {
// we need to allocation
mCurrentVideoSize.width = srcImage->GetSize().width;
mCurrentVideoSize.height = srcImage->GetSize().height;
gl->fTexImage2D(LOCAL_GL_TEXTURE_2D, 0, LOCAL_GL_RGB, srcImage->GetSize().width, srcImage->GetSize().height, 0, LOCAL_GL_RGB, LOCAL_GL_UNSIGNED_SHORT_5_6_5, nullptr);
gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_S, LOCAL_GL_CLAMP_TO_EDGE);
gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_T, LOCAL_GL_CLAMP_TO_EDGE);
gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MAG_FILTER, LOCAL_GL_LINEAR);
gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MIN_FILTER, LOCAL_GL_LINEAR);
}
const gl::OriginPos destOrigin = gl::OriginPos::TopLeft; const gl::OriginPos destOrigin = gl::OriginPos::TopLeft;
bool ok = gl->BlitHelper()->BlitImageToTexture(srcImage, srcImage->GetSize(), bool ok = gl->BlitHelper()->BlitImageToTexture(srcImage, srcImage->GetSize(),
mVideoTexture, LOCAL_GL_TEXTURE_2D, videoTexture, LOCAL_GL_TEXTURE_2D,
destOrigin); destOrigin);
if (ok) { if (ok) {
NativeSurface texSurf; NativeSurface texSurf;
texSurf.mType = NativeSurfaceType::OPENGL_TEXTURE; texSurf.mType = NativeSurfaceType::OPENGL_TEXTURE;
texSurf.mFormat = SurfaceFormat::R5G6B5_UINT16; texSurf.mFormat = SurfaceFormat::R5G6B5_UINT16;
texSurf.mSize.width = mCurrentVideoSize.width; texSurf.mSize.width = srcImage->GetSize().width;
texSurf.mSize.height = mCurrentVideoSize.height; texSurf.mSize.height = srcImage->GetSize().height;
texSurf.mSurface = (void*)((uintptr_t)mVideoTexture); texSurf.mSurface = (void*)((uintptr_t)videoTexture);
srcSurf = mTarget->CreateSourceSurfaceFromNativeSurface(texSurf); srcSurf = mTarget->CreateSourceSurfaceFromNativeSurface(texSurf);
imgSize.width = mCurrentVideoSize.width; if (!srcSurf) {
imgSize.height = mCurrentVideoSize.height; gl->fDeleteTextures(1, &videoTexture);
}
imgSize.width = srcImage->GetSize().width;
imgSize.height = srcImage->GetSize().height;
int32_t displayWidth = video->VideoWidth(); int32_t displayWidth = video->VideoWidth();
int32_t displayHeight = video->VideoHeight(); int32_t displayHeight = video->VideoHeight();
aSw *= (double)imgSize.width / (double)displayWidth; aSw *= (double)imgSize.width / (double)displayWidth;
aSh *= (double)imgSize.height / (double)displayHeight; aSh *= (double)imgSize.height / (double)displayHeight;
} else {
gl->fDeleteTextures(1, &videoTexture);
} }
srcImage = nullptr; srcImage = nullptr;

Просмотреть файл

@ -723,10 +723,6 @@ protected:
RenderingMode mRenderingMode; RenderingMode mRenderingMode;
// Texture informations for fast video rendering
unsigned int mVideoTexture;
nsIntSize mCurrentVideoSize;
// Member vars // Member vars
int32_t mWidth, mHeight; int32_t mWidth, mHeight;

Просмотреть файл

@ -91,6 +91,7 @@ CropAndCopyDataSourceSurface(DataSourceSurface* aSurface, const IntRect& aCropRe
ErrorResult error; ErrorResult error;
const IntRect positiveCropRect = FixUpNegativeDimension(aCropRect, error); const IntRect positiveCropRect = FixUpNegativeDimension(aCropRect, error);
if (NS_WARN_IF(error.Failed())) { if (NS_WARN_IF(error.Failed())) {
error.SuppressException();
return nullptr; return nullptr;
} }
@ -1106,6 +1107,7 @@ DecodeBlob(Blob& aBlob)
ErrorResult error; ErrorResult error;
aBlob.Impl()->GetInternalStream(getter_AddRefs(stream), error); aBlob.Impl()->GetInternalStream(getter_AddRefs(stream), error);
if (NS_WARN_IF(error.Failed())) { if (NS_WARN_IF(error.Failed())) {
error.SuppressException();
return nullptr; return nullptr;
} }

Просмотреть файл

@ -12,24 +12,15 @@ namespace mozilla {
already_AddRefed<WebGLSampler> already_AddRefed<WebGLSampler>
WebGL2Context::CreateSampler() WebGL2Context::CreateSampler()
{ {
const char funcName[] = "createSampler";
if (IsContextLost()) if (IsContextLost())
return nullptr; return nullptr;
/*
GLuint sampler; GLuint sampler;
MakeContextCurrent(); MakeContextCurrent();
gl->fGenSamplers(1, &sampler); gl->fGenSamplers(1, &sampler);
RefPtr<WebGLSampler> globj = new WebGLSampler(this, sampler); RefPtr<WebGLSampler> globj = new WebGLSampler(this, sampler);
return globj.forget(); return globj.forget();
*/
ErrorInvalidOperation("%s: Sampler objects are still under development, and are"
" currently disabled.",
funcName);
return nullptr;
} }
void void

Просмотреть файл

@ -776,6 +776,25 @@ WebGLContext::GetFramebufferAttachmentParameter(JSContext* cx,
switch (pname) { switch (pname) {
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
switch (attachment) {
case LOCAL_GL_BACK:
break;
case LOCAL_GL_DEPTH:
if (!mOptions.depth) {
return JS::Int32Value(LOCAL_GL_NONE);
}
break;
case LOCAL_GL_STENCIL:
if (!mOptions.stencil) {
return JS::Int32Value(LOCAL_GL_NONE);
}
break;
default:
ErrorInvalidEnum("%s: With the default framebuffer, can only query COLOR, DEPTH,"
" or STENCIL for GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",
funcName);
return JS::NullValue();
}
return JS::Int32Value(LOCAL_GL_FRAMEBUFFER_DEFAULT); return JS::Int32Value(LOCAL_GL_FRAMEBUFFER_DEFAULT);
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
@ -791,27 +810,63 @@ WebGLContext::GetFramebufferAttachmentParameter(JSContext* cx,
return JS::NumberValue(0); return JS::NumberValue(0);
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
if (attachment == LOCAL_GL_BACK) if (attachment == LOCAL_GL_BACK) {
return JS::NumberValue(mOptions.alpha ? 8 : 0); if (mOptions.alpha) {
return JS::NumberValue(8);
}
ErrorInvalidOperation("The default framebuffer doesn't contain an alpha buffer");
return JS::NullValue();
}
return JS::NumberValue(0); return JS::NumberValue(0);
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
if (attachment == LOCAL_GL_DEPTH) if (attachment == LOCAL_GL_DEPTH) {
return JS::NumberValue(mOptions.depth ? 24 : 0); if (mOptions.depth) {
return JS::NumberValue(24);
}
ErrorInvalidOperation("The default framebuffer doesn't contain an depth buffer");
return JS::NullValue();
}
return JS::NumberValue(0); return JS::NumberValue(0);
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:
if (attachment == LOCAL_GL_STENCIL) if (attachment == LOCAL_GL_STENCIL) {
return JS::NumberValue(mOptions.stencil ? 8 : 0); if (mOptions.stencil) {
return JS::NumberValue(8);
}
ErrorInvalidOperation("The default framebuffer doesn't contain an stencil buffer");
return JS::NullValue();
}
return JS::NumberValue(0); return JS::NumberValue(0);
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
if (attachment == LOCAL_GL_STENCIL) if (attachment == LOCAL_GL_STENCIL) {
return JS::NumberValue(LOCAL_GL_UNSIGNED_INT); if (mOptions.stencil) {
else return JS::NumberValue(LOCAL_GL_UNSIGNED_INT);
}
ErrorInvalidOperation("The default framebuffer doesn't contain an stencil buffer");
} else if (attachment == LOCAL_GL_DEPTH) {
if (mOptions.depth) {
return JS::NumberValue(LOCAL_GL_UNSIGNED_NORMALIZED);
}
ErrorInvalidOperation("The default framebuffer doesn't contain an depth buffer");
} else { // LOCAL_GL_BACK
return JS::NumberValue(LOCAL_GL_UNSIGNED_NORMALIZED); return JS::NumberValue(LOCAL_GL_UNSIGNED_NORMALIZED);
}
return JS::NullValue();
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:
if (attachment == LOCAL_GL_STENCIL) {
if (!mOptions.stencil) {
ErrorInvalidOperation("The default framebuffer doesn't contain an stencil buffer");
return JS::NullValue();
}
} else if (attachment == LOCAL_GL_DEPTH) {
if (!mOptions.depth) {
ErrorInvalidOperation("The default framebuffer doesn't contain an depth buffer");
return JS::NullValue();
}
}
return JS::NumberValue(LOCAL_GL_LINEAR); return JS::NumberValue(LOCAL_GL_LINEAR);
} }

Просмотреть файл

@ -528,7 +528,7 @@ WebGLFBAttachPoint::GetParameter(const char* funcName, WebGLContext* webgl, JSCo
if (!usage) if (!usage)
return JS::NullValue(); return JS::NullValue();
const auto format = usage->format; auto format = usage->format;
GLint ret = 0; GLint ret = 0;
switch (pname) { switch (pname) {
@ -559,10 +559,38 @@ WebGLFBAttachPoint::GetParameter(const char* funcName, WebGLContext* webgl, JSCo
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
MOZ_ASSERT(attachment != LOCAL_GL_DEPTH_STENCIL_ATTACHMENT); MOZ_ASSERT(attachment != LOCAL_GL_DEPTH_STENCIL_ATTACHMENT);
if (format->componentType == webgl::ComponentType::Special) {
// Special format is used for DS mixed format(e.g. D24S8 and D32FS8).
MOZ_ASSERT(format->unsizedFormat == webgl::UnsizedFormat::DS);
MOZ_ASSERT(attachment == LOCAL_GL_DEPTH_ATTACHMENT ||
attachment == LOCAL_GL_STENCIL_ATTACHMENT);
if (attachment == LOCAL_GL_DEPTH_ATTACHMENT) {
switch (format->effectiveFormat) {
case webgl::EffectiveFormat::DEPTH24_STENCIL8:
format = webgl::GetFormat(webgl::EffectiveFormat::DEPTH_COMPONENT24);
break;
case webgl::EffectiveFormat::DEPTH32F_STENCIL8:
format = webgl::GetFormat(webgl::EffectiveFormat::DEPTH_COMPONENT32F);
break;
default:
MOZ_ASSERT(false, "no matched DS format");
break;
}
} else if (attachment == LOCAL_GL_STENCIL_ATTACHMENT) {
switch (format->effectiveFormat) {
case webgl::EffectiveFormat::DEPTH24_STENCIL8:
case webgl::EffectiveFormat::DEPTH32F_STENCIL8:
format = webgl::GetFormat(webgl::EffectiveFormat::STENCIL_INDEX8);
break;
default:
MOZ_ASSERT(false, "no matched DS format");
break;
}
}
}
switch (format->componentType) { switch (format->componentType) {
case webgl::ComponentType::Special:
MOZ_ASSERT(false, "Should never happen.");
break;
case webgl::ComponentType::None: case webgl::ComponentType::None:
ret = LOCAL_GL_NONE; ret = LOCAL_GL_NONE;
break; break;
@ -581,6 +609,9 @@ WebGLFBAttachPoint::GetParameter(const char* funcName, WebGLContext* webgl, JSCo
case webgl::ComponentType::Float: case webgl::ComponentType::Float:
ret = LOCAL_GL_FLOAT; ret = LOCAL_GL_FLOAT;
break; break;
default:
MOZ_ASSERT(false, "No matched component type");
break;
} }
break; break;

Просмотреть файл

@ -0,0 +1,6 @@
<canvas id='id0'></canvas>
<script>
var c=document.getElementById('id0').getContext('2d');
c.transform(1,0,1,0,0,0);
c.fillText('A',0,53);
</script>

Просмотреть файл

@ -30,3 +30,5 @@ load 1229932-1.html
load 1244850-1.html load 1244850-1.html
load 1246775-1.html load 1246775-1.html
skip-if(d2d) load 1287515-1.html skip-if(d2d) load 1287515-1.html
load 1288872-1.html

Просмотреть файл

@ -4546,10 +4546,8 @@ skip-if = (os == 'win' && debug) || (os == 'android' || os == 'linux' || (os ==
[generated/test_2_conformance2__glsl3__vector-dynamic-indexing.html] [generated/test_2_conformance2__glsl3__vector-dynamic-indexing.html]
skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2')) skip-if = (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2'))
[generated/test_2_conformance2__misc__expando-loss-2.html] [generated/test_2_conformance2__misc__expando-loss-2.html]
fail-if = (os == 'mac') || (os == 'win')
skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2')) skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2'))
[generated/test_2_conformance2__misc__instanceof-test.html] [generated/test_2_conformance2__misc__instanceof-test.html]
fail-if = (os == 'mac') || (os == 'win')
skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2')) skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2'))
[generated/test_2_conformance2__misc__uninitialized-test-2.html] [generated/test_2_conformance2__misc__uninitialized-test-2.html]
skip-if = (os == 'mac') || (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2')) skip-if = (os == 'mac') || (os == 'win') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2'))
@ -4586,10 +4584,8 @@ skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.
[generated/test_2_conformance2__rendering__instanced-arrays.html] [generated/test_2_conformance2__rendering__instanced-arrays.html]
skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2')) skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2'))
[generated/test_2_conformance2__samplers__sampler-drawing-test.html] [generated/test_2_conformance2__samplers__sampler-drawing-test.html]
fail-if = (os == 'mac') || (os == 'win')
skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2')) skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2'))
[generated/test_2_conformance2__samplers__samplers.html] [generated/test_2_conformance2__samplers__samplers.html]
fail-if = (os == 'mac') || (os == 'win')
skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2')) skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2'))
[generated/test_2_conformance2__state__gl-enum-tests.html] [generated/test_2_conformance2__state__gl-enum-tests.html]
skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2')) skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1') || (os == 'win' && os_version == '6.2'))

Просмотреть файл

@ -133,18 +133,12 @@ fail-if = (os == 'mac')
skip-if = (os == 'win') skip-if = (os == 'win')
[generated/test_2_conformance__extensions__webgl-compressed-texture-s3tc.html] [generated/test_2_conformance__extensions__webgl-compressed-texture-s3tc.html]
fail-if = (os == 'mac') || (os == 'win') fail-if = (os == 'mac') || (os == 'win')
[generated/test_2_conformance2__misc__instanceof-test.html]
fail-if = (os == 'mac') || (os == 'win')
[generated/test_2_conformance__textures__misc__tex-image-with-invalid-data.html] [generated/test_2_conformance__textures__misc__tex-image-with-invalid-data.html]
fail-if = (os == 'mac') || (os == 'win') fail-if = (os == 'mac') || (os == 'win')
[generated/test_2_conformance2__samplers__sampler-drawing-test.html]
fail-if = (os == 'mac') || (os == 'win')
[generated/test_2_conformance2__buffers__buffer-type-restrictions.html] [generated/test_2_conformance2__buffers__buffer-type-restrictions.html]
fail-if = (os == 'mac') || (os == 'win') fail-if = (os == 'mac') || (os == 'win')
[generated/test_2_conformance2__rendering__draw-buffers.html] [generated/test_2_conformance2__rendering__draw-buffers.html]
fail-if = (os == 'mac') || (os == 'win') fail-if = (os == 'mac') || (os == 'win')
[generated/test_2_conformance2__samplers__samplers.html]
fail-if = (os == 'mac') || (os == 'win')
[generated/test_2_conformance__textures__misc__tex-image-with-format-and-type.html] [generated/test_2_conformance__textures__misc__tex-image-with-format-and-type.html]
fail-if = (os == 'mac') fail-if = (os == 'mac')
[generated/test_2_conformance__attribs__gl-vertexattribpointer.html] [generated/test_2_conformance__attribs__gl-vertexattribpointer.html]
@ -169,8 +163,6 @@ fail-if = (os == 'mac') || (os == 'win')
fail-if = (os == 'mac') || (os == 'win') || (os == 'android') || (os == 'linux') fail-if = (os == 'mac') || (os == 'win') || (os == 'android') || (os == 'linux')
[generated/test_2_conformance__textures__misc__tex-sub-image-2d-bad-args.html] [generated/test_2_conformance__textures__misc__tex-sub-image-2d-bad-args.html]
fail-if = (os == 'mac') || (os == 'win') fail-if = (os == 'mac') || (os == 'win')
[generated/test_2_conformance2__misc__expando-loss-2.html]
fail-if = (os == 'mac') || (os == 'win')
[generated/test_conformance__ogles__GL__biuDepthRange__biuDepthRange_001_to_002.html] [generated/test_conformance__ogles__GL__biuDepthRange__biuDepthRange_001_to_002.html]
fail-if = (os == 'android') || (os == 'linux') fail-if = (os == 'android') || (os == 'linux')
[generated/test_conformance__ogles__GL__gl_FragCoord__gl_FragCoord_001_to_003.html] [generated/test_conformance__ogles__GL__gl_FragCoord__gl_FragCoord_001_to_003.html]

Просмотреть файл

@ -1958,6 +1958,7 @@ public:
nsCOMPtr<nsIInputStream> stream; nsCOMPtr<nsIInputStream> stream;
mBlob->GetInternalStream(getter_AddRefs(stream), rv); mBlob->GetInternalStream(getter_AddRefs(stream), rv);
if (NS_WARN_IF(rv.Failed())) { if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
return Reject(POST_ERROR_EVENT_UNKNOWN); return Reject(POST_ERROR_EVENT_UNKNOWN);
} }
@ -2070,6 +2071,7 @@ public:
nsCOMPtr<nsIInputStream> stream; nsCOMPtr<nsIInputStream> stream;
mBlob->GetInternalStream(getter_AddRefs(stream), rv); mBlob->GetInternalStream(getter_AddRefs(stream), rv);
if (NS_WARN_IF(rv.Failed())) { if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
return Reject(POST_ERROR_EVENT_UNKNOWN); return Reject(POST_ERROR_EVENT_UNKNOWN);
} }

Просмотреть файл

@ -9,7 +9,6 @@
#include "mozilla/Atomics.h" #include "mozilla/Atomics.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "mozilla/Logging.h"
#include "mozilla/dom/devicestorage/DeviceStorageRequestChild.h" #include "mozilla/dom/devicestorage/DeviceStorageRequestChild.h"
#include "DOMRequest.h" #include "DOMRequest.h"

Просмотреть файл

@ -41,7 +41,9 @@ BeforeAfterKeyboardEvent::Constructor(
new BeforeAfterKeyboardEvent(aOwner, nullptr, nullptr); new BeforeAfterKeyboardEvent(aOwner, nullptr, nullptr);
ErrorResult rv; ErrorResult rv;
event->InitWithKeyboardEventInit(aOwner, aType, aParam, rv); event->InitWithKeyboardEventInit(aOwner, aType, aParam, rv);
NS_WARN_IF(rv.Failed()); if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
}
event->mEvent->AsBeforeAfterKeyboardEvent()->mEmbeddedCancelled = event->mEvent->AsBeforeAfterKeyboardEvent()->mEmbeddedCancelled =
aParam.mEmbeddedCancelled; aParam.mEmbeddedCancelled;

Просмотреть файл

@ -1286,7 +1286,9 @@ DataTransfer::SetDataWithPrincipalFromOtherProcess(const nsAString& aFormat,
RefPtr<DataTransferItem> item = RefPtr<DataTransferItem> item =
mItems->SetDataWithPrincipal(format, aData, aIndex, aPrincipal, mItems->SetDataWithPrincipal(format, aData, aIndex, aPrincipal,
/* aInsertOnly = */ false, aHidden, rv); /* aInsertOnly = */ false, aHidden, rv);
NS_WARN_IF(rv.Failed()); if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
}
} }
} }

Просмотреть файл

@ -2536,6 +2536,7 @@ WriteOp::Init(FileHandle* aFileHandle)
ErrorResult rv; ErrorResult rv;
blobImpl->GetInternalStream(getter_AddRefs(inputStream), rv); blobImpl->GetInternalStream(getter_AddRefs(inputStream), rv);
if (NS_WARN_IF(rv.Failed())) { if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
return false; return false;
} }

Просмотреть файл

@ -84,12 +84,14 @@ FileSystemBase::GetRealPath(BlobImpl* aFile, nsIFile** aPath) const
ErrorResult rv; ErrorResult rv;
aFile->GetMozFullPathInternal(filePath, rv); aFile->GetMozFullPathInternal(filePath, rv);
if (NS_WARN_IF(rv.Failed())) { if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
return false; return false;
} }
rv = NS_NewNativeLocalFile(NS_ConvertUTF16toUTF8(filePath), rv = NS_NewNativeLocalFile(NS_ConvertUTF16toUTF8(filePath),
true, aPath); true, aPath);
if (NS_WARN_IF(rv.Failed())) { if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
return false; return false;
} }

Просмотреть файл

@ -35,6 +35,7 @@ FileSystemRequestParent::~FileSystemRequestParent()
MOZ_ASSERT(mFileSystem); \ MOZ_ASSERT(mFileSystem); \
mTask = name##TaskParent::Create(mFileSystem, p, this, rv); \ mTask = name##TaskParent::Create(mFileSystem, p, this, rv); \
if (NS_WARN_IF(rv.Failed())) { \ if (NS_WARN_IF(rv.Failed())) { \
rv.SuppressException(); \
return false; \ return false; \
} \ } \
break; \ break; \

Просмотреть файл

@ -150,6 +150,7 @@ FileSystemTaskChildBase::Start()
ErrorResult rv; ErrorResult rv;
FileSystemParams params = GetRequestParams(serialization, rv); FileSystemParams params = GetRequestParams(serialization, rv);
if (NS_WARN_IF(rv.Failed())) { if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
return; return;
} }

Просмотреть файл

@ -365,10 +365,9 @@ GetDirectoryListingTaskParent::IOWork()
nsCOMPtr<nsIFile> currFile = do_QueryInterface(supp); nsCOMPtr<nsIFile> currFile = do_QueryInterface(supp);
MOZ_ASSERT(currFile); MOZ_ASSERT(currFile);
bool isLink, isSpecial, isFile; bool isSpecial, isFile;
if (NS_WARN_IF(NS_FAILED(currFile->IsSymlink(&isLink)) || if (NS_WARN_IF(NS_FAILED(currFile->IsSpecial(&isSpecial))) ||
NS_FAILED(currFile->IsSpecial(&isSpecial))) || isSpecial) {
isLink || isSpecial) {
continue; continue;
} }
if (NS_WARN_IF(NS_FAILED(currFile->IsFile(&isFile)) || if (NS_WARN_IF(NS_FAILED(currFile->IsFile(&isFile)) ||

Просмотреть файл

@ -72,8 +72,8 @@ GetFilesHelper::Create(nsIGlobalObject* aGlobal,
} }
GetFilesHelper::GetFilesHelper(nsIGlobalObject* aGlobal, bool aRecursiveFlag) GetFilesHelper::GetFilesHelper(nsIGlobalObject* aGlobal, bool aRecursiveFlag)
: mGlobal(aGlobal) : GetFilesHelperBase(aRecursiveFlag)
, mRecursiveFlag(aRecursiveFlag) , mGlobal(aGlobal)
, mListingCompleted(false) , mListingCompleted(false)
, mErrorResult(NS_OK) , mErrorResult(NS_OK)
, mMutex("GetFilesHelper::mMutex") , mMutex("GetFilesHelper::mMutex")
@ -259,7 +259,7 @@ GetFilesHelper::RunMainThread()
} }
nsresult nsresult
GetFilesHelper::ExploreDirectory(const nsAString& aDOMPath, nsIFile* aFile) GetFilesHelperBase::ExploreDirectory(const nsAString& aDOMPath, nsIFile* aFile)
{ {
MOZ_ASSERT(!NS_IsMainThread()); MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(aFile); MOZ_ASSERT(aFile);
@ -269,8 +269,13 @@ GetFilesHelper::ExploreDirectory(const nsAString& aDOMPath, nsIFile* aFile)
return NS_OK; return NS_OK;
} }
nsresult rv = AddExploredDirectory(aFile);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsCOMPtr<nsISimpleEnumerator> entries; nsCOMPtr<nsISimpleEnumerator> entries;
nsresult rv = aFile->GetDirectoryEntries(getter_AddRefs(entries)); rv = aFile->GetDirectoryEntries(getter_AddRefs(entries));
if (NS_WARN_IF(NS_FAILED(rv))) { if (NS_WARN_IF(NS_FAILED(rv))) {
return rv; return rv;
} }
@ -292,7 +297,7 @@ GetFilesHelper::ExploreDirectory(const nsAString& aDOMPath, nsIFile* aFile)
bool isLink, isSpecial, isFile, isDir; bool isLink, isSpecial, isFile, isDir;
if (NS_WARN_IF(NS_FAILED(currFile->IsSymlink(&isLink)) || if (NS_WARN_IF(NS_FAILED(currFile->IsSymlink(&isLink)) ||
NS_FAILED(currFile->IsSpecial(&isSpecial))) || NS_FAILED(currFile->IsSpecial(&isSpecial))) ||
isLink || isSpecial) { isSpecial) {
continue; continue;
} }
@ -302,6 +307,11 @@ GetFilesHelper::ExploreDirectory(const nsAString& aDOMPath, nsIFile* aFile)
continue; continue;
} }
// We don't want to explore loops of links.
if (isDir && isLink && !ShouldFollowSymLink(currFile)) {
continue;
}
// The new domPath // The new domPath
nsAutoString domPath; nsAutoString domPath;
domPath.Assign(aDOMPath); domPath.Assign(aDOMPath);
@ -344,6 +354,69 @@ GetFilesHelper::ExploreDirectory(const nsAString& aDOMPath, nsIFile* aFile)
return NS_OK; return NS_OK;
} }
nsresult
GetFilesHelperBase::AddExploredDirectory(nsIFile* aDir)
{
nsresult rv;
#ifdef DEBUG
bool isDir;
rv = aDir->IsDirectory(&isDir);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
MOZ_ASSERT(isDir, "Why are we here?");
#endif
bool isLink;
rv = aDir->IsSymlink(&isLink);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsAutoCString path;
if (!isLink) {
nsAutoString path16;
rv = aDir->GetPath(path16);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
path = NS_ConvertUTF16toUTF8(path16);
} else {
rv = aDir->GetNativeTarget(path);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
}
mExploredDirectories.PutEntry(path);
return NS_OK;
}
bool
GetFilesHelperBase::ShouldFollowSymLink(nsIFile* aDir)
{
#ifdef DEBUG
bool isLink, isDir;
if (NS_WARN_IF(NS_FAILED(aDir->IsSymlink(&isLink)) ||
NS_FAILED(aDir->IsDirectory(&isDir)))) {
return false;
}
MOZ_ASSERT(isLink && isDir, "Why are we here?");
#endif
nsAutoCString targetPath;
if (NS_WARN_IF(NS_FAILED(aDir->GetNativeTarget(targetPath)))) {
return false;
}
return !mExploredDirectories.Contains(targetPath);
}
void void
GetFilesHelper::ResolveOrRejectPromise(Promise* aPromise) GetFilesHelper::ResolveOrRejectPromise(Promise* aPromise)
{ {

Просмотреть файл

@ -11,6 +11,7 @@
#include "mozilla/RefPtr.h" #include "mozilla/RefPtr.h"
#include "nsCycleCollectionTraversalCallback.h" #include "nsCycleCollectionTraversalCallback.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "nsTHashtable.h"
class nsIGlobalObject; class nsIGlobalObject;
@ -36,9 +37,46 @@ protected:
virtual ~GetFilesCallback() {} virtual ~GetFilesCallback() {}
}; };
class GetFilesHelperBase
{
protected:
explicit GetFilesHelperBase(bool aRecursiveFlag)
: mRecursiveFlag(aRecursiveFlag)
{}
virtual ~GetFilesHelperBase() {}
virtual bool
IsCanceled()
{
return false;
}
nsresult
ExploreDirectory(const nsAString& aDOMPath, nsIFile* aFile);
nsresult
AddExploredDirectory(nsIFile* aDirectory);
bool
ShouldFollowSymLink(nsIFile* aDirectory);
bool mRecursiveFlag;
// We populate this array in the I/O thread with the paths of the Files that
// we want to send as result to the promise objects.
struct FileData {
nsString mDomPath;
nsString mRealPath;
};
FallibleTArray<FileData> mTargetPathArray;
nsTHashtable<nsCStringHashKey> mExploredDirectories;
};
// Retrieving the list of files can be very time/IO consuming. We use this // Retrieving the list of files can be very time/IO consuming. We use this
// helper class to do it just once. // helper class to do it just once.
class GetFilesHelper : public Runnable class GetFilesHelper : public Runnable
, public GetFilesHelperBase
{ {
friend class GetFilesHelperParent; friend class GetFilesHelperParent;
@ -69,8 +107,8 @@ protected:
mDirectoryPath = aDirectoryPath; mDirectoryPath = aDirectoryPath;
} }
bool virtual bool
IsCanceled() IsCanceled() override
{ {
MutexAutoLock lock(mMutex); MutexAutoLock lock(mMutex);
return mCanceled; return mCanceled;
@ -94,8 +132,6 @@ protected:
void void
OperationCompleted(); OperationCompleted();
nsresult
ExploreDirectory(const nsAString& aDOMPath, nsIFile* aFile);
void void
ResolveOrRejectPromise(Promise* aPromise); ResolveOrRejectPromise(Promise* aPromise);
@ -104,18 +140,9 @@ protected:
nsCOMPtr<nsIGlobalObject> mGlobal; nsCOMPtr<nsIGlobalObject> mGlobal;
bool mRecursiveFlag;
bool mListingCompleted; bool mListingCompleted;
nsString mDirectoryPath; nsString mDirectoryPath;
// We populate this array in the I/O thread with the paths of the Files that
// we want to send as result to the promise objects.
struct FileData {
nsString mDomPath;
nsString mRealPath;
};
FallibleTArray<FileData> mTargetPathArray;
// This is the real File sequence that we expose via Promises. // This is the real File sequence that we expose via Promises.
Sequence<RefPtr<File>> mFiles; Sequence<RefPtr<File>> mFiles;

Просмотреть файл

@ -223,8 +223,8 @@ GetFilesTaskParent::GetFilesTaskParent(FileSystemBase* aFileSystem,
const FileSystemGetFilesParams& aParam, const FileSystemGetFilesParams& aParam,
FileSystemRequestParent* aParent) FileSystemRequestParent* aParent)
: FileSystemTaskParentBase(aFileSystem, aParam, aParent) : FileSystemTaskParentBase(aFileSystem, aParam, aParent)
, GetFilesHelperBase(aParam.recursiveFlag())
, mDirectoryDOMPath(aParam.domPath()) , mDirectoryDOMPath(aParam.domPath())
, mRecursiveFlag(aParam.recursiveFlag())
{ {
MOZ_ASSERT(XRE_IsParentProcess(), "Only call from parent process!"); MOZ_ASSERT(XRE_IsParentProcess(), "Only call from parent process!");
AssertIsOnBackgroundThread(); AssertIsOnBackgroundThread();
@ -239,16 +239,16 @@ GetFilesTaskParent::GetSuccessRequestResult(ErrorResult& aRv) const
InfallibleTArray<PBlobParent*> blobs; InfallibleTArray<PBlobParent*> blobs;
FallibleTArray<FileSystemFileResponse> inputs; FallibleTArray<FileSystemFileResponse> inputs;
if (!inputs.SetLength(mTargetData.Length(), mozilla::fallible_t())) { if (!inputs.SetLength(mTargetPathArray.Length(), mozilla::fallible_t())) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY); aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
FileSystemFilesResponse response; FileSystemFilesResponse response;
return response; return response;
} }
for (unsigned i = 0; i < mTargetData.Length(); i++) { for (unsigned i = 0; i < mTargetPathArray.Length(); i++) {
FileSystemFileResponse fileData; FileSystemFileResponse fileData;
fileData.realPath() = mTargetData[i].mRealPath; fileData.realPath() = mTargetPathArray[i].mRealPath;
fileData.domPath() = mTargetData[i].mDOMPath; fileData.domPath() = mTargetPathArray[i].mDomPath;
inputs[i] = fileData; inputs[i] = fileData;
} }
@ -278,25 +278,8 @@ GetFilesTaskParent::IOWork()
return NS_OK; return NS_OK;
} }
// Get isDirectory.
rv = ExploreDirectory(mDirectoryDOMPath, mTargetPath);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
return NS_OK;
}
nsresult
GetFilesTaskParent::ExploreDirectory(const nsAString& aDOMPath, nsIFile* aPath)
{
MOZ_ASSERT(XRE_IsParentProcess(),
"Only call from parent process!");
MOZ_ASSERT(!NS_IsMainThread(), "Only call on worker thread!");
MOZ_ASSERT(aPath);
bool isDir; bool isDir;
nsresult rv = aPath->IsDirectory(&isDir); rv = mTargetPath->IsDirectory(&isDir);
if (NS_WARN_IF(NS_FAILED(rv))) { if (NS_WARN_IF(NS_FAILED(rv))) {
return rv; return rv;
} }
@ -305,80 +288,12 @@ GetFilesTaskParent::ExploreDirectory(const nsAString& aDOMPath, nsIFile* aPath)
return NS_ERROR_DOM_FILESYSTEM_TYPE_MISMATCH_ERR; return NS_ERROR_DOM_FILESYSTEM_TYPE_MISMATCH_ERR;
} }
nsCOMPtr<nsISimpleEnumerator> entries; // Get isDirectory.
rv = aPath->GetDirectoryEntries(getter_AddRefs(entries)); rv = ExploreDirectory(mDirectoryDOMPath, mTargetPath);
if (NS_WARN_IF(NS_FAILED(rv))) { if (NS_WARN_IF(NS_FAILED(rv))) {
return rv; return rv;
} }
for (;;) {
bool hasMore = false;
if (NS_WARN_IF(NS_FAILED(entries->HasMoreElements(&hasMore))) || !hasMore) {
break;
}
nsCOMPtr<nsISupports> supp;
if (NS_WARN_IF(NS_FAILED(entries->GetNext(getter_AddRefs(supp))))) {
break;
}
nsCOMPtr<nsIFile> currFile = do_QueryInterface(supp);
MOZ_ASSERT(currFile);
bool isLink, isSpecial, isFile;
if (NS_WARN_IF(NS_FAILED(currFile->IsSymlink(&isLink)) ||
NS_FAILED(currFile->IsSpecial(&isSpecial))) ||
isLink || isSpecial) {
continue;
}
if (NS_WARN_IF(NS_FAILED(currFile->IsFile(&isFile)) ||
NS_FAILED(currFile->IsDirectory(&isDir))) ||
!(isFile || isDir)) {
continue;
}
nsAutoString domPath;
domPath.Assign(aDOMPath);
// This is specific for unix root filesystem.
if (!aDOMPath.EqualsLiteral(FILESYSTEM_DOM_PATH_SEPARATOR_LITERAL)) {
domPath.AppendLiteral(FILESYSTEM_DOM_PATH_SEPARATOR_LITERAL);
}
nsAutoString leafName;
if (NS_WARN_IF(NS_FAILED(currFile->GetLeafName(leafName)))) {
continue;
}
domPath.Append(leafName);
if (isFile) {
FileData data;
data.mDOMPath.Append(domPath);
if (NS_WARN_IF(NS_FAILED(currFile->GetPath(data.mRealPath)))) {
continue;
}
if (!mTargetData.AppendElement(data, fallible)) {
return NS_ERROR_OUT_OF_MEMORY;
}
continue;
}
MOZ_ASSERT(isDir);
if (!mRecursiveFlag) {
continue;
}
// Recursive.
rv = ExploreDirectory(domPath, currFile);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
}
return NS_OK; return NS_OK;
} }

Просмотреть файл

@ -9,6 +9,7 @@
#include "mozilla/dom/Directory.h" #include "mozilla/dom/Directory.h"
#include "mozilla/dom/FileSystemTaskBase.h" #include "mozilla/dom/FileSystemTaskBase.h"
#include "mozilla/dom/GetFilesHelper.h"
#include "mozilla/ErrorResult.h" #include "mozilla/ErrorResult.h"
namespace mozilla { namespace mozilla {
@ -68,6 +69,7 @@ private:
}; };
class GetFilesTaskParent final : public FileSystemTaskParentBase class GetFilesTaskParent final : public FileSystemTaskParentBase
, public GetFilesHelperBase
{ {
public: public:
static already_AddRefed<GetFilesTaskParent> static already_AddRefed<GetFilesTaskParent>
@ -90,20 +92,8 @@ private:
virtual nsresult virtual nsresult
IOWork() override; IOWork() override;
nsresult
ExploreDirectory(const nsAString& aDOMPath, nsIFile* aPath);
nsString mDirectoryDOMPath; nsString mDirectoryDOMPath;
nsCOMPtr<nsIFile> mTargetPath; nsCOMPtr<nsIFile> mTargetPath;
bool mRecursiveFlag;
// We store the fullpath and the dom path of Files.
struct FileData {
nsString mRealPath;
nsString mDOMPath;
};
FallibleTArray<FileData> mTargetData;
}; };
} // namespace dom } // namespace dom

Просмотреть файл

@ -8,8 +8,8 @@
<body> <body>
<input id="inputFileWebkitDirectory" type="file" webkitdirectory></input> <input id="inputFileWebkitDirectory" type="file" webkitdirectory></input>
<input id="inputFileWebkitDirectoryAndDirectory" type="file" webkitdirectory directory></input> <input id="inputFileWebkitDirectoryAndDirectory" type="file" webkitdirectory allowdirs></input>
<input id="inputFileDirectory" type="file" directory></input> <input id="inputFileDirectory" type="file" allowdirs></input>
<input id="inputFileDirectoryChange" type="file" webkitdirectory></input> <input id="inputFileDirectoryChange" type="file" webkitdirectory></input>
<script type="application/javascript;version=1.7"> <script type="application/javascript;version=1.7">

Просмотреть файл

@ -54,8 +54,7 @@ HttpServer::Init(int32_t aPort, bool aHttps, HttpServerListener* aListener)
if (mHttps) { if (mHttps) {
nsCOMPtr<nsILocalCertService> lcs = nsCOMPtr<nsILocalCertService> lcs =
do_CreateInstance("@mozilla.org/security/local-cert-service;1"); do_CreateInstance("@mozilla.org/security/local-cert-service;1");
nsresult rv = lcs->GetOrCreateCert(NS_LITERAL_CSTRING("flyweb"), this, nsresult rv = lcs->GetOrCreateCert(NS_LITERAL_CSTRING("flyweb"), this);
nsILocalCertService::KEY_TYPE_EC);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
NotifyStarted(rv); NotifyStarted(rv);
} }

Просмотреть файл

@ -42,3 +42,9 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
LOCAL_INCLUDES += [ LOCAL_INCLUDES += [
'/dom/system/windows', '/dom/system/windows',
] ]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
if CONFIG['MOZ_GPSD']:
LOCAL_INCLUDES += [
'/dom/system/linux',
]
DEFINES['MOZ_GPSD'] = True

Просмотреть файл

@ -45,6 +45,10 @@ class nsIPrincipal;
#include "GonkGPSGeolocationProvider.h" #include "GonkGPSGeolocationProvider.h"
#endif #endif
#ifdef MOZ_GPSD
#include "GpsdLocationProvider.h"
#endif
#ifdef MOZ_WIDGET_COCOA #ifdef MOZ_WIDGET_COCOA
#include "CoreLocationLocationProvider.h" #include "CoreLocationLocationProvider.h"
#endif #endif
@ -766,6 +770,14 @@ nsresult nsGeolocationService::Init()
mProvider = do_GetService(GONK_GPS_GEOLOCATION_PROVIDER_CONTRACTID); mProvider = do_GetService(GONK_GPS_GEOLOCATION_PROVIDER_CONTRACTID);
#endif #endif
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_GPSD
if (Preferences::GetBool("geo.provider.use_gpsd", false)) {
mProvider = new GpsdLocationProvider();
}
#endif
#endif
#ifdef MOZ_WIDGET_COCOA #ifdef MOZ_WIDGET_COCOA
if (Preferences::GetBool("geo.provider.use_corelocation", true)) { if (Preferences::GetBool("geo.provider.use_corelocation", true)) {
mProvider = new CoreLocationLocationProvider(); mProvider = new CoreLocationLocationProvider();

Просмотреть файл

@ -145,16 +145,9 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLFormElement, NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLFormElement,
nsGenericHTMLElement) nsGenericHTMLElement)
tmp->Clear(); tmp->Clear();
tmp->mExpandoAndGeneration.Unlink(); tmp->mExpandoAndGeneration.OwnerUnlinked();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(HTMLFormElement,
nsGenericHTMLElement)
if (tmp->PreservingWrapper()) {
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mExpandoAndGeneration.expando)
}
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_ADDREF_INHERITED(HTMLFormElement, Element) NS_IMPL_ADDREF_INHERITED(HTMLFormElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLFormElement, Element) NS_IMPL_RELEASE_INHERITED(HTMLFormElement, Element)

Просмотреть файл

@ -120,8 +120,8 @@ public:
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override; virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(HTMLFormElement, NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLFormElement,
nsGenericHTMLElement) nsGenericHTMLElement)
/** /**
* Remove an element from this form's list of elements * Remove an element from this form's list of elements

Просмотреть файл

@ -508,7 +508,9 @@ GetDOMFileOrDirectoryName(const OwningFileOrDirectory& aData,
MOZ_ASSERT(aData.IsDirectory()); MOZ_ASSERT(aData.IsDirectory());
ErrorResult rv; ErrorResult rv;
aData.GetAsDirectory()->GetName(aName, rv); aData.GetAsDirectory()->GetName(aName, rv);
NS_WARN_IF(rv.Failed()); if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
}
} }
} }
@ -2823,8 +2825,7 @@ HTMLInputElement::GetDisplayFileName(nsAString& aValue) const
nsXPIDLString value; nsXPIDLString value;
if (mFilesOrDirectories.IsEmpty()) { if (mFilesOrDirectories.IsEmpty()) {
if ((Preferences::GetBool("dom.input.dirpicker", false) && if ((Preferences::GetBool("dom.input.dirpicker", false) && Allowdirs()) ||
HasAttr(kNameSpaceID_None, nsGkAtoms::directory)) ||
(Preferences::GetBool("dom.webkitBlink.dirPicker.enabled", false) && (Preferences::GetBool("dom.webkitBlink.dirPicker.enabled", false) &&
HasAttr(kNameSpaceID_None, nsGkAtoms::webkitdirectory))) { HasAttr(kNameSpaceID_None, nsGkAtoms::webkitdirectory))) {
nsContentUtils::GetLocalizedString(nsContentUtils::eFORMS_PROPERTIES, nsContentUtils::GetLocalizedString(nsContentUtils::eFORMS_PROPERTIES,
@ -2971,8 +2972,7 @@ HTMLInputElement::GetFiles()
return nullptr; return nullptr;
} }
if (Preferences::GetBool("dom.input.dirpicker", false) && if (Preferences::GetBool("dom.input.dirpicker", false) && Allowdirs() &&
HasAttr(kNameSpaceID_None, nsGkAtoms::directory) &&
(!Preferences::GetBool("dom.webkitBlink.dirPicker.enabled", false) || (!Preferences::GetBool("dom.webkitBlink.dirPicker.enabled", false) ||
!HasAttr(kNameSpaceID_None, nsGkAtoms::webkitdirectory))) { !HasAttr(kNameSpaceID_None, nsGkAtoms::webkitdirectory))) {
return nullptr; return nullptr;
@ -4089,8 +4089,7 @@ HTMLInputElement::MaybeInitPickers(EventChainPostVisitor& aVisitor)
if (target && if (target &&
target->GetParent() == this && target->GetParent() == this &&
target->IsRootOfNativeAnonymousSubtree() && target->IsRootOfNativeAnonymousSubtree() &&
((Preferences::GetBool("dom.input.dirpicker", false) && ((Preferences::GetBool("dom.input.dirpicker", false) && Allowdirs()) ||
HasAttr(kNameSpaceID_None, nsGkAtoms::directory)) ||
(Preferences::GetBool("dom.webkitBlink.dirPicker.enabled", false) && (Preferences::GetBool("dom.webkitBlink.dirPicker.enabled", false) &&
HasAttr(kNameSpaceID_None, nsGkAtoms::webkitdirectory)))) { HasAttr(kNameSpaceID_None, nsGkAtoms::webkitdirectory)))) {
type = FILE_PICKER_DIRECTORY; type = FILE_PICKER_DIRECTORY;
@ -5386,7 +5385,7 @@ HTMLInputElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
if (aAttribute == nsGkAtoms::type || if (aAttribute == nsGkAtoms::type ||
// The presence or absence of the 'directory' attribute determines what // The presence or absence of the 'directory' attribute determines what
// buttons we show for type=file. // buttons we show for type=file.
aAttribute == nsGkAtoms::directory || aAttribute == nsGkAtoms::allowdirs ||
aAttribute == nsGkAtoms::webkitdirectory) { aAttribute == nsGkAtoms::webkitdirectory) {
retval |= nsChangeHint_ReconstructFrame; retval |= nsChangeHint_ReconstructFrame;
} else if (mType == NS_FORM_INPUT_IMAGE && } else if (mType == NS_FORM_INPUT_IMAGE &&

Просмотреть файл

@ -708,14 +708,14 @@ public:
ErrorResult& aRv, int32_t aSelectionStart = -1, ErrorResult& aRv, int32_t aSelectionStart = -1,
int32_t aSelectionEnd = -1); int32_t aSelectionEnd = -1);
bool DirectoryAttr() const bool Allowdirs() const
{ {
return HasAttr(kNameSpaceID_None, nsGkAtoms::directory); return HasAttr(kNameSpaceID_None, nsGkAtoms::allowdirs);
} }
void SetDirectoryAttr(bool aValue, ErrorResult& aRv) void SetAllowdirs(bool aValue, ErrorResult& aRv)
{ {
SetHTMLBoolAttr(nsGkAtoms::directory, aValue, aRv); SetHTMLBoolAttr(nsGkAtoms::allowdirs, aValue, aRv);
} }
bool WebkitDirectoryAttr() const bool WebkitDirectoryAttr() const

Просмотреть файл

@ -32,15 +32,10 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMStringMap)
tmp->mElement->RemoveMutationObserver(tmp); tmp->mElement->RemoveMutationObserver(tmp);
tmp->mElement = nullptr; tmp->mElement = nullptr;
} }
tmp->mExpandoAndGeneration.Unlink(); tmp->mExpandoAndGeneration.OwnerUnlinked();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDOMStringMap) NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsDOMStringMap)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
if (tmp->PreservingWrapper()) {
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mExpandoAndGeneration.expando)
}
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMStringMap) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMStringMap)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY

Просмотреть файл

@ -3674,13 +3674,13 @@ UpgradeSchemaFrom18_0To19_0(mozIStorageConnection* aConnection)
#if !defined(MOZ_B2G) #if !defined(MOZ_B2G)
class NormalJSRuntime; class NormalJSContext;
class UpgradeFileIdsFunction final class UpgradeFileIdsFunction final
: public mozIStorageFunction : public mozIStorageFunction
{ {
RefPtr<FileManager> mFileManager; RefPtr<FileManager> mFileManager;
nsAutoPtr<NormalJSRuntime> mRuntime; nsAutoPtr<NormalJSContext> mContext;
public: public:
UpgradeFileIdsFunction() UpgradeFileIdsFunction()
@ -7832,7 +7832,7 @@ class CreateIndexOp final
{ {
friend class VersionChangeTransaction; friend class VersionChangeTransaction;
class ThreadLocalJSRuntime; class ThreadLocalJSContext;
class UpdateIndexDataValuesFunction; class UpdateIndexDataValuesFunction;
static const unsigned int kBadThreadLocalIndex = static const unsigned int kBadThreadLocalIndex =
@ -7868,19 +7868,18 @@ private:
DoDatabaseWork(DatabaseConnection* aConnection) override; DoDatabaseWork(DatabaseConnection* aConnection) override;
}; };
class NormalJSRuntime class NormalJSContext
{ {
friend class nsAutoPtr<NormalJSRuntime>; friend class nsAutoPtr<NormalJSContext>;
static const JSClass sGlobalClass; static const JSClass sGlobalClass;
static const uint32_t kRuntimeHeapSize = 768 * 1024; static const uint32_t kContextHeapSize = 768 * 1024;
JSRuntime* mRuntime;
JSContext* mContext; JSContext* mContext;
JSObject* mGlobal; JSObject* mGlobal;
public: public:
static NormalJSRuntime* static NormalJSContext*
Create(); Create();
JSContext* JSContext*
@ -7896,20 +7895,19 @@ public:
} }
protected: protected:
NormalJSRuntime() NormalJSContext()
: mRuntime(nullptr) : mContext(nullptr)
, mContext(nullptr)
, mGlobal(nullptr) , mGlobal(nullptr)
{ {
MOZ_COUNT_CTOR(NormalJSRuntime); MOZ_COUNT_CTOR(NormalJSContext);
} }
~NormalJSRuntime() ~NormalJSContext()
{ {
MOZ_COUNT_DTOR(NormalJSRuntime); MOZ_COUNT_DTOR(NormalJSContext);
if (mRuntime) { if (mContext) {
JS_DestroyRuntime(mRuntime); JS_DestroyContext(mContext);
} }
} }
@ -7917,25 +7915,25 @@ protected:
Init(); Init();
}; };
class CreateIndexOp::ThreadLocalJSRuntime final class CreateIndexOp::ThreadLocalJSContext final
: public NormalJSRuntime : public NormalJSContext
{ {
friend class CreateIndexOp; friend class CreateIndexOp;
friend class nsAutoPtr<ThreadLocalJSRuntime>; friend class nsAutoPtr<ThreadLocalJSContext>;
public: public:
static ThreadLocalJSRuntime* static ThreadLocalJSContext*
GetOrCreate(); GetOrCreate();
private: private:
ThreadLocalJSRuntime() ThreadLocalJSContext()
{ {
MOZ_COUNT_CTOR(CreateIndexOp::ThreadLocalJSRuntime); MOZ_COUNT_CTOR(CreateIndexOp::ThreadLocalJSContext);
} }
~ThreadLocalJSRuntime() ~ThreadLocalJSContext()
{ {
MOZ_COUNT_DTOR(CreateIndexOp::ThreadLocalJSRuntime); MOZ_COUNT_DTOR(CreateIndexOp::ThreadLocalJSContext);
} }
}; };
@ -18751,13 +18749,13 @@ UpgradeFileIdsFunction::Init(nsIFile* aFMDirectory,
return rv; return rv;
} }
nsAutoPtr<NormalJSRuntime> runtime(NormalJSRuntime::Create()); nsAutoPtr<NormalJSContext> context(NormalJSContext::Create());
if (NS_WARN_IF(!runtime)) { if (NS_WARN_IF(!context)) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
mFileManager.swap(fileManager); mFileManager.swap(fileManager);
mRuntime = runtime; mContext = context;
return NS_OK; return NS_OK;
} }
@ -18770,7 +18768,7 @@ UpgradeFileIdsFunction::OnFunctionCall(mozIStorageValueArray* aArguments,
MOZ_ASSERT(aArguments); MOZ_ASSERT(aArguments);
MOZ_ASSERT(aResult); MOZ_ASSERT(aResult);
MOZ_ASSERT(mFileManager); MOZ_ASSERT(mFileManager);
MOZ_ASSERT(mRuntime); MOZ_ASSERT(mContext);
PROFILER_LABEL("IndexedDB", PROFILER_LABEL("IndexedDB",
"UpgradeFileIdsFunction::OnFunctionCall", "UpgradeFileIdsFunction::OnFunctionCall",
@ -18794,9 +18792,9 @@ UpgradeFileIdsFunction::OnFunctionCall(mozIStorageValueArray* aArguments,
mFileManager, mFileManager,
&cloneInfo); &cloneInfo);
JSContext* cx = mRuntime->Context(); JSContext* cx = mContext->Context();
JSAutoRequest ar(cx); JSAutoRequest ar(cx);
JSAutoCompartment ac(cx, mRuntime->Global()); JSAutoCompartment ac(cx, mContext->Global());
JS::Rooted<JS::Value> clone(cx); JS::Rooted<JS::Value> clone(cx);
if (NS_WARN_IF(!IDBObjectStore::DeserializeUpgradeValue(cx, cloneInfo, if (NS_WARN_IF(!IDBObjectStore::DeserializeUpgradeValue(cx, cloneInfo,
@ -23826,15 +23824,15 @@ CreateIndexOp::InsertDataFromObjectStore(DatabaseConnection* aConnection)
aConnection->GetStorageConnection(); aConnection->GetStorageConnection();
MOZ_ASSERT(storageConnection); MOZ_ASSERT(storageConnection);
ThreadLocalJSRuntime* runtime = ThreadLocalJSRuntime::GetOrCreate(); ThreadLocalJSContext* context = ThreadLocalJSContext::GetOrCreate();
if (NS_WARN_IF(!runtime)) { if (NS_WARN_IF(!context)) {
IDB_REPORT_INTERNAL_ERR(); IDB_REPORT_INTERNAL_ERR();
return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR; return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
} }
JSContext* cx = runtime->Context(); JSContext* cx = context->Context();
JSAutoRequest ar(cx); JSAutoRequest ar(cx);
JSAutoCompartment ac(cx, runtime->Global()); JSAutoCompartment ac(cx, context->Global());
RefPtr<UpdateIndexDataValuesFunction> updateFunction = RefPtr<UpdateIndexDataValuesFunction> updateFunction =
new UpdateIndexDataValuesFunction(this, aConnection, cx); new UpdateIndexDataValuesFunction(this, aConnection, cx);
@ -23909,7 +23907,7 @@ CreateIndexOp::Init(TransactionBase* aTransaction)
static void static void
Destroy(void* aThreadLocal) Destroy(void* aThreadLocal)
{ {
delete static_cast<ThreadLocalJSRuntime*>(aThreadLocal); delete static_cast<ThreadLocalJSContext*>(aThreadLocal);
} }
}; };
@ -24069,7 +24067,7 @@ CreateIndexOp::DoDatabaseWork(DatabaseConnection* aConnection)
return NS_OK; return NS_OK;
} }
static const JSClassOps sNormalJSRuntimeGlobalClassOps = { static const JSClassOps sNormalJSContextGlobalClassOps = {
/* addProperty */ nullptr, /* addProperty */ nullptr,
/* delProperty */ nullptr, /* delProperty */ nullptr,
/* getProperty */ nullptr, /* getProperty */ nullptr,
@ -24084,24 +24082,22 @@ static const JSClassOps sNormalJSRuntimeGlobalClassOps = {
/* trace */ JS_GlobalObjectTraceHook /* trace */ JS_GlobalObjectTraceHook
}; };
const JSClass NormalJSRuntime::sGlobalClass = { const JSClass NormalJSContext::sGlobalClass = {
"IndexedDBTransactionThreadGlobal", "IndexedDBTransactionThreadGlobal",
JSCLASS_GLOBAL_FLAGS, JSCLASS_GLOBAL_FLAGS,
&sNormalJSRuntimeGlobalClassOps &sNormalJSContextGlobalClassOps
}; };
bool bool
NormalJSRuntime::Init() NormalJSContext::Init()
{ {
MOZ_ASSERT(!IsOnBackgroundThread()); MOZ_ASSERT(!IsOnBackgroundThread());
mRuntime = JS_NewRuntime(kRuntimeHeapSize); mContext = JS_NewContext(kContextHeapSize);
if (NS_WARN_IF(!mRuntime)) { if (NS_WARN_IF(!mContext)) {
return false; return false;
} }
mContext = JS_GetContext(mRuntime);
// Not setting this will cause JS_CHECK_RECURSION to report false positives. // Not setting this will cause JS_CHECK_RECURSION to report false positives.
JS_SetNativeStackQuota(mContext, 128 * sizeof(size_t) * 1024); JS_SetNativeStackQuota(mContext, 128 * sizeof(size_t) * 1024);
@ -24122,46 +24118,46 @@ NormalJSRuntime::Init()
} }
// static // static
NormalJSRuntime* NormalJSContext*
NormalJSRuntime::Create() NormalJSContext::Create()
{ {
MOZ_ASSERT(!IsOnBackgroundThread()); MOZ_ASSERT(!IsOnBackgroundThread());
nsAutoPtr<NormalJSRuntime> newRuntime(new NormalJSRuntime()); nsAutoPtr<NormalJSContext> newContext(new NormalJSContext());
if (NS_WARN_IF(!newRuntime->Init())) { if (NS_WARN_IF(!newContext->Init())) {
return nullptr; return nullptr;
} }
return newRuntime.forget(); return newContext.forget();
} }
// static // static
auto auto
CreateIndexOp:: CreateIndexOp::
ThreadLocalJSRuntime::GetOrCreate() -> ThreadLocalJSRuntime* ThreadLocalJSContext::GetOrCreate() -> ThreadLocalJSContext*
{ {
MOZ_ASSERT(!IsOnBackgroundThread()); MOZ_ASSERT(!IsOnBackgroundThread());
MOZ_ASSERT(CreateIndexOp::kBadThreadLocalIndex != MOZ_ASSERT(CreateIndexOp::kBadThreadLocalIndex !=
CreateIndexOp::sThreadLocalIndex); CreateIndexOp::sThreadLocalIndex);
auto* runtime = static_cast<ThreadLocalJSRuntime*>( auto* context = static_cast<ThreadLocalJSContext*>(
PR_GetThreadPrivate(CreateIndexOp::sThreadLocalIndex)); PR_GetThreadPrivate(CreateIndexOp::sThreadLocalIndex));
if (runtime) { if (context) {
return runtime; return context;
} }
nsAutoPtr<ThreadLocalJSRuntime> newRuntime(new ThreadLocalJSRuntime()); nsAutoPtr<ThreadLocalJSContext> newContext(new ThreadLocalJSContext());
if (NS_WARN_IF(!newRuntime->Init())) { if (NS_WARN_IF(!newContext->Init())) {
return nullptr; return nullptr;
} }
DebugOnly<PRStatus> status = DebugOnly<PRStatus> status =
PR_SetThreadPrivate(CreateIndexOp::sThreadLocalIndex, newRuntime); PR_SetThreadPrivate(CreateIndexOp::sThreadLocalIndex, newContext);
MOZ_ASSERT(status == PR_SUCCESS); MOZ_ASSERT(status == PR_SUCCESS);
return newRuntime.forget(); return newContext.forget();
} }
NS_IMPL_ISUPPORTS(CreateIndexOp::UpdateIndexDataValuesFunction, NS_IMPL_ISUPPORTS(CreateIndexOp::UpdateIndexDataValuesFunction,

Просмотреть файл

@ -345,7 +345,7 @@ function gc()
function scheduleGC() function scheduleGC()
{ {
SpecialPowers.exactGC(window, continueToNextStep); SpecialPowers.exactGC(continueToNextStep);
} }
function workerScript() { function workerScript() {

Просмотреть файл

@ -217,7 +217,7 @@ function gc()
function scheduleGC() function scheduleGC()
{ {
SpecialPowers.exactGC(null, continueToNextStep); SpecialPowers.exactGC(continueToNextStep);
} }
function setTimeout(fun, timeout) { function setTimeout(fun, timeout) {
@ -492,7 +492,7 @@ var SpecialPowers = {
this._getPrefs().clearUserPref(prefName); this._getPrefs().clearUserPref(prefName);
}, },
// Copied (and slightly adjusted) from specialpowersAPI.js // Copied (and slightly adjusted) from specialpowersAPI.js
exactGC: function(win, callback) { exactGC: function(callback) {
let count = 0; let count = 0;
function doPreciseGCandCC() { function doPreciseGCandCC() {

Просмотреть файл

@ -859,6 +859,7 @@ CreateBlobImpl(const nsTArray<BlobData>& aBlobDatas,
} }
if (NS_WARN_IF(rv.Failed())) { if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
return nullptr; return nullptr;
} }
@ -4394,6 +4395,7 @@ BlobParent::RecvGetFilePath(nsString* aFilePath)
ErrorResult rv; ErrorResult rv;
mBlobImpl->GetMozFullPathInternal(filePath, rv); mBlobImpl->GetMozFullPathInternal(filePath, rv);
if (NS_WARN_IF(rv.Failed())) { if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
return false; return false;
} }

Просмотреть файл

@ -1422,7 +1422,8 @@ ContentChild::RecvSetProcessSandbox(const MaybeFileDesc& aBroker)
#endif #endif
int brokerFd = -1; int brokerFd = -1;
if (aBroker.type() == MaybeFileDesc::TFileDescriptor) { if (aBroker.type() == MaybeFileDesc::TFileDescriptor) {
brokerFd = aBroker.get_FileDescriptor().PlatformHandle(); auto fd = aBroker.get_FileDescriptor().ClonePlatformHandle();
brokerFd = fd.release();
// brokerFd < 0 means to allow direct filesystem access, so // brokerFd < 0 means to allow direct filesystem access, so
// make absolutely sure that doesn't happen if the parent // make absolutely sure that doesn't happen if the parent
// didn't intend it. // didn't intend it.

Просмотреть файл

@ -3335,6 +3335,7 @@ ContentParent::RecvGetXPCOMProcessAttributes(bool* aIsOffline,
ErrorResult rv; ErrorResult rv;
aInitialData->Write(jsapi.cx(), init, rv); aInitialData->Write(jsapi.cx(), init, rv);
if (NS_WARN_IF(rv.Failed())) { if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
return false; return false;
} }
} }
@ -4921,9 +4922,9 @@ ContentParent::RecvBackUpXResources(const FileDescriptor& aXSocketFd)
#else #else
MOZ_ASSERT(0 > mChildXSocketFdDup.get(), MOZ_ASSERT(0 > mChildXSocketFdDup.get(),
"Already backed up X resources??"); "Already backed up X resources??");
mChildXSocketFdDup.forget();
if (aXSocketFd.IsValid()) { if (aXSocketFd.IsValid()) {
mChildXSocketFdDup.reset(aXSocketFd.PlatformHandle()); auto rawFD = aXSocketFd.ClonePlatformHandle();
mChildXSocketFdDup.reset(rawFD.release());
} }
#endif #endif
return true; return true;

Просмотреть файл

@ -110,11 +110,13 @@ FilePickerParent::IORunnable::Run()
ErrorResult error; ErrorResult error;
blobImpl->GetSize(error); blobImpl->GetSize(error);
if (NS_WARN_IF(error.Failed())) { if (NS_WARN_IF(error.Failed())) {
error.SuppressException();
continue; continue;
} }
blobImpl->GetLastModified(error); blobImpl->GetLastModified(error);
if (NS_WARN_IF(error.Failed())) { if (NS_WARN_IF(error.Failed())) {
error.SuppressException();
continue; continue;
} }

Просмотреть файл

@ -220,6 +220,7 @@ TabChildBase::DispatchMessageManagerMessage(const nsAString& aMessageName,
ErrorResult rv; ErrorResult rv;
data.Write(cx, json, rv); data.Write(cx, json, rv);
if (NS_WARN_IF(rv.Failed())) { if (NS_WARN_IF(rv.Failed())) {
rv.SuppressException();
return; return;
} }
} }

Просмотреть файл

@ -362,9 +362,11 @@ AudioStream::OpenCubeb(cubeb_stream_params& aParams,
} }
cubeb_stream* stream = nullptr; cubeb_stream* stream = nullptr;
/* Convert from milliseconds to frames. */
uint32_t latency_frames = CubebUtils::GetCubebLatency() * aParams.rate / 1000;
if (cubeb_stream_init(cubebContext, &stream, "AudioStream", if (cubeb_stream_init(cubebContext, &stream, "AudioStream",
nullptr, nullptr, nullptr, &aParams, nullptr, nullptr, nullptr, &aParams,
CubebUtils::GetCubebLatency(), latency_frames,
DataCallback_S, StateCallback_S, this) == CUBEB_OK) { DataCallback_S, StateCallback_S, this) == CUBEB_OK) {
mCubebStream.reset(stream); mCubebStream.reset(stream);
CubebUtils::ReportCubebBackendUsed(); CubebUtils::ReportCubebBackendUsed();

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше