about:startup - address Gavin's review comments. try: -b do -p macosx64 -m none -u all -t tp4

This commit is contained in:
Daniel Brooks 2010-10-25 06:49:42 -05:00
parent 362fafd9da
commit afab208aa5
10 changed files with 139 additions and 25 deletions

View File

@ -111,7 +111,8 @@ nsAppStartup::nsAppStartup() :
mRunning(PR_FALSE),
mShuttingDown(PR_FALSE),
mAttemptingQuit(PR_FALSE),
mRestart(PR_FALSE)
mRestart(PR_FALSE),
mRestoredTimestamp(0)
{ }
@ -521,8 +522,7 @@ nsAppStartup::Observe(nsISupports *aSubject,
EnterLastWindowClosingSurvivalArea();
} else if (!strcmp(aTopic, "xul-window-destroyed")) {
ExitLastWindowClosingSurvivalArea();
} else if ((!strcmp(aTopic, "sessionstore-browser-state-restored")) ||
(!strcmp(aTopic, "sessionstore-windows-restored"))) {
} else if (!strcmp(aTopic, "sessionstore-windows-restored")) {
RecordStartupDuration();
} else if (!strcmp(aTopic, "AddonManager-event")) {
RecordAddonEvent(aData, aSubject);

View File

@ -14,7 +14,7 @@
* The Original Code is the about:startup page.
*
* The Initial Developer of the Original Code is
* Mozilla Corporation.
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
@ -37,11 +37,10 @@
var Cc = Components.classes;
var Ci = Components.interfaces;
Components.utils.import("resource://gre/modules/Services.jsm");
let stringsvc = Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService);
let strings = stringsvc.createBundle("chrome://global/locale/aboutStartup.properties");
let branding = stringsvc.createBundle("chrome://branding/locale/brand.properties");
let strings = Services.strings.createBundle("chrome://global/locale/aboutStartup.properties");
let branding = Services.strings.createBundle("chrome://branding/locale/brand.properties");
let brandShortName = branding.GetStringFromName("brandShortName");
function displayTimestamp(id, µs) document.getElementById(id).textContent = formatstamp(µs);
@ -70,13 +69,12 @@ function extensionMark(x, l) label(green(mark(range(x))), l);
///// First, display the timings from the current startup
let launched, startup, restored;
let runtime = Cc["@mozilla.org/xre/runtime;1"].getService(Ci.nsIXULRuntime);
try {
displayTimestamp("launched", launched = runtime.launchTimestamp);
displayTimestamp("launched", launched = Services.appinfo.launchTimestamp);
} catch(x) { }
displayTimestamp("started", startup = runtime.startupTimestamp);
displayTimestamp("started", startup = Services.appinfo.startupTimestamp);
if (launched)
displayDuration("started", startup - launched);
@ -86,14 +84,10 @@ displayTimestamp("restored", restored = app.restoredTimestamp);
displayDuration("restored", restored - startup);
///// Next, load the database
var file = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties)
.get("ProfD", Components.interfaces.nsIFile);
var file = Services.dirsvc.get("ProfD", Components.interfaces.nsIFile);
file.append("startup.sqlite");
var svc = Components.classes["@mozilla.org/storage/service;1"]
.getService(Components.interfaces.mozIStorageService);
var db = svc.openDatabase(file);
var db = Services.storage.openDatabase(file);
///// set up the graph options
var graph, overview;

View File

@ -15,7 +15,7 @@
- The Original Code is the about:startup page.
-
- The Initial Developer of the Original Code is
- the Mozilla Corporation.
- the Mozilla Foundation.
- Portions created by the Initial Developer are Copyright (C) 2010
- the Initial Developer. All Rights Reserved.
-

View File

@ -2798,8 +2798,9 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<h1><a name="jquery"></a>jQuery License</h1>
<p class="correctme">This license applies to files in the directory
<span class="path">mail/jquery/</span>.<br>
<p class="correctme">This license applies to files in the directories
<span class="path">mail/jquery/</span> and
<span class="path">toolkit/content/jquery/</span>.<br>
Furthermore, the file <span class="path">browser/base/content/tabview/iq.js</span>
incorporates work from jQuery.</p>

View File

@ -228,6 +228,8 @@ var AddonManagerInternal = {
if (gStarted)
return;
this._addNotificationListeners();
let appChanged = undefined;
try {
@ -872,8 +874,6 @@ var AddonManagerInternal = {
*/
_addNotificationListeners: function()
{
const svc = Cc["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService);
function notify(msg, extension)
{
let bag = Cc["@mozilla.org/hash-property-bag;1"]
@ -881,7 +881,7 @@ var AddonManagerInternal = {
bag.setPropertyAsAString("id", extension.id);
bag.setPropertyAsAString("name", extension.name);
bag.setPropertyAsAString("version", extension.version);
svc.notifyObservers(bag, "AddonManager-event", msg);
Services.obs.notifyObservers(bag, "AddonManager-event", msg);
}
this.addAddonListener({ onEnabling: function(extension) { notify("Enabled", extension) },
onDisabling: function(extension) { notify("Disabled", extension) },

View File

@ -1,3 +1,40 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the about:startup page.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Daniel Brooks <db48x@db48x.net>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
h1 {
font-size: 140%;
margin: .5em 0;

View File

@ -1,3 +1,40 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the about:startup page.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Daniel Brooks <db48x@db48x.net>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
h1 {
font-size: 140%;
margin: .5em 0;

View File

@ -1,3 +1,40 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the about:startup page.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Daniel Brooks <db48x@db48x.net>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
h1 {
font-size: 140%;
margin: .5em 0;

View File

@ -845,7 +845,7 @@ NS_IMETHODIMP nsXULAppInfo::GetLaunchTimestamp(PRUint64 *aTimestamp)
*aTimestamp = cached;
return NS_OK;
}
#ifdef XP_UNIX
#if defined(XP_UNIX) && !defined(XP_MACOSX)
FILE *uptime;
long tickspersecond = sysconf(_SC_CLK_TCK);
unsigned long long sec, ssec;
@ -892,10 +892,10 @@ NS_IMETHODIMP nsXULAppInfo::GetLaunchTimestamp(PRUint64 *aTimestamp)
#endif
return NS_OK;
}
return NS_ERROR_FAILURE;
#else
return NS_ERROR_NOT_IMPLEMENTED;
#endif
return NS_ERROR_FAILURE;
}
/* readonly attribute unsigned long startupTimestamp; */

View File

@ -108,7 +108,15 @@ interface nsIXULRuntime : nsISupports
*/
void invalidateCachesOnRestart();
/**
* Recorded timestamp indicating when the operating system began launching the app
*/
readonly attribute unsigned long long launchTimestamp;
/**
* Recorded timestamp indicating when app startup began (essentially XRE_Main)
*/
readonly attribute unsigned long long startupTimestamp;
/**