summaryrefslogtreecommitdiffstats
path: root/base/float_util.h
diff options
context:
space:
mode:
authormiu@chromium.org <miu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-23 05:24:46 +0000
committermiu@chromium.org <miu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-23 05:24:46 +0000
commit68c550cfef163553d89a1d0914b2e9049fd30cee (patch)
tree66757ea547fb026613360f36dca86f13adc2eb52 /base/float_util.h
parent85c8404778eca59eabcb4211a4a1f08e431b6852 (diff)
downloadchromium_src-68c550cfef163553d89a1d0914b2e9049fd30cee.zip
chromium_src-68c550cfef163553d89a1d0914b2e9049fd30cee.tar.gz
chromium_src-68c550cfef163553d89a1d0914b2e9049fd30cee.tar.bz2
Replace AudioSilenceDetector with an AudioPowerMonitor.
This will allow the tab audio UI indicator to animate/paint based on the real-time measured power level of the audio stream being played. This change includes necessary plumbing of the power measurement value all the way from audio internals to the fringes of the tab UI. BUG=178934 Review URL: https://chromiumcodereview.appspot.com/14600025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213042 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/float_util.h')
-rw-r--r--base/float_util.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/base/float_util.h b/base/float_util.h
index 458e859..9027310 100644
--- a/base/float_util.h
+++ b/base/float_util.h
@@ -13,7 +13,8 @@
namespace base {
-inline bool IsFinite(const double& number) {
+template <typename Float>
+inline bool IsFinite(const Float& number) {
#if defined(OS_POSIX)
return std::isfinite(number) != 0;
#elif defined(OS_WIN)
@@ -21,6 +22,15 @@ inline bool IsFinite(const double& number) {
#endif
}
+template <typename Float>
+inline bool IsNaN(const Float& number) {
+#if defined(OS_POSIX)
+ return std::isnan(number) != 0;
+#elif defined(OS_WIN)
+ return _isnan(number) != 0;
+#endif
+}
+
} // namespace base
#endif // BASE_FLOAT_UTIL_H_