mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backout tests because they're failing on Mac
This commit is contained in:
commit
860c59f147
@ -94,6 +94,10 @@ ifdef NSS_DISABLE_DBM
|
||||
DEFINES += -DNSS_DISABLE_DBM=1
|
||||
endif
|
||||
|
||||
ifdef MOZ_UPDATER
|
||||
DEFINES += -DMOZ_UPDATER=1
|
||||
endif
|
||||
|
||||
ifdef MOZ_PKG_MANIFEST_P
|
||||
MOZ_PKG_MANIFEST = package-manifest
|
||||
|
||||
|
@ -292,7 +292,11 @@
|
||||
@BINPATH@/components/nsSidebar.js
|
||||
@BINPATH@/components/nsExtensionManager.js
|
||||
@BINPATH@/components/nsBlocklistService.js
|
||||
#ifdef MOZ_UPDATER
|
||||
@BINPATH@/components/nsUpdateService.js
|
||||
@BINPATH@/components/nsUpdateServiceStub.js
|
||||
#endif
|
||||
@BINPATH@/components/nsUpdateTimerManager.js
|
||||
@BINPATH@/components/pluginGlue.js
|
||||
@BINPATH@/components/nsSessionStartup.js
|
||||
@BINPATH@/components/nsSessionStore.js
|
||||
|
@ -832,3 +832,7 @@ js3250.dll
|
||||
#ifdef XP_WIN
|
||||
components/brwsrcmp.dll
|
||||
#endif
|
||||
#ifndef MOZ_UPDATER
|
||||
components/nsUpdateService.js
|
||||
components/nsUpdateServiceStub.js
|
||||
#endif
|
||||
|
@ -21,6 +21,7 @@
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alec Flett <alecf@netscape.com>
|
||||
* Mats Palmgren <matspal@gmail.com>
|
||||
*
|
||||
* 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
|
||||
@ -76,7 +77,6 @@ static nsresult pref_InitInitialObjects(void);
|
||||
*/
|
||||
|
||||
nsPrefService::nsPrefService()
|
||||
: mDontWriteUserPrefs(PR_FALSE)
|
||||
{
|
||||
}
|
||||
|
||||
@ -305,10 +305,22 @@ nsresult nsPrefService::UseUserPrefFile()
|
||||
nsresult nsPrefService::MakeBackupPrefFile(nsIFile *aFile)
|
||||
{
|
||||
// Example: this copies "prefs.js" to "Invalidprefs.js" in the same directory.
|
||||
// "Invalidprefs.js" is removed if it exists, prior to making the copy.
|
||||
nsAutoString newFilename;
|
||||
nsresult rv = aFile->GetLeafName(newFilename);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
newFilename.Insert(NS_LITERAL_STRING("Invalid"), 0);
|
||||
nsCOMPtr<nsIFile> newFile;
|
||||
rv = aFile->GetParent(getter_AddRefs(newFile));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = newFile->Append(newFilename);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
PRBool exists = PR_FALSE;
|
||||
newFile->Exists(&exists);
|
||||
if (exists) {
|
||||
rv = newFile->Remove(PR_FALSE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
rv = aFile->CopyTo(nsnull, newFilename);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
return rv;
|
||||
@ -328,7 +340,10 @@ nsresult nsPrefService::ReadAndOwnUserPrefFile(nsIFile *aFile)
|
||||
if (exists) {
|
||||
rv = openPrefFile(mCurrentFile);
|
||||
if (NS_FAILED(rv)) {
|
||||
mDontWriteUserPrefs = NS_FAILED(MakeBackupPrefFile(mCurrentFile));
|
||||
// Save a backup copy of the current (invalid) prefs file, since all prefs
|
||||
// from the error line to the end of the file will be lost (bug 361102).
|
||||
// TODO we should notify the user about it (bug 523725).
|
||||
MakeBackupPrefFile(mCurrentFile);
|
||||
}
|
||||
} else {
|
||||
rv = NS_ERROR_FILE_NOT_FOUND;
|
||||
@ -388,12 +403,6 @@ nsresult nsPrefService::WritePrefFile(nsIFile* aFile)
|
||||
if (!gHashTable.ops)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
// Don't save user prefs if there was an error reading them and we failed
|
||||
// to make a backup copy, since all prefs from the error line to the end of
|
||||
// the file would be lost (bug 361102).
|
||||
if (mDontWriteUserPrefs && aFile == mCurrentFile)
|
||||
return NS_OK;
|
||||
|
||||
// execute a "safe" save by saving through a tempfile
|
||||
rv = NS_NewSafeLocalFileOutputStream(getter_AddRefs(outStreamSink),
|
||||
aFile,
|
||||
|
@ -21,6 +21,7 @@
|
||||
*
|
||||
* Contributor(s):
|
||||
* Brian Nesse <bnesse@netscape.com>
|
||||
* Mats Palmgren <matspal@gmail.com>
|
||||
*
|
||||
* 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
|
||||
@ -77,8 +78,7 @@ protected:
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIPrefBranch2> mRootBranch;
|
||||
nsCOMPtr<nsIFile> mCurrentFile;
|
||||
PRPackedBool mDontWriteUserPrefs;
|
||||
nsCOMPtr<nsIFile> mCurrentFile;
|
||||
};
|
||||
|
||||
#endif // nsPrefService_h__
|
||||
|
@ -87,7 +87,7 @@
|
||||
mime types, file extensions, etc that are required.
|
||||
Use a vertical bar to separate types, end types with \0.
|
||||
FileVersion and ProductVersion are 32bit ints, all other
|
||||
entries are strings the MUST be terminated wwith a \0.
|
||||
entries are strings that MUST be terminated with a \0.
|
||||
|
||||
AN EXAMPLE:
|
||||
|
||||
@ -264,7 +264,7 @@ typedef enum {
|
||||
* compatible with older compilers. To prevent older plugins from
|
||||
* not understanding a new browser's ABI, these masks change the
|
||||
* values of those selectors on those platforms. To remain backwards
|
||||
* compatible with differenet versions of the browser, plugins can
|
||||
* compatible with different versions of the browser, plugins can
|
||||
* use these masks to dynamically determine and use the correct C++
|
||||
* ABI that the browser is expecting. This does not apply to Windows
|
||||
* as Microsoft's COM ABI will likely not change.
|
||||
@ -394,7 +394,7 @@ typedef enum {
|
||||
} NPNURLVariable;
|
||||
|
||||
/*
|
||||
* The type of Tookkit the widgets use
|
||||
* The type of Toolkit the widgets use
|
||||
*/
|
||||
typedef enum {
|
||||
NPNVGtk12 = 1,
|
||||
@ -421,7 +421,7 @@ typedef struct _NPWindow
|
||||
uint32_t height;
|
||||
NPRect clipRect; /* Clipping rectangle in port coordinates */
|
||||
#if defined(XP_UNIX) && !defined(XP_MACOSX)
|
||||
void * ws_info; /* Platform-dependent additonal data */
|
||||
void * ws_info; /* Platform-dependent additional data */
|
||||
#endif /* XP_UNIX */
|
||||
NPWindowType type; /* Is this a window or a drawable? */
|
||||
} NPWindow;
|
||||
|
@ -44,15 +44,20 @@ include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = update
|
||||
|
||||
EXTRA_PP_COMPONENTS = nsUpdateTimerManager.js
|
||||
|
||||
ifdef MOZ_UPDATER
|
||||
DEFINES += -DMOZ_UPDATER
|
||||
DIRS = updater
|
||||
endif
|
||||
|
||||
EXTRA_PP_COMPONENTS += nsUpdateServiceStub.js
|
||||
|
||||
EXTRA_COMPONENTS = nsUpdateService.js
|
||||
GARBAGE += nsUpdateService.js
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
ifdef MOZ_UPDATER
|
||||
nsUpdateService.js: nsUpdateService.js.in
|
||||
$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $^ > $@
|
||||
endif
|
||||
|
File diff suppressed because it is too large
Load Diff
95
toolkit/mozapps/update/src/nsUpdateServiceStub.js
Normal file
95
toolkit/mozapps/update/src/nsUpdateServiceStub.js
Normal file
@ -0,0 +1,95 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
# ***** 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 Update Service Stub.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Mozilla Foundation
|
||||
# Portions created by the Initial Developer are Copyright (C) 2009
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Robert Strong <robert.bugzilla@gmail.com> (Original Author)
|
||||
#
|
||||
# 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 ***** */
|
||||
*/
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/FileUtils.jsm");
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
const DIR_UPDATES = "updates";
|
||||
const FILE_UPDATE_STATUS = "update.status";
|
||||
|
||||
const KEY_APPDIR = "XCurProcD";
|
||||
#ifdef XP_WIN
|
||||
#ifndef WINCE
|
||||
const KEY_UPDROOT = "UpdRootD";
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
# Gets the specified directory at the specified hierarchy under the update root
|
||||
# directory without creating it if it doesn't exist.
|
||||
# @param pathArray
|
||||
# An array of path components to locate beneath the directory
|
||||
# specified by |key|
|
||||
# @return nsIFile object for the location specified.
|
||||
*/
|
||||
function getUpdateDirNoCreate(pathArray) {
|
||||
#ifdef XP_WIN
|
||||
#ifndef WINCE
|
||||
try {
|
||||
let dir = FileUtils.getDir(KEY_UPDROOT, pathArray, false);
|
||||
return dir;
|
||||
} catch (e) {
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return FileUtils.getDir(KEY_APPDIR, pathArray, false);
|
||||
}
|
||||
|
||||
function UpdateServiceStub() {
|
||||
let statusFile = getUpdateDirNoCreate([DIR_UPDATES, "0"]);
|
||||
statusFile.append(FILE_UPDATE_STATUS);
|
||||
// If the update.status file exists then initiate post update processing.
|
||||
if (statusFile.exists()) {
|
||||
let aus = Components.classes["@mozilla.org/updates/update-service;1"].
|
||||
getService(Ci.nsIApplicationUpdateService).
|
||||
QueryInterface(Ci.nsIObserver);
|
||||
aus.observe(null, "post-update-processing", "");
|
||||
}
|
||||
}
|
||||
UpdateServiceStub.prototype = {
|
||||
classDescription: "Update Service Stub",
|
||||
contractID: "@mozilla.org/updates/update-service-stub;1",
|
||||
classID: Components.ID("{e43b0010-04ba-4da6-b523-1f92580bc150}"),
|
||||
_xpcom_categories: [{ category: "profile-after-change" }],
|
||||
QueryInterface: XPCOMUtils.generateQI([])
|
||||
};
|
||||
|
||||
function NSGetModule(compMgr, fileSpec)
|
||||
XPCOMUtils.generateModule([UpdateServiceStub]);
|
272
toolkit/mozapps/update/src/nsUpdateTimerManager.js
Normal file
272
toolkit/mozapps/update/src/nsUpdateTimerManager.js
Normal file
@ -0,0 +1,272 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
# ***** 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 Update timer Manager.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Ben Goodger.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2004
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Ben Goodger <ben@mozilla.org> (Original Author)
|
||||
# Robert Strong <robert.bugzilla@gmail.com>
|
||||
#
|
||||
# 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 *****
|
||||
*/
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
const PREF_APP_UPDATE_LASTUPDATETIME_FMT = "app.update.lastUpdateTime.%ID%";
|
||||
const PREF_APP_UPDATE_TIMER = "app.update.timer";
|
||||
const PREF_APP_UPDATE_LOG = "app.update.log";
|
||||
|
||||
const CATEGORY_UPDATE_TIMER = "update-timer";
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gPref",
|
||||
"@mozilla.org/preferences-service;1",
|
||||
"nsIPrefBranch2");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gConsole",
|
||||
"@mozilla.org/consoleservice;1",
|
||||
"nsIConsoleService");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "gLogEnabled", function tm_gLogEnabled() {
|
||||
return getPref("getBoolPref", PREF_APP_UPDATE_LOG, false);
|
||||
});
|
||||
|
||||
function getObserverService() {
|
||||
return Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
|
||||
}
|
||||
|
||||
/**
|
||||
# Gets a preference value, handling the case where there is no default.
|
||||
# @param func
|
||||
# The name of the preference function to call, on nsIPrefBranch
|
||||
# @param preference
|
||||
# The name of the preference
|
||||
# @param defaultValue
|
||||
# The default value to return in the event the preference has
|
||||
# no setting
|
||||
# @returns The value of the preference, or undefined if there was no
|
||||
# user or default value.
|
||||
*/
|
||||
function getPref(func, preference, defaultValue) {
|
||||
try {
|
||||
return gPref[func](preference);
|
||||
}
|
||||
catch (e) {
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
# Logs a string to the error console.
|
||||
# @param string
|
||||
# The string to write to the error console.
|
||||
*/
|
||||
function LOG(string) {
|
||||
if (gLogEnabled) {
|
||||
dump("*** UTM:SVC " + string + "\n");
|
||||
gConsole.logStringMessage("UTM:SVC " + string);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
# A manager for timers. Manages timers that fire over long periods of time
|
||||
# (e.g. days, weeks, months).
|
||||
# @constructor
|
||||
*/
|
||||
function TimerManager() {
|
||||
getObserverService().addObserver(this, "xpcom-shutdown", false);
|
||||
}
|
||||
TimerManager.prototype = {
|
||||
/**
|
||||
* The Checker Timer
|
||||
*/
|
||||
_timer: null,
|
||||
|
||||
/**
|
||||
# The Checker Timer interval as specified by the app.update.timer pref. If
|
||||
# the app.update.timer pref doesn't exist this will default to 600000.
|
||||
*/
|
||||
_timerInterval: null,
|
||||
|
||||
/**
|
||||
* The set of registered timers.
|
||||
*/
|
||||
_timers: { },
|
||||
|
||||
/**
|
||||
# The amount to fudge the lastUpdateTime where fudge is a random increment of
|
||||
# the update check interval (e.g. some random slice of 10 minutes). When the
|
||||
# time comes to notify a timer or a timer is first registered the timer is
|
||||
# offset by this amount to lessen the number of timers firing at the same
|
||||
# time. this._timerInterval is in milliseconds, whereas the lastUpdateTime is
|
||||
# in seconds so this._timerInterval is divided by 1000.
|
||||
*/
|
||||
get _fudge() {
|
||||
return Math.round(Math.random() * this._timerInterval / 1000);
|
||||
},
|
||||
|
||||
/**
|
||||
* See nsIObserver.idl
|
||||
*/
|
||||
observe: function TM_observe(aSubject, aTopic, aData) {
|
||||
switch (aTopic) {
|
||||
case "profile-after-change":
|
||||
this._start();
|
||||
break;
|
||||
case "xpcom-shutdown":
|
||||
let os = getObserverService();
|
||||
os.removeObserver(this, "xpcom-shutdown");
|
||||
|
||||
// Release everything we hold onto.
|
||||
if (this._timer) {
|
||||
this._timer.cancel();
|
||||
this._timer = null;
|
||||
}
|
||||
for (var timerID in this._timers)
|
||||
delete this._timers[timerID];
|
||||
this._timers = null;
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
_start: function TM__start() {
|
||||
this._timerInterval = getPref("getIntPref", "app.update.timer", 600000);
|
||||
this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
this._timer.initWithCallback(this, this._timerInterval,
|
||||
Ci.nsITimer.TYPE_REPEATING_SLACK);
|
||||
},
|
||||
/**
|
||||
# Called when the checking timer fires.
|
||||
# @param timer
|
||||
# The checking timer that fired.
|
||||
*/
|
||||
notify: function TM_notify(timer) {
|
||||
var prefLastUpdate;
|
||||
var lastUpdateTime;
|
||||
var now = Math.round(Date.now() / 1000);
|
||||
var catMan = Cc["@mozilla.org/categorymanager;1"].
|
||||
getService(Ci.nsICategoryManager);
|
||||
var entries = catMan.enumerateCategory(CATEGORY_UPDATE_TIMER);
|
||||
while (entries.hasMoreElements()) {
|
||||
let entry = entries.getNext().QueryInterface(Ci.nsISupportsCString).data;
|
||||
let value = catMan.getCategoryEntry(CATEGORY_UPDATE_TIMER, entry);
|
||||
let [cid, method, timerID, prefInterval, defaultInterval] = value.split(",");
|
||||
defaultInterval = parseInt(defaultInterval);
|
||||
// cid and method are validated below when calling notify.
|
||||
if (!timerID || !defaultInterval || isNaN(defaultInterval)) {
|
||||
LOG("TimerManager:notify - update-timer category registered" +
|
||||
(cid ? " for " + cid : "") + " without required parameters - " +
|
||||
"skipping");
|
||||
continue;
|
||||
}
|
||||
|
||||
let interval = getPref("getIntPref", prefInterval, defaultInterval);
|
||||
prefLastUpdate = PREF_APP_UPDATE_LASTUPDATETIME_FMT.replace(/%ID%/,
|
||||
timerID);
|
||||
if (gPref.prefHasUserValue(prefLastUpdate)) {
|
||||
lastUpdateTime = gPref.getIntPref(prefLastUpdate);
|
||||
}
|
||||
else {
|
||||
lastUpdateTime = now + this._fudge;
|
||||
gPref.setIntPref(prefLastUpdate, lastUpdateTime);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((now - lastUpdateTime) > interval) {
|
||||
try {
|
||||
Components.classes[cid][method](Ci.nsITimerCallback).notify(timer);
|
||||
LOG("TimerManager:notify - notified " + cid);
|
||||
}
|
||||
catch (e) {
|
||||
LOG("TimerManager:notify - error notifying component id: " +
|
||||
cid + " ,error: " + e);
|
||||
}
|
||||
lastUpdateTime = now + this._fudge;
|
||||
gPref.setIntPref(prefLastUpdate, lastUpdateTime);
|
||||
}
|
||||
}
|
||||
|
||||
for (var timerID in this._timers) {
|
||||
var timerData = this._timers[timerID];
|
||||
|
||||
if ((now - timerData.lastUpdateTime) > timerData.interval) {
|
||||
if (timerData.callback instanceof Ci.nsITimerCallback) {
|
||||
try {
|
||||
timerData.callback.notify(timer);
|
||||
LOG("TimerManager:notify - notified timerID: " + timerID);
|
||||
}
|
||||
catch (e) {
|
||||
LOG("TimerManager:notify - error notifying timerID: " + timerID +
|
||||
", error: " + e);
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG("TimerManager:notify - timerID: " + timerID + " doesn't " +
|
||||
"implement nsITimerCallback - skipping");
|
||||
}
|
||||
lastUpdateTime = now + this._fudge;
|
||||
timerData.lastUpdateTime = lastUpdateTime;
|
||||
prefLastUpdate = PREF_APP_UPDATE_LASTUPDATETIME_FMT.replace(/%ID%/, timerID);
|
||||
gPref.setIntPref(prefLastUpdate, lastUpdateTime);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* See nsIUpdateTimerManager.idl
|
||||
*/
|
||||
registerTimer: function TM_registerTimer(id, callback, interval) {
|
||||
LOG("TimerManager:registerTimer - id: " + id);
|
||||
var prefLastUpdate = PREF_APP_UPDATE_LASTUPDATETIME_FMT.replace(/%ID%/, id);
|
||||
var lastUpdateTime;
|
||||
if (gPref.prefHasUserValue(prefLastUpdate)) {
|
||||
lastUpdateTime = gPref.getIntPref(prefLastUpdate);
|
||||
} else {
|
||||
lastUpdateTime = Math.round(Date.now() / 1000) + this._fudge;
|
||||
gPref.setIntPref(prefLastUpdate, lastUpdateTime);
|
||||
}
|
||||
this._timers[id] = { callback : callback,
|
||||
interval : interval,
|
||||
lastUpdateTime : lastUpdateTime };
|
||||
},
|
||||
|
||||
classDescription: "Timer Manager",
|
||||
contractID: "@mozilla.org/updates/timer-manager;1",
|
||||
classID: Components.ID("{B322A5C0-A419-484E-96BA-D7182163899F}"),
|
||||
_xpcom_categories: [{ category: "profile-after-change" }],
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIUpdateTimerManager,
|
||||
Ci.nsITimerCallback,
|
||||
Ci.nsIObserver])
|
||||
};
|
||||
|
||||
function NSGetModule(compMgr, fileSpec)
|
||||
XPCOMUtils.generateModule([TimerManager]);
|
@ -153,7 +153,7 @@ function setDefaultPrefs() {
|
||||
// pref to false like Firefox does.
|
||||
pb.setBoolPref(PREF_APP_UPDATE_SHOW_INSTALLED_UI, false);
|
||||
// Enable Update logging
|
||||
pb.setBoolPref("app.update.log.all", true);
|
||||
pb.setBoolPref("app.update.log", true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -163,10 +163,12 @@ function setDefaultPrefs() {
|
||||
function startAUS() {
|
||||
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1.0", "2.0");
|
||||
setDefaultPrefs();
|
||||
// Initialize the update service stub component
|
||||
AUS_Cc["@mozilla.org/updates/update-service-stub;1"].
|
||||
createInstance(AUS_Ci.nsISupports);
|
||||
gAUS = AUS_Cc["@mozilla.org/updates/update-service;1"].
|
||||
getService(AUS_Ci.nsIApplicationUpdateService).
|
||||
QueryInterface(AUS_Ci.nsIObserver);
|
||||
gAUS.observe(null, "profile-after-change", "");
|
||||
}
|
||||
|
||||
/* Initializes nsIUpdateChecker */
|
||||
|
Loading…
Reference in New Issue
Block a user