Commit graph

19611 commits

Author SHA1 Message Date
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
4f6b6b044f fix linting 2018-06-27 10:05:22 +10:00
Samuel Attard
02026279be rename back to expected values 2018-06-27 10:05:15 +10:00
Samuel Attard
6fd1f7ecb1 move native_mate script to the electron scripts dir 2018-06-27 10:05:07 +10:00
Samuel Attard
922cf08ab4 update paths for native_mate 2018-06-27 10:04:58 +10:00
Samuel Attard
7f8cd51f63 remove native_mate submodule 2018-06-27 10:04:51 +10:00
Samuel Attard
31e5b046a4 Merge 'native_mate' into 'electron' 2018-06-27 10:04:04 +10:00
trop[bot]
957f008726 fix: repair fs.statSyncNoException throwing exceptions (#13397) 2018-06-23 17:27:38 +10:00
Samuel Attard
4cada5e845 prepare for merging to electron 2018-06-22 11:29:57 +10:00
trop[bot]
2069eb1972 Fix links to webview.md (#13370) 2018-06-22 03:06:54 +10:00
Samuel Attard
e15ffd96eb
Merge pull request #30 from electron/chromium-66-upgrade
Chromium 66 Updates
2018-06-21 22:35:49 +10:00
trop[bot]
e57f7edd37 Revert "Drop support of Mac OS 10.9" (#13350)
This reverts commit efa0ec0263481ae188f206625bec6f4a4e5d3ecf.
2018-06-21 09:37:18 +10:00
John Kleinschmidt
df62fb7788 Skip tests for release build 2018-06-20 18:20:04 -04:00
John Kleinschmidt
9b09d103fd Update appveyor for release. 2018-06-20 16:55:16 -04:00
John Kleinschmidt
453edb42b4 Fix linting error 2018-06-20 14:17:17 -04:00
John Kleinschmidt
1b2a85436c Bump v3.0.0-beta.1 2018-06-20 12:52:49 -04:00
John Kleinschmidt
c7d4d2d18f Set to last version released
Need to properly bump version
2018-06-20 12:52:33 -04:00
John Kleinschmidt
d1a0eb3d11
Merge pull request #13339 from trop-bot/3-0-x-bp-fix-linking-error-for-mas-build-1529503586342
Backport (3-0-x) - Fix linking error for MAS build
2018-06-20 11:00:35 -04:00
trop[bot]
a0e37d1383 Backport (3-0-x) - test: Upgrade spec dependencies (#13328)
* package: Update mocha, mocha-junit-reporter

* package: Update graceful-fs, multiparty, q, walkdir

* package: Update basic-auth

* package: Update ws

* package: Update dbus-native

* package: Upgrade yargs

* lock: Run `npm audit fix`

* wrench: Fix websocket API change
2018-06-20 09:24:27 -05:00
trop[bot]
128a03450a Backport (3-0-x) - fix: tls check shouldnt rely on an external service (#13338)
* fix: tls check shouldnt rely on an external service

* fix linting in the tls script'
2018-06-21 00:12:58 +10:00
Cheng Zhao
d34c7396ef fix: link with crashpad_client for MAS build 2018-06-20 14:06:32 +00:00
John Kleinschmidt
cdbd4792e3
Merge pull request #13336 from trop-bot/3-0-x-bp-revert-"fix--drop-support-for-os-x-mavericks-(version-10.9)"-1529497748886
Backport (3-0-x) - Revert "fix: Drop support for OS X Mavericks (version 10.9)"
2018-06-20 09:07:46 -04:00
Samuel Attard
b0f6c3ab65 Revert "fix: Drop support for OS X Mavericks (version 10.9)" 2018-06-20 12:29:14 +00:00
trop[bot]
d2508faea8 Disable node options in node config (#13323) 2018-06-20 17:10:37 +10:00
trop[bot]
9bda7d0b73 set mac protocol to none (#13326) 2018-06-20 17:10:23 +10:00
John Kleinschmidt
fc12b5cab3
Merge pull request #13283 from jack-teng1/fix-asar-pack-cant-find-module
fix: can't load module error when app is packaged
2018-06-19 14:58:37 -04:00
John Kleinschmidt
04a7a34c42
Merge pull request #13301 from electron/revert-frame-sub-deprecation
fix: revert frame subscriber deprecation and re-enable tests
2018-06-19 14:26:14 -04:00
Heilig Benedek
f643ce4f66 revert: frame subscriber deprecation and re-enable tests 2018-06-19 19:49:44 +02:00
Jack Teng
3044607746 spec: fix asar spec due to change in node.js
node.js rename the internalModuleReadFile to internalModuleReadJSON
change spec to reflect this change
2018-06-19 10:42:21 -07:00
Jack Teng
10df019075 fix: can't load module error when app is packaged
due to change in node.js(https://github.com/nodejs/node/issues/17076)
internalModuleReadFile has been renamed to internalModuleReadJSON, and
in vendor/node/lib/internal/modules/cjs/loader.js it will call
internalModuleReadJSON and result in can't read the package.json file.
2018-06-19 10:42:21 -07:00
John Kleinschmidt
295c823a1b
Merge pull request #13298 from electron/update-libcc-ref
Update vendor/libchromiumcontent ref
2018-06-19 13:24:05 -04:00
John Kleinschmidt
d367b75680
Merge pull request #13296 from electron/miniak/drop-macos-10.9
fix: Drop support for OS X Mavericks (version 10.9)
2018-06-19 13:19:24 -04:00
Aleksei Kuzmin
e683af1eb6 Update vendor/libchromiumcontent ref 2018-06-19 18:12:41 +02:00
Milan Burda
794fe741e9 fix: Drop support for OS X Mavericks (version 10.9) 2018-06-19 17:49:27 +02:00
Jeremy Apthorp
c598272891 refactor: [gn] compile node with boringssl (#13285) 2018-06-19 10:39:43 -05:00
Justin Guze
137aaf2429 fix: pass down the bool value of enableAutoSize to setSize (#13282)
* fix: pass the boolean value of enableAutoSize to setSize

The webContents setSize API takes in an optional enableAutoSize boolean.
Looking in the code, if that property is set, regardless if you pass in
true or false, it will always set it to true. This change passes the
appropriate boolean value down properly.

* creating new bool for autosize
2018-06-19 10:38:55 -05:00
popod
13f97b4cae Add Sentry.io to 3rd party hosted solution list for crash reports (#13281)
* Add Sentry.io to 3rd party hosted solution list for crash reports

* Single link to sentry doc
2018-06-19 10:32:37 -05:00
Jeremy Apthorp
9e8f83e25c refactor: fix chromium-style in url_request_asar_job (#13284) 2018-06-19 10:31:55 -05:00
Jeremy Apthorp
e177117fa5 chore: [gn] add desktop capturer sources to GN build (#13286) 2018-06-19 10:29:36 -05:00
Danny Brown
dd6c776a19 docs: add note about how to remove a previously set aspect ratio (#13293) 2018-06-19 10:24:42 -05:00
John Kleinschmidt
36c1e4cd75
Merge pull request #13267 from electron/expect-debugger-spec
spec: convert debugger spec to expect
2018-06-19 11:22:47 -04:00
John Kleinschmidt
faef453df5
Merge branch 'master' into expect-debugger-spec 2018-06-19 11:22:25 -04:00
Shelley Vohr
cba3a9fcce spec: convert deprecations to expect (#13268)
* spec: convert deprecations to expect

* address feedback from review
2018-06-19 10:22:08 -05:00
Shelley Vohr
9a79889692 spec: convert ipc specs to expect (#13273)
* spec: convert ipc specs to expect

* fix buffer value comparison
2018-06-19 10:21:50 -05:00
John Kleinschmidt
0219ef0feb
Merge pull request #13269 from electron/expect-desktop-capturer-spec
spec: convert desktop capturer to expect
2018-06-19 11:21:13 -04:00
John Kleinschmidt
be29a1973b
Merge pull request #13291 from electron/slightly-rewrite-webview-tests
spec: slightly rewrite webview tests
2018-06-19 11:20:45 -04:00
John Kleinschmidt
0fdcc5d485
Merge pull request #13294 from electron/MarshallOfSound-patch-1
Mark browser window affinity as experimental
2018-06-19 11:20:22 -04:00
John Kleinschmidt
a3bc989426
Merge pull request #13292 from electron/fix-release-tests
build:Fix VSTS config for release builds
2018-06-19 11:00:07 -04:00