Bug 1273079 - Use MOZ_MUST_USE in hal. r=gsvelto
authorWei-Cheng Pan <wpan@mozilla.com>
Mon, 16 May 2016 17:24:03 +0800
changeset 298616 fbfd273902ac64b3ce1029d64c3c53e5905d1593
parent 298615 34f82d838f0366381161ba9efcc2bc8124541968
child 298617 b6de0388fc011af71fe8e3745c087ee881ca4bc0
push id77251
push usercbook@mozilla.com
push dateTue, 24 May 2016 09:01:11 +0000
treeherdermozilla-inbound@d34a99623615 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgsvelto
bugs1273079
milestone49.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 1273079 - Use MOZ_MUST_USE in hal. r=gsvelto MozReview-Commit-ID: 7VLDpz34DRu
dom/base/ScreenOrientation.cpp
hal/Hal.h
hal/HalInternal.h
--- a/dom/base/ScreenOrientation.cpp
+++ b/dom/base/ScreenOrientation.cpp
@@ -548,17 +548,18 @@ ScreenOrientation::Notify(const hal::Scr
 }
 
 void
 ScreenOrientation::UpdateActiveOrientationLock(ScreenOrientationInternal aOrientation)
 {
   if (aOrientation == eScreenOrientation_None) {
     hal::UnlockScreenOrientation();
   } else {
-    hal::LockScreenOrientation(aOrientation);
+    bool rv = hal::LockScreenOrientation(aOrientation);
+    NS_WARN_IF(!rv);
   }
 }
 
 void
 ScreenOrientation::DispatchChangeEvent()
 {
   nsresult rv = DispatchTrustedEvent(NS_LITERAL_STRING("change"));
   NS_WARN_IF(NS_FAILED(rv));
--- a/hal/Hal.h
+++ b/hal/Hal.h
@@ -389,17 +389,17 @@ void GetCurrentScreenConfiguration(hal::
  * @param aScreenConfiguration The new screen orientation.
  */
 void NotifyScreenConfigurationChange(const hal::ScreenConfiguration& aScreenConfiguration);
 
 /**
  * Lock the screen orientation to the specific orientation.
  * @return Whether the lock has been accepted.
  */
-bool LockScreenOrientation(const dom::ScreenOrientationInternal& aOrientation);
+MOZ_MUST_USE bool LockScreenOrientation(const dom::ScreenOrientationInternal& aOrientation);
 
 /**
  * Unlock the screen orientation.
  */
 void UnlockScreenOrientation();
 
 /**
  * Register an observer for the switch of given SwitchDevice.
@@ -433,17 +433,17 @@ void NotifySwitchStateFromInputDevice(ha
                                       hal::SwitchState aState);
 
 /**
  * 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);
+MOZ_MUST_USE bool RegisterTheOneAlarmObserver(hal::AlarmObserver* aObserver);
 
 /**
  * Unregister the alarm observer.  Doing so will implicitly cancel any
  * programmed alarm.
  */
 void UnregisterTheOneAlarmObserver();
 
 /**
@@ -460,17 +460,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(int32_t aSeconds, int32_t aNanoseconds);
+MOZ_MUST_USE bool SetAlarm(int32_t aSeconds, int32_t aNanoseconds);
 
 /**
  * Set the priority of the given process.
  *
  * Exactly what this does will vary between platforms.  On *nix we might give
  * background processes higher nice values.  On other platforms, we might
  * ignore this call entirely.
  */
@@ -580,17 +580,17 @@ void CancelFMRadioSeek();
 /**
  * Get FM radio band settings by country.
  */
 hal::FMRadioSettings GetFMBandSettings(hal::FMRadioCountry aCountry);
 
 /**
  * Enable RDS data reception
  */
-bool EnableRDS(uint32_t aMask);
+MOZ_MUST_USE bool EnableRDS(uint32_t aMask);
 
 /**
  * Disable RDS data reception
  */
 void DisableRDS();
 
 /**
  * Start a watchdog to compulsively shutdown the system if it hangs.
--- a/hal/HalInternal.h
+++ b/hal/HalInternal.h
@@ -62,17 +62,17 @@ void EnableSwitchNotifications(hal::Swit
 /**
  * Disable switch notifications from the backend
  */
 void DisableSwitchNotifications(hal::SwitchDevice aDevice);
 
 /**
  * Enable alarm notifications from the backend.
  */
-bool EnableAlarm();
+MOZ_MUST_USE bool EnableAlarm();
 
 /**
  * Disable alarm notifications from the backend.
  */
 void DisableAlarm();
 
 /**
  * Enable system clock change notifications from the backend.