refactor: remove unused fields, methods in gin_helper::Locker (#39803)

* refactor: remove unused field gin_helper::Locker::g_is_browser_process

refactor: remove unused field gin_helper::Locker::g_is_renderer_process

refactor: make field const gin_helper::Locker::locker_

* refactor: remove unused declaration gin_helper::Locker::new()

refactor: remove unused declaration gin_helper::Locker::delete()

* refactor: make field const electron::JavascriptEnvironment::locker_

* refactor: remove unused #include gin_helper/locker.h
This commit is contained in:
Charles Kerr 2023-09-12 18:53:20 -05:00 committed by GitHub
parent 650ef9a51c
commit f6e8a42c48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 14 deletions

View file

@ -49,7 +49,7 @@ class JavascriptEnvironment {
const raw_ptr<v8::Isolate> isolate_; const raw_ptr<v8::Isolate> isolate_;
// depends-on: isolate_ // depends-on: isolate_
v8::Locker locker_; const v8::Locker locker_;
std::unique_ptr<MicrotasksRunner> microtasks_runner_; std::unique_ptr<MicrotasksRunner> microtasks_runner_;
}; };

View file

@ -4,7 +4,6 @@
#include "shell/common/gin_helper/event_emitter_caller.h" #include "shell/common/gin_helper/event_emitter_caller.h"
#include "shell/common/gin_helper/locker.h"
#include "shell/common/gin_helper/microtasks_scope.h" #include "shell/common/gin_helper/microtasks_scope.h"
#include "shell/common/node_includes.h" #include "shell/common/node_includes.h"

View file

@ -8,10 +8,9 @@
namespace gin_helper { namespace gin_helper {
Locker::Locker(v8::Isolate* isolate) { Locker::Locker(v8::Isolate* isolate)
if (electron::IsBrowserProcess()) : locker_{electron::IsBrowserProcess() ? new v8::Locker{isolate}
locker_ = std::make_unique<v8::Locker>(isolate); : nullptr} {}
}
Locker::~Locker() = default; Locker::~Locker() = default;

View file

@ -22,13 +22,7 @@ class Locker {
Locker& operator=(const Locker&) = delete; Locker& operator=(const Locker&) = delete;
private: private:
void* operator new(size_t size); const std::unique_ptr<v8::Locker> locker_;
void operator delete(void*, size_t);
std::unique_ptr<v8::Locker> locker_;
static bool g_is_browser_process;
static bool g_is_renderer_process;
}; };
} // namespace gin_helper } // namespace gin_helper

View file

@ -31,7 +31,6 @@
#include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/dictionary.h"
#include "shell/common/gin_helper/event.h" #include "shell/common/gin_helper/event.h"
#include "shell/common/gin_helper/event_emitter_caller.h" #include "shell/common/gin_helper/event_emitter_caller.h"
#include "shell/common/gin_helper/locker.h"
#include "shell/common/gin_helper/microtasks_scope.h" #include "shell/common/gin_helper/microtasks_scope.h"
#include "shell/common/mac/main_application_bundle.h" #include "shell/common/mac/main_application_bundle.h"
#include "shell/common/world_ids.h" #include "shell/common/world_ids.h"