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

Unified Diff: src/d8-debug.cc

Issue 83333002: Remove usage of deprecated APIs from d8 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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 | « src/d8.gyp ('k') | src/d8-posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8-debug.cc
diff --git a/src/d8-debug.cc b/src/d8-debug.cc
index 379631cb7c5a5bd2eee80870db93a5bf1884cb6f..6c297d73969500a4d9d177f2d814124c56e1b2d3 100644
--- a/src/d8-debug.cc
+++ b/src/d8-debug.cc
@@ -63,7 +63,8 @@ void HandleDebugEvent(const Debug::EventDetails& event_details) {
TryCatch try_catch;
// Get the toJSONProtocol function on the event and get the JSON format.
- Local<String> to_json_fun_name = String::New("toJSONProtocol");
+ Local<String> to_json_fun_name =
+ String::NewFromUtf8(isolate, "toJSONProtocol");
Handle<Object> event_data = event_details.GetEventData();
Local<Function> to_json_fun =
Local<Function>::Cast(event_data->Get(to_json_fun_name));
@@ -80,7 +81,7 @@ void HandleDebugEvent(const Debug::EventDetails& event_details) {
Shell::ReportException(isolate, &try_catch);
return;
}
- String::Utf8Value str(details->Get(String::New("text")));
+ String::Utf8Value str(details->Get(String::NewFromUtf8(isolate, "text")));
if (str.length() == 0) {
// Empty string is used to signal not to process this event.
return;
@@ -88,7 +89,8 @@ void HandleDebugEvent(const Debug::EventDetails& event_details) {
printf("%s\n", *str);
// Get the debug command processor.
- Local<String> fun_name = String::New("debugCommandProcessor");
+ Local<String> fun_name =
+ String::NewFromUtf8(isolate, "debugCommandProcessor");
Handle<Object> exec_state = event_details.GetExecutionState();
Local<Function> fun = Local<Function>::Cast(exec_state->Get(fun_name));
Local<Object> cmd_processor =
@@ -112,8 +114,8 @@ void HandleDebugEvent(const Debug::EventDetails& event_details) {
TryCatch try_catch;
// Convert the debugger command to a JSON debugger request.
- Handle<Value> request =
- Shell::DebugCommandToJSONRequest(isolate, String::New(command));
+ Handle<Value> request = Shell::DebugCommandToJSONRequest(
+ isolate, String::NewFromUtf8(isolate, command));
if (try_catch.HasCaught()) {
Shell::ReportException(isolate, &try_catch);
continue;
@@ -134,7 +136,7 @@ void HandleDebugEvent(const Debug::EventDetails& event_details) {
// Invoke the JavaScript to convert the debug command line to a JSON
// request, invoke the JSON request and convert the JSON respose to a text
// representation.
- fun_name = String::New("processDebugRequest");
+ fun_name = String::NewFromUtf8(isolate, "processDebugRequest");
fun = Handle<Function>::Cast(cmd_processor->Get(fun_name));
args[0] = request;
Handle<Value> response_val = fun->Call(cmd_processor, kArgc, args);
@@ -151,12 +153,14 @@ void HandleDebugEvent(const Debug::EventDetails& event_details) {
Shell::ReportException(isolate, &try_catch);
continue;
}
- String::Utf8Value text_str(response_details->Get(String::New("text")));
+ String::Utf8Value text_str(
+ response_details->Get(String::NewFromUtf8(isolate, "text")));
if (text_str.length() > 0) {
printf("%s\n", *text_str);
}
- running =
- response_details->Get(String::New("running"))->ToBoolean()->Value();
+ running = response_details->Get(String::NewFromUtf8(isolate, "running"))
+ ->ToBoolean()
+ ->Value();
}
}
@@ -273,15 +277,14 @@ void RemoteDebugger::HandleMessageReceived(char* message) {
// Print the event details.
TryCatch try_catch;
- Handle<Object> details =
- Shell::DebugMessageDetails(isolate_,
- Handle<String>::Cast(String::New(message)));
+ Handle<Object> details = Shell::DebugMessageDetails(
+ isolate_, Handle<String>::Cast(String::NewFromUtf8(isolate_, message)));
if (try_catch.HasCaught()) {
Shell::ReportException(isolate_, &try_catch);
PrintPrompt();
return;
}
- String::Utf8Value str(details->Get(String::New("text")));
+ String::Utf8Value str(details->Get(String::NewFromUtf8(isolate_, "text")));
if (str.length() == 0) {
// Empty string is used to signal not to process this event.
return;
@@ -292,7 +295,9 @@ void RemoteDebugger::HandleMessageReceived(char* message) {
printf("???\n");
}
- bool is_running = details->Get(String::New("running"))->ToBoolean()->Value();
+ bool is_running = details->Get(String::NewFromUtf8(isolate_, "running"))
+ ->ToBoolean()
+ ->Value();
PrintPrompt(is_running);
}
@@ -303,8 +308,8 @@ void RemoteDebugger::HandleKeyboardCommand(char* command) {
// Convert the debugger command to a JSON debugger request.
TryCatch try_catch;
- Handle<Value> request =
- Shell::DebugCommandToJSONRequest(isolate_, String::New(command));
+ Handle<Value> request = Shell::DebugCommandToJSONRequest(
+ isolate_, String::NewFromUtf8(isolate_, command));
if (try_catch.HasCaught()) {
Shell::ReportException(isolate_, &try_catch);
PrintPrompt();
« no previous file with comments | « src/d8.gyp ('k') | src/d8-posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698