| 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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 return v8::Handle<v8::Value>(); | 380 return v8::Handle<v8::Value>(); |
| 381 } | 381 } |
| 382 | 382 |
| 383 // Conversion flags, used in toIntXX/toUIntXX. | 383 // Conversion flags, used in toIntXX/toUIntXX. |
| 384 enum IntegerConversionConfiguration { | 384 enum IntegerConversionConfiguration { |
| 385 NormalConversion, | 385 NormalConversion, |
| 386 EnforceRange, | 386 EnforceRange, |
| 387 Clamp | 387 Clamp |
| 388 }; | 388 }; |
| 389 | 389 |
| 390 // Convert a value to a boolean. |
| 391 CORE_EXPORT bool toBooleanSlow(v8::Isolate*, v8::Local<v8::Value>, ExceptionStat
e&); |
| 392 inline bool toBoolean(v8::Isolate* isolate, v8::Local<v8::Value> value, Exceptio
nState& exceptionState) |
| 393 { |
| 394 if (LIKELY(value->IsBoolean())) |
| 395 return value.As<v8::Boolean>()->Value(); |
| 396 return toBooleanSlow(isolate, value, exceptionState); |
| 397 } |
| 398 |
| 390 // Convert a value to a 8-bit signed integer. The conversion fails if the | 399 // Convert a value to a 8-bit signed integer. The conversion fails if the |
| 391 // value cannot be converted to a number or the range violated per WebIDL: | 400 // value cannot be converted to a number or the range violated per WebIDL: |
| 392 // http://www.w3.org/TR/WebIDL/#es-byte | 401 // http://www.w3.org/TR/WebIDL/#es-byte |
| 393 int8_t toInt8(v8::Isolate*, v8::Handle<v8::Value>, IntegerConversionConfiguratio
n, ExceptionState&); | 402 int8_t toInt8(v8::Isolate*, v8::Handle<v8::Value>, IntegerConversionConfiguratio
n, ExceptionState&); |
| 394 | 403 |
| 395 // Convert a value to a 8-bit unsigned integer. The conversion fails if the | 404 // Convert a value to a 8-bit unsigned integer. The conversion fails if the |
| 396 // value cannot be converted to a number or the range violated per WebIDL: | 405 // value cannot be converted to a number or the range violated per WebIDL: |
| 397 // http://www.w3.org/TR/WebIDL/#es-octet | 406 // http://www.w3.org/TR/WebIDL/#es-octet |
| 398 uint8_t toUInt8(v8::Isolate*, v8::Handle<v8::Value>, IntegerConversionConfigurat
ion, ExceptionState&); | 407 uint8_t toUInt8(v8::Isolate*, v8::Handle<v8::Value>, IntegerConversionConfigurat
ion, ExceptionState&); |
| 399 | 408 |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate*, ExecutionContext*, v8::Handle<v8::Function>); | 999 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate*, ExecutionContext*, v8::Handle<v8::Function>); |
| 991 | 1000 |
| 992 // Callback functions used by generated code. | 1001 // Callback functions used by generated code. |
| 993 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); | 1002 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); |
| 994 | 1003 |
| 995 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); | 1004 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); |
| 996 | 1005 |
| 997 } // namespace blink | 1006 } // namespace blink |
| 998 | 1007 |
| 999 #endif // V8Binding_h | 1008 #endif // V8Binding_h |
| OLD | NEW |