#403 (#375): last minute perf wins from M1357146 M1363956

This commit is contained in:
Cameron Kaiser 2017-06-17 20:45:26 -07:00
parent 9a87f47d8e
commit 438ff2c96f
2 changed files with 1 additions and 34 deletions

View File

@ -2913,8 +2913,6 @@ ContentPermissionPrompt.prototype = {
var DefaultBrowserCheck = {
get OPTIONPOPUP() { return "defaultBrowserNotificationPopup" },
_setAsDefaultTimer: null,
_setAsDefaultButtonClickStartTime: 0,
closePrompt: function(aNode) {
if (this._notification) {
@ -2937,37 +2935,6 @@ var DefaultBrowserCheck = {
#endif
try {
ShellService.setDefaultBrowser(claimAllTypes, false);
if (this._setAsDefaultTimer) {
this._setAsDefaultTimer.cancel();
}
this._setAsDefaultButtonClickStartTime = Math.floor(Date.now() / 1000);
this._setAsDefaultTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
this._setAsDefaultTimer.init(() => {
let isDefault = false;
let isDefaultError = false;
try {
isDefault = ShellService.isDefaultBrowser(true, false);
} catch (ex) {
isDefaultError = true;
}
let now = Math.floor(Date.now() / 1000);
let runTime = now - this._setAsDefaultButtonClickStartTime;
if (isDefault || runTime > 600) {
this._setAsDefaultTimer.cancel();
this._setAsDefaultTimer = null;
/*
Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS")
.add(runTime);
*/
}
/*
Services.telemetry.getHistogramById("BROWSER_IS_USER_DEFAULT_ERROR")
.add(isDefaultError);
*/
}, 1000, Ci.nsITimer.TYPE_REPEATING_SLACK);
} catch (ex) {
setAsDefaultError = true;
Cu.reportError(ex);

View File

@ -95,7 +95,7 @@ JS_FRIEND_API(JSObject*)
js::UnwrapOneChecked(JSObject* obj, bool stopAtWindowProxy)
{
if (!obj->is<WrapperObject>() ||
MOZ_UNLIKELY(IsWindowProxy(obj) && stopAtWindowProxy))
MOZ_UNLIKELY(stopAtWindowProxy && IsWindowProxy(obj)))
{
return obj;
}