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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 // Return a V8 external string that shares the underlying buffer with the given | 400 // Return a V8 external string that shares the underlying buffer with the given |
401 // WebCore string. The reference counting mechanism is used to keep the | 401 // WebCore string. The reference counting mechanism is used to keep the |
402 // underlying buffer alive while the string is still live in the V8 engine. | 402 // underlying buffer alive while the string is still live in the V8 engine. |
403 inline v8::Local<v8::String> v8String(v8::Isolate* isolate, const String& string
) | 403 inline v8::Local<v8::String> v8String(v8::Isolate* isolate, const String& string
) |
404 { | 404 { |
405 if (string.isNull()) | 405 if (string.isNull()) |
406 return v8::String::Empty(isolate); | 406 return v8::String::Empty(isolate); |
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) | |
411 { | |
412 if (string.isNull()) | |
413 return v8::Null(isolate); | |
414 return V8PerIsolateData::from(isolate)->getStringCache()->v8ExternalString(i
solate, string.impl()); | |
415 } | |
416 | |
417 inline v8::Local<v8::String> v8String(v8::Isolate* isolate, const CompressibleSt
ring& string) | 410 inline v8::Local<v8::String> v8String(v8::Isolate* isolate, const CompressibleSt
ring& string) |
418 { | 411 { |
419 if (string.isNull()) | 412 if (string.isNull()) |
420 return v8::String::Empty(isolate); | 413 return v8::String::Empty(isolate); |
421 return V8PerIsolateData::from(isolate)->getStringCache()->v8ExternalString(i
solate, string); | 414 return V8PerIsolateData::from(isolate)->getStringCache()->v8ExternalString(i
solate, string); |
422 } | 415 } |
423 | 416 |
424 inline v8::Local<v8::String> v8AtomicString(v8::Isolate* isolate, const char* st
r, int length = -1) | 417 inline v8::Local<v8::String> v8AtomicString(v8::Isolate* isolate, const char* st
r, int length = -1) |
425 { | 418 { |
426 ASSERT(isolate); | 419 ASSERT(isolate); |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 typedef void (*InstallTemplateFunction)(v8::Isolate*, const DOMWrapperWorld&, v8
::Local<v8::FunctionTemplate> interfaceTemplate); | 963 typedef void (*InstallTemplateFunction)(v8::Isolate*, const DOMWrapperWorld&, v8
::Local<v8::FunctionTemplate> interfaceTemplate); |
971 | 964 |
972 // Freeze a V8 object. The type of the first parameter and the return value is | 965 // Freeze a V8 object. The type of the first parameter and the return value is |
973 // intentionally v8::Value so that this function can wrap toV8(). | 966 // intentionally v8::Value so that this function can wrap toV8(). |
974 // If the argument isn't an object, this will crash. | 967 // If the argument isn't an object, this will crash. |
975 CORE_EXPORT v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>, v8::Isolat
e*); | 968 CORE_EXPORT v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>, v8::Isolat
e*); |
976 | 969 |
977 } // namespace blink | 970 } // namespace blink |
978 | 971 |
979 #endif // V8Binding_h | 972 #endif // V8Binding_h |
OLD | NEW |