Bug 776785 - Alarm API - hal::SetAlarm takes |long|s, but should instead take PRInt32s. r=jlebar
authorGene Lian <clian@mozilla.com>
Tue, 31 Jul 2012 10:52:57 +0800
changeset 100985 bcf4a3c07234a9499b3f57c21f5f4f54a600a896
parent 100984 31f42dd24f25014e8122b527617e93828a4d6d5f
child 100986 5e5bb655d718b8894bc6dc8e39740cc96e7c8c73
push idunknown
push userunknown
push dateunknown
reviewersjlebar
bugs776785
milestone17.0a1
Bug 776785 - Alarm API - hal::SetAlarm takes |long|s, but should instead take PRInt32s. r=jlebar
dom/alarm/nsIAlarmHalService.idl
hal/Hal.cpp
hal/Hal.h
hal/fallback/FallbackAlarm.cpp
hal/gonk/GonkHal.cpp
hal/sandbox/SandboxHal.cpp
--- a/dom/alarm/nsIAlarmHalService.idl
+++ b/dom/alarm/nsIAlarmHalService.idl
@@ -8,26 +8,26 @@
 interface nsIAlarmFiredCb : nsISupports 
 {
   void onAlarmFired();
 };
 
 [scriptable, function, uuid(0ca52e84-ba8f-11e1-87e8-63235527db9e)]
 interface nsITimezoneChangedCb : nsISupports 
 {
-  void onTimezoneChanged(in long aTimezoneOffset);
+  void onTimezoneChanged(in PRInt32 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);
+  bool setAlarm(in PRInt32 aSeconds, in PRInt32 aNanoseconds);
   void setAlarmFiredCb(in nsIAlarmFiredCb aAlarmFiredCb);
   void setTimezoneChangedCb(in nsITimezoneChangedCb aTimezoneChangedCb);
 };
 
 
 
--- a/hal/Hal.cpp
+++ b/hal/Hal.cpp
@@ -716,17 +716,17 @@ void
 NotifyAlarmFired()
 {
   if (sAlarmObserver) {
     sAlarmObserver->Notify(void_t());
   }
 }
 
 bool
-SetAlarm(long aSeconds, long aNanoseconds)
+SetAlarm(PRInt32 aSeconds, PRInt32 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
@@ -395,17 +395,17 @@ void NotifyAlarmFired();
  * 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);
+bool SetAlarm(PRInt32 aSeconds, PRInt32 aNanoseconds);
 
 } // namespace MOZ_HAL_NAMESPACE
 } // namespace mozilla
 
 #ifdef MOZ_DEFINED_HAL_NAMESPACE
 # undef MOZ_DEFINED_HAL_NAMESPACE
 # undef MOZ_HAL_NAMESPACE
 #endif
--- a/hal/fallback/FallbackAlarm.cpp
+++ b/hal/fallback/FallbackAlarm.cpp
@@ -14,15 +14,15 @@ EnableAlarm()
 }
 
 void
 DisableAlarm()
 {
 }
 
 bool
-SetAlarm(long aSeconds, long aNanoseconds)
+SetAlarm(PRInt32 aSeconds, PRInt32 aNanoseconds)
 {
   return false;
 }
 
 } // hal_impl
 } // namespace mozilla
--- a/hal/gonk/GonkHal.cpp
+++ b/hal/gonk/GonkHal.cpp
@@ -773,17 +773,17 @@ DisableAlarm()
 
   // The cancel will interrupt the thread and destroy it, freeing the
   // data pointed at by sAlarmData.
   DebugOnly<int> err = pthread_kill(sAlarmFireWatcherThread, SIGUSR1);
   MOZ_ASSERT(!err);
 }
 
 bool
-SetAlarm(long aSeconds, long aNanoseconds)
+SetAlarm(PRInt32 aSeconds, PRInt32 aNanoseconds)
 {
   if (!sAlarmData) {
     HAL_LOG(("We should have enabled the alarm."));
     return false;
   }
 
   struct timespec ts;
   ts.tv_sec = aSeconds;
--- a/hal/sandbox/SandboxHal.cpp
+++ b/hal/sandbox/SandboxHal.cpp
@@ -269,17 +269,17 @@ EnableAlarm()
 
 void
 DisableAlarm()
 {
   NS_RUNTIMEABORT("Alarms can't be programmed from sandboxed contexts.  Yet.");
 }
 
 bool
-SetAlarm(long aSeconds, long aNanoseconds)
+SetAlarm(PRInt32 aSeconds, PRInt32 aNanoseconds)
 {
   NS_RUNTIMEABORT("Alarms can't be programmed from sandboxed contexts.  Yet.");
   return false;
 }
 
 class HalParent : public PHalParent
                 , public BatteryObserver
                 , public NetworkObserver