Bug 1273079 - Use MOZ_MUST_USE in hal. r=gsvelto
☠☠ backed out by 7b2809db7c76 ☠ ☠
authorWei-Cheng Pan <wpan@mozilla.com>
Mon, 16 May 2016 17:24:03 +0800
changeset 336840 7f656d673a98de4c87b2ba5aeb7537caca910e45
parent 336839 d818be07b423aac4b21160b2ba37273d08aa6e58
child 336841 035efa5e0655810627f1f771ec1cee620a30df53
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [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_FALSE(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.