fix: remove deprecated usage of v8::String::NewFromUtf8

This commit is contained in:
Samuel Attard
2019-02-14 14:27:34 -08:00
parent 3396d08a3b
commit 277373a95a
2 changed files with 6 additions and 2 deletions

View File

@@ -57,7 +57,9 @@ void SavePageHandler::OnDownloadUpdated(download::DownloadItem* item) {
callback_.Run(v8::Null(isolate));
} else {
v8::Local<v8::String> error_message =
v8::String::NewFromUtf8(isolate, "Fail to save page");
v8::String::NewFromUtf8(isolate, "Fail to save page",
v8::NewStringType::kNormal)
.ToLocalChecked();
callback_.Run(v8::Exception::Error(error_message));
}
Destroy(item);

View File

@@ -173,7 +173,9 @@ void PrintPreviewMessageHandler::RunPrintToPDFCallback(
print_to_pdf_callback_map_[request_id].Run(v8::Null(isolate), buffer);
} else {
v8::Local<v8::String> error_message =
v8::String::NewFromUtf8(isolate, "Failed to generate PDF");
v8::String::NewFromUtf8(isolate, "Failed to generate PDF",
v8::NewStringType::kNormal)
.ToLocalChecked();
print_to_pdf_callback_map_[request_id].Run(
v8::Exception::Error(error_message), v8::Null(isolate));
}