| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Ericsson AB. All rights reserved. | 3 * Copyright (C) 2012 Ericsson AB. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 | 518 |
| 519 // Convert a value to a single precision float, which might fail. | 519 // Convert a value to a single precision float, which might fail. |
| 520 float toFloat(v8::Handle<v8::Value>, ExceptionState&); | 520 float toFloat(v8::Handle<v8::Value>, ExceptionState&); |
| 521 | 521 |
| 522 // Convert a value to a single precision float assuming the conversion cannot fa
il. | 522 // Convert a value to a single precision float assuming the conversion cannot fa
il. |
| 523 inline float toFloat(v8::Local<v8::Value> value) | 523 inline float toFloat(v8::Local<v8::Value> value) |
| 524 { | 524 { |
| 525 return static_cast<float>(value->NumberValue()); | 525 return static_cast<float>(value->NumberValue()); |
| 526 } | 526 } |
| 527 | 527 |
| 528 // Converts a value to a String, throwing if any code unit is outside 0-255. |
| 529 String toByteString(v8::Handle<v8::Value>, ExceptionState&); |
| 530 |
| 528 inline v8::Handle<v8::Boolean> v8Boolean(bool value, v8::Isolate* isolate) | 531 inline v8::Handle<v8::Boolean> v8Boolean(bool value, v8::Isolate* isolate) |
| 529 { | 532 { |
| 530 return value ? v8::True(isolate) : v8::False(isolate); | 533 return value ? v8::True(isolate) : v8::False(isolate); |
| 531 } | 534 } |
| 532 | 535 |
| 533 inline double toCoreDate(v8::Handle<v8::Value> object) | 536 inline double toCoreDate(v8::Handle<v8::Value> object) |
| 534 { | 537 { |
| 535 if (object->IsDate()) | 538 if (object->IsDate()) |
| 536 return v8::Handle<v8::Date>::Cast(object)->ValueOf(); | 539 return v8::Handle<v8::Date>::Cast(object)->ValueOf(); |
| 537 if (object->IsNumber()) | 540 if (object->IsNumber()) |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 RefPtr<ScriptState> m_scriptState; | 940 RefPtr<ScriptState> m_scriptState; |
| 938 }; | 941 }; |
| 939 | 942 |
| 940 void GetDevToolsFunctionInfo(v8::Handle<v8::Function>, v8::Isolate*, int& script
Id, String& resourceName, int& lineNumber); | 943 void GetDevToolsFunctionInfo(v8::Handle<v8::Function>, v8::Isolate*, int& script
Id, String& resourceName, int& lineNumber); |
| 941 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio
nContext*, v8::Handle<v8::Function>, v8::Isolate*); | 944 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio
nContext*, v8::Handle<v8::Function>, v8::Isolate*); |
| 942 | 945 |
| 943 | 946 |
| 944 } // namespace WebCore | 947 } // namespace WebCore |
| 945 | 948 |
| 946 #endif // V8Binding_h | 949 #endif // V8Binding_h |
| OLD | NEW |