| 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 { | 419 { |
| 420 if (string.isNull()) | 420 if (string.isNull()) |
| 421 return v8::String::Empty(isolate); | 421 return v8::String::Empty(isolate); |
| 422 return V8PerIsolateData::from(isolate)->getStringCache()->v8ExternalString(i
solate, string); | 422 return V8PerIsolateData::from(isolate)->getStringCache()->v8ExternalString(i
solate, string); |
| 423 } | 423 } |
| 424 | 424 |
| 425 inline v8::Local<v8::String> v8AtomicString(v8::Isolate* isolate, const StringVi
ew& string) | 425 inline v8::Local<v8::String> v8AtomicString(v8::Isolate* isolate, const StringVi
ew& string) |
| 426 { | 426 { |
| 427 DCHECK(isolate); | 427 DCHECK(isolate); |
| 428 if (string.is8Bit()) | 428 if (string.is8Bit()) |
| 429 return v8CallOrCrash(v8::String::NewFromOneByte(isolate, reinterpret_cas
t<const uint8_t*>(string.characters8()), v8::NewStringType::kInternalized, stati
c_cast<int>(string.length()))); | 429 return v8::String::NewFromOneByte(isolate, reinterpret_cast<const uint8_
t*>(string.characters8()), v8::NewStringType::kInternalized, static_cast<int>(st
ring.length())).ToLocalChecked(); |
| 430 return v8CallOrCrash(v8::String::NewFromTwoByte(isolate, reinterpret_cast<co
nst uint16_t*>(string.characters16()), v8::NewStringType::kInternalized, static_
cast<int>(string.length()))); | 430 return v8::String::NewFromTwoByte(isolate, reinterpret_cast<const uint16_t*>
(string.characters16()), v8::NewStringType::kInternalized, static_cast<int>(stri
ng.length())).ToLocalChecked(); |
| 431 } | 431 } |
| 432 | 432 |
| 433 inline v8::Local<v8::String> v8StringFromUtf8(v8::Isolate* isolate, const char*
bytes, int length) | 433 inline v8::Local<v8::String> v8StringFromUtf8(v8::Isolate* isolate, const char*
bytes, int length) |
| 434 { | 434 { |
| 435 DCHECK(isolate); | 435 DCHECK(isolate); |
| 436 return v8CallOrCrash(v8::String::NewFromUtf8(isolate, bytes, v8::NewStringTy
pe::kNormal, length)); | 436 return v8::String::NewFromUtf8(isolate, bytes, v8::NewStringType::kNormal, l
ength).ToLocalChecked(); |
| 437 } | 437 } |
| 438 | 438 |
| 439 inline v8::Local<v8::Value> v8Undefined() | 439 inline v8::Local<v8::Value> v8Undefined() |
| 440 { | 440 { |
| 441 return v8::Local<v8::Value>(); | 441 return v8::Local<v8::Value>(); |
| 442 } | 442 } |
| 443 | 443 |
| 444 // Conversion flags, used in toIntXX/toUIntXX. | 444 // Conversion flags, used in toIntXX/toUIntXX. |
| 445 enum IntegerConversionConfiguration { | 445 enum IntegerConversionConfiguration { |
| 446 NormalConversion, | 446 NormalConversion, |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 typedef void (*InstallTemplateFunction)(v8::Isolate*, const DOMWrapperWorld&, v8
::Local<v8::FunctionTemplate> interfaceTemplate); | 967 typedef void (*InstallTemplateFunction)(v8::Isolate*, const DOMWrapperWorld&, v8
::Local<v8::FunctionTemplate> interfaceTemplate); |
| 968 | 968 |
| 969 // Freeze a V8 object. The type of the first parameter and the return value is | 969 // Freeze a V8 object. The type of the first parameter and the return value is |
| 970 // intentionally v8::Value so that this function can wrap toV8(). | 970 // intentionally v8::Value so that this function can wrap toV8(). |
| 971 // If the argument isn't an object, this will crash. | 971 // If the argument isn't an object, this will crash. |
| 972 CORE_EXPORT v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>, v8::Isolat
e*); | 972 CORE_EXPORT v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>, v8::Isolat
e*); |
| 973 | 973 |
| 974 } // namespace blink | 974 } // namespace blink |
| 975 | 975 |
| 976 #endif // V8Binding_h | 976 #endif // V8Binding_h |
| OLD | NEW |