Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(842)

Unified Diff: src/extensions/externalize-string-extension.cc

Issue 559913002: Rename ascii to one-byte where applicable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/extensions/externalize-string-extension.cc
diff --git a/src/extensions/externalize-string-extension.cc b/src/extensions/externalize-string-extension.cc
index 3f31249c543b857e304628676b26dce7d8baee7d..8d38dfa0f015eee3e049412c9fc73a79b18c30d4 100644
--- a/src/extensions/externalize-string-extension.cc
+++ b/src/extensions/externalize-string-extension.cc
@@ -27,15 +27,15 @@ class SimpleStringResource : public Base {
};
-typedef SimpleStringResource<char, v8::String::ExternalAsciiStringResource>
- SimpleAsciiStringResource;
+typedef SimpleStringResource<char, v8::String::ExternalOneByteStringResource>
+ SimpleOneByteStringResource;
typedef SimpleStringResource<uc16, v8::String::ExternalStringResource>
SimpleTwoByteStringResource;
const char* const ExternalizeStringExtension::kSource =
"native function externalizeString();"
- "native function isAsciiString();";
+ "native function isOneByteString();";
v8::Handle<v8::FunctionTemplate>
ExternalizeStringExtension::GetNativeFunctionTemplate(
@@ -44,9 +44,9 @@ ExternalizeStringExtension::GetNativeFunctionTemplate(
return v8::FunctionTemplate::New(isolate,
ExternalizeStringExtension::Externalize);
} else {
- DCHECK(strcmp(*v8::String::Utf8Value(str), "isAsciiString") == 0);
+ DCHECK(strcmp(*v8::String::Utf8Value(str), "isOneByteString") == 0);
return v8::FunctionTemplate::New(isolate,
- ExternalizeStringExtension::IsAscii);
+ ExternalizeStringExtension::IsOneByte);
}
}
@@ -81,7 +81,7 @@ void ExternalizeStringExtension::Externalize(
if (string->IsOneByteRepresentation() && !force_two_byte) {
uint8_t* data = new uint8_t[string->length()];
String::WriteToFlat(*string, data, 0, string->length());
- SimpleAsciiStringResource* resource = new SimpleAsciiStringResource(
+ SimpleOneByteStringResource* resource = new SimpleOneByteStringResource(
reinterpret_cast<char*>(data), string->length());
result = string->MakeExternal(resource);
if (result) {
@@ -109,12 +109,12 @@ void ExternalizeStringExtension::Externalize(
}
-void ExternalizeStringExtension::IsAscii(
+void ExternalizeStringExtension::IsOneByte(
const v8::FunctionCallbackInfo<v8::Value>& args) {
if (args.Length() != 1 || !args[0]->IsString()) {
args.GetIsolate()->ThrowException(v8::String::NewFromUtf8(
args.GetIsolate(),
- "isAsciiString() requires a single string argument."));
+ "isOneByteString() requires a single string argument."));
return;
}
bool is_one_byte =
« no previous file with comments | « src/extensions/externalize-string-extension.h ('k') | src/factory.h » ('j') | src/jsregexp.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698