Compare commits

...

16 Commits

Author SHA1 Message Date
Electron Bot
9d69d4b9ef Bump v9.0.0-beta.1 2020-02-10 06:50:08 -08:00
Electron Bot
d57d5c544e Revert "Bump v9.0.0-beta.2"
This reverts commit 74d4dab157.
2020-02-10 06:38:44 -08:00
Electron Bot
74d4dab157 Bump v9.0.0-beta.2 2020-02-10 04:32:41 -08:00
trop[bot]
94246dabe3 ci: fix build failure on doc only changes (#22089)
* ci: fix build failure on doc only changes

* ci: fix doc-only check when CI fires on branch before PR is created

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-10 17:09:35 +09:00
trop[bot]
4fe91e56ac chore: remove debugging log (#22095)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-02-10 17:05:34 +09:00
trop[bot]
0d7440d676 build: preserve timestamps when stripping files (#22098)
* build: preserve timestamps when stripping files

Resolves an issue where the binaries in mksnapshot.zip were not getting stripped.

* Add missing comma

* Update script/strip-binaries.py

Co-Authored-By: Jeremy Apthorp <jeremya@chromium.org>

* Don't try to run strip on macOS

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-02-10 17:05:04 +09:00
trop[bot]
60edd2d3b1 build: try using newer version of xcode/macOS sdk (#22106)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-10 16:48:51 +09:00
trop[bot]
d4d06660f3 fix: flash plugin (#22111)
* fix: flash plugin

Fixes https://github.com/electron/electron/issues/20744

* cleanup

* fix linting issue

Co-authored-by: t57ser <seve@live.at>
2020-02-10 10:50:56 +09:00
trop[bot]
8d8f15121b fix: use a WeakPtr so we do not UAF the store in FunctionLifetimeMonitor (#22113)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-02-10 10:47:23 +09:00
trop[bot]
1f8cb5144d build: copy chromedriver to correct location (#22092)
* build: copy chromedriver to correct location

* build: try to free up disk space for macos releases

* get verbose mode working on strip-binaries

* Only use separate chromedriver build arm/arm64

* fixup circleci config

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-07 16:49:04 -05:00
trop[bot]
667ee359a1 test: get native unit tests running (#22086)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-07 10:53:09 -05:00
trop[bot]
4b009159ba docs: clarify requirements for GOOGLE_API_KEY (#22071)
* docs: clarify requirements for GOOGLE_API_KEY

* Update docs/api/environment-variables.md

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

* Update docs/api/environment-variables.md

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

* Update docs/api/environment-variables.md

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

* update

Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2020-02-06 15:25:28 -05:00
John Kleinschmidt
89f66bd00c Revert "Bump v9.0.0-beta.1"
This reverts commit 68346fec55.
2020-02-06 15:19:27 -05:00
trop[bot]
2d542c6028 build: copy chromedriver to proper directory for release (#22073)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-06 15:07:46 -05:00
Electron Bot
68346fec55 Bump v9.0.0-beta.1 2020-02-05 13:46:21 -08:00
Samuel Attard
23f32ca9f3 chore: prepare for 9.0.0-beta.1 2020-02-05 13:44:23 -08:00
12 changed files with 86 additions and 51 deletions

View File

@@ -65,12 +65,12 @@ machine-linux-2xlarge: &machine-linux-2xlarge
machine-mac: &machine-mac
macos:
xcode: "10.3.0"
xcode: "11.1.0"
machine-mac-large: &machine-mac-large
resource_class: large
macos:
xcode: "10.3.0"
xcode: "11.1.0"
# Build configurations options.
env-testing-build: &env-testing-build
@@ -432,15 +432,17 @@ step-electron-dist-store: &step-electron-dist-store
path: src/out/Default/dist.zip
destination: dist.zip
step-electron-chromedriver-gn-gen: &step-electron-chromedriver-gn-gen
step-electron-maybe-chromedriver-gn-gen: &step-electron-maybe-chromedriver-gn-gen
run:
name: chromedriver GN gen
command: |
cd src
if [ "$USE_GOMA" == "true" ]; then
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") import(\"//electron/build/args/goma.gn\") is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
else
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") cc_wrapper=\"$SCCACHE_PATH\" is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
if [ "$USE_GOMA" == "true" ]; then
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") import(\"//electron/build/args/goma.gn\") is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
else
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") cc_wrapper=\"$SCCACHE_PATH\" is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
fi
fi
step-electron-chromedriver-build: &step-electron-chromedriver-build
@@ -448,13 +450,23 @@ step-electron-chromedriver-build: &step-electron-chromedriver-build
name: Build chromedriver.zip
command: |
cd src
ninja -C out/chromedriver electron:electron_chromedriver -j $NUMBER_OF_NINJA_PROCESSES
electron/script/strip-binaries.py --target-cpu="$TARGET_ARCH" --file $PWD/out/chromedriver/chromedriver
ninja -C out/chromedriver electron:electron_chromedriver_zip
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
export CHROMEDRIVER_DIR="out/chromedriver"
else
export CHROMEDRIVER_DIR="out/Default"
fi
ninja -C $CHROMEDRIVER_DIR electron:electron_chromedriver -j $NUMBER_OF_NINJA_PROCESSES
if [ "`uname`" == "Linux" ]; then
electron/script/strip-binaries.py --target-cpu="$TARGET_ARCH" --file $PWD/$CHROMEDRIVER_DIR/chromedriver
fi
ninja -C $CHROMEDRIVER_DIR electron:electron_chromedriver_zip
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
cp out/chromedriver/chromedriver.zip out/Default
fi
step-electron-chromedriver-store: &step-electron-chromedriver-store
store_artifacts:
path: src/out/chromedriver/chromedriver.zip
path: src/out/Default/chromedriver.zip
destination: chromedriver.zip
step-nodejs-headers-build: &step-nodejs-headers-build
@@ -481,6 +493,7 @@ step-electron-publish: &step-electron-publish
if [ "`uname`" == "Darwin" ]; then
rm -rf src/out/Default/obj
fi
cd src/electron
if [ "$UPLOAD_TO_S3" == "1" ]; then
echo 'Uploading Electron release distribution to S3'
@@ -497,7 +510,7 @@ step-persist-data-for-tests: &step-persist-data-for-tests
# Build artifacts
- src/out/Default/dist.zip
- src/out/Default/mksnapshot.zip
- src/out/chromedriver/chromedriver.zip
- src/out/Default/chromedriver.zip
- src/out/Default/shell_browser_ui_unittests
- src/out/Default/gen/node_headers
- src/out/ffmpeg/ffmpeg.zip
@@ -532,7 +545,7 @@ step-chromedriver-unzip: &step-chromedriver-unzip
run:
name: Unzip chromedriver.zip
command: |
cd src/out/chromedriver
cd src/out/Default
unzip -o chromedriver.zip
step-ffmpeg-gn-gen: &step-ffmpeg-gn-gen
@@ -577,7 +590,7 @@ step-verify-chromedriver: &step-verify-chromedriver
name: Verify ChromeDriver
command: |
cd src
python electron/script/verify-chromedriver.py --source-root "$PWD" --build-dir out/chromedriver
python electron/script/verify-chromedriver.py --source-root "$PWD" --build-dir out/Default
step-setup-linux-for-headless-testing: &step-setup-linux-for-headless-testing
run:
@@ -833,7 +846,7 @@ step-check-for-doc-only-change: &step-check-for-doc-only-change
command: |
cd src/electron
node script/yarn install --frozen-lockfile
if node script/doc-only-change.js --prNumber=$CIRCLE_PR_NUMBER --prURL=$CIRCLE_PULL_REQUEST; then
if node script/doc-only-change.js --prNumber=$CIRCLE_PR_NUMBER --prURL=$CIRCLE_PULL_REQUEST --prBranch=$CIRCLE_BRANCH; then
#PR is doc only change; save file with value true to indicate doc only change
echo "true" > .skip-ci-build
else
@@ -869,7 +882,7 @@ step-ts-compile: &step-ts-compile
command: |
cd src
ninja -C out/Default electron:default_app_js -j $NUMBER_OF_NINJA_PROCESSES
ninja -C out/Default electron:atom_js2c -j $NUMBER_OF_NINJA_PROCESSES
ninja -C out/Default electron:electron_js2c -j $NUMBER_OF_NINJA_PROCESSES
# Lists of steps.
steps-lint: &steps-lint
@@ -1003,7 +1016,7 @@ steps-electron-build: &steps-electron-build
- *step-maybe-cross-arch-snapshot-store
# chromedriver
- *step-electron-chromedriver-gn-gen
- *step-electron-maybe-chromedriver-gn-gen
- *step-electron-chromedriver-build
- *step-electron-chromedriver-store
@@ -1094,7 +1107,7 @@ steps-electron-build-for-publish: &steps-electron-build-for-publish
- *step-mksnapshot-store
# chromedriver
- *step-electron-chromedriver-gn-gen
- *step-electron-maybe-chromedriver-gn-gen
- *step-electron-chromedriver-build
- *step-electron-chromedriver-store
@@ -1125,7 +1138,7 @@ steps-chromedriver-build: &steps-chromedriver-build
- *step-setup-env-for-build
- *step-fix-sync-on-mac
- *step-electron-chromedriver-gn-gen
- *step-electron-maybe-chromedriver-gn-gen
- *step-electron-chromedriver-build
- *step-electron-chromedriver-store
@@ -1429,7 +1442,7 @@ commands:
- *step-maybe-cross-arch-snapshot-store
# chromedriver
- *step-electron-chromedriver-gn-gen
- *step-electron-maybe-chromedriver-gn-gen
- *step-electron-chromedriver-build
- *step-electron-chromedriver-store

View File

@@ -1 +1 @@
9.0.0-nightly.20200205
9.0.0-beta.1

View File

@@ -53,16 +53,23 @@ Unsupported options are:
### `GOOGLE_API_KEY`
You can provide an API key for making requests to Google's geocoding webservice. To do this, place the following code in your main process
file, before opening any browser windows that will make geocoding requests:
Geolocation support in Electron requires the use of Google Cloud Platform's
geolocation webservice. To enable this feature, acquire a
[Google API key](https://developers.google.com/maps/documentation/geolocation/get-api-key)
and place the following code in your main process file, before opening any
browser windows that will make geolocation requests:
```javascript
process.env.GOOGLE_API_KEY = 'YOUR_KEY_HERE'
```
For instructions on how to acquire a Google API key, visit [this page](https://developers.google.com/maps/documentation/javascript/get-api-key).
By default, a newly generated Google API key may not be allowed to make
geocoding requests. To enable geocoding requests, visit [this page](https://developers.google.com/maps/documentation/geocoding/get-api-key).
By default, a newly generated Google API key may not be allowed to make geolocation requests.
To enable the geolocation webservice for your project, enable it through the
[API library](https://console.cloud.google.com/apis/library).
N.B. You will need to add a
[Billing Account](https://cloud.google.com/billing/docs/how-to/payment-methods#add_a_payment_method)
to the project associated to the API key for the geolocation webservice to work.
### `ELECTRON_NO_ASAR`

View File

@@ -14,7 +14,6 @@ const remoteObjectCache = v8Util.createIDWeakMap()
const contextId = v8Util.getHiddenValue(global, 'contextId')
ipcRendererInternal.invoke('ELECTRON_BROWSER_GET_LAST_WEB_PREFERENCES').then(preferences => {
console.log(preferences)
if (!preferences.enableRemoteModule) {
console.warn('%cElectron Deprecation Warning', 'font-weight: bold', "The 'remote' module is deprecated and will be disabled by default in a future version of Electron. To ensure a smooth upgrade and silence this warning, specify {enableRemoteModule: true} in the WebPreferences for this window.")
}

View File

@@ -1,6 +1,6 @@
{
"name": "electron",
"version": "9.0.0-nightly.20200205",
"version": "9.0.0-beta.1",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {

View File

@@ -9,7 +9,11 @@ async function checkIfDocOnlyChange () {
try {
let pullRequestNumber = args.prNumber
if (!pullRequestNumber || isNaN(pullRequestNumber)) {
if (args.prBranch) {
if (args.prURL) {
// CircleCI doesn't provide the PR number for branch builds, but it does provide the PR URL
const pullRequestParts = args.prURL.split('/')
pullRequestNumber = pullRequestParts[pullRequestParts.length - 1]
} else if (args.prBranch) {
// AppVeyor doesn't provide a PR number for branch builds - figure it out from the branch
const prsForBranch = await octokit.pulls.list({
owner: 'electron',
@@ -23,10 +27,6 @@ async function checkIfDocOnlyChange () {
// If there are 0 PRs or more than one PR on a branch, just assume that this is more than a doc change
process.exit(1)
}
} else if (args.prURL) {
// CircleCI doesn't provide the PR number for branch builds, but it does provide the PR URL
const pullRequestParts = args.prURL.split('/')
pullRequestNumber = pullRequestParts[pullRequestParts.length - 1]
}
}
const filesChanged = await octokit.pulls.listFiles({

View File

@@ -35,9 +35,8 @@ const NPX_CMD = process.platform === 'win32' ? 'npx.cmd' : 'npx'
const runners = new Map([
['main', { description: 'Main process specs', run: runMainProcessElectronTests }],
['remote', { description: 'Remote based specs', run: runRemoteBasedElectronTests }]
// TODO(codebytere): refactor native tests to only depend on what we need
/* ['native', { description: 'Native specs', run: runNativeElectronTests }] */
['remote', { description: 'Remote based specs', run: runRemoteBasedElectronTests }],
['native', { description: 'Native specs', run: runNativeElectronTests }]
])
const specHashPath = path.resolve(__dirname, '../spec/.hash')

View File

@@ -4,7 +4,7 @@ import argparse
import os
import sys
from lib.config import LINUX_BINARIES
from lib.config import LINUX_BINARIES, enable_verbose_mode
from lib.util import execute, get_out_dir
def strip_binaries(directory, target_cpu):
@@ -22,10 +22,12 @@ def strip_binary(binary_path, target_cpu):
strip = 'mips64el-redhat-linux-strip'
else:
strip = 'strip'
execute([strip, binary_path])
execute([strip, '--preserve-dates', binary_path])
def main():
args = parse_args()
if args.verbose:
enable_verbose_mode()
if args.file:
strip_binary(args.file, args.target_cpu)
else:

View File

@@ -11,6 +11,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/cors_exempt_headers.h"
#include "content/public/browser/network_service_instance.h"
#include "content/public/common/content_features.h"
#include "content/public/common/service_names.mojom.h"
@@ -154,6 +155,10 @@ SystemNetworkContextManager::CreateDefaultNetworkContextParams() {
network::mojom::NetworkContextParamsPtr network_context_params =
network::mojom::NetworkContextParams::New();
// This is required to avoid blocking X-Requested-With headers sent by PPAPI
// plugins, more info crbug.com/940331
content::UpdateCorsExemptHeader(network_context_params.get());
network_context_params->enable_brotli = true;
network_context_params->enable_referrers = true;

View File

@@ -50,8 +50,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 9,0,0,20200205
PRODUCTVERSION 9,0,0,20200205
FILEVERSION 9,0,0,1
PRODUCTVERSION 9,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L

View File

@@ -50,6 +50,10 @@ class RenderFramePersistenceStore final : public content::RenderFrameObserver {
v8::Local<v8::Value> proxy_value);
v8::MaybeLocal<v8::Value> GetCachedProxiedObject(v8::Local<v8::Value> from);
base::WeakPtr<RenderFramePersistenceStore> GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
private:
// func_id ==> { function, owning_context }
std::map<size_t, FunctionContextPair> functions_;

View File

@@ -111,25 +111,31 @@ bool IsPlainArray(const v8::Local<v8::Value>& arr) {
class FunctionLifeMonitor final : public ObjectLifeMonitor {
public:
static void BindTo(v8::Isolate* isolate,
v8::Local<v8::Object> target,
context_bridge::RenderFramePersistenceStore* store,
size_t func_id) {
static void BindTo(
v8::Isolate* isolate,
v8::Local<v8::Object> target,
base::WeakPtr<context_bridge::RenderFramePersistenceStore> store,
size_t func_id) {
new FunctionLifeMonitor(isolate, target, store, func_id);
}
protected:
FunctionLifeMonitor(v8::Isolate* isolate,
v8::Local<v8::Object> target,
context_bridge::RenderFramePersistenceStore* store,
size_t func_id)
FunctionLifeMonitor(
v8::Isolate* isolate,
v8::Local<v8::Object> target,
base::WeakPtr<context_bridge::RenderFramePersistenceStore> store,
size_t func_id)
: ObjectLifeMonitor(isolate, target), store_(store), func_id_(func_id) {}
~FunctionLifeMonitor() override = default;
void RunDestructor() override { store_->functions().erase(func_id_); }
void RunDestructor() override {
if (!store_)
return;
store_->functions().erase(func_id_);
}
private:
context_bridge::RenderFramePersistenceStore* store_;
base::WeakPtr<context_bridge::RenderFramePersistenceStore> store_;
size_t func_id_;
};
@@ -176,7 +182,7 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContext(
base::BindRepeating(&ProxyFunctionWrapper, store, func_id));
FunctionLifeMonitor::BindTo(destination_context->GetIsolate(),
v8::Local<v8::Object>::Cast(proxy_func),
store, func_id);
store->GetWeakPtr(), func_id);
store->CacheProxiedObject(value, proxy_func);
return v8::MaybeLocal<v8::Value>(proxy_func);
}