Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tools/xo_bundle/components/nsUpdateServiceStub.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/xo_bundle/components/nsUpdateServiceStub.js')
-rw-r--r--tools/xo_bundle/components/nsUpdateServiceStub.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/tools/xo_bundle/components/nsUpdateServiceStub.js b/tools/xo_bundle/components/nsUpdateServiceStub.js
new file mode 100644
index 0000000..067b113
--- /dev/null
+++ b/tools/xo_bundle/components/nsUpdateServiceStub.js
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+//@line 38 "/builds/slave/linux_build/build/toolkit/mozapps/update/src/nsUpdateServiceStub.js"
+*/
+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";
+//@line 53 "/builds/slave/linux_build/build/toolkit/mozapps/update/src/nsUpdateServiceStub.js"
+
+/**
+//@line 61 "/builds/slave/linux_build/build/toolkit/mozapps/update/src/nsUpdateServiceStub.js"
+ */
+function getUpdateDirNoCreate(pathArray) {
+//@line 72 "/builds/slave/linux_build/build/toolkit/mozapps/update/src/nsUpdateServiceStub.js"
+ 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]);