Backout 1dba66cfad9a, ed768b821da1, 23fd9a8d0c9a, 1e90805d96aa, 07425f0e921e (bug 749551) for M3 failures
authorEd Morley <emorley@mozilla.com>
Tue, 03 Jul 2012 11:23:54 +0100
changeset 102984 c86aa20289a4062e7d7540dca6a0a429185f44fb
parent 102983 10fad54737f63d06b17194ee7c780e54df1b99b6
child 102985 f749cea93c54bcad2b252a1fdeca7aa67b138f5f
push id1316
push userakeybl@mozilla.com
push dateMon, 27 Aug 2012 22:37:00 +0000
treeherdermozilla-beta@db4b09302ee2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs749551
milestone16.0a1
backs out1dba66cfad9ab1aac43a7a1dec8f219192f9566b
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
Backout 1dba66cfad9a, ed768b821da1, 23fd9a8d0c9a, 1e90805d96aa, 07425f0e921e (bug 749551) for M3 failures
b2g/app/b2g.js
b2g/chrome/content/shell.js
b2g/installer/package-manifest.in
browser/installer/package-manifest.in
dom/Makefile.in
dom/alarm/AlarmDB.jsm
dom/alarm/AlarmHalService.cpp
dom/alarm/AlarmHalService.h
dom/alarm/AlarmService.jsm
dom/alarm/AlarmsManager.js
dom/alarm/AlarmsManager.manifest
dom/alarm/Makefile.in
dom/alarm/nsIAlarmHalService.idl
dom/alarm/nsIDOMAlarmsManager.idl
dom/alarm/test/Makefile.in
dom/alarm/test/test_alarm_non_permitted_app.html
dom/alarm/test/test_alarm_permitted_app.html
dom/dom-config.mk
hal/Hal.cpp
hal/Hal.h
hal/HalInternal.h
hal/Makefile.in
hal/fallback/FallbackAlarm.cpp
hal/gonk/GonkHal.cpp
hal/sandbox/SandboxHal.cpp
layout/build/Makefile.in
layout/build/nsLayoutModule.cpp
modules/libpref/src/init/all.js
toolkit/toolkit-makefiles.sh
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -373,19 +373,16 @@ pref("dom.ipc.tabs.disabled", false);
 pref("dom.ipc.browser_frames.oop_by_default", false);
 
 // Temporary permission hack for WebSMS
 pref("dom.sms.enabled", true);
 
 // Temporary permission hack for WebContacts
 pref("dom.mozContacts.enabled", true);
 
-// WebAlarms
-pref("dom.mozAlarms.enabled", true);
-
 // WebSettings
 pref("dom.mozSettings.enabled", true);
 
 // Ignore X-Frame-Options headers.
 pref("b2g.ignoreXFrameOptions", true);
 
 // controls if we want camera support
 pref("device.camera.enabled", true);
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -9,17 +9,16 @@ const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
 Cu.import('resource://gre/modules/Services.jsm');
 Cu.import('resource://gre/modules/ContactService.jsm');
 Cu.import('resource://gre/modules/SettingsChangeNotifier.jsm');
 Cu.import('resource://gre/modules/Webapps.jsm');
-Cu.import('resource://gre/modules/AlarmService.jsm');
 
 XPCOMUtils.defineLazyServiceGetter(Services, 'env',
                                    '@mozilla.org/process/environment;1',
                                    'nsIEnvironment');
 
 XPCOMUtils.defineLazyServiceGetter(Services, 'ss',
                                    '@mozilla.org/content/style-sheet-service;1',
                                    'nsIStyleSheetService');
@@ -47,17 +46,17 @@ XPCOMUtils.defineLazyGetter(this, 'Debug
 // until we have a proper security model, add some rights to
 // the pre-installed web applications
 // XXX never grant 'content-camera' to non-gaia apps
 function addPermissions(urls) {
   let permissions = [
     'indexedDB', 'indexedDB-unlimited', 'webapps-manage', 'offline-app', 'pin-app',
     'websettings-read', 'websettings-readwrite',
     'content-camera', 'webcontacts-manage', 'wifi-manage', 'desktop-notification',
-    'geolocation', 'device-storage', 'alarms'
+    'geolocation', 'device-storage'
   ];
   urls.forEach(function(url) {
     url = url.trim();
     let uri = Services.io.newURI(url, null, null);
     let allow = Ci.nsIPermissionManager.ALLOW_ACTION;
 
     permissions.forEach(function(permission) {
       Services.perms.add(uri, permission, allow);
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -156,17 +156,16 @@
 @BINPATH@/components/dom_system_gonk.xpt
 #endif
 @BINPATH@/components/dom_battery.xpt
 #ifdef MOZ_B2G_BT
 @BINPATH@/components/dom_bluetooth.xpt
 #endif
 @BINPATH@/components/dom_canvas.xpt
 @BINPATH@/components/dom_contacts.xpt
-@BINPATH@/components/dom_alarm.xpt
 @BINPATH@/components/dom_core.xpt
 @BINPATH@/components/dom_css.xpt
 @BINPATH@/components/dom_devicestorage.xpt
 @BINPATH@/components/dom_events.xpt
 @BINPATH@/components/dom_file.xpt
 @BINPATH@/components/dom_geolocation.xpt
 @BINPATH@/components/dom_media.xpt
 @BINPATH@/components/dom_network.xpt
@@ -313,18 +312,16 @@
 
 ; JavaScript components
 @BINPATH@/components/ConsoleAPI.manifest
 @BINPATH@/components/ConsoleAPI.js
 @BINPATH@/components/BrowserElementParent.manifest
 @BINPATH@/components/BrowserElementParent.js
 @BINPATH@/components/ContactManager.js
 @BINPATH@/components/ContactManager.manifest
-@BINPATH@/components/AlarmsManager.js
-@BINPATH@/components/AlarmsManager.manifest
 @BINPATH@/components/FeedProcessor.manifest
 @BINPATH@/components/FeedProcessor.js
 @BINPATH@/components/BrowserFeeds.manifest
 @BINPATH@/components/FeedConverter.js
 @BINPATH@/components/FeedWriter.js
 @BINPATH@/components/fuelApplication.manifest
 @BINPATH@/components/fuelApplication.js
 @BINPATH@/components/WebContentConverter.js
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -167,17 +167,16 @@
 @BINPATH@/components/dom_system_gonk.xpt
 #endif
 @BINPATH@/components/dom_battery.xpt
 #ifdef MOZ_B2G_BT
 @BINPATH@/components/dom_bluetooth.xpt
 #endif
 @BINPATH@/components/dom_canvas.xpt
 @BINPATH@/components/dom_contacts.xpt
-@BINPATH@/components/dom_alarm.xpt
 @BINPATH@/components/dom_core.xpt
 @BINPATH@/components/dom_css.xpt
 @BINPATH@/components/dom_devicestorage.xpt
 @BINPATH@/components/dom_events.xpt
 @BINPATH@/components/dom_file.xpt
 @BINPATH@/components/dom_geolocation.xpt
 @BINPATH@/components/dom_media.xpt
 @BINPATH@/components/dom_network.xpt
@@ -467,18 +466,16 @@
 @BINPATH@/components/SettingsManager.manifest
 @BINPATH@/components/Webapps.js
 @BINPATH@/components/Webapps.manifest
 @BINPATH@/components/AppsService.js
 @BINPATH@/components/AppsService.manifest
 
 @BINPATH@/components/ContactManager.js
 @BINPATH@/components/ContactManager.manifest
-@BINPATH@/components/AlarmsManager.js
-@BINPATH@/components/AlarmsManager.manifest
 #ifdef ENABLE_MARIONETTE
 @BINPATH@/chrome/marionette@JAREXT@
 @BINPATH@/chrome/marionette.manifest
 @BINPATH@/components/MarionetteComponents.manifest
 @BINPATH@/components/marionettecomponent.js
 #endif
 
 ; Modules
--- a/dom/Makefile.in
+++ b/dom/Makefile.in
@@ -45,17 +45,16 @@ DIRS += \
 
 DIRS += \
   apps \
   base \
   bindings \
   battery \
   browser-element \
   contacts \
-  alarm \
   devicestorage \
   file \
   media \
   messages \
   power \
   settings \
   sms \
   mms \
deleted file mode 100644
--- a/dom/alarm/AlarmDB.jsm
+++ /dev/null
@@ -1,124 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const EXPORTED_SYMBOLS = ["AlarmDB"];
-
-/* static functions */
-const DEBUG = false;
-
-function debug(aStr) {
-  if (DEBUG)
-    dump("AlarmDB: " + aStr + "\n");
-}
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/IndexedDBHelper.jsm");
-
-const ALARMDB_NAME    = "alarms";
-const ALARMDB_VERSION = 1;
-const ALARMSTORE_NAME = "alarms";
-
-function AlarmDB(aGlobal) {
-  debug("AlarmDB()");
-  this._global = aGlobal;
-}
-
-AlarmDB.prototype = {
-  __proto__: IndexedDBHelper.prototype,
-
-  init: function init(aGlobal) {
-    debug("init()");
-
-    this.initDBHelper(ALARMDB_NAME, ALARMDB_VERSION, ALARMSTORE_NAME, aGlobal);
-  },
-
-  upgradeSchema: function upgradeSchema(aTransaction, aDb, aOldVersion, aNewVersion) {
-    debug("upgradeSchema()");
-
-    let objectStore = aDb.createObjectStore(ALARMSTORE_NAME, { keyPath: "id", autoIncrement: true });
-
-    objectStore.createIndex("date",           "date",           { unique: false });
-    objectStore.createIndex("ignoreTimezone", "ignoreTimezone", { unique: false });
-    objectStore.createIndex("timezoneOffset", "timezoneOffset", { unique: false });
-    objectStore.createIndex("data",           "data",           { unique: false });
-
-    debug("Created object stores and indexes");
-  },
-
-  /**
-   * @param aAlarm
-   *        The record to be added.
-   * @param aSuccessCb
-   *        Callback function to invoke with result ID.
-   * @param aErrorCb [optional]
-   *        Callback function to invoke when there was an error.
-   */
-  add: function add(aAlarm, aSuccessCb, aErrorCb) {
-    debug("add()");
-
-    this.newTxn(
-      "readwrite", 
-      function txnCb(aTxn, aStore) {
-        debug("Going to add " + JSON.stringify(aAlarm));
-        aStore.put(aAlarm).onsuccess = function setTxnResult(aEvent) {
-          aTxn.result = aEvent.target.result;
-          debug("Request successful. New record ID: " + aTxn.result);
-        };
-      },
-      aSuccessCb, 
-      aErrorCb
-    );
-  },
-
-  /**
-   * @param aId
-   *        The ID of record to be removed.
-   * @param aSuccessCb
-   *        Callback function to invoke with result.
-   * @param aErrorCb [optional]
-   *        Callback function to invoke when there was an error.
-   */
-  remove: function remove(aId, aSuccessCb, aErrorCb) {
-    debug("remove()");
-    
-    this.newTxn(
-      "readwrite", 
-      function txnCb(aTxn, aStore) {
-        debug("Going to remove " + aId);
-        aStore.delete(aId);
-      }, 
-      aSuccessCb, 
-      aErrorCb
-    );
-  },
-
-  /**
-   * @param aSuccessCb
-   *        Callback function to invoke with result array.
-   * @param aErrorCb [optional]
-   *        Callback function to invoke when there was an error.
-   */
-  getAll: function getAll(aSuccessCb, aErrorCb) {
-    debug("getAll()");
-
-    this.newTxn(
-      "readonly", 
-      function txnCb(aTxn, aStore) {
-        if (!aTxn.result)
-          aTxn.result = {};
-        
-        aStore.getAll().onsuccess = function setTxnResult(aEvent) {
-          aTxn.result = aEvent.target.result;
-          debug("Request successful. Record count: " + aTxn.result.length);
-        };
-      }, 
-      aSuccessCb, 
-      aErrorCb
-    );
-  }
-};
deleted file mode 100644
--- a/dom/alarm/AlarmHalService.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "AlarmHalService.h"
-
-namespace mozilla {
-namespace dom {
-namespace alarm {
-
-using namespace hal;
-
-NS_IMPL_ISUPPORTS1(AlarmHalService, nsIAlarmHalService)
-
-void
-AlarmHalService::Init()
-{
-  mAlarmEnabled = RegisterTheOneAlarmObserver(this);
-}
-
-/* virtual */ AlarmHalService::~AlarmHalService() 
-{
-  if (mAlarmEnabled) {
-    UnregisterTheOneAlarmObserver();
-  }
-}
-
-/* static */ nsRefPtr<AlarmHalService> AlarmHalService::sSingleton;
-
-/* static */ already_AddRefed<nsIAlarmHalService>
-AlarmHalService::GetInstance()
-{
-  if (!sSingleton) {
-    sSingleton = new AlarmHalService();
-    sSingleton->Init(); 
-    ClearOnShutdown(&sSingleton);
-  }
-
-  nsCOMPtr<nsIAlarmHalService> service(do_QueryInterface(sSingleton));
-  return service.forget();
-}
-
-NS_IMETHODIMP
-AlarmHalService::SetAlarm(PRInt32 aSeconds, PRInt32 aNanoseconds, bool* aStatus)
-{
-  if (!mAlarmEnabled) {
-    return NS_ERROR_FAILURE;
-  }
-
-  bool status = hal::SetAlarm(aSeconds, aNanoseconds);
-
-  if (status) {
-    *aStatus = status;
-    return NS_OK;
-  } else {
-    return NS_ERROR_FAILURE;
-  }
-}
-
-NS_IMETHODIMP
-AlarmHalService::SetAlarmFiredCb(nsIAlarmFiredCb* aAlarmFiredCb)
-{
-  mAlarmFiredCb = aAlarmFiredCb;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-AlarmHalService::SetTimezoneChangedCb(nsITimezoneChangedCb* aTimeZoneChangedCb)
-{
-  mTimezoneChangedCb = aTimeZoneChangedCb;
-  return NS_OK;
-}
-
-void
-AlarmHalService::Notify(const mozilla::void_t& aVoid)
-{
-  if (mAlarmFiredCb) {
-    mAlarmFiredCb->OnAlarmFired();
-  }
-}
-
-PRInt32
-AlarmHalService::GetTimezoneOffset(bool aIgnoreDST)
-{
-  PRExplodedTime prTime;
-  PR_ExplodeTime(PR_Now(), PR_LocalTimeParameters, &prTime);
-
-  PRInt32 offset = prTime.tm_params.tp_gmt_offset;
-  if (!aIgnoreDST) {
-    offset += prTime.tm_params.tp_dst_offset;
-  }
-
-  return -(offset / 60);
-}
-
-} // alarm
-} // dom
-} // mozilla
deleted file mode 100644
--- a/dom/alarm/AlarmHalService.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
-#ifndef mozilla_dom_alarm_AlarmHalService_h
-#define mozilla_dom_alarm_AlarmHalService_h
-
-#include "base/basictypes.h"
-#include "mozilla/ClearOnShutdown.h"
-#include "mozilla/Hal.h"
-#include "mozilla/Services.h"
-#include "nsIAlarmHalService.h"
-#include "nsIObserver.h"
-#include "nsIObserverService.h"
-#include "prtime.h"
-
-namespace mozilla {
-namespace dom {
-namespace alarm {
-
-class AlarmHalService : public nsIAlarmHalService, 
-                        mozilla::hal::AlarmObserver
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIALARMHALSERVICE
-
-  void Init();
-  virtual ~AlarmHalService();
-
-  static nsRefPtr<AlarmHalService> sSingleton;
-  static already_AddRefed<nsIAlarmHalService> GetInstance();
-
-  // Implementing hal::AlarmObserver
-  void Notify(const mozilla::void_t& aVoid);
-
-private:
-  bool mAlarmEnabled;
-  nsCOMPtr<nsIAlarmFiredCb> mAlarmFiredCb;
-
-  // TODO The mTimezoneChangedCb would be called 
-  // when a timezone-changed event is detected 
-  // at run-time. To do so, we can register a 
-  // timezone-changed observer, see bug 714358.
-  // We need to adjust the alarm time respect to
-  // the correct timezone where user is located.
-  nsCOMPtr<nsITimezoneChangedCb> mTimezoneChangedCb;
-
-  PRInt32 GetTimezoneOffset(bool aIgnoreDST);
-};
-
-} // namespace alarm
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_alarm_AlarmHalService_h
deleted file mode 100644
--- a/dom/alarm/AlarmService.jsm
+++ /dev/null
@@ -1,299 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-/* static functions */
-const DEBUG = false;
-
-function debug(aStr) {
-  if (DEBUG)
-    dump("AlarmService: " + aStr + "\n");
-}
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AlarmDB.jsm");
-
-let EXPORTED_SYMBOLS = ["AlarmService"];
-
-XPCOMUtils.defineLazyGetter(this, "ppmm", function() {
-  return Cc["@mozilla.org/parentprocessmessagemanager;1"].getService(Ci.nsIFrameMessageManager);
-});
-
-let myGlobal = this;
-
-let AlarmService = {
-  init: function init() {
-    debug("init()");
-
-    this._currentTimezoneOffset = (new Date()).getTimezoneOffset();
-
-    let alarmHalService = this._alarmHalService = Cc["@mozilla.org/alarmHalService;1"].getService(Ci.nsIAlarmHalService);
-    alarmHalService.setAlarmFiredCb(this._onAlarmFired.bind(this));
-    alarmHalService.setTimezoneChangedCb(this._onTimezoneChanged.bind(this));
-
-    // add the messages to be listened
-    const messages = ["AlarmsManager:GetAll", "AlarmsManager:Add", "AlarmsManager:Remove"];
-    messages.forEach(function addMessage(msgName) {
-        ppmm.addMessageListener(msgName, this);
-    }.bind(this));
-
-    // set the indexeddb database
-    let idbManager = Components.classes["@mozilla.org/dom/indexeddb/manager;1"].getService(Ci.nsIIndexedDatabaseManager);
-    idbManager.initWindowless(myGlobal);
-    this._db = new AlarmDB(myGlobal);
-    this._db.init(myGlobal);
-
-    // variable to save alarms waiting to be set
-    this._alarmQueue = [];
-
-    this._restoreAlarmsFromDb();
-  },
-
-  // getter/setter to access the current alarm set in system
-  _alarm: null,
-  get _currentAlarm() {
-    return this._alarm;
-  },
-  set _currentAlarm(aAlarm) {
-    this._alarm = aAlarm;
-    if (!aAlarm)
-      return;
-
-    if (!this._alarmHalService.setAlarm(this._getAlarmTime(aAlarm) / 1000, 0))
-      throw Components.results.NS_ERROR_FAILURE;
-  },
-
-  receiveMessage: function receiveMessage(aMessage) {
-    debug("receiveMessage(): " + aMessage.name);
-
-    let json = aMessage.json;
-    switch (aMessage.name) {
-      case "AlarmsManager:GetAll":
-        this._db.getAll(
-          function getAllSuccessCb(aAlarms) {
-            debug("Callback after getting alarms from database: " + JSON.stringify(aAlarms));
-            ppmm.sendAsyncMessage(
-              "AlarmsManager:GetAll:Return:OK", 
-              { requestID: json.requestID, alarms: aAlarms }
-            ); 
-          }.bind(this),
-          function getAllErrorCb(aErrorMsg) {
-            ppmm.sendAsyncMessage(
-              "AlarmsManager:GetAll:Return:KO", 
-              { requestID: json.requestID, errorMsg: aErrorMsg }
-            );
-          }.bind(this)
-        );
-        break;
-
-      case "AlarmsManager:Add":
-        // prepare a record for the new alarm to be added
-        let newAlarm = {
-          date: json.date, 
-          ignoreTimezone: json.ignoreTimezone, 
-          timezoneOffset: this._currentTimezoneOffset, 
-          data: json.data
-        };
-
-        this._db.add(
-          newAlarm,
-          function addSuccessCb(aNewId) {
-            debug("Callback after adding alarm in database.");
-
-            newAlarm['id'] = aNewId;
-            let newAlarmTime = this._getAlarmTime(newAlarm);
-
-            if (newAlarmTime <= Date.now()) {
-              debug("Adding a alarm that has past time. Don't set it in system.");
-              this._debugCurrentAlarm();
-              return;
-            }
-
-            // if there is no alarm being set in system, set the new alarm
-            if (this._currentAlarm == null) {
-              this._currentAlarm = newAlarm;
-              this._debugCurrentAlarm();
-              return;
-            }
-
-            // if the new alarm is earlier than the current alarm
-            // swap them and push the previous alarm back to queue
-            let alarmQueue = this._alarmQueue;
-            let currentAlarmTime = this._getAlarmTime(this._currentAlarm);
-            if (newAlarmTime < currentAlarmTime) {
-              alarmQueue.unshift(this._currentAlarm);
-              this._currentAlarm = newAlarm;
-              this._debugCurrentAlarm();
-              return;
-            }
-
-            //push the new alarm in the queue
-            alarmQueue.push(newAlarm);
-            alarmQueue.sort(this._sortAlarmByTimeStamps.bind(this));
-            this._debugCurrentAlarm();
-
-            ppmm.sendAsyncMessage(
-              "AlarmsManager:Add:Return:OK", 
-              { requestID: json.requestID, id: aNewId }
-            );
-          }.bind(this),
-          function addErrorCb(aErrorMsg) {
-            ppmm.sendAsyncMessage(
-              "AlarmsManager:Add:Return:KO", 
-              { requestID: json.requestID, errorMsg: aErrorMsg }
-            );
-          }.bind(this)
-        );
-        break;
-
-      case "AlarmsManager:Remove":
-        this._db.remove(
-          json.id,
-          function removeSuccessCb() {
-            debug("Callback after removing alarm from database.");
-
-            // if there is no alarm being set
-            if (!this._currentAlarm) {
-              this._debugCurrentAlarm();
-              return;
-            }
-
-            // check if the alarm to be removed is in the queue
-            let alarmQueue = this._alarmQueue;
-            if (this._currentAlarm.id != json.id) {
-              for (let i = 0; i < alarmQueue.length; i++) {
-                if (alarmQueue[i].id == json.id) {
-                  alarmQueue.splice(i, 1);
-                  break;
-                }
-              }
-              this._debugCurrentAlarm();
-              return;
-            }
-
-            // the alarm to be removed is the current alarm
-            // reset the next alarm from queue if any
-            if (alarmQueue.length) {
-              this._currentAlarm = alarmQueue.shift();
-              this._debugCurrentAlarm();
-              return;
-            }
-
-            // no alarm waiting to be set in the queue
-            this._currentAlarm = null;
-            this._debugCurrentAlarm();
-          }.bind(this),
-          function removeErrorCb(aErrorMsg) {
-            throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-          }
-        );
-        break;
-
-      default:
-        throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-        break;
-    }
-  },
-
-  _onAlarmFired: function _onAlarmFired() {
-    debug("_onAlarmFired()");
-
-    if (this._currentAlarm) {
-      debug("Fire system intent: " + JSON.stringify(this._currentAlarm));
-      // TODO Fire a system message, see bug 755245
-      this._currentAlarm = null;
-    }
-
-    // reset the next alarm from the queue
-    let nowTime = Date.now();
-    let alarmQueue = this._alarmQueue;
-    while (alarmQueue.length > 0) {
-      let nextAlarm = alarmQueue.shift();
-      let nextAlarmTime = this._getAlarmTime(nextAlarm);
-
-      // if the next alarm has been expired, directly 
-      // fire system intent for it instead of setting it
-      if (nextAlarmTime <= nowTime) {
-        debug("Fire system intent: " + JSON.stringify(nextAlarm));
-        // TODO Fire a system message, see bug 755245
-      } else {
-        this._currentAlarm = nextAlarm;
-        break;
-      }
-    }
-    this._debugCurrentAlarm();
-  },
-
-  _onTimezoneChanged: function _onTimezoneChanged(aTimezoneOffset) {
-    debug("_onTimezoneChanged()");
-
-    this._currentTimezoneOffset = aTimezoneOffset;
-    this._restoreAlarmsFromDb();
-  },
-
-  _restoreAlarmsFromDb: function _restoreAlarmsFromDb() {
-    debug("_restoreAlarmsFromDb()");
-
-    this._db.getAll(
-      function getAllSuccessCb(aAlarms) {
-        debug("Callback after getting alarms from database: " + JSON.stringify(aAlarms));
-
-        // clear any alarms set or queued in the cache
-        let alarmQueue = this._alarmQueue;
-        alarmQueue.length = 0;
-        this._currentAlarm = null;
-        
-        // only add the alarm that is valid
-        let nowTime = Date.now();
-        aAlarms.forEach(function addAlarm(aAlarm) {
-          if (this._getAlarmTime(aAlarm) > nowTime)
-            alarmQueue.push(aAlarm);
-        }.bind(this));
-
-        // set the next alarm from queue
-        if (alarmQueue.length) {
-          alarmQueue.sort(this._sortAlarmByTimeStamps.bind(this));
-          this._currentAlarm = alarmQueue.shift();
-        }
-
-        this._debugCurrentAlarm();
-      }.bind(this),
-      function getAllErrorCb(aErrorMsg) {
-        throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-      }
-    );
-  },
-
-  _getAlarmTime: function _getAlarmTime(aAlarm) {
-    let alarmTime = (new Date(aAlarm.date)).getTime();
-    
-    // For an alarm specified with "ignoreTimezone",
-    // it must be fired respect to the user's timezone.
-    // Supposing an alarm was set at 7:00pm at Tokyo,
-    // it must be gone off at 7:00pm respect to Paris' 
-    // local time when the user is located at Paris.
-    // We can adjust the alarm UTC time by calculating
-    // the difference of the orginal timezone and the 
-    // current timezone.
-    if (aAlarm.ignoreTimezone)
-       alarmTime += (this._currentTimezoneOffset - aAlarm.timezoneOffset) * 60000;
-
-    return alarmTime;
-  },
-
-  _sortAlarmByTimeStamps: function _sortAlarmByTimeStamps(aAlarm1, aAlarm2) {
-    return this._getAlarmTime(aAlarm1) - this._getAlarmTime(aAlarm2);
-  },
-
-  _debugCurrentAlarm: function _debugCurrentAlarm() {
-    debug("Current alarm: " + JSON.stringify(this._currentAlarm));
-    debug("Alarm queue: " + JSON.stringify(this._alarmQueue));
-  },
-}
-
-AlarmService.init();
deleted file mode 100644
--- a/dom/alarm/AlarmsManager.js
+++ /dev/null
@@ -1,159 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-/* static functions */
-const DEBUG = false;
-
-function debug(aStr) {
-  if (DEBUG)
-    dump("AlarmsManager: " + aStr + "\n");
-}
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
-
-const ALARMSMANAGER_CONTRACTID = "@mozilla.org/alarmsManager;1";
-const ALARMSMANAGER_CID        = Components.ID("{fea1e884-9b05-11e1-9b64-87a7016c3860}");
-const nsIDOMMozAlarmsManager   = Ci.nsIDOMMozAlarmsManager;
-const nsIClassInfo             = Ci.nsIClassInfo;
-
-function AlarmsManager()
-{
-  debug("Constructor");
-}
-
-AlarmsManager.prototype = {
-
-  __proto__: DOMRequestIpcHelper.prototype,
-
-  classID : ALARMSMANAGER_CID,
-
-  QueryInterface : XPCOMUtils.generateQI([nsIDOMMozAlarmsManager, Ci.nsIDOMGlobalPropertyInitializer]),
-
-  classInfo : XPCOMUtils.generateCI({ classID: ALARMSMANAGER_CID,
-                                      contractID: ALARMSMANAGER_CONTRACTID,
-                                      classDescription: "AlarmsManager",
-                                      interfaces: [nsIDOMMozAlarmsManager],
-                                      flags: nsIClassInfo.DOM_OBJECT }),
-
-  add: function add(aDate, aRespectTimezone, aData) {
-    debug("add()");
-
-    let isIgnoreTimezone = true;
-    switch (aRespectTimezone) {
-      case "honorTimezone":
-        isIgnoreTimezone = false;
-        break;
-
-      case "ignoreTimezone":
-        isIgnoreTimezone = true;
-        break;
-
-      default:
-        throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-        break;
-    }
-
-    let request = this.createRequest();
-    this._cpmm.sendAsyncMessage(
-      "AlarmsManager:Add", 
-      { requestID: this.getRequestId(request), date: aDate, ignoreTimezone: isIgnoreTimezone, data: aData }
-    );
-    return request;
-  },
-
-  remove: function remove(aId) {
-    debug("remove()");
-
-    return this._cpmm.sendSyncMessage(
-      "AlarmsManager:Remove", 
-      { id: aId }
-    );
-  },
-
-  getAll: function getAll() {
-    debug("getAll()");
-
-    let request = this.createRequest();
-    this._cpmm.sendAsyncMessage(
-      "AlarmsManager:GetAll", 
-      { requestID: this.getRequestId(request) }
-    );
-    return request;
-  },
-
-  receiveMessage: function receiveMessage(aMessage) {
-    debug("receiveMessage(): " + aMessage.name);
-
-    let json = aMessage.json;
-    let request = this.getRequest(json.requestID);
-
-    if (!request) {
-      debug("No request stored! " + json.requestID);
-      return;
-    }
-
-    switch (aMessage.name) {
-      case "AlarmsManager:Add:Return:OK":
-        Services.DOMRequest.fireSuccess(request, json.id);
-        break;
-
-      case "AlarmsManager:GetAll:Return:OK":
-        Services.DOMRequest.fireSuccess(request, json.alarms);
-        break;
-
-      case "AlarmsManager:Add:Return:KO":
-        Services.DOMRequest.fireError(request, json.errorMsg);
-        break;
-
-      case "AlarmsManager:GetAll:Return:KO":
-        Services.DOMRequest.fireError(request, json.errorMsg);
-        break;
-
-      default:
-        debug("Wrong message: " + aMessage.name);
-        break;
-    }
-    this.removeRequest(json.requestID);
-   },
-
-  // nsIDOMGlobalPropertyInitializer implementation
-  init: function init(aWindow) {
-    debug("init()");
-
-    // Set navigator.mozAlarms to null.
-    if (!Services.prefs.getBoolPref("dom.mozAlarms.enabled"))
-      return null;
-
-    let principal = aWindow.document.nodePrincipal;
-    let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(Ci.nsIScriptSecurityManager);
-
-    let perm = principal == secMan.getSystemPrincipal() ? 
-      Ci.nsIPermissionManager.ALLOW_ACTION : Services.perms.testExactPermission(principal.URI, "alarms");
-
-    // Only pages with perm set can use the alarms.
-    this.hasPrivileges = perm == Ci.nsIPermissionManager.ALLOW_ACTION;
-
-    if (!this.hasPrivileges)
-      return null;
-
-    this._cpmm = Cc["@mozilla.org/childprocessmessagemanager;1"].getService(Ci.nsISyncMessageSender);
-
-    // Add the valid messages to be listened.
-    this.initHelper(aWindow, ["AlarmsManager:Add:Return:OK", "AlarmsManager:Add:Return:KO", 
-                              "AlarmsManager:GetAll:Return:OK", "AlarmsManager:GetAll:Return:KO"]);
-  },
-
-  // Called from DOMRequestIpcHelper.
-  uninit: function uninit() {
-    debug("uninit()");
-  },
-}
-
-const NSGetFactory = XPCOMUtils.generateNSGetFactory([AlarmsManager])
deleted file mode 100644
--- a/dom/alarm/AlarmsManager.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-component {fea1e884-9b05-11e1-9b64-87a7016c3860} AlarmsManager.js
-contract @mozilla.org/alarmsManager;1 {fea1e884-9b05-11e1-9b64-87a7016c3860}
-category JavaScript-navigator-property mozAlarms @mozilla.org/alarmsManager;1
deleted file mode 100644
--- a/dom/alarm/Makefile.in
+++ /dev/null
@@ -1,52 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this file,
-# You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH       = ../..
-topsrcdir   = @top_srcdir@
-srcdir      = @srcdir@
-VPATH       = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE              = dom
-XPIDL_MODULE        = dom_alarm
-LIBRARY_NAME        = domalarm_s
-LIBXUL_LIBRARY      = 1
-FORCE_STATIC_LIB    = 1
-GRE_MODULE          = 1
-
-include $(topsrcdir)/dom/dom-config.mk
-
-EXPORTS_NAMESPACES = mozilla/dom/alarm
-
-EXTRA_COMPONENTS =       \
-  AlarmsManager.js       \
-  AlarmsManager.manifest \
-  $(NULL)
-
-EXTRA_JS_MODULES = \
-  AlarmDB.jsm      \
-  AlarmService.jsm \
-  $(NULL)
-
-XPIDLSRCS =               \
-  nsIDOMAlarmsManager.idl \
-  nsIAlarmHalService.idl  \
-  $(NULL)
-
-EXPORTS_mozilla/dom/alarm = \
-  AlarmHalService.h         \
-  $(NULL)
-
-CPPSRCS =             \
-  AlarmHalService.cpp \
-  $(NULL)
-
-ifdef ENABLE_TESTS
-DIRS += test
-endif
-
-include $(topsrcdir)/config/config.mk
-include $(topsrcdir)/ipc/chromium/chromium-config.mk
-include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/dom/alarm/nsIAlarmHalService.idl
+++ /dev/null
@@ -1,33 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-[scriptable, function, uuid(9f3ed2c0-aed9-11e1-8c3d-5310bd393466)]
-interface nsIAlarmFiredCb : nsISupports 
-{
-  void onAlarmFired();
-};
-
-[scriptable, function, uuid(0ca52e84-ba8f-11e1-87e8-63235527db9e)]
-interface nsITimezoneChangedCb : nsISupports 
-{
-  void onTimezoneChanged(in long aTimezoneOffset);
-};
-
-%{C++
-#define NS_ALARMHALSERVICE_CID { 0x7dafea4c, 0x7163, 0x4b70, { 0x95, 0x4e, 0x5a, 0xd4, 0x09, 0x94, 0x83, 0xd7 } }
-#define ALARMHALSERVICE_CONTRACTID "@mozilla.org/alarmHalService;1"
-%}
-
-[scriptable, builtinclass, uuid(057b1ee4-f696-486d-bd55-205e21e88fab)]
-interface nsIAlarmHalService : nsISupports
-{
-  bool setAlarm(in long aSeconds, in long aNanoseconds);
-  void setAlarmFiredCb(in nsIAlarmFiredCb aAlarmFiredCb);
-  void setTimezoneChangedCb(in nsITimezoneChangedCb aTimezoneChangedCb);
-};
-
-
-
deleted file mode 100644
--- a/dom/alarm/nsIDOMAlarmsManager.idl
+++ /dev/null
@@ -1,15 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "domstubs.idl"
-
-interface nsIDOMDOMRequest;
-
-[scriptable, uuid(fea1e884-9b05-11e1-9b64-87a7016c3860)]
-interface nsIDOMMozAlarmsManager : nsISupports
-{
-  nsIDOMDOMRequest getAll();
-  nsIDOMDOMRequest add(in jsval date, in DOMString respectTimezone, [optional] in jsval data);
-  void remove(in unsigned long id);
-};
deleted file mode 100644
--- a/dom/alarm/test/Makefile.in
+++ /dev/null
@@ -1,25 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this file,
-# You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH            = ../../..
-topsrcdir        = @top_srcdir@
-srcdir           = @srcdir@
-VPATH            = @srcdir@
-
-relativesrcdir   = dom/alarm/test
-
-include $(DEPTH)/config/autoconf.mk
-
-DIRS = \
-  $(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
-_TEST_FILES = \
-  test_alarm_permitted_app.html \
-  test_alarm_non_permitted_app.html \
-  $(NULL)
-
-libs:: $(_TEST_FILES)
-	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
deleted file mode 100644
--- a/dom/alarm/test/test_alarm_non_permitted_app.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test Non-Permitted Application for Alarm API</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript">
-
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-
-SpecialPowers.pushPrefEnv({"set": [["dom.mozAlarms.enabled", true]]}, function() {
-  SpecialPowers.removePermission("alarms", document);
-
-  var mozAlarms = navigator.mozAlarms;
-
-  ok('mozAlarms' in navigator, "navigator.mozAlarms should exist");
-  is(mozAlarms, null, "navigator.mozAlarms should return null");
-
-  SimpleTest.finish();
-});
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/alarm/test/test_alarm_permitted_app.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test Permitted Application for Alarm API</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript">
-
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-
-SpecialPowers.pushPrefEnv({"set": [["dom.mozAlarms.enabled", true]]}, function() {
-  SpecialPowers.addPermission("alarms", true, document);
-
-  var mozAlarms = navigator.mozAlarms;
-
-  ok('mozAlarms' in navigator, "navigator.mozAlarms should exist");
-  ok(mozAlarms, "navigator.mozAlarms should return an object");
-  ok(mozAlarms instanceof Components.interfaces.nsIDOMMozAlarmsManager,
-    "navigator.mozAlarms should be an nsIDOMMozAlarmsManager object");
-
-  SpecialPowers.removePermission("alarms", document);
-  SimpleTest.finish();
-});
-
-</script>
-</pre>
-</body>
-</html>
--- a/dom/dom-config.mk
+++ b/dom/dom-config.mk
@@ -7,17 +7,16 @@ DOM_SRCDIRS = \
   dom/battery \
   dom/file \
   dom/power \
   dom/media \
   dom/network/src \
   dom/settings \
   dom/sms/src \
   dom/contacts \
-  dom/alarm \
   dom/src/events \
   dom/src/storage \
   dom/src/offline \
   dom/src/geolocation \
   dom/src/notification \
   dom/workers \
   content/xbl/src \
   content/xul/document/src \
--- a/hal/Hal.cpp
+++ b/hal/Hal.cpp
@@ -684,47 +684,10 @@ NotifySwitchChange(const hal::SwitchEven
   // first. We should check if this pointer is valid.
   if (!sSwitchObserverLists)
     return;
 
   SwitchObserverList& observer = GetSwitchObserverList(aEvent.device());
   observer.Broadcast(aEvent);
 }
 
-static AlarmObserver* sAlarmObserver;
-
-bool
-RegisterTheOneAlarmObserver(AlarmObserver* aObserver)
-{
-  MOZ_ASSERT(!InSandbox());
-  MOZ_ASSERT(!sAlarmObserver);
-
-  sAlarmObserver = aObserver;
-  RETURN_PROXY_IF_SANDBOXED(EnableAlarm());
-}
-
-void
-UnregisterTheOneAlarmObserver()
-{
-  if (sAlarmObserver) {
-    sAlarmObserver = NULL;
-    PROXY_IF_SANDBOXED(DisableAlarm());
-  }
-}
-
-void
-NotifyAlarmFired()
-{
-  if (sAlarmObserver) {
-    sAlarmObserver->Notify(void_t());
-  }
-}
-
-bool
-SetAlarm(long aSeconds, long aNanoseconds)
-{
-  // It's pointless to program an alarm nothing is going to observe ...
-  MOZ_ASSERT(sAlarmObserver);
-  RETURN_PROXY_IF_SANDBOXED(SetAlarm(aSeconds, aNanoseconds));
-}
-
 } // namespace hal
 } // namespace mozilla
--- a/hal/Hal.h
+++ b/hal/Hal.h
@@ -37,17 +37,16 @@ class nsIDOMWindow;
 
 namespace mozilla {
 
 template <class T>
 class Observer;
 
 namespace hal {
 
-typedef Observer<void_t> AlarmObserver;
 typedef Observer<ScreenConfiguration> ScreenConfigurationObserver;
 
 class WindowIdentifier;
 
 extern PRLogModuleInfo *sHalLog;
 #define HAL_LOG(msg) PR_LOG(mozilla::hal::sHalLog, PR_LOG_DEBUG, msg)
 
 } // namespace hal
@@ -362,51 +361,16 @@ void UnregisterSwitchObserver(hal::Switc
  */
 void NotifySwitchChange(const hal::SwitchEvent& aEvent);
 
 /**
  * Get current switch information.
  */
 hal::SwitchState GetCurrentSwitchState(hal::SwitchDevice aDevice);
 
-/**
- * Register an observer that is notified when a programmed alarm
- * expires.
- *
- * Currently, there can only be 0 or 1 alarm observers.
- */
-bool RegisterTheOneAlarmObserver(hal::AlarmObserver* aObserver);
-
-/**
- * Unregister the alarm observer.  Doing so will implicitly cancel any
- * programmed alarm.
- */
-void UnregisterTheOneAlarmObserver();
-
-/**
- * Notify that the programmed alarm has expired.
- *
- * This API is internal to hal; clients shouldn't call it directly.
- */
-void NotifyAlarmFired();
-
-/**
- * Program the real-time clock to expire at the time |aSeconds|,
- * |aNanoseconds|.  These specify a point in real time relative to the
- * UNIX epoch.  The alarm will fire at this time point even if the
- * real-time clock is changed; that is, this alarm respects changes to
- * the real-time clock.  Return true iff the alarm was programmed.
- *
- * The alarm can be reprogrammed at any time.
- *
- * This API is currently only allowed to be used from non-sandboxed
- * contexts.
- */
-bool SetAlarm(long aSeconds, long aNanoseconds);
-
 } // namespace MOZ_HAL_NAMESPACE
 } // namespace mozilla
 
 #ifdef MOZ_DEFINED_HAL_NAMESPACE
 # undef MOZ_DEFINED_HAL_NAMESPACE
 # undef MOZ_HAL_NAMESPACE
 #endif
 
--- a/hal/HalInternal.h
+++ b/hal/HalInternal.h
@@ -59,22 +59,12 @@ void DisableScreenConfigurationNotificat
  */
 void EnableSwitchNotifications(hal::SwitchDevice aDevice);
 
 /**
  * Disable switch notifications from the backend
  */
 void DisableSwitchNotifications(hal::SwitchDevice aDevice);
 
-/**
- * Enable alarm notifications from the backend.
- */
-bool EnableAlarm();
-
-/**
- * Disable alarm notifications from the backend.
- */
-void DisableAlarm();
-
 } // namespace MOZ_HAL_NAMESPACE
 } // namespace mozilla
 
 #endif  // mozilla_HalInternal_h
--- a/hal/Makefile.in
+++ b/hal/Makefile.in
@@ -42,81 +42,75 @@ CPPSRCS = \
   HalWakeLock.cpp \
   $(NULL)
 
 ifeq (android,$(MOZ_WIDGET_TOOLKIT))
 CPPSRCS += \
   AndroidHal.cpp \
   AndroidSensor.cpp \
   FallbackPower.cpp \
-  FallbackAlarm.cpp \
   $(NULL)
 else ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
 CPPSRCS += \
   GonkHal.cpp \
   LinuxPower.cpp \
   GonkSensor.cpp \
   UeventPoller.cpp \
   GonkSwitch.cpp \
   $(NULL)
 else ifeq (Linux,$(OS_TARGET))
 CPPSRCS += \
   LinuxPower.cpp \
   FallbackScreenConfiguration.cpp \
   FallbackSensor.cpp \
   FallbackVibration.cpp \
-  FallbackAlarm.cpp \
   $(NULL)
 ifdef MOZ_ENABLE_DBUS
 CPPSRCS += UPowerClient.cpp
 else
 CPPSRCS += FallbackBattery.cpp
 endif
 else ifeq (WINNT,$(OS_TARGET))
 CPPSRCS += \
   WindowsBattery.cpp \
   WindowsSensor.cpp \
   FallbackVibration.cpp \
   FallbackScreenConfiguration.cpp \
   FallbackPower.cpp \
-  FallbackAlarm.cpp \
   $(NULL)
 else ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 CPPSRCS += \
   FallbackBattery.cpp \
   FallbackVibration.cpp \
   FallbackPower.cpp \
   FallbackScreenConfiguration.cpp \
-  FallbackAlarm.cpp \
   $(NULL)
 CMMSRCS += \
   CocoaSensor.mm \
   smslib.mm \
   $(NULL)
 else ifneq (,$(filter OpenBSD NetBSD FreeBSD DragonFlyBSD,$(OS_TARGET)))
 CPPSRCS += \
   FallbackSensor.cpp \
   FallbackVibration.cpp \
   FallbackPower.cpp \
   FallbackScreenConfiguration.cpp \
-  FallbackAlarm.cpp \
   $(NULL)
 ifdef MOZ_ENABLE_DBUS
 CPPSRCS += UPowerClient.cpp
 else
 CPPSRCS += FallbackBattery.cpp
 endif
 else
 CPPSRCS += \
   FallbackBattery.cpp \
   FallbackSensor.cpp \
   FallbackVibration.cpp \
   FallbackPower.cpp \
   FallbackScreenConfiguration.cpp \
-  FallbackAlarm.cpp \
   $(NULL)
 endif
 
 # Fallbacks for backends implemented on Gonk only.
 ifneq (gonk,$(MOZ_WIDGET_TOOLKIT)) #{
 CPPSRCS += \
   FallbackLights.cpp  \
   FallbackTime.cpp \
@@ -137,9 +131,9 @@ include $(topsrcdir)/config/rules.mk
 
 CFLAGS          += $(MOZ_DBUS_GLIB_CFLAGS)
 CXXFLAGS        += $(MOZ_DBUS_GLIB_CFLAGS)
 
 ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
 # So that we can call nsScreenManagerGonk::GetConfiguration().
 LOCAL_INCLUDES += -I$(topsrcdir)/widget/gonk
 LOCAL_INCLUDES += -I$(topsrcdir)/widget/xpwidgets
-endif
+endif
\ No newline at end of file
deleted file mode 100644
--- a/hal/fallback/FallbackAlarm.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "Hal.h"
-
-namespace mozilla {
-namespace hal_impl {
-
-bool
-EnableAlarm()
-{
-  return false;
-}
-
-void
-DisableAlarm()
-{
-}
-
-bool
-SetAlarm(long aSeconds, long aNanoseconds)
-{
-  return false;
-}
-
-} // hal_impl
-} // namespace mozilla
--- a/hal/gonk/GonkHal.cpp
+++ b/hal/gonk/GonkHal.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set sw=2 ts=8 et ft=cpp : */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <errno.h>
 #include <fcntl.h>
-#include <linux/android_alarm.h>
 #include <math.h>
 #include <stdio.h>
 #include <sys/syscall.h>
 #include <time.h>
 
 #include "android/log.h"
 #include "cutils/properties.h"
 #include "hardware/hardware.h"
@@ -622,172 +621,10 @@ LockScreenOrientation(const dom::ScreenO
 }
 
 void
 UnlockScreenOrientation()
 {
   OrientationObserver::GetInstance()->UnlockScreenOrientation();
 }
 
-
-static pthread_t sAlarmFireWatcherThread;
-
-// If |sAlarmData| is non-null, it's owned by the watcher thread.
-typedef struct AlarmData {
-
-public:
-  AlarmData(int aFd) : mFd(aFd), mGeneration(sNextGeneration++), mShuttingDown(false) {}
-  ScopedClose mFd;
-  int mGeneration;
-  bool mShuttingDown;
-
-  static int sNextGeneration;
-
-} AlarmData;
-
-int AlarmData::sNextGeneration = 0;
-
-AlarmData* sAlarmData = NULL;
-
-class AlarmFiredEvent : public nsRunnable {
-
-public:
-  AlarmFiredEvent(int aGeneration) : mGeneration(aGeneration) {}
-
-  NS_IMETHOD Run() {
-    // Guard against spurious notifications caused by an alarm firing
-    // concurrently with it being disabled.
-    if (sAlarmData && !sAlarmData->mShuttingDown && mGeneration == sAlarmData->mGeneration) {
-      hal::NotifyAlarmFired();
-    }
-
-    return NS_OK;
-  }
-
-private:
-  int mGeneration;
-};
-
-// Runs on alarm-watcher thread.
-static void 
-DestroyAlarmData(void* aData)
-{
-  AlarmData* alarmData = static_cast<AlarmData*>(aData);
-  delete alarmData;
-}
-
-// Runs on alarm-watcher thread.
-void ShutDownAlarm(int aSigno)
-{
-  if (aSigno == SIGUSR2) {
-    sAlarmData->mShuttingDown = true;
-  }
-  return;
-}
-
-static void* 
-WaitForAlarm(void* aData)
-{
-  pthread_cleanup_push(DestroyAlarmData, aData);
-
-  AlarmData* alarmData = static_cast<AlarmData*>(aData);
-
-  while (!alarmData->mShuttingDown) {
-    int alarmTypeFlags = 0;
-
-    // ALARM_WAIT apparently will block even if an alarm hasn't been
-    // programmed, although this behavior doesn't seem to be
-    // documented.  We rely on that here to avoid spinning the CPU
-    // while awaiting an alarm to be programmed.
-    do {
-      alarmTypeFlags = ioctl(alarmData->mFd, ANDROID_ALARM_WAIT);
-    } while (alarmTypeFlags < 0 && errno == EINTR && !alarmData->mShuttingDown);
-
-    if (!alarmData->mShuttingDown && 
-        alarmTypeFlags >= 0 && (alarmTypeFlags & ANDROID_ALARM_RTC_WAKEUP_MASK)) {
-      NS_DispatchToMainThread(new AlarmFiredEvent(alarmData->mGeneration));
-    }
-  }
-
-  pthread_cleanup_pop(1);
-  return NULL;
-}
-
-bool
-EnableAlarm()
-{
-  MOZ_ASSERT(!sAlarmData);
-
-  int alarmFd = open("/dev/alarm", O_RDWR);
-  if (alarmFd < 0) {
-    HAL_LOG(("Failed to open alarm device: %s.", strerror(errno)));
-    return false;
-  }
-
-  nsAutoPtr<AlarmData> alarmData(new AlarmData(alarmFd));
-
-  struct sigaction actions;
-  memset(&actions, 0, sizeof(actions));
-  sigemptyset(&actions.sa_mask);
-  actions.sa_flags = 0;
-  actions.sa_handler = ShutDownAlarm;
-  if (sigaction(SIGUSR2, &actions, NULL)) {
-    HAL_LOG(("Failed to set SIGUSR2 signal for alarm-watcher thread."));
-    return false;
-  }
-
-  pthread_attr_t attr;
-  pthread_attr_init(&attr);
-  pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-
-  int status = pthread_create(&sAlarmFireWatcherThread, &attr, WaitForAlarm, alarmData.get());
-  if (status) {
-    alarmData = NULL;
-    HAL_LOG(("Failed to create alarm watcher thread. Status: %d.", status));
-    return false;
-  }
-
-  pthread_attr_destroy(&attr);
-
-  // The thread owns this now.  We only hold a pointer.
-  sAlarmData = alarmData.forget();
-  return true;
-}
-
-void
-DisableAlarm()
-{
-  MOZ_ASSERT(sAlarmData);
-
-  // NB: this must happen-before the thread cancellation.
-  sAlarmData = NULL;
-
-  // The cancel will interrupt the thread and destroy it, freeing the
-  // data pointed at by sAlarmData.
-  DebugOnly<int> err = pthread_kill(sAlarmFireWatcherThread, SIGUSR2);
-  MOZ_ASSERT(!err);
-}
-
-bool
-SetAlarm(long aSeconds, long aNanoseconds)
-{
-  if (!sAlarmData) {
-    HAL_LOG(("We should have enabled the alarm."));
-    return false;
-  }
-
-  struct timespec ts;
-  ts.tv_sec = aSeconds;
-  ts.tv_nsec = aNanoseconds;
-
-  // currently we only support RTC wakeup alarm type
-  const int result = ioctl(sAlarmData->mFd, ANDROID_ALARM_SET(ANDROID_ALARM_RTC_WAKEUP), &ts);
-
-  if (result < 0) {
-    HAL_LOG(("Unable to set alarm: %s.", strerror(errno)));
-    return false;
-  }
-
-  return true;
-}
-
 } // hal_impl
 } // mozilla
--- a/hal/sandbox/SandboxHal.cpp
+++ b/hal/sandbox/SandboxHal.cpp
@@ -255,36 +255,16 @@ DisableSwitchNotifications(SwitchDevice 
 SwitchState
 GetCurrentSwitchState(SwitchDevice aDevice)
 {
   SwitchState state;
   Hal()->SendGetCurrentSwitchState(aDevice, &state);
   return state;
 }
 
-bool
-EnableAlarm()
-{
-  NS_RUNTIMEABORT("Alarms can't be programmed from sandboxed contexts.  Yet.");
-  return false;
-}
-
-void
-DisableAlarm()
-{
-  NS_RUNTIMEABORT("Alarms can't be programmed from sandboxed contexts.  Yet.");
-}
-
-bool
-SetAlarm(long aSeconds, long aNanoseconds)
-{
-  NS_RUNTIMEABORT("Alarms can't be programmed from sandboxed contexts.  Yet.");
-  return false;
-}
-
 class HalParent : public PHalParent
                 , public BatteryObserver
                 , public NetworkObserver
                 , public ISensorObserver
                 , public WakeLockObserver
                 , public ScreenConfigurationObserver
                 , public SwitchObserver
 {
--- a/layout/build/Makefile.in
+++ b/layout/build/Makefile.in
@@ -57,17 +57,16 @@ SHARED_LIBRARY_LIBS = \
 	$(DEPTH)/content/xslt/src/xpath/$(LIB_PREFIX)txxpath_s.$(LIB_SUFFIX) \
 	$(DEPTH)/content/xslt/src/xslt/$(LIB_PREFIX)txxslt_s.$(LIB_SUFFIX) \
 	$(DEPTH)/content/xbl/src/$(LIB_PREFIX)gkconxbl_s.$(LIB_SUFFIX) \
 	$(DEPTH)/content/xul/document/src/$(LIB_PREFIX)gkconxuldoc_s.$(LIB_SUFFIX) \
 	$(DEPTH)/view/src/$(LIB_PREFIX)gkview_s.$(LIB_SUFFIX) \
 	$(DEPTH)/dom/base/$(LIB_PREFIX)jsdombase_s.$(LIB_SUFFIX) \
 	$(DEPTH)/dom/battery/$(LIB_PREFIX)dom_battery_s.$(LIB_SUFFIX) \
 	$(DEPTH)/dom/contacts/$(LIB_PREFIX)jsdomcontacts_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/alarm/$(LIB_PREFIX)domalarm_s.$(LIB_SUFFIX) \
 	$(DEPTH)/dom/devicestorage/$(LIB_PREFIX)domdevicestorage_s.$(LIB_SUFFIX) \
 	$(DEPTH)/dom/file/$(LIB_PREFIX)domfile_s.$(LIB_SUFFIX) \
 	$(DEPTH)/dom/power/$(LIB_PREFIX)dom_power_s.$(LIB_SUFFIX) \
 	$(DEPTH)/dom/settings/$(LIB_PREFIX)jsdomsettings_s.$(LIB_SUFFIX) \
 	$(DEPTH)/dom/network/src/$(LIB_PREFIX)dom_network_s.$(LIB_SUFFIX) \
 	$(DEPTH)/dom/media/$(LIB_PREFIX)dom_media_s.$(LIB_SUFFIX) \
 	$(DEPTH)/dom/sms/src/$(LIB_PREFIX)dom_sms_s.$(LIB_SUFFIX) \
 	$(DEPTH)/dom/src/events/$(LIB_PREFIX)jsdomevents_s.$(LIB_SUFFIX) \
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -212,28 +212,23 @@ static void Shutdown();
 #include "nsGeolocation.h"
 #include "nsDeviceSensors.h"
 #include "nsCSPService.h"
 #include "nsISmsService.h"
 #include "nsISmsDatabaseService.h"
 #include "mozilla/dom/sms/SmsRequestManager.h"
 #include "mozilla/dom/sms/SmsServicesFactory.h"
 #include "nsIPowerManagerService.h"
-#include "nsIAlarmHalService.h"
 
 using namespace mozilla::dom::sms;
 
 #include "mozilla/dom/power/PowerManagerService.h"
 
 using mozilla::dom::power::PowerManagerService;
 
-#include "mozilla/dom/alarm/AlarmHalService.h"
-
-using mozilla::dom::alarm::AlarmHalService;
-
 // Transformiix
 /* 5d5d92cd-6bf8-11d9-bf4a-000a95dc234c */
 #define TRANSFORMIIX_NODESET_CID \
 { 0x5d5d92cd, 0x6bf8, 0x11d9, { 0xbf, 0x4a, 0x0, 0x0a, 0x95, 0xdc, 0x23, 0x4c } }
 
 #define TRANSFORMIIX_NODESET_CONTRACTID \
 "@mozilla.org/transformiix-nodeset;1"
 
@@ -273,18 +268,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsHapticF
 #endif
 #endif
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ThirdPartyUtil, Init)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsISmsService, SmsServicesFactory::CreateSmsService)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsISmsDatabaseService, SmsServicesFactory::CreateSmsDatabaseService)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIPowerManagerService,
                                          PowerManagerService::GetInstance)
 NS_GENERIC_FACTORY_CONSTRUCTOR(SmsRequestManager)
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIAlarmHalService,
-                                         AlarmHalService::GetInstance)
 
 //-----------------------------------------------------------------------------
 
 // Per bug 209804, it is necessary to observe the "xpcom-shutdown" event and
 // perform shutdown of the layout modules at that time instead of waiting for
 // our module destructor to run.  If we do not do this, then we risk holding
 // references to objects in other component libraries that have already been
 // shutdown (and possibly unloaded if 60709 is ever fixed).
@@ -773,17 +766,16 @@ NS_DEFINE_NAMED_CID(NS_DEVICE_SENSORS_CI
 #if defined(ANDROID) || defined(MOZ_PLATFORM_MAEMO)
 NS_DEFINE_NAMED_CID(NS_HAPTICFEEDBACK_CID);
 #endif
 #endif
 NS_DEFINE_NAMED_CID(SMS_SERVICE_CID);
 NS_DEFINE_NAMED_CID(SMS_DATABASE_SERVICE_CID);
 NS_DEFINE_NAMED_CID(SMS_REQUEST_MANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_POWERMANAGERSERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_ALARMHALSERVICE_CID);
 
 static nsresult
 CreateWindowCommandTableConstructor(nsISupports *aOuter,
                                     REFNSIID aIID, void **aResult)
 {
   nsresult rv;
   nsCOMPtr<nsIControllerCommandTable> commandTable =
       do_CreateInstance(NS_CONTROLLERCOMMANDTABLE_CONTRACTID, &rv);
@@ -1041,17 +1033,16 @@ static const mozilla::Module::CIDEntry k
 #endif
   { &kTHIRDPARTYUTIL_CID, false, NULL, ThirdPartyUtilConstructor },
   { &kNS_STRUCTUREDCLONECONTAINER_CID, false, NULL, nsStructuredCloneContainerConstructor },
   { &kNS_DOMMUTATIONOBSERVER_CID, false, NULL, nsDOMMutationObserverConstructor },
   { &kSMS_SERVICE_CID, false, NULL, nsISmsServiceConstructor },
   { &kSMS_DATABASE_SERVICE_CID, false, NULL, nsISmsDatabaseServiceConstructor },
   { &kSMS_REQUEST_MANAGER_CID, false, NULL, SmsRequestManagerConstructor },
   { &kNS_POWERMANAGERSERVICE_CID, false, NULL, nsIPowerManagerServiceConstructor },
-  { &kNS_ALARMHALSERVICE_CID, false, NULL, nsIAlarmHalServiceConstructor },
   { NULL }
 };
 
 static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
   XPCONNECT_CONTRACTS
   { "@mozilla.org/layout/xul-boxobject;1", &kNS_BOXOBJECT_CID },
 #ifdef MOZ_XUL
   { "@mozilla.org/layout/xul-boxobject-listbox;1", &kNS_LISTBOXOBJECT_CID },
@@ -1174,17 +1165,16 @@ static const mozilla::Module::ContractID
 #endif
   { THIRDPARTYUTIL_CONTRACTID, &kTHIRDPARTYUTIL_CID },
   { NS_STRUCTUREDCLONECONTAINER_CONTRACTID, &kNS_STRUCTUREDCLONECONTAINER_CID },
   { NS_DOMMUTATIONOBSERVER_CONTRACTID, &kNS_DOMMUTATIONOBSERVER_CID },
   { SMS_SERVICE_CONTRACTID, &kSMS_SERVICE_CID },
   { SMS_DATABASE_SERVICE_CONTRACTID, &kSMS_DATABASE_SERVICE_CID },
   { SMS_REQUEST_MANAGER_CONTRACTID, &kSMS_REQUEST_MANAGER_CID },
   { POWERMANAGERSERVICE_CONTRACTID, &kNS_POWERMANAGERSERVICE_CID },
-  { ALARMHALSERVICE_CONTRACTID, &kNS_ALARMHALSERVICE_CID },
   { NULL }
 };
 
 static const mozilla::Module::CategoryEntry kLayoutCategories[] = {
   XPCONNECT_CATEGORIES
   { JAVASCRIPT_GLOBAL_CONSTRUCTOR_CATEGORY, "Image", NS_HTMLIMGELEMENT_CONTRACTID },
   { JAVASCRIPT_GLOBAL_CONSTRUCTOR_PROTO_ALIAS_CATEGORY, "Image", "HTMLImageElement" },
   { JAVASCRIPT_GLOBAL_CONSTRUCTOR_CATEGORY, "Option", NS_HTMLOPTIONELEMENT_CONTRACTID },
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -3572,19 +3572,16 @@ pref("dom.battery.enabled", true);
 // WebSMS
 pref("dom.sms.enabled", false);
 pref("dom.sms.whitelist", "");
 
 // WebContacts
 pref("dom.mozContacts.enabled", false);
 pref("dom.mozContacts.whitelist", "");
 
-// WebAlarms
-pref("dom.mozAlarms.enabled", false);
-
 // WebSettings
 pref("dom.mozSettings.enabled", false);
 
 // enable JS dump() function.
 pref("browser.dom.window.dump.enabled", false);
 
 // SPS Profiler
 pref("profiler.enabled", false);
--- a/toolkit/toolkit-makefiles.sh
+++ b/toolkit/toolkit-makefiles.sh
@@ -30,17 +30,16 @@ MAKEFILES_dom="
   dom/interfaces/sidebar/Makefile
   dom/interfaces/storage/Makefile
   dom/interfaces/stylesheets/Makefile
   dom/interfaces/svg/Makefile
   dom/interfaces/traversal/Makefile
   dom/interfaces/xbl/Makefile
   dom/interfaces/xpath/Makefile
   dom/interfaces/xul/Makefile
-  dom/alarm/Makefile
   dom/base/Makefile
   dom/battery/Makefile
   dom/file/Makefile
   dom/indexedDB/Makefile
   dom/ipc/Makefile
   dom/locales/Makefile
   dom/messages/Makefile
   dom/messages/interfaces/Makefile
@@ -705,17 +704,16 @@ if [ "$ENABLE_TESTS" ]; then
     content/xml/document/test/Makefile
     content/xslt/tests/buster/Makefile
     content/xslt/tests/mochitest/Makefile
     content/xul/content/test/Makefile
     content/xul/document/test/Makefile
     docshell/test/Makefile
     docshell/test/chrome/Makefile
     docshell/test/navigation/Makefile
-    dom/alarm/test/Makefile
     dom/battery/test/Makefile
     dom/indexedDB/test/Makefile
     dom/indexedDB/test/unit/Makefile
     dom/network/tests/Makefile
     dom/plugins/test/Makefile
     dom/plugins/test/testplugin/Makefile
     dom/power/test/Makefile
     dom/sms/tests/Makefile