Bug 1273079 - Use MOZ_MUST_USE in hal. r=gsvelto
☠☠ backed out by 89c6cb3b0860 ☠ ☠
authorWei-Cheng Pan <wpan@mozilla.com>
Mon, 16 May 2016 17:24:03 +0800
changeset 298072 a906d38b7c07071bdb0af78361c83a447aec3ed9
parent 298071 9d85d87c11798efec57cf69d6e53f74381e41958
child 298073 7521936774c1eacd5872c34be824c8f1db39778d
push id77026
push userryanvm@gmail.com
push dateThu, 19 May 2016 12:44:23 +0000
treeherdermozilla-inbound@11db59507360 [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, "Lock screen failed!");
   }
 }
 
 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.