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:
parent
650ef9a51c
commit
f6e8a42c48
5 changed files with 5 additions and 14 deletions
|
@ -49,7 +49,7 @@ class JavascriptEnvironment {
|
|||
const raw_ptr<v8::Isolate> isolate_;
|
||||
|
||||
// depends-on: isolate_
|
||||
v8::Locker locker_;
|
||||
const v8::Locker locker_;
|
||||
|
||||
std::unique_ptr<MicrotasksRunner> microtasks_runner_;
|
||||
};
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#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/node_includes.h"
|
||||
|
||||
|
|
|
@ -8,10 +8,9 @@
|
|||
|
||||
namespace gin_helper {
|
||||
|
||||
Locker::Locker(v8::Isolate* isolate) {
|
||||
if (electron::IsBrowserProcess())
|
||||
locker_ = std::make_unique<v8::Locker>(isolate);
|
||||
}
|
||||
Locker::Locker(v8::Isolate* isolate)
|
||||
: locker_{electron::IsBrowserProcess() ? new v8::Locker{isolate}
|
||||
: nullptr} {}
|
||||
|
||||
Locker::~Locker() = default;
|
||||
|
||||
|
|
|
@ -22,13 +22,7 @@ class Locker {
|
|||
Locker& operator=(const Locker&) = delete;
|
||||
|
||||
private:
|
||||
void* operator new(size_t size);
|
||||
void operator delete(void*, size_t);
|
||||
|
||||
std::unique_ptr<v8::Locker> locker_;
|
||||
|
||||
static bool g_is_browser_process;
|
||||
static bool g_is_renderer_process;
|
||||
const std::unique_ptr<v8::Locker> locker_;
|
||||
};
|
||||
|
||||
} // namespace gin_helper
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/gin_helper/event.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/mac/main_application_bundle.h"
|
||||
#include "shell/common/world_ids.h"
|
||||
|
|
Loading…
Reference in a new issue