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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 return V8PerIsolateData::from(isolate)->getStringCache()->v8ExternalString(i
solate, string.impl()); | 407 return V8PerIsolateData::from(isolate)->getStringCache()->v8ExternalString(i
solate, string.impl()); |
408 } | 408 } |
409 | 409 |
410 inline v8::Local<v8::Value> v8StringOrNull(v8::Isolate* isolate, const AtomicStr
ing& string) | 410 inline v8::Local<v8::Value> v8StringOrNull(v8::Isolate* isolate, const AtomicStr
ing& string) |
411 { | 411 { |
412 if (string.isNull()) | 412 if (string.isNull()) |
413 return v8::Null(isolate); | 413 return v8::Null(isolate); |
414 return V8PerIsolateData::from(isolate)->getStringCache()->v8ExternalString(i
solate, string.impl()); | 414 return V8PerIsolateData::from(isolate)->getStringCache()->v8ExternalString(i
solate, string.impl()); |
415 } | 415 } |
416 | 416 |
417 inline v8::Local<v8::Value> v8StringOrNull(v8::Isolate* isolate, const AtomicStr
ing& string) | |
418 { | |
419 if (string.isNull()) | |
420 return v8::Null(isolate); | |
421 return V8PerIsolateData::from(isolate)->getStringCache()->v8ExternalString(i
solate, string.impl()); | |
422 } | |
423 | |
424 inline v8::Local<v8::String> v8String(v8::Isolate* isolate, const CompressibleSt
ring& string) | 417 inline v8::Local<v8::String> v8String(v8::Isolate* isolate, const CompressibleSt
ring& string) |
425 { | 418 { |
426 if (string.isNull()) | 419 if (string.isNull()) |
427 return v8::String::Empty(isolate); | 420 return v8::String::Empty(isolate); |
428 return V8PerIsolateData::from(isolate)->getStringCache()->v8ExternalString(i
solate, string); | 421 return V8PerIsolateData::from(isolate)->getStringCache()->v8ExternalString(i
solate, string); |
429 } | 422 } |
430 | 423 |
431 inline v8::Local<v8::String> v8AtomicString(v8::Isolate* isolate, const char* st
r, int length = -1) | 424 inline v8::Local<v8::String> v8AtomicString(v8::Isolate* isolate, const char* st
r, int length = -1) |
432 { | 425 { |
433 ASSERT(isolate); | 426 ASSERT(isolate); |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 typedef void (*InstallTemplateFunction)(v8::Isolate*, const DOMWrapperWorld&, v8
::Local<v8::FunctionTemplate> interfaceTemplate); | 970 typedef void (*InstallTemplateFunction)(v8::Isolate*, const DOMWrapperWorld&, v8
::Local<v8::FunctionTemplate> interfaceTemplate); |
978 | 971 |
979 // Freeze a V8 object. The type of the first parameter and the return value is | 972 // Freeze a V8 object. The type of the first parameter and the return value is |
980 // intentionally v8::Value so that this function can wrap toV8(). | 973 // intentionally v8::Value so that this function can wrap toV8(). |
981 // If the argument isn't an object, this will crash. | 974 // If the argument isn't an object, this will crash. |
982 CORE_EXPORT v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>, v8::Isolat
e*); | 975 CORE_EXPORT v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>, v8::Isolat
e*); |
983 | 976 |
984 } // namespace blink | 977 } // namespace blink |
985 | 978 |
986 #endif // V8Binding_h | 979 #endif // V8Binding_h |
OLD | NEW |