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

Unified Diff: tools/parser-shell.cc

Issue 1217123004: Remove usage of to-be-deprecated APIs from tools (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | tools/parser-shell.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/parser-shell.cc
diff --git a/tools/parser-shell.cc b/tools/parser-shell.cc
index 8abe768a36bbb0f778f9f99394ea99bd23844cfc..ead7777022fd52a7ff0646b8602f2c4694edecf7 100644
--- a/tools/parser-shell.cc
+++ b/tools/parser-shell.cc
@@ -69,26 +69,29 @@ class StringResource8 : public v8::String::ExternalOneByteStringResource {
std::pair<v8::base::TimeDelta, v8::base::TimeDelta> RunBaselineParser(
const char* fname, Encoding encoding, int repeat, v8::Isolate* isolate,
- v8::Handle<v8::Context> context) {
+ v8::Local<v8::Context> context) {
int length = 0;
const byte* source = ReadFileAndRepeat(fname, &length, repeat);
- v8::Handle<v8::String> source_handle;
+ v8::Local<v8::String> source_handle;
switch (encoding) {
case UTF8: {
source_handle = v8::String::NewFromUtf8(
- isolate, reinterpret_cast<const char*>(source));
+ isolate, reinterpret_cast<const char*>(source),
+ v8::NewStringType::kNormal).ToLocalChecked();
break;
}
case UTF16: {
- source_handle = v8::String::NewFromTwoByte(
- isolate, reinterpret_cast<const uint16_t*>(source),
- v8::String::kNormalString, length / 2);
+ source_handle =
+ v8::String::NewFromTwoByte(
+ isolate, reinterpret_cast<const uint16_t*>(source),
+ v8::NewStringType::kNormal, length / 2).ToLocalChecked();
break;
}
case LATIN1: {
StringResource8* string_resource =
new StringResource8(reinterpret_cast<const char*>(source), length);
- source_handle = v8::String::NewExternal(isolate, string_resource);
+ source_handle = v8::String::NewExternalOneByte(isolate, string_resource)
+ .ToLocalChecked();
break;
}
}
@@ -170,7 +173,7 @@ int main(int argc, char* argv[]) {
{
v8::Isolate::Scope isolate_scope(isolate);
v8::HandleScope handle_scope(isolate);
- v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate);
+ v8::Local<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate);
v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global);
DCHECK(!context.IsEmpty());
{
« no previous file with comments | « no previous file | tools/parser-shell.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698