mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
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:
@@ -24,8 +24,7 @@
|
||||
#include "shell/common/gin_converters/content_converter.h"
|
||||
#include "shell/common/gin_converters/hid_device_info_converter.h"
|
||||
#include "shell/common/gin_converters/value_converter.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "shell/common/process_util.h"
|
||||
#include "shell/common/node_util.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
|
||||
namespace {
|
||||
@@ -204,10 +203,9 @@ void HidChooserController::OnDeviceChosen(gin::Arguments* args) {
|
||||
}
|
||||
RunCallback(std::move(devices));
|
||||
} else {
|
||||
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
||||
node::Environment* env = node::Environment::GetCurrent(isolate);
|
||||
EmitWarning(env, "The device id " + device_id + " was not found.",
|
||||
"UnknownHIDDeviceId");
|
||||
util::EmitWarning(
|
||||
base::StrCat({"The device id ", device_id, " was not found."}),
|
||||
"UnknownHIDDeviceId");
|
||||
RunCallback({});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user