chore: remove deprecated app.runningUnderRosettaTranslation() (#39956)

This commit is contained in:
Milan Burda 2023-10-02 10:55:32 +02:00 committed by GitHub
parent 5643e86956
commit d301616f60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 27 deletions

View file

@ -1767,8 +1767,6 @@ gin::ObjectTemplateBuilder App::GetObjectTemplateBuilder(v8::Isolate* isolate) {
#endif
#if BUILDFLAG(IS_MAC)
.SetProperty("dock", &App::GetDockAPI)
.SetProperty("runningUnderRosettaTranslation",
&App::IsRunningUnderRosettaTranslation)
#endif
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
.SetProperty("runningUnderARM64Translation",

View file

@ -229,7 +229,6 @@ class App : public ElectronBrowserClient::Delegate,
bool MoveToApplicationsFolder(gin_helper::ErrorThrower, gin::Arguments* args);
bool IsInApplicationsFolder();
v8::Local<v8::Value> GetDockAPI(v8::Isolate* isolate);
bool IsRunningUnderRosettaTranslation() const;
v8::Global<v8::Value> dock_;
#endif

View file

@ -60,17 +60,6 @@ void App::SetActivationPolicy(gin_helper::ErrorThrower thrower,
[NSApp setActivationPolicy:activation_policy];
}
bool App::IsRunningUnderRosettaTranslation() const {
node::Environment* env =
node::Environment::GetCurrent(JavascriptEnvironment::GetIsolate());
EmitWarning(env,
"The app.runningUnderRosettaTranslation API is deprecated, use "
"app.runningUnderARM64Translation instead.",
"electron");
return IsRunningUnderARM64Translation();
}
bool App::IsRunningUnderARM64Translation() const {
int proc_translated = 0;
size_t size = sizeof(proc_translated);