chore: remove native_mate (Part 7) (#20561)

* refactor: use gin converters in api::Protocol

* refactor: convert JS constructor impl to gin

* refactor: use InitWithArgs helper

* fix: gin_helper::Dictionary should behave the same with mate

* fix cpplint warnings

* refactor: no more need to patch gin/dictionary.h
This commit is contained in:
Cheng Zhao 2019-10-15 10:15:23 +09:00 committed by GitHub
parent 6c6bff81ac
commit 1ecfcc8c70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 274 additions and 368 deletions

View file

@ -108,11 +108,10 @@ TopLevelWindow::TopLevelWindow(v8::Isolate* isolate,
#endif
}
TopLevelWindow::TopLevelWindow(v8::Isolate* isolate,
v8::Local<v8::Object> wrapper,
TopLevelWindow::TopLevelWindow(gin::Arguments* args,
const mate::Dictionary& options)
: TopLevelWindow(isolate, options) {
InitWith(isolate, wrapper);
: TopLevelWindow(args->isolate(), options) {
InitWithArgs(args);
// Init window after everything has been setup.
window()->InitFromOptions(options);
}
@ -1057,11 +1056,11 @@ void TopLevelWindow::RemoveFromParentChildWindows() {
}
// static
mate::WrappableBase* TopLevelWindow::New(mate::Arguments* args) {
mate::WrappableBase* TopLevelWindow::New(gin::Arguments* args) {
mate::Dictionary options = mate::Dictionary::CreateEmpty(args->isolate());
args->GetNext(&options);
return new TopLevelWindow(args->isolate(), args->GetThis(), options);
return new TopLevelWindow(args, options);
}
// static