Bug 1010668 - B2G NFC: Nfc doesn't implement nsIObserver. r=dimi
authorYoshi Huang <allstars.chh@mozilla.com>
Thu, 15 May 2014 12:11:51 +0800
changeset 183236 df44342e527e85e7512df9d3bdc9fed44ea1a723
parent 183235 f415acf18763847af128244fa0c3da3184b1a81c
child 183237 5104adb28589fde822f4a35a6dddb38a45532461
push id26788
push userkwierso@gmail.com
push dateThu, 15 May 2014 22:46:24 +0000
treeherdermozilla-central@827f4dc53387 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdimi
bugs1010668
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1010668 - B2G NFC: Nfc doesn't implement nsIObserver. r=dimi From 48629f7e966c98e2149eb9ec46fa16120d804413 Mon Sep 17 00:00:00 2001 --- dom/system/gonk/Nfc.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
dom/system/gonk/Nfc.js
--- a/dom/system/gonk/Nfc.js
+++ b/dom/system/gonk/Nfc.js
@@ -432,17 +432,17 @@ function Nfc() {
 
 Nfc.prototype = {
 
   classID:   NFC_CID,
   classInfo: XPCOMUtils.generateCI({classID: NFC_CID,
                                     classDescription: "Nfc",
                                     interfaces: [Ci.nsIWorkerHolder]}),
 
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIWorkerHolder]),
+  QueryInterface: XPCOMUtils.generateQI([Ci.nsIWorkerHolder, Ci.nsIObserver]),
 
   _currentSessionId: null,
 
   powerLevel: NFC.NFC_POWER_LEVEL_UNKNOWN,
 
   onerror: function onerror(event) {
     debug("Got an error: " + event.filename + ":" +
           event.lineno + ": " + event.message + "\n");
@@ -631,16 +631,25 @@ Nfc.prototype = {
       default:
         debug("UnSupported : Message Name " + message.name);
         return null;
     }
 
     return null;
   },
 
+  /**
+   * nsIObserver interface methods.
+   */
+  observe: function(subject, topic, data) {
+    if (topic != "profile-after-change") {
+      debug("Should receive 'profile-after-change' only, received " + topic);
+    }
+  },
+
   setConfig: function setConfig(prop) {
     this.sendToWorker("config", prop);
   }
 };
 
 if (NFC_ENABLED) {
   this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Nfc]);
 }