[or-cvs] [torbutton/master 17/31] Fix crash observer.

mikeperry at torproject.org mikeperry at torproject.org
Tue Jan 4 07:02:19 UTC 2011


Author: Mike Perry <mikeperry-git at fscked.org>
Date: Thu, 23 Dec 2010 17:57:02 -0600
Subject: Fix crash observer.
Commit: e8ad5535ba65c16540b0c364a27fb5b629fb1a68

Was missing some events.
---
 src/chrome.manifest              |    4 +---
 src/components/crash-observer.js |    5 +++++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/chrome.manifest b/src/chrome.manifest
index bad7e56..2425651 100644
--- a/src/chrome.manifest
+++ b/src/chrome.manifest
@@ -97,6 +97,4 @@ category content-policy ContentPolicy @torproject.org/cssblocker;1
 category profile-after-change CookieJarSelector @torproject.org/cookie-jar-selector;1
 category profile-after-change RefSpoofer @torproject.org/torRefSpoofer;1
 category profile-after-change TBSessionBlocker @torproject.org/torbutton-ss-blocker;1
-
-
-
+category profile-after-change CrashObserver @torproject.org/crash-observer;1
diff --git a/src/components/crash-observer.js b/src/components/crash-observer.js
index e5e0d97..39db181 100644
--- a/src/components/crash-observer.js
+++ b/src/components/crash-observer.js
@@ -24,6 +24,7 @@ const kMODULE_CID = Components.ID("06322def-6fde-4c06-aef6-47ae8e799629");
 const TORBUTTON_EXTENSION_UUID = "{E0204BD5-9D31-402B-A99D-A6AA8FFEBDCA}";
 
 function CrashObserver() {
+    dump("Crash observer\n\n\n");
     this._uninstall = false;
     this.logger = Components.classes["@torproject.org/torbutton-logger;1"]
          .getService(Components.interfaces.nsISupports).wrappedJSObject;
@@ -33,6 +34,7 @@ function CrashObserver() {
 
     var observerService = Cc["@mozilla.org/observer-service;1"].
             getService(Ci.nsIObserverService);
+    observerService.addObserver(this, "final-ui-startup", false);
     observerService.addObserver(this, "em-action-requested", false);
     observerService.addObserver(this, "quit-application-granted", false);
 }
@@ -130,6 +132,9 @@ CrashObserver.prototype = {
   classID: kMODULE_CID,
   contractID: kMODULE_CONTRACTID,
 
+  // Hack to get us registered early to observe recovery
+  _xpcom_categories: [{category:"profile-after-change"}],
+
   getInterfaces: function(count) {
     var interfaceList = [nsIClassInfo];
     count.value = interfaceList.length;
-- 
1.7.1




More information about the tor-commits mailing list