Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Unified Diff: Source/bindings/core/v8/V8Binding.h

Issue 967293002: [bindings] Make toFloat inline (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed stale code Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/bindings/core/v8/V8Binding.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8Binding.h
diff --git a/Source/bindings/core/v8/V8Binding.h b/Source/bindings/core/v8/V8Binding.h
index 780e11025789cc823e047b40604caa849341c039..22960ca36434add272fd748c9253b3fa0cbf136a 100644
--- a/Source/bindings/core/v8/V8Binding.h
+++ b/Source/bindings/core/v8/V8Binding.h
@@ -478,18 +478,6 @@ inline uint64_t toUInt64(v8::Handle<v8::Value> value, ExceptionState& exceptionS
// Convert a value to a 64-bit unsigned integer assuming the conversion cannot fail.
uint64_t toUInt64(v8::Handle<v8::Value>);
-// Convert a value to a single precision float, which might fail.
-float toFloat(v8::Handle<v8::Value>, ExceptionState&);
-
-// Convert a value to a single precision float, throwing on non-finite values.
-float toRestrictedFloat(v8::Handle<v8::Value>, ExceptionState&);
-
-// Convert a value to a single precision float assuming the conversion cannot fail.
-inline float toFloat(v8::Local<v8::Value> value)
-{
- return static_cast<float>(value->NumberValue());
-}
-
// Convert a value to a double precision float, which might fail.
double toDoubleSlow(v8::Handle<v8::Value>, ExceptionState&);
@@ -503,6 +491,15 @@ inline double toDouble(v8::Handle<v8::Value> value, ExceptionState& exceptionSta
// Convert a value to a double precision float, throwing on non-finite values.
double toRestrictedDouble(v8::Handle<v8::Value>, ExceptionState&);
+// Convert a value to a single precision float, which might fail.
+inline float toFloat(v8::Handle<v8::Value> value, ExceptionState& exceptionState)
+{
+ return static_cast<float>(toDouble(value, exceptionState));
+}
+
+// Convert a value to a single precision float, throwing on non-finite values.
+float toRestrictedFloat(v8::Handle<v8::Value>, ExceptionState&);
+
// Converts a value to a String, throwing if any code unit is outside 0-255.
String toByteString(v8::Handle<v8::Value>, ExceptionState&);
« no previous file with comments | « no previous file | Source/bindings/core/v8/V8Binding.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698