Commit graph

19554 commits

Author SHA1 Message Date
Cheng Zhao
136cf389e8 fix: use context counter as contextId (backport 3-0-x)
For sandboxed renderer it may not have a node::Environment in the context,
using a increasing counter as contextId works for all cases.
2018-07-19 11:27:41 -07:00
Zeke Sikelianos
8d9775b0b1 Bump v3.0.0-beta.3 2018-07-17 09:38:50 -07:00
John Kleinschmidt
9237d46dba make sure tests don't run for GitHub releases. (#13701)
Also fix VSTS slack integration and
Update to latest libchromiumcontent

(cherry picked from commit 1c70a1cccd)
2018-07-17 10:57:59 -05:00
John Kleinschmidt
8f8d198c5a
Merge pull request #13539 from trop-bot/3-0-x-bp-enable-webview-in-sandbox-renderer-1530547750986
Backport (3-0-x) - Enable webview in sandbox renderer
2018-07-17 10:01:40 -04:00
trop[bot]
fcdbb8c4a7 fix: create a window capturer correctly (backport: 3-0-x) (#13693)
* fix: create a window capturer correctly

We were incorrectly creating two screen capturers instead of a window
capturer

* spec: ensure dc tests pass

* spec: enable all tests after verifying dc tests work
2018-07-17 15:30:33 +10:00
trop[bot]
b49b071a1f fix: remove race condition for executeJavaScript (#13692)
Replaces 'did-finish-load' with 'did-stop-loading' which semantically
maps to the events inside Chromium.  Before I think we were relying
on a natural 99% winnable race condition.

Fixes #13504
2018-07-16 21:22:27 -07:00
trop[bot]
1feb45da29 docs: update second-instance event docs (#13682) 2018-07-16 13:57:58 -07:00
John Kleinschmidt
2c43dbdb25
Merge pull request #13680 from trop-bot/3-0-x-bp-fix-crash-when-opening-devtools-for-frameless-window-1531748442042
Fix crash when opening devtools for frameless window (backport: 3-0-x)
2018-07-16 10:48:37 -04:00
Cheng Zhao
7eff91dde1 spec: openDevTools should not crash for frameless window 2018-07-16 13:40:48 +00:00
Cheng Zhao
780483ff35 fix: use InspectableWebContentsView as content view 2018-07-16 13:40:48 +00:00
trop[bot]
c2f770df02 Update Windows VS2017 requirement (#13665) 2018-07-13 18:17:53 -05:00
John Kleinschmidt
74e6e063d4
Merge pull request #13658 from trop-bot/3-0-x-bp-fix--don't-invoke-callback-after-framesubscriber-is-destroyed-1531475760693
fix: don't invoke callback after FrameSubscriber is destroyed (backport: 3-0-x)
2018-07-13 11:51:07 -04:00
Cheng Zhao
7702cc1090 fix: don't invoke callback after FrameSubscriber is destroyed 2018-07-13 09:56:07 +00:00
trop[bot]
97319e5a3a fix: remember the render_process_id when permission requests occur on the IO thread (#13651)
Fixes #13620
2018-07-13 12:50:57 +10:00
Jeremy Apthorp
041c952574 fix: enable spell checking, which broke in upgrade to ch66
Chromium commit [03563dd163][1] changed the way that the
spellcheck-enabled status was checked, defaulting to false.

Added the first (!) test for spellchecking, too.

Fixes #13608.

[1]: 03563dd163
2018-07-12 13:28:15 -07:00
John Kleinschmidt
6c9b6f9cac
Merge pull request #13642 from trop-bot/3-0-x-bp-chore--updates-for-release-process-1531400155960
chore: Updates for release process (backport: 3-0-x)
2018-07-12 09:37:12 -04:00
John Kleinschmidt
c4884da601 Update docs to reflect current process
Also added troubleshooting steps.
2018-07-12 12:56:02 +00:00
John Kleinschmidt
59b05ed661 Fix Appveyor URL 2018-07-12 12:56:02 +00:00
Cheng Zhao
e3204a5ec1
Merge pull request #13637 from electron/fix-remote-3-0-x
fix: guard against double-freeing remote references (3-0-x)
2018-07-12 16:01:52 +09:00
Cheng Zhao
adf49daaac fix double-freeing remote references
After the page does navigations, garbage collection can still happen in
the old context. This commit changes to store references to remote objects
by _pages_, instead of by _WebContents_.
2018-07-12 11:17:26 +09:00
Cheng Zhao
9431677e79 add API to return an unique ID for page 2018-07-12 11:16:13 +09:00
John Kleinschmidt
0141c083d0 Bump v3.0.0-beta.2 2018-07-10 14:12:05 -04:00
John Kleinschmidt
96b2c08293
Merge pull request #13612 from trop-bot/3-0-x-bp-build--updates-to-the-release-process-1531237367452
Backport (3-0-x) - build: Updates to the release process
2018-07-10 13:26:24 -04:00
John Kleinschmidt
d6f2c26b0f Move github release checking to node.js
Our upload script was relying on an old python script to find the GitHub release for uploading.
2018-07-10 15:42:53 +00:00
John Kleinschmidt
d478906f9c Update to run new AppVeyor jobs
AppVeyor builds got split into two jobs, `electron-x64` and `electron-ia32`
2018-07-10 15:42:53 +00:00
trop[bot]
85526c7f21 fix: fallback to FullSizeContentView for frameless window on mac (#13600)
When using `views::Widget` to create window, Chromium will automatically
use a `BridgedContentView` as content view, which however does not
support draggable regions inside it.

By fallback to `FullSizeContentView` we can work around this problem,
with the price of losing the ability to use `views::View` APIs. Since
we don't expect users to use the new `View` APIs in `BrowserWindow`
anyway, it should not be a problem.

This change does not affect users of `TopLevelWindow`, and for users of
`BrowserWindow` there is nothing to lose.

In the long term we should look into how to make draggable regions work
with `BridgedContentView`. The related Chromium code is still being
changed rapidly, we can wait until Chromium migrated its
`NativeAppWindowCocoa` class to use `views::Widget`.
2018-07-10 13:09:46 +09:00
John Kleinschmidt
f6ae438005
Merge pull request #13591 from trop-bot/3-0-x-bp-fix-failed-devtools-tests-due-to-fs.statsyncnoexception-not-working--1531147212282
Backport (3-0-x) - Fix failed devtools tests due to fs.statSyncNoException not working
2018-07-09 14:30:42 -04:00
John Kleinschmidt
5e51e608db
Merge pull request #13593 from electron/update-libcc-3-0-x
build: Update to latest libchromiumcontent for 3-0-x
2018-07-09 14:30:08 -04:00
John Kleinschmidt
97248a7a56 Update to latest libchromiumcontent
Use the latest libchromiumcontent for 3-0-x which is built with Visual Studio 2017 15.7.4
2018-07-09 13:20:41 -04:00
Cheng Zhao
8639466c75 update node to fix fs.statSyncNoException 2018-07-09 14:40:18 +00:00
Cheng Zhao
31e2166cea Revert "spec: disable the i18nString test"
This reverts commit 86c79653de.
2018-07-09 14:40:18 +00:00
trop[bot]
c2f4144996 Backport (3-0-x) - Fix devtools not functioning well (#13571)
* implement devtools showItemInFolder message

* add stubs for new devtools messages

* fix: update devtools url

* spec: enable back devtools tests

* spec: disable the i18nString test

It is failed because of fs.statSyncNoException, I'll fix it in another
PR.
2018-07-06 13:19:21 +10:00
Hari Juturu
f63e5ffa65 cache lastwebprefs 2018-07-02 16:09:17 +00:00
Hari Juturu
32e40cb4c3 Enable webview in sandbox renderer Security: Inherit embedder prefs onto webview 2018-07-02 16:09:17 +00:00
John Kleinschmidt
8585372e11
Merge pull request #13517 from trop-bot/3-0-x-bp-fix--tray-setcontextmenu-crash-1530309092727
Backport (3-0-x) - fix: tray setContextMenu crash
2018-07-02 09:13:58 -04:00
John Kleinschmidt
2e2289d701
Merge pull request #13530 from electron/fix-mas-build-3-0-x
Update libcc to fix private APIs in MAS build (3-0-x)
2018-07-02 08:05:56 -04:00
Cheng Zhao
f6229d9489 fix: update libcc to fix private APIs in mas build 2018-07-02 15:21:18 +09:00
Maxine Whitely
bace4890c8 fix: tray setContextMenu crash
Co-authored-by: Zhuo Lu <sethlu@mintkit.net>
Co-authored-by: Kristine Zhang <kzhang@slack-corp.com>
2018-06-29 21:51:38 +00:00
Cheng Zhao
0a3211c387
fix the crash when loading site with jquery (#13476) 2018-06-29 09:42:26 +09:00
John Kleinschmidt
7d27c91400 Remove no longer used files from asset validation (#13372)
Also removed temporary sha value needed for initial 3.0.0-beta.1
2018-06-27 11:12:11 -07:00
trop[bot]
93edf2edd3 Backport (3-0-x) - fix: deprecate properties in app.getAppMetrics() (#13453)
* fix: deprecate properties in app.getAppMetrics()

* address feedback from review

* fix deprecated property location

* simplify test
2018-06-27 19:07:39 +10:00
trop[bot]
ec993214a2 docs: add native_mate to source code directory structure doc (#13457) 2018-06-27 18:28:13 +10:00
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
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