Skip to content

Commit

Permalink
merge mozilla-central to autoland. r=merge a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Archaeopteryx committed Aug 24, 2017
2 parents 00c70fd + 4a15875 commit 73eb05c
Show file tree
Hide file tree
Showing 101 changed files with 1,101 additions and 1,000 deletions.
4 changes: 3 additions & 1 deletion accessible/base/AccEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,13 @@ a11y::MakeXPCEvent(AccEvent* aEvent)

if (eventGroup & (1 << AccEvent::eObjectAttrChangedEvent)) {
AccObjectAttrChangedEvent* oac = downcast_accEvent(aEvent);
nsString attribute;
oac->GetAttribute()->ToString(attribute);
xpEvent = new xpcAccObjectAttributeChangedEvent(type,
ToXPC(acc),
ToXPCDocument(doc), domNode,
fromUser,
oac->GetAttribute());
attribute);
return xpEvent.forget();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include "nsIAccessibleEvent.idl"

interface nsIAtom;

/**
* Fired when an attribute of an accessible changes.
*/
Expand All @@ -17,5 +15,5 @@ interface nsIAccessibleObjectAttributeChangedEvent : nsIAccessibleEvent
/**
* Return the accessible attribute that changed.
*/
readonly attribute nsIAtom changedAttribute;
readonly attribute AString changedAttribute;
};
2 changes: 1 addition & 1 deletion accessible/jsat/EventManager.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ this.EventManager.prototype = {
{
let evt = aEvent.QueryInterface(
Ci.nsIAccessibleObjectAttributeChangedEvent);
if (evt.changedAttribute.toString() !== "aria-hidden") {
if (evt.changedAttribute !== "aria-hidden") {
// Only handle aria-hidden attribute change.
break;
}
Expand Down
3 changes: 1 addition & 2 deletions accessible/jsat/Utils.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ this.Utils = { // jshint ignore:line

getMessageManager: function getMessageManager(aBrowser) {
try {
return aBrowser.QueryInterface(Ci.nsIFrameLoaderOwner).
frameLoader.messageManager;
return aBrowser.frameLoader.messageManager;
} catch (x) {
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions accessible/tests/mochitest/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -1745,7 +1745,7 @@ function objAttrChangedChecker(aID, aAttr) {
return;
}

is(event.changedAttribute.toString(), aAttr,
is(event.changedAttribute, aAttr,
"Wrong attribute name of the object attribute changed event.");
};

Expand All @@ -1754,7 +1754,7 @@ function objAttrChangedChecker(aID, aAttr) {
var scEvent = aEvent.QueryInterface(
nsIAccessibleObjectAttributeChangedEvent);
return (aEvent.accessible == getAccessible(this.target)) &&
(scEvent.changedAttribute.toString() == aAttr);
(scEvent.changedAttribute == aAttr);
}
return false;
};
Expand Down
1 change: 0 additions & 1 deletion browser/base/content/aboutaccounts/aboutaccounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ var wrapper = {

let iframe = document.getElementById("remote");
this.iframe = iframe;
this.iframe.QueryInterface(Ci.nsIFrameLoaderOwner);
let docShell = this.iframe.frameLoader.docShell;
docShell.QueryInterface(Ci.nsIWebProgress);
docShell.addProgressListener(this.iframeListener,
Expand Down
18 changes: 7 additions & 11 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5361,17 +5361,13 @@ nsBrowserAccess.prototype = {
: Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID

let referrer = aParams.referrer ? makeURI(aParams.referrer) : null;
let browser = this._openURIInNewTab(aURI, referrer,
aParams.referrerPolicy,
aParams.isPrivate,
isExternal, false,
userContextId, null, aParams.openerBrowser,
aParams.triggeringPrincipal,
aNextTabParentId, aName);
if (browser)
return browser.QueryInterface(Ci.nsIFrameLoaderOwner);

return null;
return this._openURIInNewTab(aURI, referrer,
aParams.referrerPolicy,
aParams.isPrivate,
isExternal, false,
userContextId, null, aParams.openerBrowser,
aParams.triggeringPrincipal,
aNextTabParentId, aName);
},

isTabContentWindow(aWindow) {
Expand Down
1 change: 0 additions & 1 deletion browser/base/content/pageinfo/pageInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ var gBundle;

const PERMISSION_CONTRACTID = "@mozilla.org/permissionmanager;1";
const PREFERENCES_CONTRACTID = "@mozilla.org/preferences-service;1";
const ATOM_CONTRACTID = "@mozilla.org/atom-service;1";

// a number of services I'll need later
// the cache services
Expand Down
6 changes: 3 additions & 3 deletions browser/base/content/tabbrowser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2119,7 +2119,7 @@
if (aParams.remoteType) {
throw new Error("Cannot set opener window on a remote browser!");
}
b.QueryInterface(Ci.nsIFrameLoaderOwner).presetOpenerWindow(aParams.openerWindow);
b.presetOpenerWindow(aParams.openerWindow);
}
if (!aParams.isPreloadBrowser && this.hasAttribute("autocompletepopup")) {
Expand Down Expand Up @@ -4136,7 +4136,7 @@
this.setTabStateNoAction(tab, state);
let browser = tab.linkedBrowser;
let {tabParent} = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
let {tabParent} = browser.frameLoader;
if (state == this.STATE_LOADING) {
this.assert(!this.minimizedOrFullyOccluded);
browser.docShellIsActive = true;
Expand Down Expand Up @@ -4723,7 +4723,7 @@
this.requestedTab = tab;
let browser = this.requestedTab.linkedBrowser;
let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
let fl = browser.frameLoader;
if (fl && fl.tabParent && !this.activeSuppressDisplayport.has(fl.tabParent)) {
fl.tabParent.suppressDisplayport(true);
Expand Down
2 changes: 1 addition & 1 deletion browser/components/sessionstore/SessionStore.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -4756,7 +4756,7 @@ var SessionStoreInternal = {
if (options.tabData.storage) {
for (let origin of Object.getOwnPropertyNames(options.tabData.storage)) {
try {
let {frameLoader} = browser.QueryInterface(Components.interfaces.nsIFrameLoaderOwner);
let {frameLoader} = browser;
if (frameLoader.tabParent) {
let attrs = browser.contentPrincipal.originAttributes;
let dataPrincipal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin);
Expand Down
4 changes: 2 additions & 2 deletions browser/modules/ProcessHangMonitor.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ var ProcessHangMonitor = {
* Find a active hang report for the given <browser> element.
*/
findActiveReport(browser) {
let frameLoader = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
let frameLoader = browser.frameLoader;
for (let report of this._activeReports) {
if (report.isReportForBrowser(frameLoader)) {
return report;
Expand All @@ -237,7 +237,7 @@ var ProcessHangMonitor = {
* Find a paused hang report for the given <browser> element.
*/
findPausedReport(browser) {
let frameLoader = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
let frameLoader = browser.frameLoader;
for (let [report, ] of this._pausedReports) {
if (report.isReportForBrowser(frameLoader)) {
return report;
Expand Down
5 changes: 2 additions & 3 deletions devtools/client/framework/toolbox-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ if (url.search.length > 1) {
throw new Error("Unable to find the targeted iframe to debug");
}

// Need to use a xray and query some interfaces to have
// attributes and behavior expected by devtools codebase
// Need to use a xray to have attributes and behavior expected by
// devtools codebase
iframe = XPCNativeWrapper(iframe);
iframe.QueryInterface(Ci.nsIFrameLoaderOwner);

// Fake a xul:tab object as we don't have one.
// linkedBrowser is the only one attribute being queried by client.getTab
Expand Down
3 changes: 1 addition & 2 deletions devtools/shim/devtools-startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,7 @@ const JsonView = {
// The following code emulates saveBrowser, but:
// - Uses the given blob URL containing the custom contents to save.
// - Obtains the file name from the URL of the document, not the blob.
let persistable = browser.QueryInterface(Ci.nsIFrameLoaderOwner)
.frameLoader.QueryInterface(Ci.nsIWebBrowserPersistable);
let persistable = browser.frameLoader;
persistable.startPersistence(message.data.windowID, {
onDocumentReady(doc) {
let uri = chrome.makeURI(doc.documentURI, doc.characterSet);
Expand Down
26 changes: 20 additions & 6 deletions dom/base/TimeoutManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,20 @@ GetMaxBudget(bool aIsBackground)
return maxBudget > 0 ? TimeDuration::FromMilliseconds(maxBudget)
: TimeDuration::Forever();
}

TimeDuration
GetMinBudget(bool aIsBackground)
{
// The minimum budget is computed by looking up the maximum allowed
// delay and computing how long time it would take to regenerate
// that budget using the regeneration factor. This number is
// expected to be negative.
return TimeDuration::FromMilliseconds(
- gBudgetThrottlingMaxDelay /
std::max(aIsBackground ? gBackgroundBudgetRegenerationFactor
: gForegroundBudgetRegenerationFactor,
1));
}
} // namespace

//
Expand Down Expand Up @@ -205,9 +219,7 @@ TimeoutManager::MinSchedulingDelay() const
mExecutionBudget < TimeDuration()) {
// Only throttle if execution budget is less than 0
double factor = 1.0 / GetRegenerationFactor(mWindow.IsBackgroundInternal());
return TimeDuration::Min(
TimeDuration::FromMilliseconds(gBudgetThrottlingMaxDelay),
TimeDuration::Max(unthrottled, -mExecutionBudget.MultDouble(factor)));
return TimeDuration::Max(unthrottled, -mExecutionBudget.MultDouble(factor));
}
//
return unthrottled;
Expand Down Expand Up @@ -333,9 +345,11 @@ TimeoutManager::UpdateBudget(const TimeStamp& aNow, const TimeDuration& aDuratio
if (BudgetThrottlingEnabled(isBackground)) {
double factor = GetRegenerationFactor(isBackground);
TimeDuration regenerated = (aNow - mLastBudgetUpdate).MultDouble(factor);
// Clamp the budget to the maximum allowed budget.
mExecutionBudget = TimeDuration::Min(
GetMaxBudget(isBackground), mExecutionBudget - aDuration + regenerated);
// Clamp the budget to the range of minimum and maximum allowed budget.
mExecutionBudget = TimeDuration::Max(
GetMinBudget(isBackground),
TimeDuration::Min(GetMaxBudget(isBackground),
mExecutionBudget - aDuration + regenerated));
}
mLastBudgetUpdate = aNow;
}
Expand Down
Loading

0 comments on commit 73eb05c

Please sign in to comment.