Do not rely on Constructor to call Init
This makes it deterministic when the JavaScript is initialized, which can make our logic more clear.
This commit is contained in:
parent
84bb82866d
commit
1505a46ed0
11 changed files with 44 additions and 44 deletions
|
@ -40,7 +40,7 @@ class WebContents;
|
|||
class Window : public mate::TrackableObject<Window>,
|
||||
public NativeWindowObserver {
|
||||
public:
|
||||
static mate::WrappableBase* New(v8::Isolate* isolate, mate::Arguments* args);
|
||||
static mate::WrappableBase* New(mate::Arguments* args);
|
||||
|
||||
static void BuildPrototype(v8::Isolate* isolate,
|
||||
v8::Local<v8::ObjectTemplate> prototype);
|
||||
|
@ -52,12 +52,10 @@ class Window : public mate::TrackableObject<Window>,
|
|||
NativeWindow* window() const { return window_.get(); }
|
||||
|
||||
protected:
|
||||
Window(v8::Isolate* isolate, const mate::Dictionary& options);
|
||||
Window(v8::Isolate* isolate, v8::Local<v8::Object> wrapper,
|
||||
const mate::Dictionary& options);
|
||||
~Window() override;
|
||||
|
||||
// TrackableObject:
|
||||
void AfterInit(v8::Isolate* isolate) override;
|
||||
|
||||
// NativeWindowObserver:
|
||||
void WillCloseWindow(bool* prevent_default) override;
|
||||
void WillDestoryNativeObject() override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue