#include "third_party/blink/renderer/platform/bindings/to_blink_string.h"
#include <type_traits>
#include "third_party/blink/renderer/platform/bindings/string_resource.h"
#include "third_party/blink/renderer/platform/bindings/v8_binding.h"
namespace blink {
namespace {
template <class StringClass>
struct StringTraits { … };
template <>
struct StringTraits<String> { … };
template <>
struct StringTraits<AtomicString> { … };
struct V8StringTwoBytesTrait { … };
struct V8StringOneByteTrait { … };
template <typename V8StringTrait>
String StringTraits<String>::FromV8String(v8::Isolate* isolate,
v8::Local<v8::String> v8_string,
int length) { … }
template <typename V8StringTrait>
AtomicString StringTraits<AtomicString>::FromV8String(
v8::Isolate* isolate,
v8::Local<v8::String> v8_string,
int length) { … }
ALWAYS_INLINE bool CanExternalize(v8::Local<v8::String> v8_string,
ExternalMode mode,
bool is_one_byte) { … }
ALWAYS_INLINE StringResourceBase* GetExternalizedString(
v8::Isolate* isolate,
v8::Local<v8::String> v8_string) { … }
template <typename StringType>
ALWAYS_INLINE StringType
ConvertAndExternalizeString(v8::Isolate* isolate,
v8::Local<v8::String> v8_string,
bool can_externalize,
bool is_one_byte,
bool* was_externalized) { … }
}
template <typename StringType>
StringType ToBlinkString(v8::Isolate* isolate,
v8::Local<v8::String> v8_string,
ExternalMode mode) { … }
template String ToBlinkString<String>(v8::Isolate* isolate,
v8::Local<v8::String>,
ExternalMode);
template AtomicString ToBlinkString<AtomicString>(v8::Isolate* isolate,
v8::Local<v8::String>,
ExternalMode);
StringView ToBlinkStringView(v8::Isolate* isolate,
v8::Local<v8::String> v8_string,
StringView::StackBackingStore& backing_store,
ExternalMode mode) { … }
static String ToBlinkStringFast(int value) { … }
String ToBlinkString(int value) { … }
}