refactor: add EmitWarning(v8::Isolate*) helper (#43736)

refactor: add `EmitWarning(v8::Isolate*)` helper (#43722)

* refactor: add EmitWarning(Isolate*, ...) warning

* chore: remove EmitWarning(node::Environment*, ...)

* chore: add code comments

* fixup! refactor: add EmitWarning(Isolate*, ...) warning

* chore: remove unused node #includes
This commit is contained in:
Charles Kerr 2024-09-17 04:50:48 -05:00 committed by GitHub
parent 18bd295873
commit d11c840cf0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 69 additions and 84 deletions

View file

@ -21,6 +21,7 @@
#include "base/files/file_util.h"
#include "base/json/json_reader.h"
#include "base/no_destructor.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/current_thread.h"
#include "base/threading/scoped_blocking_call.h"
@ -128,8 +129,8 @@
#include "shell/common/gin_helper/promise.h"
#include "shell/common/language_util.h"
#include "shell/common/node_includes.h"
#include "shell/common/node_util.h"
#include "shell/common/options_switches.h"
#include "shell/common/process_util.h"
#include "shell/common/thread_restrictions.h"
#include "shell/common/v8_value_serializer.h"
#include "storage/browser/file_system/isolated_context.h"
@ -2098,10 +2099,9 @@ void WebContents::DidFinishNavigation(
// Do not emit "did-fail-load" for canceled requests.
if (code != net::ERR_ABORTED) {
EmitWarning(
node::Environment::GetCurrent(JavascriptEnvironment::GetIsolate()),
"Failed to load URL: " + url.possibly_invalid_spec() +
" with error: " + description,
util::EmitWarning(
base::StrCat({"Failed to load URL: ", url.possibly_invalid_spec(),
" with error: ", description}),
"electron");
Emit("did-fail-load", code, description, url, is_main_frame,
frame_process_id, frame_routing_id);