Skip to content

Commit

Permalink
#403 (#375): last minute perf wins from M1357146 M1363956
Browse files Browse the repository at this point in the history
  • Loading branch information
classilla committed Jun 18, 2017
1 parent 9a87f47 commit 438ff2c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 34 deletions.
33 changes: 0 additions & 33 deletions browser/components/nsBrowserGlue.js
Original file line number Diff line number Diff line change
Expand Up @@ -2913,8 +2913,6 @@ ContentPermissionPrompt.prototype = {

var DefaultBrowserCheck = {
get OPTIONPOPUP() { return "defaultBrowserNotificationPopup" },
_setAsDefaultTimer: null,
_setAsDefaultButtonClickStartTime: 0,

closePrompt: function(aNode) {
if (this._notification) {
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion js/src/proxy/Wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 438ff2c

Please sign in to comment.