From f1317cbb98d62cf31d5c9e48f2705111652ac728 Mon Sep 17 00:00:00 2001 From: Stefan Mirea Date: Wed, 19 Jun 2013 18:25:01 -0700 Subject: [PATCH 1/4] Bug 868306 - Ignoring extensions.%ID%.getAddons.cache.enabled preference for addon submission; r=gps Bug 868306 - Ignoring extensions.%ID%.getAddons.cache.enabled preference for addon submission; r=gps --- services/healthreport/providers.jsm | 7 ------- 1 file changed, 7 deletions(-) diff --git a/services/healthreport/providers.jsm b/services/healthreport/providers.jsm index 85a50c8f29c..701c20339d6 100644 --- a/services/healthreport/providers.jsm +++ b/services/healthreport/providers.jsm @@ -842,13 +842,6 @@ AddonsProvider.prototype = Object.freeze({ continue; } - let optOutPref = "extensions." + addon.id + ".getAddons.cache.enabled"; - if (!this._prefs.get(optOutPref, true)) { - this._log.debug("Ignoring add-on that's opted out of AMO updates: " + - addon.id); - continue; - } - let obj = {}; for (let field of this.COPY_FIELDS) { obj[field] = addon[field]; From da2bce2e44dbaa063cf79433ffd5cf42236f043a Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Thu, 20 Jun 2013 10:43:30 -0700 Subject: [PATCH 2/4] Bug 757408 - Opening debugger hangs completely on large scripts; r=past --- toolkit/devtools/server/actors/script.js | 120 ++++++------------ .../server/tests/unit/testcompatactors.js | 2 +- 2 files changed, 41 insertions(+), 81 deletions(-) diff --git a/toolkit/devtools/server/actors/script.js b/toolkit/devtools/server/actors/script.js index 0cf752b06ed..d5a0c0803fe 100644 --- a/toolkit/devtools/server/actors/script.js +++ b/toolkit/devtools/server/actors/script.js @@ -218,6 +218,8 @@ ThreadActor.prototype = { } packet.why = { type: "attached" }; + this._restoreBreakpoints(); + // Send the response to the attach request now (rather than // returning it), because we're going to start a nested event loop // here. @@ -740,36 +742,23 @@ ThreadActor.prototype = { /** * Get the script and source lists from the debugger. + * + * TODO bug 637572: we should be dealing with sources directly, not inferring + * them through scripts. */ - _discoverScriptsAndSources: function TA__discoverScriptsAndSources() { - let promises = []; - let foundSourceMaps = false; - let scripts = this.dbg.findScripts(); - for (let s of scripts) { - if (s.sourceMapURL && !foundSourceMaps) { - foundSourceMaps = true; - break; - } + _discoverSources: function TA__discoverSources() { + // Only get one script per url. + let scriptsByUrl = {}; + for (let s of this.dbg.findScripts()) { + scriptsByUrl[s.url] = s; } - if (this._options.useSourceMaps && foundSourceMaps) { - for (let s of scripts) { - promises.push(this._addScript(s)); - } - return all(promises); - } - // When source maps are not enabled or not used in the page _addScript is - // synchronous, since it doesn't need to wait for fetching source maps, so - // resolves immediately. This eliminates a huge slowdown in script-heavy - // pages like G+ or chrome debugging, where the GC takes a long time to - // clean up after Promise.all. - for (let s of scripts) { - this._addScriptSync(s); - } - return resolve(null); + + return all([this.sources.sourcesForScript(scriptsByUrl[s]) + for (s of Object.keys(scriptsByUrl))]); }, onSources: function TA_onSources(aRequest) { - return this._discoverScriptsAndSources().then(() => { + return this._discoverSources().then(() => { return { sources: [s.form() for (s of this.sources.iter())] }; @@ -1269,6 +1258,7 @@ ThreadActor.prototype = { */ onNewScript: function TA_onNewScript(aScript, aGlobal) { this._addScript(aScript); + this.sources.sourcesForScript(aScript); }, onNewSource: function TA_onNewSource(aSource) { @@ -1303,37 +1293,12 @@ ThreadActor.prototype = { }, /** - * Add the provided script to the server cache synchronously, without checking - * for any declared source maps. - * - * @param aScript Debugger.Script - * The source script that will be stored. - * @returns true, if the script was added; false otherwise. + * Restore any pre-existing breakpoints to the scripts that we have access to. */ - _addScriptSync: function TA__addScriptSync(aScript) { - if (!this._allowSource(aScript.url)) { - return false; + _restoreBreakpoints: function TA__restoreBreakpoints() { + for (let s of this.dbg.findScripts()) { + this._addScript(s); } - - this.sources.source(aScript.url); - // Set any stored breakpoints. - let existing = this._breakpointStore[aScript.url]; - if (existing) { - let endLine = aScript.startLine + aScript.lineCount - 1; - // Iterate over the lines backwards, so that sliding breakpoints don't - // affect the loop. - for (let line = existing.length - 1; line >= 0; line--) { - let bp = existing[line]; - // Only consider breakpoints that are not already associated with - // scripts, and limit search to the line numbers contained in the new - // script. - if (bp && !bp.actor.scripts.length && - line >= aScript.startLine && line <= endLine) { - this._setBreakpoint(bp); - } - } - } - return true; }, /** @@ -1341,38 +1306,32 @@ ThreadActor.prototype = { * * @param aScript Debugger.Script * The source script that will be stored. - * @returns a promise of true, if the script was added; of false otherwise. + * @returns true, if the script was added; false otherwise. */ _addScript: function TA__addScript(aScript) { if (!this._allowSource(aScript.url)) { - return resolve(false); + return false; } - // TODO bug 637572: we should be dealing with sources directly, not - // inferring them through scripts. - return this.sources.sourcesForScript(aScript).then(() => { - - // Set any stored breakpoints. - let existing = this._breakpointStore[aScript.url]; - if (existing) { - let endLine = aScript.startLine + aScript.lineCount - 1; - // Iterate over the lines backwards, so that sliding breakpoints don't - // affect the loop. - for (let line = existing.length - 1; line >= 0; line--) { - let bp = existing[line]; - // Only consider breakpoints that are not already associated with - // scripts, and limit search to the line numbers contained in the new - // script. - if (bp && !bp.actor.scripts.length && - line >= aScript.startLine && line <= endLine) { - this._setBreakpoint(bp); - } + // Set any stored breakpoints. + let existing = this._breakpointStore[aScript.url]; + if (existing) { + let endLine = aScript.startLine + aScript.lineCount - 1; + // Iterate over the lines backwards, so that sliding breakpoints don't + // affect the loop. + for (let line = existing.length - 1; line >= aScript.startLine; line--) { + let bp = existing[line]; + // Only consider breakpoints that are not already associated with + // scripts, and limit search to the line numbers contained in the new + // script. + if (bp && !bp.actor.scripts.length && line <= endLine) { + this._setBreakpoint(bp); } } - - return true; - }); + } + return true; }, + }; ThreadActor.prototype.requestTypes = { @@ -2638,7 +2597,8 @@ ThreadSources.prototype = { return [ this.source(s, aSourceMap) for (s of aSourceMap.sources) ]; - }, (e) => { + }) + .then(null, (e) => { reportError(e); delete this._sourceMaps[this._normalize(aScript.sourceMapURL, aScript.url)]; delete this._sourceMapsByGeneratedSource[aScript.url]; @@ -2682,7 +2642,7 @@ ThreadSources.prototype = { return this._sourceMaps[aAbsSourceMapURL]; } else { let promise = fetch(aAbsSourceMapURL).then((rawSourceMap) => { - let map = new SourceMapConsumer(rawSourceMap); + let map = new SourceMapConsumer(rawSourceMap); let base = aAbsSourceMapURL.replace(/\/[^\/]+$/, '/'); if (base.indexOf("data:") !== 0) { map.sourceRoot = map.sourceRoot diff --git a/toolkit/devtools/server/tests/unit/testcompatactors.js b/toolkit/devtools/server/tests/unit/testcompatactors.js index 0b778e51e1b..755125e9cf3 100644 --- a/toolkit/devtools/server/tests/unit/testcompatactors.js +++ b/toolkit/devtools/server/tests/unit/testcompatactors.js @@ -30,7 +30,7 @@ function createRootActor() }; actor.thread.requestTypes["scripts"] = function (aRequest) { - return this._discoverScriptsAndSources().then(function () { + return this._discoverSources().then(function () { let scripts = []; for (let s of this.dbg.findScripts()) { if (!s.url) { From 916ce4824c16103e38cba11a559240f0fc94f28f Mon Sep 17 00:00:00 2001 From: Anton Kovalyov Date: Thu, 20 Jun 2013 10:48:25 -0700 Subject: [PATCH 3/4] Bug 863653 - Add hints to profiler [start|stop|show] commands; r=jwalker --- browser/devtools/profiler/cmd-profiler.jsm | 9 ++++++--- .../browser/devtools/gclicommands.properties | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/browser/devtools/profiler/cmd-profiler.jsm b/browser/devtools/profiler/cmd-profiler.jsm index b8454febb4d..e146626c502 100644 --- a/browser/devtools/profiler/cmd-profiler.jsm +++ b/browser/devtools/profiler/cmd-profiler.jsm @@ -68,7 +68,8 @@ gcli.addCommand({ params: [ { name: "name", - type: "string" + type: "string", + manual: gcli.lookup("profilerStartManual") } ], @@ -114,7 +115,8 @@ gcli.addCommand({ params: [ { name: "name", - type: "string" + type: "string", + manual: gcli.lookup("profilerStopManual") } ], @@ -196,7 +198,8 @@ gcli.addCommand({ params: [ { name: "name", - type: "string" + type: "string", + manual: gcli.lookup("profilerShowManual") } ], diff --git a/browser/locales/en-US/chrome/browser/devtools/gclicommands.properties b/browser/locales/en-US/chrome/browser/devtools/gclicommands.properties index 6ff50cf2455..a912170ef1b 100644 --- a/browser/locales/en-US/chrome/browser/devtools/gclicommands.properties +++ b/browser/locales/en-US/chrome/browser/devtools/gclicommands.properties @@ -1209,10 +1209,19 @@ profilerCloseDesc=Close the profiler # of the profiler start command. profilerStartDesc=Start profiling +# LOCALIZATION NOTE (profilerStartManual) A fuller description of the 'profile name' +# parameter. This parameter is used to name a newly created profile or to lookup +# an existing profile by its name. +profilerStartManual=Name of a profile you wish to start. + # LOCALIZATION NOTE (profilerStop) A very short string used to describe the function # of the profiler stop command. profilerStopDesc=Stop profiling +# LOCALIZATION NOTE (profilerStopManual) A fuller description of the 'profile name' +# parameter. This parameter is used to lookup an existing profile by its name. +profilerStopManual=Name of a profile you wish to stop. + # LOCALIZATION NOTE (profilerList) A very short string used to describe the function # of the profiler list command. profilerListDesc=List all profiles @@ -1221,6 +1230,11 @@ profilerListDesc=List all profiles # of the profiler show command. profilerShowDesc=Show individual profile +# LOCALIZATION NOTE (profilerShowManual) A fuller description of the 'profile name' +# parameter. This parameter is used to name a newly created profile or to lookup +# an existing profile by its name. +profilerShowManual=Name of a profile. + # LOCALIZATION NOTE (profilerAlreadyStarted) A message that is displayed whenever # an operation cannot be completed because the profile in question has already # been started. From 31329541e5fbb4938ec979e4d31d6b128fa9afc0 Mon Sep 17 00:00:00 2001 From: Sid Date: Thu, 20 Jun 2013 20:06:14 +0200 Subject: [PATCH 4/4] Bug 884585 - Exclude about:newtab from Recently Closed Tabs list; r=ttaubert --- browser/components/sessionstore/src/SessionStore.jsm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/browser/components/sessionstore/src/SessionStore.jsm b/browser/components/sessionstore/src/SessionStore.jsm index 10af8aa21c4..978340d0ee4 100644 --- a/browser/components/sessionstore/src/SessionStore.jsm +++ b/browser/components/sessionstore/src/SessionStore.jsm @@ -4052,13 +4052,14 @@ let SessionStoreInternal = { * @returns boolean */ _shouldSaveTabState: function ssi_shouldSaveTabState(aTabState) { - // If the tab has only the transient about:blank history entry, no other + // If the tab has only a transient about: history entry, no other // session history, and no userTypedValue, then we don't actually want to // store this tab's data. return aTabState.entries.length && !(aTabState.entries.length == 1 && - aTabState.entries[0].url == "about:blank" && - !aTabState.userTypedValue); + (aTabState.entries[0].url == "about:blank" || + aTabState.entries[0].url == "about:newtab") && + !aTabState.userTypedValue); }, /**