Commit graph

879 commits

Author SHA1 Message Date
Samuel Attard
509120acde
Merge pull request #13456 from electron/native-mate-in-electron-3
Native mate in electron 3
2018-06-27 17:45:04 +10:00
Samuel Attard
b472a69279
Revert "Native mate in electron 3 (#13450)" (#13455)
This reverts commit 7f3620bee3.
2018-06-27 17:43:01 +10:00
Samuel Attard
7f3620bee3
Native mate in electron 3 (#13450)
* Initial commit.

* Do not rely on latest base/template_util.

* Enable modifying existing ObjectTemplate.

* Fix compilation error of function_template.

* Add initial Constructor type.

* Fix passing the wrong parameter.

* Make the Constructor accept arbitrary callback.

* Cleanup.

* Constructor should wrap the this pointer.

* Simplify Wrappable API.

* Remove helper typedefs.

* Support function with 7 parameters.

* Enable converting void*.

* Enable setting method in Dictionary.

* Add v8::Handle<v8::String> to converter.

* Make ScopedPersistent do type conversion.

* Add Arguments.Length method.

* Do not wrap an object when it's already wrapped.

* No need to reset wrapper_ when we would run destructor.

* Call object._init if we have one.

* Add object() accessor for Dictionary.

* Add converter for const char*.

* Enable creating empty Dictionary directly.

* Mark Dictionary.Get as const.

* Strictly check for boolean type.

* Add .gitignore.

* Add APIs to match new V8 APIs.

* Bring back ScopedPersistent.SetWeak.

* Some more APIs fixes.

* Reset handle in weak callback.

This doesn't seem to be neccesary, but we had better follow what upstream does.

* Enable converting ScopedPersistent.

* Fix compilation error with node 0.10.

* Fix compilation error of Constructor and ScopedPersistent in node 0.10.

* Use pump to generate source files.

* Add callback converter.

* Make ScopedPersistent's interface consistent with V8.

* Remove unused constructor of Dictionary.

* Add PersistentDictionary.

* Make throwing exception when parsing args easier

* Use NODE_VERSION_AT_LEAST to determine node version

* Don't throw error in Constructor

* Guard against non-constructor call in Constructor::New

* Fix throwing error in constructor

* Fix ignored exception thrown from constructor.

* OVERRIDE => override

* Avoid unnecessary copy in ConvertToV8

* Check internal field before converting

* Remove unneeded helper

* Add AfterInit method for Wrappable

* Add converter for unsigned long

* usigned long is uint64 on Linux

* Don't reset handle before Wrappable is destroyed

It is possible that the user wants to use the V8 object in the destructor.

Fixes atom/atom-shell#1112.

* added std::set converter

* Use Local instead of Handle

* Pass Handle to upper HandleScope when returning a V8 Handle

* Enter context before calling callback

* Allow converting Array

* Remember isolate in Wrappable

* Make isolate() public

* Check for null when converting Wrappable

* Add IsDestroyed method for Wrappable

* Allow specify methods that can be called after object is destroyed

* Use C++11 version of CreateFunctionTemplate

* Remove callback.h

* Remove locker.h

* Add Dictionary::CreateEmpty

* GetNext should have no side effect when failed

* Don't convert Function to Dictionary

* Don't pass callback as const reference

* Add SetHidden for Dictionary

* Use the new SetWeak in Wrappable

* Check whether key exists in Dictionary::Get

* Don't return v8::Maybe for std::vector

* Add Dictionary::Delete

* Do not manually destroy native resources

* isDestroy => isDestroyed

* Fix converter for std::set

* Improve error message for type error

Close atom/electron#4307.

* Clear internal field when Wrapper is destroyed

* basic_types.h => macros.h

* use v8::private symbols as identifiers for object properties

* Make Wrappable a template class

* Leak Wrappable's template

Since it is declared as static variable it will be released
automatically when process exits, which causes crashes in
renderer process because the template will then be released
later than V8 is closed.

This commit simply leaks the template so the crash won't happen,
this leak should be fine since leaking resource on exit is not
a bad thing.

* Handle.ToV8 should return Object

* Add converter for std::map

* Setup v8::MicrotasksScope for callbacks

* Update to API changes of V8 5.2

* CHECK is not needed

* Call the user call Init in Constructor

* Make InitWith virtual

* Turn Wrappable into using FunctionTemplate

* Create objects from InstanceTemplate

* NewOperatorFactory is not used

* Remove the Constructor class

* GetConstructor should init default constructor

* Pass FunctionTemplate in BuildPrototype

* Do not set constructor name in SetConstructor

* Use ToDetailString for processing error message

* Add back empty handle string

* Add README

* create empty handle for null or undefined value

* Support setting read-only property value

* Add Converter<std::map<std::string, T>>::ToV8

* Add CI build through Electron

* Support 5 argument member function

* Use std functions instead of template_util

* Make Wrappable thread safe

* Use gin to manage FunctionTemplate

Sadly there is no way for us to know when V8 is closing, thus it is
impossible for us to clean the FunctionTemplate on exit at the right
time, which is critcal for multi-thread environment.

* add ability to set high memory usage, skipping the second round of GC callbacks

* Fix broken link

* Add a converter for `nullptr_t`

* Upstream Muon changes to avoid crashing

* only mark handle as independent when it's a high memory user

* Remove WrappableBase::GetWrapper() DCHECK

* virtual members need a virtual destructor

* GetWrapper should be const

* Add support for FreeBSD

* Remove usage of MarkIndependent api

https://bugs.chromium.org/p/chromium/issues/detail?id=780749
Use Active/Not Active as indicator whether the Scavenger can drop wrappers

* Address breaking API

* Fix Value::ToDetailString() call

See https://chromium-review.googlesource.com/848782

* Revert "Address breaking API"

This reverts commit e20cf8687e.

* Add mate::Promise

* Update travis settings

Use Node.js 9.7.0 and Xcode 9.3.

* Update appveyor settings

Use Visual Studio 2017.

* Remove mate::TryCatch (#26)

It's not used anywhere. We use v8::TryCatch instead.

* Address breaking API

* Don't copy things on Dictionary::Set

* Remove native_mate/compat.h

* prepare for merging to electron

* remove native_mate submodule

* update paths for native_mate

* move native_mate script to the electron scripts dir

* rename back to expected values

* fix linting
2018-06-27 17:42:20 +10:00
trop[bot]
21d4ef5eab fix: do not expose Node's external strings (#13452) 2018-06-27 11:40:44 +09:00
Samuel Attard
7f8cd51f63 remove native_mate submodule 2018-06-27 10:04:51 +10:00
trop[bot]
957f008726 fix: repair fs.statSyncNoException throwing exceptions (#13397) 2018-06-23 17:27:38 +10:00
Aleksei Kuzmin
e683af1eb6 Update vendor/libchromiumcontent ref 2018-06-19 18:12:41 +02:00
Samuel Attard
906ef3da6a Fix windows desktop_capturer build 2018-06-19 17:41:43 +10:00
Samuel Attard
42c37cc26d Bump libcc for desktop capturer fix 2018-06-19 15:16:13 +10:00
John Kleinschmidt
56ae882bb8 Update libcc 2018-06-18 23:20:31 -04:00
Aleksei Kuzmin
6c604e1eb3 Update vendor/libchromiumcontent ref 2018-06-19 11:49:46 +10:00
Samuel Attard
c882b37a40 Bump node to fix native module rebuilding 2018-06-19 11:49:46 +10:00
Samuel Attard
a64def5745 Bump node vendor to remove openssl compile warning 2018-06-19 11:49:46 +10:00
Aleksei Kuzmin
792bb9b4a8 Update vendor/libchromiumcontent ref 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
caed1c37e0 Update vendor/libchromiumcontent ref 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
cd428a047f Update vendor/libchromiumcontent ref 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
a7d2f7531c Update vendor/node ref 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
6481161ef2 Update vendor/libchromiumcontent ref 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
6e11494d0b Update vendor/node ref 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
c3ccd42a23 Update the vendor/libchromiumcontent ref 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
81398c1fde Use Chromium 66.0.3359.181 and Node.js 10.2.0 2018-06-19 11:49:44 +10:00
Aleksei Kuzmin
dd444fd429 Update vendor/libchromiumcontent ref 2018-06-19 11:49:44 +10:00
Aleksei Kuzmin
6d7e281dc8 Update vendor/node ref 2018-06-19 11:49:44 +10:00
Aleksei Kuzmin
7616cb38a7 Update vendor/libchromiumcontent ref 2018-06-19 11:49:44 +10:00
Tomas Rycl
a9eb267f92 Update vendor/node ref 2018-06-19 11:49:44 +10:00
Aleksei Kuzmin
3e6e01eb94 Update vendor/libchromiumcontent ref 2018-06-19 11:49:44 +10:00
Aleksei Kuzmin
42d84bbd70 Use Node 10.0.0 2018-06-19 11:49:44 +10:00
Nitish Sakhawalkar
3ac4c1f03f Update libcc and replace snapshot_blob.bin by v8_context_snapshot.bin 2018-06-19 11:49:43 +10:00
Aleksei Kuzmin
623ed84b23 Update vendor/libchromiumcontent ref 2018-06-19 11:49:43 +10:00
Aleksei Kuzmin
aaef07e637 Update vendor/libchromiumcontent ref 2018-06-19 11:49:43 +10:00
Aleksei Kuzmin
97414cc931 Update vendor/libchromiumcontent ref 2018-06-19 11:49:43 +10:00
Aleksei Kuzmin
5451635df0 Update vendor/node ref 2018-06-19 11:49:43 +10:00
Aleksei Kuzmin
9e3011dbcd Update libcc ref 2018-06-19 11:49:43 +10:00
Aleksei Kuzmin
37d64e6a00 Update vendor/node ref
To get changes from
a635a8aa8f
2018-06-19 11:49:42 +10:00
Aleksei Kuzmin
4236c17654 Use native-mate from the Ch66 branch 2018-06-19 11:49:42 +10:00
Aleksei Kuzmin
24db18f34e Update libcc ref 2018-06-19 11:49:42 +10:00
Samuel Attard
3da6450b0c Bump libcc to get builds 2018-06-19 11:49:41 +10:00
Aleksei Kuzmin
48c3340d95 Update the vendor/node reference 2018-06-19 11:49:40 +10:00
Aleksei Kuzmin
341f698ace Use latest libcc with Ch66 2018-06-19 11:49:40 +10:00
Aleksei Kuzmin
deb8cd458d Use latest libcc with Ch66 2018-06-19 11:46:59 +10:00
Aleksei Kuzmin
11b96c214d Use latest libcc with Ch66 2018-06-19 11:46:59 +10:00
Aleksei Kuzmin
c7691d8a40 Use latest libcc with Ch66 2018-06-19 11:46:58 +10:00
Aleksei Kuzmin
f5b68b8950 Update crashpad ref 2018-06-19 11:46:58 +10:00
Aleksei Kuzmin
06410202d0 Use latest libcc with Chromium 66.0.3359.66 2018-06-19 11:46:58 +10:00
Aleksei Kuzmin
0c0d31e13a Use the same Crashpad as Chromium 66.0.3359.66 2018-06-19 11:46:58 +10:00
Samuel Attard
17b5870ca1 Change node ref 2018-06-19 11:46:58 +10:00
Samuel Attard
a9db673cdf Bump libcc 2018-06-19 11:46:58 +10:00
Milan Burda
a0a5e4abb2 Bump vendor/native_mate 2018-05-18 16:30:20 +02:00
Aleksei Kuzmin
aec3c3fb66 Update vendor/libchromiumcontent ref 2018-05-14 14:18:58 +02:00
Robo
ad2baccefa tools: pass custom template for js2c (#12593)
* Update node v9.7.0 ref

* tools: pass custom template to node/tools/js2c.py
2018-04-13 08:20:04 -04:00