v8.h | v8.h | |||
---|---|---|---|---|
skipping to change at line 819 | skipping to change at line 819 | |||
/** | /** | |||
* Returns true if the string is external | * Returns true if the string is external | |||
*/ | */ | |||
bool IsExternal() const; | bool IsExternal() const; | |||
/** | /** | |||
* Returns true if the string is both external and ascii | * Returns true if the string is both external and ascii | |||
*/ | */ | |||
bool IsExternalAscii() const; | bool IsExternalAscii() const; | |||
class V8EXPORT ExternalStringResourceBase { | ||||
public: | ||||
virtual ~ExternalStringResourceBase() {} | ||||
protected: | ||||
ExternalStringResourceBase() {} | ||||
private: | ||||
// Disallow copying and assigning. | ||||
ExternalStringResourceBase(const ExternalStringResourceBase&); | ||||
void operator=(const ExternalStringResourceBase&); | ||||
}; | ||||
/** | /** | |||
* An ExternalStringResource is a wrapper around a two-byte string | * An ExternalStringResource is a wrapper around a two-byte string | |||
* buffer that resides outside V8's heap. Implement an | * buffer that resides outside V8's heap. Implement an | |||
* ExternalStringResource to manage the life cycle of the underlying | * ExternalStringResource to manage the life cycle of the underlying | |||
* buffer. Note that the string data must be immutable. | * buffer. Note that the string data must be immutable. | |||
*/ | */ | |||
class V8EXPORT ExternalStringResource { // NOLINT | class V8EXPORT ExternalStringResource | |||
: public ExternalStringResourceBase { | ||||
public: | public: | |||
/** | /** | |||
* Override the destructor to manage the life cycle of the underlying | * Override the destructor to manage the life cycle of the underlying | |||
* buffer. | * buffer. | |||
*/ | */ | |||
virtual ~ExternalStringResource() {} | virtual ~ExternalStringResource() {} | |||
/** The string data from the underlying buffer.*/ | /** The string data from the underlying buffer.*/ | |||
virtual const uint16_t* data() const = 0; | virtual const uint16_t* data() const = 0; | |||
/** The length of the string. That is, the number of two-byte character s.*/ | /** The length of the string. That is, the number of two-byte character s.*/ | |||
virtual size_t length() const = 0; | virtual size_t length() const = 0; | |||
protected: | protected: | |||
ExternalStringResource() {} | ExternalStringResource() {} | |||
private: | ||||
// Disallow copying and assigning. | ||||
ExternalStringResource(const ExternalStringResource&); | ||||
void operator=(const ExternalStringResource&); | ||||
}; | }; | |||
/** | /** | |||
* An ExternalAsciiStringResource is a wrapper around an ascii | * An ExternalAsciiStringResource is a wrapper around an ascii | |||
* string buffer that resides outside V8's heap. Implement an | * string buffer that resides outside V8's heap. Implement an | |||
* ExternalAsciiStringResource to manage the life cycle of the | * ExternalAsciiStringResource to manage the life cycle of the | |||
* underlying buffer. Note that the string data must be immutable | * underlying buffer. Note that the string data must be immutable | |||
* and that the data must be strict 7-bit ASCII, not Latin1 or | * and that the data must be strict 7-bit ASCII, not Latin1 or | |||
* UTF-8, which would require special treatment internally in the | * UTF-8, which would require special treatment internally in the | |||
* engine and, in the case of UTF-8, do not allow efficient indexing. | * engine and, in the case of UTF-8, do not allow efficient indexing. | |||
* Use String::New or convert to 16 bit data for non-ASCII. | * Use String::New or convert to 16 bit data for non-ASCII. | |||
*/ | */ | |||
class V8EXPORT ExternalAsciiStringResource { // NOLINT | class V8EXPORT ExternalAsciiStringResource | |||
: public ExternalStringResourceBase { | ||||
public: | public: | |||
/** | /** | |||
* Override the destructor to manage the life cycle of the underlying | * Override the destructor to manage the life cycle of the underlying | |||
* buffer. | * buffer. | |||
*/ | */ | |||
virtual ~ExternalAsciiStringResource() {} | virtual ~ExternalAsciiStringResource() {} | |||
/** The string data from the underlying buffer.*/ | /** The string data from the underlying buffer.*/ | |||
virtual const char* data() const = 0; | virtual const char* data() const = 0; | |||
/** The number of ascii characters in the string.*/ | /** The number of ascii characters in the string.*/ | |||
virtual size_t length() const = 0; | virtual size_t length() const = 0; | |||
protected: | protected: | |||
ExternalAsciiStringResource() {} | ExternalAsciiStringResource() {} | |||
private: | ||||
// Disallow copying and assigning. | ||||
ExternalAsciiStringResource(const ExternalAsciiStringResource&); | ||||
void operator=(const ExternalAsciiStringResource&); | ||||
}; | }; | |||
/** | /** | |||
* Get the ExternalStringResource for an external string. Returns | * Get the ExternalStringResource for an external string. Returns | |||
* NULL if IsExternal() doesn't return true. | * NULL if IsExternal() doesn't return true. | |||
*/ | */ | |||
inline ExternalStringResource* GetExternalStringResource() const; | inline ExternalStringResource* GetExternalStringResource() const; | |||
/** | /** | |||
* Get the ExternalAsciiStringResource for an external ascii string. | * Get the ExternalAsciiStringResource for an external ascii string. | |||
End of changes. 5 change blocks. | ||||
10 lines changed or deleted | 16 lines changed or added | |||