mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Compare commits
29 Commits
v8.0.0-nig
...
v8.0.0-nig
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e459114149 | ||
|
|
624ba4f642 | ||
|
|
63f08fcdb0 | ||
|
|
3f5833ce5d | ||
|
|
ffe2182883 | ||
|
|
e510af77b2 | ||
|
|
afc59aefb7 | ||
|
|
b0fe3e20e6 | ||
|
|
eb2d2264d0 | ||
|
|
104088b86b | ||
|
|
11cd0db86b | ||
|
|
8bf74164e2 | ||
|
|
eaa18041e1 | ||
|
|
d2a94e6b13 | ||
|
|
42999f42f2 | ||
|
|
dfd2135647 | ||
|
|
7c45c2fdef | ||
|
|
2cac40444b | ||
|
|
f566e562a3 | ||
|
|
0e61709fa7 | ||
|
|
2b316f3843 | ||
|
|
660e566201 | ||
|
|
999f7df158 | ||
|
|
816bc5c8a7 | ||
|
|
99f1b96c4f | ||
|
|
334ea36f38 | ||
|
|
c485c1e4b0 | ||
|
|
b2652beceb | ||
|
|
3ec17a88ba |
@@ -1,3 +1,46 @@
|
||||
version: 2.1
|
||||
|
||||
parameters:
|
||||
upload-to-s3:
|
||||
type: string
|
||||
default: '1'
|
||||
|
||||
run-lint:
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
run-build-linux:
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
run-build-mac:
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
run-linux-x64-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
run-linux-ia32-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
run-linux-arm-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
run-linux-arm64-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
run-osx-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
run-mas-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
# The config expects the following environment variables to be set:
|
||||
# - "SLACK_WEBHOOK" Slack hook URL to send notifications.
|
||||
#
|
||||
@@ -32,6 +75,7 @@ machine-mac-large: &machine-mac-large
|
||||
# Build configurations options.
|
||||
env-debug-build: &env-debug-build
|
||||
GN_CONFIG: //electron/build/args/debug.gn
|
||||
SKIP_DIST_ZIP: '1'
|
||||
|
||||
env-testing-build: &env-testing-build
|
||||
GN_CONFIG: //electron/build/args/testing.gn
|
||||
@@ -301,28 +345,30 @@ step-electron-dist-build: &step-electron-dist-build
|
||||
name: Build dist.zip
|
||||
command: |
|
||||
cd src
|
||||
ninja -C out/Default electron:electron_dist_zip
|
||||
if [ "$CHECK_DIST_MANIFEST" == "1" ]; then
|
||||
if [ "`uname`" == "Darwin" ]; then
|
||||
target_os=mac
|
||||
target_cpu=x64
|
||||
if [ x"$MAS_BUILD" == x"true" ]; then
|
||||
target_os=mac_mas
|
||||
fi
|
||||
elif [ "`uname`" == "Linux" ]; then
|
||||
target_os=linux
|
||||
if [ x"$TARGET_ARCH" == x ]; then
|
||||
if [ "$SKIP_DIST_ZIP" != "1" ]; then
|
||||
ninja -C out/Default electron:electron_dist_zip
|
||||
if [ "$CHECK_DIST_MANIFEST" == "1" ]; then
|
||||
if [ "`uname`" == "Darwin" ]; then
|
||||
target_os=mac
|
||||
target_cpu=x64
|
||||
elif [ "$TARGET_ARCH" == "ia32" ]; then
|
||||
target_cpu=x86
|
||||
if [ x"$MAS_BUILD" == x"true" ]; then
|
||||
target_os=mac_mas
|
||||
fi
|
||||
elif [ "`uname`" == "Linux" ]; then
|
||||
target_os=linux
|
||||
if [ x"$TARGET_ARCH" == x ]; then
|
||||
target_cpu=x64
|
||||
elif [ "$TARGET_ARCH" == "ia32" ]; then
|
||||
target_cpu=x86
|
||||
else
|
||||
target_cpu="$TARGET_ARCH"
|
||||
fi
|
||||
else
|
||||
target_cpu="$TARGET_ARCH"
|
||||
echo "Unknown system: `uname`"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Unknown system: `uname`"
|
||||
exit 1
|
||||
electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.$target_os.$target_cpu.manifest
|
||||
fi
|
||||
electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.$target_os.$target_cpu.manifest
|
||||
fi
|
||||
|
||||
step-electron-dist-store: &step-electron-dist-store
|
||||
@@ -378,6 +424,9 @@ step-persist-data-for-tests: &step-persist-data-for-tests
|
||||
- src/out/Default/mksnapshot.zip
|
||||
- src/out/Default/gen/node_headers
|
||||
- src/out/ffmpeg/ffmpeg.zip
|
||||
- src/electron
|
||||
- src/third_party/electron_node
|
||||
- src/third_party/nan
|
||||
|
||||
step-electron-dist-unzip: &step-electron-dist-unzip
|
||||
run:
|
||||
@@ -465,7 +514,9 @@ step-mksnapshot-build: &step-mksnapshot-build
|
||||
electron/script/strip-binaries.py --file $PWD/out/Default/mksnapshot
|
||||
fi
|
||||
fi
|
||||
ninja -C out/Default electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||
if [ "$SKIP_DIST_ZIP" != "1" ]; then
|
||||
ninja -C out/Default electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||
fi
|
||||
|
||||
step-mksnapshot-store: &step-mksnapshot-store
|
||||
store_artifacts:
|
||||
@@ -487,6 +538,8 @@ step-maybe-zip-symbols: &step-maybe-zip-symbols
|
||||
command: |
|
||||
cd src
|
||||
export BUILD_PATH="$PWD/out/Default"
|
||||
ninja -C out/Default electron:licenses
|
||||
ninja -C out/Default electron:electron_version
|
||||
electron/script/zip-symbols.py -b $BUILD_PATH
|
||||
|
||||
step-maybe-cross-arch-snapshot: &step-maybe-cross-arch-snapshot
|
||||
@@ -651,7 +704,7 @@ steps-lint: &steps-lint
|
||||
chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
|
||||
gn_version="$(curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/DEPS?format=TEXT" | base64 -d | grep gn_version | head -n1 | cut -d\' -f4)"
|
||||
|
||||
cipd ensure -ensure-file - -root . <<-CIPD
|
||||
cipd ensure -ensure-file - -root . \<<-CIPD
|
||||
\$ServiceURL https://chrome-infra-packages.appspot.com/
|
||||
@Subdir src/buildtools/linux64
|
||||
gn/gn/linux-amd64 $gn_version
|
||||
@@ -755,10 +808,16 @@ steps-electron-build: &steps-electron-build
|
||||
at: .
|
||||
- *step-depot-tools-add-to-path
|
||||
- *step-setup-env-for-build
|
||||
- *step-restore-brew-cache
|
||||
- *step-get-more-space-on-mac
|
||||
- *step-install-npm-deps-on-mac
|
||||
- *step-fix-sync-on-mac
|
||||
- *step-gn-gen-default
|
||||
- *step-delete-git-directories
|
||||
|
||||
# Electron app
|
||||
- *step-electron-build
|
||||
- *step-maybe-electron-dist-strip
|
||||
- *step-electron-dist-build
|
||||
- *step-electron-dist-store
|
||||
- *step-ninja-summary
|
||||
@@ -769,10 +828,54 @@ steps-electron-build: &steps-electron-build
|
||||
|
||||
- *step-show-sccache-stats
|
||||
|
||||
steps-electron-build-for-tests: &steps-electron-build-for-tests
|
||||
# mksnapshot
|
||||
- *step-mksnapshot-build
|
||||
- *step-mksnapshot-store
|
||||
- *step-maybe-cross-arch-snapshot
|
||||
- *step-maybe-cross-arch-snapshot-store
|
||||
|
||||
# ffmpeg
|
||||
- *step-ffmpeg-gn-gen
|
||||
- *step-ffmpeg-build
|
||||
- *step-ffmpeg-store
|
||||
|
||||
# Save all data needed for a further tests run.
|
||||
- *step-persist-data-for-tests
|
||||
|
||||
- *step-maybe-generate-breakpad-symbols
|
||||
- *step-maybe-zip-symbols
|
||||
|
||||
# Trigger tests on arm hardware if needed
|
||||
- *step-maybe-trigger-arm-test
|
||||
|
||||
- *step-maybe-notify-slack-failure
|
||||
|
||||
steps-electron-build-with-inline-checkout-for-tests: &steps-electron-build-with-inline-checkout-for-tests
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: .
|
||||
# Checkout - Copied ffrom steps-checkout
|
||||
- *step-checkout-electron
|
||||
- *step-depot-tools-get
|
||||
- *step-depot-tools-add-to-path
|
||||
- *step-restore-brew-cache
|
||||
- *step-get-more-space-on-mac
|
||||
- *step-install-gnutar-on-mac
|
||||
- *step-generate-deps-hash
|
||||
- *step-touch-sync-done
|
||||
- *step-maybe-restore-src-cache
|
||||
- *step-maybe-restore-git-cache
|
||||
- *step-set-git-cache-path
|
||||
# This sync call only runs if .circle-sync-done is an EMPTY file
|
||||
- *step-gclient-sync
|
||||
# These next few steps reset Electron to the correct commit regardless of which cache was restored
|
||||
- run:
|
||||
name: Wipe Electron
|
||||
command: rm -rf src/electron
|
||||
- *step-checkout-electron
|
||||
- *step-run-electron-only-hooks
|
||||
- *step-generate-deps-hash-cleanly
|
||||
- *step-mark-sync-done
|
||||
- *step-minimize-workspace-size-from-checkout
|
||||
|
||||
- *step-depot-tools-add-to-path
|
||||
- *step-setup-env-for-build
|
||||
- *step-restore-brew-cache
|
||||
@@ -1008,7 +1111,6 @@ chromium-upgrade-branches: &chromium-upgrade-branches
|
||||
/chromium\-upgrade\/[0-9]+/
|
||||
|
||||
# List of all jobs.
|
||||
version: 2
|
||||
jobs:
|
||||
# Layer 0: Lint. Standalone.
|
||||
lint:
|
||||
@@ -1068,7 +1170,8 @@ jobs:
|
||||
<<: *env-debug-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
<<: *steps-electron-build-with-inline-checkout-for-tests
|
||||
|
||||
linux-x64-debug-gn-check:
|
||||
<<: *machine-linux-medium
|
||||
@@ -1084,7 +1187,8 @@ jobs:
|
||||
<<: *env-testing-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build-for-tests
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
<<: *steps-electron-build-with-inline-checkout-for-tests
|
||||
|
||||
linux-x64-testing-no-run-as-node:
|
||||
<<: *machine-linux-2xlarge
|
||||
@@ -1094,7 +1198,8 @@ jobs:
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *env-disable-run-as-node
|
||||
<<: *steps-electron-build-for-tests
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
<<: *steps-electron-build-with-inline-checkout-for-tests
|
||||
|
||||
linux-x64-testing-gn-check:
|
||||
<<: *machine-linux-medium
|
||||
@@ -1120,7 +1225,7 @@ jobs:
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-send-slack-notifications
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build-for-tests
|
||||
<<: *steps-electron-build
|
||||
|
||||
linux-x64-publish:
|
||||
<<: *machine-linux-2xlarge
|
||||
@@ -1128,6 +1233,7 @@ jobs:
|
||||
<<: *env-linux-2xlarge-release
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
|
||||
<<: *env-release-build
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *steps-electron-build-for-publish
|
||||
|
||||
linux-ia32-debug:
|
||||
@@ -1138,7 +1244,8 @@ jobs:
|
||||
<<: *env-debug-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
<<: *steps-electron-build-with-inline-checkout-for-tests
|
||||
|
||||
linux-ia32-testing:
|
||||
<<: *machine-linux-2xlarge
|
||||
@@ -1148,7 +1255,8 @@ jobs:
|
||||
<<: *env-testing-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build-for-tests
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
<<: *steps-electron-build-with-inline-checkout-for-tests
|
||||
|
||||
linux-ia32-chromedriver:
|
||||
<<: *machine-linux-medium
|
||||
@@ -1169,7 +1277,7 @@ jobs:
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-send-slack-notifications
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build-for-tests
|
||||
<<: *steps-electron-build
|
||||
|
||||
linux-ia32-publish:
|
||||
<<: *machine-linux-2xlarge
|
||||
@@ -1178,6 +1286,7 @@ jobs:
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
|
||||
<<: *env-ia32
|
||||
<<: *env-release-build
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *steps-electron-build-for-publish
|
||||
|
||||
linux-arm-debug:
|
||||
@@ -1188,7 +1297,8 @@ jobs:
|
||||
<<: *env-debug-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
<<: *steps-electron-build-with-inline-checkout-for-tests
|
||||
|
||||
linux-arm-testing:
|
||||
<<: *machine-linux-2xlarge
|
||||
@@ -1199,7 +1309,8 @@ jobs:
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
TRIGGER_ARM_TEST: true
|
||||
<<: *steps-electron-build-for-tests
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
<<: *steps-electron-build-with-inline-checkout-for-tests
|
||||
|
||||
linux-arm-chromedriver:
|
||||
<<: *machine-linux-medium
|
||||
@@ -1220,7 +1331,7 @@ jobs:
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-send-slack-notifications
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build-for-tests
|
||||
<<: *steps-electron-build
|
||||
|
||||
linux-arm-publish:
|
||||
<<: *machine-linux-2xlarge
|
||||
@@ -1229,6 +1340,7 @@ jobs:
|
||||
<<: *env-arm
|
||||
<<: *env-release-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *steps-electron-build-for-publish
|
||||
|
||||
linux-arm64-debug:
|
||||
@@ -1239,7 +1351,8 @@ jobs:
|
||||
<<: *env-debug-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
<<: *steps-electron-build-with-inline-checkout-for-tests
|
||||
|
||||
linux-arm64-debug-gn-check:
|
||||
<<: *machine-linux-medium
|
||||
@@ -1258,7 +1371,8 @@ jobs:
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
TRIGGER_ARM_TEST: true
|
||||
<<: *steps-electron-build-for-tests
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
<<: *steps-electron-build-with-inline-checkout-for-tests
|
||||
|
||||
linux-arm64-testing-gn-check:
|
||||
<<: *machine-linux-medium
|
||||
@@ -1287,7 +1401,7 @@ jobs:
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-send-slack-notifications
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build-for-tests
|
||||
<<: *steps-electron-build
|
||||
|
||||
linux-arm64-publish:
|
||||
<<: *machine-linux-2xlarge
|
||||
@@ -1296,6 +1410,7 @@ jobs:
|
||||
<<: *env-arm64
|
||||
<<: *env-release-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm64=True --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *steps-electron-build-for-publish
|
||||
|
||||
osx-testing:
|
||||
@@ -1305,7 +1420,7 @@ jobs:
|
||||
<<: *env-testing-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build-for-tests
|
||||
<<: *steps-electron-build
|
||||
|
||||
osx-debug:
|
||||
<<: *machine-mac-large
|
||||
@@ -1314,7 +1429,7 @@ jobs:
|
||||
<<: *env-debug-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build-for-tests
|
||||
<<: *steps-electron-build
|
||||
|
||||
osx-debug-gn-check:
|
||||
<<: *machine-mac
|
||||
@@ -1346,7 +1461,7 @@ jobs:
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build-for-tests
|
||||
<<: *steps-electron-build
|
||||
|
||||
osx-publish:
|
||||
<<: *machine-mac-large
|
||||
@@ -1354,6 +1469,7 @@ jobs:
|
||||
<<: *env-mac-large-release
|
||||
<<: *env-release-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *steps-electron-build-for-publish
|
||||
|
||||
mas-testing:
|
||||
@@ -1364,7 +1480,7 @@ jobs:
|
||||
<<: *env-testing-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build-for-tests
|
||||
<<: *steps-electron-build
|
||||
|
||||
mas-debug:
|
||||
<<: *machine-mac-large
|
||||
@@ -1374,7 +1490,7 @@ jobs:
|
||||
<<: *env-debug-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build-for-tests
|
||||
<<: *steps-electron-build
|
||||
|
||||
mas-debug-gn-check:
|
||||
<<: *machine-mac
|
||||
@@ -1409,7 +1525,7 @@ jobs:
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build-for-tests
|
||||
<<: *steps-electron-build
|
||||
|
||||
mas-publish:
|
||||
<<: *machine-mac-large
|
||||
@@ -1418,6 +1534,7 @@ jobs:
|
||||
<<: *env-mas
|
||||
<<: *env-release-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *steps-electron-build-for-publish
|
||||
|
||||
# Layer 3: Tests.
|
||||
@@ -1672,28 +1789,61 @@ jobs:
|
||||
- *step-maybe-notify-slack-success
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
version: 2.1
|
||||
|
||||
# The publish workflows below each contain one job so that they are
|
||||
# compatible with how sudowoodo works today. If these workflows are
|
||||
# changed to have multiple jobs, then scripts/release/ci-release-build.js
|
||||
# will need to be updated and there will most likely need to be changes to
|
||||
# sudowoodo
|
||||
|
||||
publish-x64-linux:
|
||||
when: << pipeline.parameters.run-linux-x64-publish >>
|
||||
jobs:
|
||||
- linux-x64-publish
|
||||
|
||||
publish-ia32-linux:
|
||||
when: << pipeline.parameters.run-linux-ia32-publish >>
|
||||
jobs:
|
||||
- linux-ia32-publish
|
||||
|
||||
publish-arm-linux:
|
||||
when: << pipeline.parameters.run-linux-arm-publish >>
|
||||
jobs:
|
||||
- linux-arm-publish
|
||||
|
||||
publish-arm64-linux:
|
||||
when: << pipeline.parameters.run-linux-arm64-publish >>
|
||||
jobs:
|
||||
- linux-arm64-publish
|
||||
|
||||
publish-osx:
|
||||
when: << pipeline.parameters.run-osx-publish >>
|
||||
jobs:
|
||||
- osx-publish
|
||||
|
||||
publish-mas:
|
||||
when: << pipeline.parameters.run-mas-publish >>
|
||||
jobs:
|
||||
- mas-publish
|
||||
|
||||
lint:
|
||||
when: << pipeline.parameters.run-lint >>
|
||||
jobs:
|
||||
- lint
|
||||
|
||||
build-linux:
|
||||
when: << pipeline.parameters.run-build-linux >>
|
||||
jobs:
|
||||
- linux-checkout-fast
|
||||
- linux-checkout-and-save-cache
|
||||
|
||||
- linux-x64-debug:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
- linux-x64-debug
|
||||
- linux-x64-debug-gn-check:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
- linux-x64-testing:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
- linux-x64-testing-no-run-as-node:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
- linux-x64-testing
|
||||
- linux-x64-testing-no-run-as-node
|
||||
- linux-x64-testing-gn-check:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
@@ -1707,12 +1857,8 @@ workflows:
|
||||
requires:
|
||||
- linux-x64-testing
|
||||
|
||||
- linux-ia32-debug:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
- linux-ia32-testing:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
- linux-ia32-debug
|
||||
- linux-ia32-testing
|
||||
- linux-ia32-testing-tests:
|
||||
requires:
|
||||
- linux-ia32-testing
|
||||
@@ -1723,27 +1869,20 @@ workflows:
|
||||
requires:
|
||||
- linux-ia32-testing
|
||||
|
||||
- linux-arm-debug:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
- linux-arm-testing:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
- linux-arm-debug
|
||||
- linux-arm-testing
|
||||
|
||||
- linux-arm64-debug:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
- linux-arm64-debug
|
||||
- linux-arm64-debug-gn-check:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
- linux-arm64-testing:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
- linux-arm64-testing
|
||||
- linux-arm64-testing-gn-check:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
|
||||
build-mac:
|
||||
when: << pipeline.parameters.run-build-mac >>
|
||||
jobs:
|
||||
- mac-checkout-fast
|
||||
- mac-checkout-and-save-cache
|
||||
@@ -1798,11 +1937,11 @@ workflows:
|
||||
- master
|
||||
- *chromium-upgrade-branches
|
||||
jobs:
|
||||
- linux-checkout
|
||||
- linux-checkout-fast
|
||||
|
||||
- linux-x64-release:
|
||||
requires:
|
||||
- linux-checkout
|
||||
- linux-checkout-fast
|
||||
- linux-x64-release-tests:
|
||||
requires:
|
||||
- linux-x64-release
|
||||
@@ -1814,7 +1953,7 @@ workflows:
|
||||
- linux-x64-release
|
||||
- linux-x64-chromedriver:
|
||||
requires:
|
||||
- linux-checkout
|
||||
- linux-checkout-fast
|
||||
- linux-x64-release-summary:
|
||||
requires:
|
||||
- linux-x64-release
|
||||
@@ -1824,7 +1963,7 @@ workflows:
|
||||
|
||||
- linux-ia32-release:
|
||||
requires:
|
||||
- linux-checkout
|
||||
- linux-checkout-fast
|
||||
- linux-ia32-release-tests:
|
||||
requires:
|
||||
- linux-ia32-release
|
||||
@@ -1836,7 +1975,7 @@ workflows:
|
||||
- linux-ia32-release
|
||||
- linux-ia32-chromedriver:
|
||||
requires:
|
||||
- linux-checkout
|
||||
- linux-checkout-fast
|
||||
- linux-ia32-release-summary:
|
||||
requires:
|
||||
- linux-ia32-release
|
||||
@@ -1846,10 +1985,10 @@ workflows:
|
||||
|
||||
- linux-arm-release:
|
||||
requires:
|
||||
- linux-checkout
|
||||
- linux-checkout-fast
|
||||
- linux-arm-chromedriver:
|
||||
requires:
|
||||
- linux-checkout
|
||||
- linux-checkout-fast
|
||||
- linux-arm-release-summary:
|
||||
requires:
|
||||
- linux-arm-release
|
||||
@@ -1858,10 +1997,10 @@ workflows:
|
||||
|
||||
- linux-arm64-release:
|
||||
requires:
|
||||
- linux-checkout
|
||||
- linux-checkout-fast
|
||||
- linux-arm64-chromedriver:
|
||||
requires:
|
||||
- linux-checkout
|
||||
- linux-checkout-fast
|
||||
- linux-arm64-release-summary:
|
||||
requires:
|
||||
- linux-arm64-release
|
||||
@@ -1877,11 +2016,11 @@ workflows:
|
||||
- master
|
||||
- *chromium-upgrade-branches
|
||||
jobs:
|
||||
- mac-checkout
|
||||
- mac-checkout-fast
|
||||
|
||||
- osx-release:
|
||||
requires:
|
||||
- mac-checkout
|
||||
- mac-checkout-fast
|
||||
- osx-release-tests:
|
||||
requires:
|
||||
- osx-release
|
||||
@@ -1893,7 +2032,7 @@ workflows:
|
||||
- osx-release
|
||||
- osx-chromedriver:
|
||||
requires:
|
||||
- mac-checkout
|
||||
- mac-checkout-fast
|
||||
- osx-release-summary:
|
||||
requires:
|
||||
- osx-release
|
||||
@@ -1903,7 +2042,7 @@ workflows:
|
||||
|
||||
- mas-release:
|
||||
requires:
|
||||
- mac-checkout
|
||||
- mac-checkout-fast
|
||||
- mas-release-tests:
|
||||
requires:
|
||||
- mas-release
|
||||
@@ -1915,7 +2054,7 @@ workflows:
|
||||
- mas-release
|
||||
- mas-chromedriver:
|
||||
requires:
|
||||
- mac-checkout
|
||||
- mac-checkout-fast
|
||||
- mas-release-summary:
|
||||
requires:
|
||||
- mas-release
|
||||
|
||||
12
BUILD.gn
12
BUILD.gn
@@ -280,6 +280,7 @@ if (is_linux) {
|
||||
"notify_notification_add_action",
|
||||
"notify_notification_set_image_from_pixbuf",
|
||||
"notify_notification_set_timeout",
|
||||
"notify_notification_set_urgency",
|
||||
"notify_notification_set_hint_string",
|
||||
"notify_notification_show",
|
||||
"notify_notification_close",
|
||||
@@ -579,6 +580,17 @@ source_set("electron_lib") {
|
||||
]
|
||||
}
|
||||
|
||||
if (enable_remote_module) {
|
||||
sources += [
|
||||
"shell/common/api/remote/object_life_monitor.cc",
|
||||
"shell/common/api/remote/object_life_monitor.h",
|
||||
"shell/common/api/remote/remote_callback_freer.cc",
|
||||
"shell/common/api/remote/remote_callback_freer.h",
|
||||
"shell/common/api/remote/remote_object_freer.cc",
|
||||
"shell/common/api/remote/remote_object_freer.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (enable_desktop_capturer) {
|
||||
if (is_component_build && !is_linux) {
|
||||
# On windows the implementation relies on unexported
|
||||
|
||||
7
DEPS
7
DEPS
@@ -5,12 +5,13 @@ gclient_gn_args = [
|
||||
'checkout_android_native_support',
|
||||
'checkout_libaom',
|
||||
'checkout_nacl',
|
||||
'checkout_oculus_sdk'
|
||||
'checkout_oculus_sdk',
|
||||
'checkout_openxr'
|
||||
]
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'62327c655093c821aa0fcfc6db53f5fd943e08c7',
|
||||
'af5e1805f244bb71328690460ddd3d48ef3b1eca',
|
||||
'node_version':
|
||||
'v12.9.1',
|
||||
'nan_version':
|
||||
@@ -60,6 +61,8 @@ vars = {
|
||||
True,
|
||||
'checkout_oculus_sdk':
|
||||
False,
|
||||
'checkout_openxr':
|
||||
False,
|
||||
'build_with_chromium':
|
||||
True,
|
||||
'checkout_android':
|
||||
|
||||
@@ -1 +1 @@
|
||||
8.0.0-nightly.20190912
|
||||
8.0.0-nightly.20190919
|
||||
@@ -77,8 +77,8 @@ steps:
|
||||
python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
|
||||
displayName: 'Verify ffmpeg'
|
||||
|
||||
- script: |
|
||||
taskkill /F /IM electron.exe
|
||||
taskkill /F /IM MicrosoftEdge.exe
|
||||
- powershell: |
|
||||
Get-Process | Where Name –Like "electron.exe*" | Stop-Process
|
||||
Get-Process | Where Name –Like "MicrosoftEdge.exe*" | Stop-Process
|
||||
displayName: 'Kill processes left running from last test run'
|
||||
condition: always()
|
||||
@@ -24,3 +24,6 @@ is_cfi = false
|
||||
# TODO: Remove this and update CI to contain 10.14 SDK once
|
||||
# crbug.com/986701 is fixed.
|
||||
mac_sdk_min = "10.13"
|
||||
|
||||
# TODO: disabled due to crashes. re-enable.
|
||||
enable_osr = false
|
||||
|
||||
@@ -12,6 +12,7 @@ buildflag_header("buildflags") {
|
||||
"ENABLE_DESKTOP_CAPTURER=$enable_desktop_capturer",
|
||||
"ENABLE_RUN_AS_NODE=$enable_run_as_node",
|
||||
"ENABLE_OSR=$enable_osr",
|
||||
"ENABLE_REMOTE_MODULE=$enable_remote_module",
|
||||
"ENABLE_VIEW_API=$enable_view_api",
|
||||
"ENABLE_PEPPER_FLASH=$enable_pepper_flash",
|
||||
"ENABLE_PDF_VIEWER=$enable_pdf_viewer",
|
||||
|
||||
@@ -10,6 +10,8 @@ declare_args() {
|
||||
|
||||
enable_osr = true
|
||||
|
||||
enable_remote_module = true
|
||||
|
||||
enable_view_api = false
|
||||
|
||||
enable_pdf_viewer = false
|
||||
|
||||
@@ -135,10 +135,6 @@ static_library("chrome") {
|
||||
sources += [
|
||||
"//chrome/browser/speech/tts_controller_delegate_impl.cc",
|
||||
"//chrome/browser/speech/tts_controller_delegate_impl.h",
|
||||
"//chrome/browser/speech/tts_message_filter.cc",
|
||||
"//chrome/browser/speech/tts_message_filter.h",
|
||||
"//chrome/renderer/tts_dispatcher.cc",
|
||||
"//chrome/renderer/tts_dispatcher.h",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -202,8 +198,6 @@ static_library("chrome") {
|
||||
"//chrome/browser/ui/views/overlay/back_to_tab_image_button.h",
|
||||
"//chrome/browser/ui/views/overlay/close_image_button.cc",
|
||||
"//chrome/browser/ui/views/overlay/close_image_button.h",
|
||||
"//chrome/browser/ui/views/overlay/mute_image_button.cc",
|
||||
"//chrome/browser/ui/views/overlay/mute_image_button.h",
|
||||
"//chrome/browser/ui/views/overlay/overlay_window_views.cc",
|
||||
"//chrome/browser/ui/views/overlay/overlay_window_views.h",
|
||||
"//chrome/browser/ui/views/overlay/playback_image_button.cc",
|
||||
|
||||
@@ -73,7 +73,7 @@ net::NSSCertDatabase* GetNSSCertDatabaseForResourceContext(
|
||||
void CertificateManagerModel::Create(content::BrowserContext* browser_context,
|
||||
const CreationCallback& callback) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
base::PostTaskWithTraits(
|
||||
base::PostTask(
|
||||
FROM_HERE, {BrowserThread::IO},
|
||||
base::BindOnce(&CertificateManagerModel::GetCertDBOnIOThread,
|
||||
browser_context->GetResourceContext(), callback));
|
||||
@@ -86,7 +86,7 @@ CertificateManagerModel::CertificateManagerModel(
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
}
|
||||
|
||||
CertificateManagerModel::~CertificateManagerModel() {}
|
||||
CertificateManagerModel::~CertificateManagerModel() = default;
|
||||
|
||||
int CertificateManagerModel::ImportFromPKCS12(
|
||||
PK11SlotInfo* slot_info,
|
||||
@@ -146,7 +146,7 @@ void CertificateManagerModel::DidGetCertDBOnIOThread(
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
|
||||
bool is_user_db_available = !!cert_db->GetPublicSlot();
|
||||
base::PostTaskWithTraits(
|
||||
base::PostTask(
|
||||
FROM_HERE, {BrowserThread::UI},
|
||||
base::BindOnce(&CertificateManagerModel::DidGetCertDBOnUIThread, cert_db,
|
||||
is_user_db_available, callback));
|
||||
|
||||
@@ -185,7 +185,7 @@ int WaitSocketForRead(int fd, const base::TimeDelta& timeout) {
|
||||
FD_ZERO(&read_fds);
|
||||
FD_SET(fd, &read_fds);
|
||||
|
||||
return HANDLE_EINTR(select(fd + 1, &read_fds, NULL, NULL, &tv));
|
||||
return HANDLE_EINTR(select(fd + 1, &read_fds, nullptr, nullptr, &tv));
|
||||
}
|
||||
|
||||
// Read a message from a socket fd, with an optional timeout.
|
||||
@@ -705,7 +705,7 @@ void ProcessSingleton::LinuxWatcher::SocketReader::FinishWithACK(
|
||||
if (shutdown(fd_, SHUT_WR) < 0)
|
||||
PLOG(ERROR) << "shutdown() failed";
|
||||
|
||||
base::PostTaskWithTraits(
|
||||
base::PostTask(
|
||||
FROM_HERE, {BrowserThread::IO},
|
||||
base::BindOnce(&ProcessSingleton::LinuxWatcher::RemoveSocketReader,
|
||||
parent_, this));
|
||||
@@ -885,10 +885,9 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() {
|
||||
|
||||
void ProcessSingleton::StartListeningOnSocket() {
|
||||
watcher_ = new LinuxWatcher(this);
|
||||
base::PostTaskWithTraits(
|
||||
FROM_HERE, {BrowserThread::IO},
|
||||
base::BindOnce(&ProcessSingleton::LinuxWatcher::StartListening, watcher_,
|
||||
sock_));
|
||||
base::PostTask(FROM_HERE, {BrowserThread::IO},
|
||||
base::BindOnce(&ProcessSingleton::LinuxWatcher::StartListening,
|
||||
watcher_, sock_));
|
||||
}
|
||||
|
||||
void ProcessSingleton::OnBrowserReady() {
|
||||
|
||||
@@ -54,6 +54,7 @@ component("pepper_flash") {
|
||||
"//chrome/browser/renderer_host/pepper/monitor_finder_mac.h",
|
||||
"//chrome/browser/renderer_host/pepper/monitor_finder_mac.mm",
|
||||
]
|
||||
libs = [ "CoreGraphics.framework" ]
|
||||
}
|
||||
if (is_linux) {
|
||||
deps += [ "//components/services/font/public/cpp" ]
|
||||
|
||||
@@ -4,18 +4,12 @@
|
||||
|
||||
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process)
|
||||
|
||||
The following example shows how to write a string to the clipboard:
|
||||
|
||||
```javascript
|
||||
const { clipboard } = require('electron')
|
||||
clipboard.writeText('Example String')
|
||||
```
|
||||
|
||||
On Linux, there is also a `selection` clipboard. To manipulate it
|
||||
you need to pass `selection` to each method:
|
||||
|
||||
```javascript
|
||||
const { clipboard } = require('electron')
|
||||
|
||||
clipboard.writeText('Example String', 'selection')
|
||||
console.log(clipboard.readText('selection'))
|
||||
```
|
||||
@@ -28,56 +22,106 @@ The `clipboard` module has the following methods:
|
||||
|
||||
### `clipboard.readText([type])`
|
||||
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
|
||||
|
||||
Returns `String` - The content in the clipboard as plain text.
|
||||
|
||||
```js
|
||||
const { clipboard } = require('electron')
|
||||
|
||||
clipboard.writeText('hello i am a bit of text!')
|
||||
|
||||
const text = clipboard.readText()
|
||||
console.log(text)
|
||||
// hello i am a bit of text!'
|
||||
```
|
||||
|
||||
### `clipboard.writeText(text[, type])`
|
||||
|
||||
* `text` String
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
|
||||
|
||||
Writes the `text` into the clipboard as plain text.
|
||||
|
||||
```js
|
||||
const { clipboard } = require('electron')
|
||||
|
||||
const text = 'hello i am a bit of text!'
|
||||
clipboard.writeText(text)
|
||||
```
|
||||
|
||||
### `clipboard.readHTML([type])`
|
||||
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
|
||||
|
||||
Returns `String` - The content in the clipboard as markup.
|
||||
|
||||
```js
|
||||
const { clipboard } = require('electron')
|
||||
|
||||
clipboard.writeHTML('<b>Hi</b>')
|
||||
const html = clipboard.readHTML()
|
||||
|
||||
console.log(html)
|
||||
// <meta charset='utf-8'><b>Hi</b>
|
||||
```
|
||||
|
||||
### `clipboard.writeHTML(markup[, type])`
|
||||
|
||||
* `markup` String
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
|
||||
|
||||
Writes `markup` to the clipboard.
|
||||
|
||||
```js
|
||||
const { clipboard } = require('electron')
|
||||
|
||||
clipboard.writeHTML('<b>Hi</b')
|
||||
```
|
||||
|
||||
### `clipboard.readImage([type])`
|
||||
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
|
||||
|
||||
Returns [`NativeImage`](native-image.md) - The image content in the clipboard.
|
||||
|
||||
### `clipboard.writeImage(image[, type])`
|
||||
|
||||
* `image` [NativeImage](native-image.md)
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
|
||||
|
||||
Writes `image` to the clipboard.
|
||||
|
||||
### `clipboard.readRTF([type])`
|
||||
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
|
||||
|
||||
Returns `String` - The content in the clipboard as RTF.
|
||||
|
||||
```js
|
||||
const { clipboard } = require('electron')
|
||||
|
||||
clipboard.writeRTF('{\\rtf1\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\\f0\\pard\nThis is some {\\b bold} text.\\par\n}')
|
||||
|
||||
const rtf = clipboard.readRTF()
|
||||
console.log(rtf)
|
||||
// {\\rtf1\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\\f0\\pard\nThis is some {\\b bold} text.\\par\n}
|
||||
```
|
||||
|
||||
### `clipboard.writeRTF(text[, type])`
|
||||
|
||||
* `text` String
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
|
||||
|
||||
Writes the `text` into the clipboard in RTF.
|
||||
|
||||
```js
|
||||
const { clipboard } = require('electron')
|
||||
|
||||
const rtf = '{\\rtf1\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\\f0\\pard\nThis is some {\\b bold} text.\\par\n}'
|
||||
clipboard.writeRTF(rtf)
|
||||
```
|
||||
|
||||
### `clipboard.readBookmark()` _macOS_ _Windows_
|
||||
|
||||
Returns `Object`:
|
||||
@@ -93,7 +137,7 @@ bookmark is unavailable.
|
||||
|
||||
* `title` String
|
||||
* `url` String
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
|
||||
|
||||
Writes the `title` and `url` into the clipboard as a bookmark.
|
||||
|
||||
@@ -102,7 +146,9 @@ you can use `clipboard.write` to write both a bookmark and fallback text to the
|
||||
clipboard.
|
||||
|
||||
```js
|
||||
clipboard.write({
|
||||
const { clipboard } = require('electron')
|
||||
|
||||
clipboard.writeBookmark({
|
||||
text: 'https://electronjs.org',
|
||||
bookmark: 'Electron Homepage'
|
||||
})
|
||||
@@ -110,39 +156,50 @@ clipboard.write({
|
||||
|
||||
### `clipboard.readFindText()` _macOS_
|
||||
|
||||
Returns `String` - The text on the find pasteboard. This method uses synchronous
|
||||
IPC when called from the renderer process. The cached value is reread from the
|
||||
find pasteboard whenever the application is activated.
|
||||
Returns `String` - The text on the find pasteboard, which is the pasteboard that holds information about the current state of the active application’s find panel.
|
||||
|
||||
This method uses synchronous IPC when called from the renderer process.
|
||||
The cached value is reread from the find pasteboard whenever the application is activated.
|
||||
|
||||
### `clipboard.writeFindText(text)` _macOS_
|
||||
|
||||
* `text` String
|
||||
|
||||
Writes the `text` into the find pasteboard as plain text. This method uses
|
||||
synchronous IPC when called from the renderer process.
|
||||
Writes the `text` into the find pasteboard (the pasteboard that holds information about the current state of the active application’s find panel) as plain text. This method uses synchronous IPC when called from the renderer process.
|
||||
|
||||
### `clipboard.clear([type])`
|
||||
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
|
||||
|
||||
Clears the clipboard content.
|
||||
|
||||
### `clipboard.availableFormats([type])`
|
||||
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
|
||||
|
||||
Returns `String[]` - An array of supported formats for the clipboard `type`.
|
||||
|
||||
```js
|
||||
const { clipboard } = require('electron')
|
||||
|
||||
const formats = clipboard.availableFormats()
|
||||
console.log(formats)
|
||||
// [ 'text/plain', 'text/html' ]
|
||||
```
|
||||
|
||||
### `clipboard.has(format[, type])` _Experimental_
|
||||
|
||||
* `format` String
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
|
||||
|
||||
Returns `Boolean` - Whether the clipboard supports the specified `format`.
|
||||
|
||||
```javascript
|
||||
```js
|
||||
const { clipboard } = require('electron')
|
||||
console.log(clipboard.has('<p>selection</p>'))
|
||||
|
||||
const hasFormat = clipboard.has('<p>selection</p>')
|
||||
console.log(hasFormat)
|
||||
// 'true' or 'false
|
||||
```
|
||||
|
||||
### `clipboard.read(format)` _Experimental_
|
||||
@@ -157,14 +214,33 @@ Returns `String` - Reads `format` type from the clipboard.
|
||||
|
||||
Returns `Buffer` - Reads `format` type from the clipboard.
|
||||
|
||||
```js
|
||||
const { clipboard } = require('electron')
|
||||
|
||||
const buffer = Buffer.from('this is binary', 'utf8')
|
||||
clipboard.writeBuffer('public.utf8-plain-text', buffer)
|
||||
|
||||
const ret = clipboard.readBuffer('public.utf8-plain-text')
|
||||
|
||||
console.log(buffer.equals(out))
|
||||
// true
|
||||
```
|
||||
|
||||
### `clipboard.writeBuffer(format, buffer[, type])` _Experimental_
|
||||
|
||||
* `format` String
|
||||
* `buffer` Buffer
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
|
||||
|
||||
Writes the `buffer` into the clipboard as `format`.
|
||||
|
||||
```js
|
||||
const { clipboard } = require('electron')
|
||||
|
||||
const buffer = Buffer.from('writeBuffer', 'utf8')
|
||||
clipboard.writeBuffer('public.utf8-plain-text', buffer)
|
||||
```
|
||||
|
||||
### `clipboard.write(data[, type])`
|
||||
|
||||
* `data` Object
|
||||
@@ -173,10 +249,29 @@ Writes the `buffer` into the clipboard as `format`.
|
||||
* `image` [NativeImage](native-image.md) (optional)
|
||||
* `rtf` String (optional)
|
||||
* `bookmark` String (optional) - The title of the URL at `text`.
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
|
||||
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
|
||||
|
||||
```javascript
|
||||
const { clipboard } = require('electron')
|
||||
clipboard.write({ text: 'test', html: '<b>test</b>' })
|
||||
```
|
||||
Writes `data` to the clipboard.
|
||||
|
||||
```js
|
||||
const { clipboard } = require('electron')
|
||||
|
||||
clipboard.write({
|
||||
text: 'test',
|
||||
html: '<b>Hi</b>',
|
||||
rtf: '{\\rtf1\\utf8 text}',
|
||||
bookmark: 'a title'
|
||||
})
|
||||
|
||||
console.log(clipboard.readText())
|
||||
// 'test'
|
||||
|
||||
console.log(clipboard.readHTML())
|
||||
// <meta charset='utf-8'><b>Hi</b>
|
||||
|
||||
console.log(clipboard.readRTF())
|
||||
// '{\\rtf1\\utf8 text}'
|
||||
|
||||
console.log(clipboard.readBookmark())
|
||||
// { title: 'a title', url: 'test' }
|
||||
```
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
> Read and respond to changes in Chromium's native color theme.
|
||||
|
||||
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process)
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
## Events
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ Returns `Boolean` - Whether or not desktop notifications are supported on the cu
|
||||
* `hasReply` Boolean (optional) _macOS_ - Whether or not to add an inline reply option to the notification.
|
||||
* `replyPlaceholder` String (optional) _macOS_ - The placeholder to write in the inline reply input field.
|
||||
* `sound` String (optional) _macOS_ - The name of the sound file to play when the notification is shown.
|
||||
* `urgency` String (optional) _Linux_ - The urgency level of the notification. Can be 'normal', 'critical', or 'low'.
|
||||
* `actions` [NotificationAction[]](structures/notification-action.md) (optional) _macOS_ - Actions to add to the notification. Please read the available actions and limitations in the `NotificationAction` documentation.
|
||||
* `closeButtonText` String (optional) _macOS_ - A custom title for the close button of an alert. An empty string will cause the default localized text to be used.
|
||||
|
||||
@@ -144,6 +145,12 @@ A `Boolean` property representing whether the notification is silent.
|
||||
|
||||
A `Boolean` property representing whether the notification has a reply action.
|
||||
|
||||
#### `notification.urgency` _Linux_
|
||||
|
||||
A `String` property representing the urgency level of the notification. Can be 'normal', 'critical', or 'low'.
|
||||
|
||||
Default is 'low' - see [NotifyUrgency](https://developer.gnome.org/notification-spec/#urgency-levels) for more information.
|
||||
|
||||
#### `notification.actions`
|
||||
|
||||
A [`NotificationAction[]`](structures/notification-action.md) property representing the actions of the notification.
|
||||
|
||||
@@ -5,8 +5,15 @@ Follow the guidelines below for building Electron on Windows.
|
||||
## Prerequisites
|
||||
|
||||
* Windows 10 / Server 2012 R2 or higher
|
||||
* Visual Studio 2017 15.7.2 or higher - [download VS 2017 Community Edition for
|
||||
* Visual Studio 2017 15.7.2 or higher - [download VS 2019 Community Edition for
|
||||
free](https://www.visualstudio.com/vs/)
|
||||
* See [the Chromium build documentation](https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#visual-studio) for more details on which Visual Studio
|
||||
components are required.
|
||||
* If your Visual Studio is installed in a directory other than the default, you'll need to
|
||||
set a few environment variables to point the toolchains to your installation path.
|
||||
* `vs2019_install = DRIVE:\path\to\Microsoft Visual Studio\2019\Community`
|
||||
(replace `2019` and `Community` with your installed versions)
|
||||
* `WINDOWSSDKDIR = DRIVE:\path\to\Windows Kits\10`
|
||||
* [Python 2.7.10 or higher](http://www.python.org/download/releases/2.7/)
|
||||
* Contrary to the `depot_tools` setup instructions linked below, you will need
|
||||
to use your locally installed Python with at least version 2.7.10 (with
|
||||
|
||||
@@ -43,7 +43,8 @@ When releasing your product, you’re also shipping a bundle composed of Electro
|
||||
Chromium shared library and Node.js. Vulnerabilities affecting these components
|
||||
may impact the security of your application. By updating Electron to the latest
|
||||
version, you ensure that critical vulnerabilities (such as *nodeIntegration bypasses*)
|
||||
are already patched and cannot be exploited in your application.
|
||||
are already patched and cannot be exploited in your application. For more information,
|
||||
see "[Use a current version of Electron](#17-use-a-current-version-of-electron)".
|
||||
|
||||
* **Evaluate your dependencies.** While NPM provides half a million reusable packages,
|
||||
it is your responsibility to choose trusted 3rd-party libraries. If you use outdated
|
||||
@@ -101,6 +102,7 @@ You should at least follow these steps to improve the security of your applicati
|
||||
14. [Do not use `openExternal` with untrusted content](#14-do-not-use-openexternal-with-untrusted-content)
|
||||
15. [Disable the `remote` module](#15-disable-the-remote-module)
|
||||
16. [Filter the `remote` module](#16-filter-the-remote-module)
|
||||
17. [Use a current version of Electron](#17-use-a-current-version-of-electron)
|
||||
|
||||
To automate the detection of misconfigurations and insecure patterns, it is
|
||||
possible to use
|
||||
@@ -830,6 +832,29 @@ app.on('remote-get-guest-web-contents', (event, webContents, guestWebContents) =
|
||||
})
|
||||
```
|
||||
|
||||
## 17) Use a current version of Electron
|
||||
|
||||
You should strive for always using the latest available version of Electron.
|
||||
Whenever a new major version is released, you should attempt to update your
|
||||
app as quickly as possible.
|
||||
|
||||
### Why?
|
||||
|
||||
An application built with an older version of Electron, Chromium, and Node.js
|
||||
is an easier target than an application that is using more recent versions of
|
||||
those components. Generally speaking, security issues and exploits for older
|
||||
versions of Chromium and Node.js are more widely available.
|
||||
|
||||
Both Chromium and Node.js are impressive feats of engineering built by
|
||||
thousands of talented developers. Given their popularity, their security is
|
||||
carefully tested and analyzed by equally skilled security researchers. Many of
|
||||
those researchers [disclose vulnerabilities responsibly][responsible-disclosure],
|
||||
which generally means that researchers will give Chromium and Node.js some time
|
||||
to fix issues before publishing them. Your application will be more secure if
|
||||
it is running a recent version of Electron (and thus, Chromium and Node.js) for
|
||||
which potential security issues are not as widely known.
|
||||
|
||||
|
||||
[browser-window]: ../api/browser-window.md
|
||||
[browser-view]: ../api/browser-view.md
|
||||
[webview-tag]: ../api/webview-tag.md
|
||||
@@ -838,3 +863,4 @@ app.on('remote-get-guest-web-contents', (event, webContents, guestWebContents) =
|
||||
[will-navigate]: ../api/web-contents.md#event-will-navigate
|
||||
[open-external]: ../api/shell.md#shellopenexternalurl-options-callback
|
||||
[sandbox]: ../api/sandbox-option.md
|
||||
[responsible-disclosure]: https://en.wikipedia.org/wiki/Responsible_disclosure
|
||||
|
||||
@@ -132,22 +132,20 @@ auto_filenames = {
|
||||
"lib/common/api/deprecate.ts",
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/native-theme.ts",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/buffer-utils.ts",
|
||||
"lib/common/clipboard-utils.ts",
|
||||
"lib/common/crash-reporter.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
"lib/common/error-utils.ts",
|
||||
"lib/common/is-promise.ts",
|
||||
"lib/common/remote/buffer-utils.ts",
|
||||
"lib/common/remote/is-promise.ts",
|
||||
"lib/common/web-view-methods.ts",
|
||||
"lib/renderer/api/crash-reporter.js",
|
||||
"lib/renderer/api/desktop-capturer.ts",
|
||||
"lib/renderer/api/ipc-renderer.ts",
|
||||
"lib/renderer/api/remote.js",
|
||||
"lib/renderer/api/web-frame.ts",
|
||||
"lib/renderer/callbacks-registry.ts",
|
||||
"lib/renderer/chrome-api.ts",
|
||||
"lib/renderer/content-scripts-injector.ts",
|
||||
"lib/renderer/extensions/event.ts",
|
||||
@@ -157,6 +155,7 @@ auto_filenames = {
|
||||
"lib/renderer/inspector.ts",
|
||||
"lib/renderer/ipc-renderer-internal-utils.ts",
|
||||
"lib/renderer/ipc-renderer-internal.ts",
|
||||
"lib/renderer/remote/callbacks-registry.ts",
|
||||
"lib/renderer/security-warnings.ts",
|
||||
"lib/renderer/web-frame-init.ts",
|
||||
"lib/renderer/web-view/guest-view-internal.ts",
|
||||
@@ -224,6 +223,7 @@ auto_filenames = {
|
||||
"lib/browser/api/menu-utils.js",
|
||||
"lib/browser/api/menu.js",
|
||||
"lib/browser/api/module-list.ts",
|
||||
"lib/browser/api/native-theme.ts",
|
||||
"lib/browser/api/net-log.js",
|
||||
"lib/browser/api/net.js",
|
||||
"lib/browser/api/notification.js",
|
||||
@@ -258,24 +258,24 @@ auto_filenames = {
|
||||
"lib/browser/ipc-main-internal-utils.ts",
|
||||
"lib/browser/ipc-main-internal.ts",
|
||||
"lib/browser/navigation-controller.js",
|
||||
"lib/browser/objects-registry.js",
|
||||
"lib/browser/remote/objects-registry.js",
|
||||
"lib/browser/remote/server.js",
|
||||
"lib/browser/rpc-server.js",
|
||||
"lib/browser/utils.ts",
|
||||
"lib/common/api/clipboard.js",
|
||||
"lib/common/api/deprecate.ts",
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/native-theme.ts",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/buffer-utils.ts",
|
||||
"lib/common/clipboard-utils.ts",
|
||||
"lib/common/crash-reporter.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
"lib/common/error-utils.ts",
|
||||
"lib/common/init.ts",
|
||||
"lib/common/is-promise.ts",
|
||||
"lib/common/parse-features-string.js",
|
||||
"lib/common/remote/buffer-utils.ts",
|
||||
"lib/common/remote/is-promise.ts",
|
||||
"lib/common/reset-search-paths.ts",
|
||||
"lib/common/web-view-methods.ts",
|
||||
"lib/renderer/ipc-renderer-internal-utils.ts",
|
||||
@@ -291,16 +291,15 @@ auto_filenames = {
|
||||
"lib/common/api/deprecate.ts",
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/native-theme.ts",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/buffer-utils.ts",
|
||||
"lib/common/clipboard-utils.ts",
|
||||
"lib/common/crash-reporter.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
"lib/common/error-utils.ts",
|
||||
"lib/common/init.ts",
|
||||
"lib/common/is-promise.ts",
|
||||
"lib/common/remote/buffer-utils.ts",
|
||||
"lib/common/remote/is-promise.ts",
|
||||
"lib/common/reset-search-paths.ts",
|
||||
"lib/common/web-view-methods.ts",
|
||||
"lib/renderer/api/crash-reporter.js",
|
||||
@@ -310,7 +309,6 @@ auto_filenames = {
|
||||
"lib/renderer/api/module-list.ts",
|
||||
"lib/renderer/api/remote.js",
|
||||
"lib/renderer/api/web-frame.ts",
|
||||
"lib/renderer/callbacks-registry.ts",
|
||||
"lib/renderer/chrome-api.ts",
|
||||
"lib/renderer/content-scripts-injector.ts",
|
||||
"lib/renderer/extensions/event.ts",
|
||||
@@ -321,6 +319,7 @@ auto_filenames = {
|
||||
"lib/renderer/inspector.ts",
|
||||
"lib/renderer/ipc-renderer-internal-utils.ts",
|
||||
"lib/renderer/ipc-renderer-internal.ts",
|
||||
"lib/renderer/remote/callbacks-registry.ts",
|
||||
"lib/renderer/security-warnings.ts",
|
||||
"lib/renderer/web-frame-init.ts",
|
||||
"lib/renderer/web-view/guest-view-internal.ts",
|
||||
@@ -342,16 +341,15 @@ auto_filenames = {
|
||||
"lib/common/api/deprecate.ts",
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/native-theme.ts",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/buffer-utils.ts",
|
||||
"lib/common/clipboard-utils.ts",
|
||||
"lib/common/crash-reporter.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
"lib/common/error-utils.ts",
|
||||
"lib/common/init.ts",
|
||||
"lib/common/is-promise.ts",
|
||||
"lib/common/remote/buffer-utils.ts",
|
||||
"lib/common/remote/is-promise.ts",
|
||||
"lib/common/reset-search-paths.ts",
|
||||
"lib/renderer/api/crash-reporter.js",
|
||||
"lib/renderer/api/desktop-capturer.ts",
|
||||
@@ -360,9 +358,9 @@ auto_filenames = {
|
||||
"lib/renderer/api/module-list.ts",
|
||||
"lib/renderer/api/remote.js",
|
||||
"lib/renderer/api/web-frame.ts",
|
||||
"lib/renderer/callbacks-registry.ts",
|
||||
"lib/renderer/ipc-renderer-internal-utils.ts",
|
||||
"lib/renderer/ipc-renderer-internal.ts",
|
||||
"lib/renderer/remote/callbacks-registry.ts",
|
||||
"lib/renderer/webpack-provider.ts",
|
||||
"lib/worker/init.js",
|
||||
"package.json",
|
||||
|
||||
@@ -65,6 +65,9 @@ filenames = {
|
||||
"shell/browser/api/atom_api_menu_mac.mm",
|
||||
"shell/browser/api/atom_api_menu_views.cc",
|
||||
"shell/browser/api/atom_api_menu_views.h",
|
||||
"shell/browser/api/atom_api_native_theme.cc",
|
||||
"shell/browser/api/atom_api_native_theme.h",
|
||||
"shell/browser/api/atom_api_native_theme_mac.mm",
|
||||
"shell/browser/api/atom_api_net.cc",
|
||||
"shell/browser/api/atom_api_net.h",
|
||||
"shell/browser/api/atom_api_net_log.cc",
|
||||
@@ -427,9 +430,6 @@ filenames = {
|
||||
"shell/common/api/atom_api_native_image.cc",
|
||||
"shell/common/api/atom_api_native_image.h",
|
||||
"shell/common/api/atom_api_native_image_mac.mm",
|
||||
"shell/common/api/atom_api_native_theme.cc",
|
||||
"shell/common/api/atom_api_native_theme.h",
|
||||
"shell/common/api/atom_api_native_theme_mac.mm",
|
||||
"shell/common/api/atom_api_shell.cc",
|
||||
"shell/common/api/atom_api_v8_util.cc",
|
||||
"shell/common/api/electron_bindings.cc",
|
||||
@@ -440,12 +440,6 @@ filenames = {
|
||||
"shell/common/api/features.cc",
|
||||
"shell/common/api/locker.cc",
|
||||
"shell/common/api/locker.h",
|
||||
"shell/common/api/object_life_monitor.cc",
|
||||
"shell/common/api/object_life_monitor.h",
|
||||
"shell/common/api/remote_callback_freer.cc",
|
||||
"shell/common/api/remote_callback_freer.h",
|
||||
"shell/common/api/remote_object_freer.cc",
|
||||
"shell/common/api/remote_object_freer.h",
|
||||
"shell/common/asar/archive.cc",
|
||||
"shell/common/asar/archive.h",
|
||||
"shell/common/asar/asar_util.cc",
|
||||
@@ -482,6 +476,7 @@ filenames = {
|
||||
"shell/common/gin_converters/gurl_converter.h",
|
||||
"shell/common/gin_converters/image_converter.cc",
|
||||
"shell/common/gin_converters/image_converter.h",
|
||||
"shell/common/gin_converters/native_mate_handle_converter.h",
|
||||
"shell/common/gin_converters/message_box_converter.cc",
|
||||
"shell/common/gin_converters/message_box_converter.h",
|
||||
"shell/common/gin_converters/native_window_converter.h",
|
||||
@@ -500,6 +495,8 @@ filenames = {
|
||||
"shell/common/gin_helper/event_emitter_caller.h",
|
||||
"shell/common/gin_helper/function_template.cc",
|
||||
"shell/common/gin_helper/function_template.h",
|
||||
"shell/common/gin_helper/object_template_builder.cc",
|
||||
"shell/common/gin_helper/object_template_builder.h",
|
||||
"shell/common/heap_snapshot.cc",
|
||||
"shell/common/heap_snapshot.h",
|
||||
"shell/common/key_weak_map.h",
|
||||
|
||||
@@ -16,6 +16,7 @@ export const browserModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'inAppPurchase', loader: () => require('./in-app-purchase') },
|
||||
{ name: 'Menu', loader: () => require('./menu') },
|
||||
{ name: 'MenuItem', loader: () => require('./menu-item') },
|
||||
{ name: 'nativeTheme', loader: () => require('./native-theme') },
|
||||
{ name: 'net', loader: () => require('./net') },
|
||||
{ name: 'netLog', loader: () => require('./net-log') },
|
||||
{ name: 'Notification', loader: () => require('./notification') },
|
||||
|
||||
@@ -19,7 +19,13 @@ export const getSources = (event: Electron.IpcMainEvent, options: ElectronIntern
|
||||
}
|
||||
|
||||
const getSources = new Promise<ElectronInternal.GetSourcesResult[]>((resolve, reject) => {
|
||||
let capturer: ElectronInternal.DesktopCapturer | null = createDesktopCapturer()
|
||||
|
||||
const stopRunning = () => {
|
||||
if (capturer) {
|
||||
capturer.emit = null
|
||||
capturer = null
|
||||
}
|
||||
// Remove from currentlyRunning once we resolve or reject
|
||||
currentlyRunning = currentlyRunning.filter(running => running.options !== options)
|
||||
}
|
||||
@@ -42,19 +48,13 @@ export const getSources = (event: Electron.IpcMainEvent, options: ElectronIntern
|
||||
})))
|
||||
})
|
||||
|
||||
let capturer: ElectronInternal.DesktopCapturer | null = createDesktopCapturer()
|
||||
|
||||
capturer.emit = emitter.emit.bind(emitter)
|
||||
capturer.startHandling(options.captureWindow, options.captureScreen, options.thumbnailSize, options.fetchWindowIcons)
|
||||
|
||||
// If the WebContents is destroyed before receiving result, just remove the
|
||||
// reference to emit and the capturer itself so that it never dispatches
|
||||
// back to the renderer
|
||||
event.sender.once('destroyed', () => {
|
||||
capturer!.emit = null
|
||||
capturer = null
|
||||
stopRunning()
|
||||
})
|
||||
event.sender.once('destroyed', () => stopRunning())
|
||||
})
|
||||
|
||||
currentlyRunning.push({
|
||||
|
||||
@@ -151,11 +151,17 @@ app._setDefaultAppPaths(packagePath)
|
||||
// Load the chrome devtools support.
|
||||
require('@electron/internal/browser/devtools')
|
||||
|
||||
const features = process.electronBinding('features')
|
||||
|
||||
// Load the chrome extension support.
|
||||
if (!process.electronBinding('features').isExtensionsEnabled()) {
|
||||
if (!features.isExtensionsEnabled()) {
|
||||
require('@electron/internal/browser/chrome-extension')
|
||||
}
|
||||
|
||||
if (features.isRemoteModuleEnabled()) {
|
||||
require('@electron/internal/browser/remote/server')
|
||||
}
|
||||
|
||||
// Load protocol module to ensure it is populated on app ready
|
||||
require('@electron/internal/browser/api/protocol')
|
||||
|
||||
|
||||
471
lib/browser/remote/server.js
Normal file
471
lib/browser/remote/server.js
Normal file
@@ -0,0 +1,471 @@
|
||||
'use strict'
|
||||
|
||||
const electron = require('electron')
|
||||
const { EventEmitter } = require('events')
|
||||
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
const eventBinding = process.electronBinding('event')
|
||||
const features = process.electronBinding('features')
|
||||
|
||||
if (!features.isRemoteModuleEnabled()) {
|
||||
throw new Error('remote module is disabled')
|
||||
}
|
||||
|
||||
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
|
||||
const objectsRegistry = require('@electron/internal/browser/remote/objects-registry')
|
||||
const guestViewManager = require('@electron/internal/browser/guest-view-manager')
|
||||
const bufferUtils = require('@electron/internal/common/remote/buffer-utils')
|
||||
const errorUtils = require('@electron/internal/common/error-utils')
|
||||
const { isPromise } = require('@electron/internal/common/remote/is-promise')
|
||||
|
||||
const hasProp = {}.hasOwnProperty
|
||||
|
||||
// The internal properties of Function.
|
||||
const FUNCTION_PROPERTIES = [
|
||||
'length', 'name', 'arguments', 'caller', 'prototype'
|
||||
]
|
||||
|
||||
// The remote functions in renderer processes.
|
||||
// id => Function
|
||||
const rendererFunctions = v8Util.createDoubleIDWeakMap()
|
||||
|
||||
// Return the description of object's members:
|
||||
const getObjectMembers = function (object) {
|
||||
let names = Object.getOwnPropertyNames(object)
|
||||
// For Function, we should not override following properties even though they
|
||||
// are "own" properties.
|
||||
if (typeof object === 'function') {
|
||||
names = names.filter((name) => {
|
||||
return !FUNCTION_PROPERTIES.includes(name)
|
||||
})
|
||||
}
|
||||
// Map properties to descriptors.
|
||||
return names.map((name) => {
|
||||
const descriptor = Object.getOwnPropertyDescriptor(object, name)
|
||||
const member = { name, enumerable: descriptor.enumerable, writable: false }
|
||||
if (descriptor.get === undefined && typeof object[name] === 'function') {
|
||||
member.type = 'method'
|
||||
} else {
|
||||
if (descriptor.set || descriptor.writable) member.writable = true
|
||||
member.type = 'get'
|
||||
}
|
||||
return member
|
||||
})
|
||||
}
|
||||
|
||||
// Return the description of object's prototype.
|
||||
const getObjectPrototype = function (object) {
|
||||
const proto = Object.getPrototypeOf(object)
|
||||
if (proto === null || proto === Object.prototype) return null
|
||||
return {
|
||||
members: getObjectMembers(proto),
|
||||
proto: getObjectPrototype(proto)
|
||||
}
|
||||
}
|
||||
|
||||
// Convert a real value into meta data.
|
||||
const valueToMeta = function (sender, contextId, value, optimizeSimpleObject = false) {
|
||||
// Determine the type of value.
|
||||
const meta = { type: typeof value }
|
||||
if (meta.type === 'object') {
|
||||
// Recognize certain types of objects.
|
||||
if (value === null) {
|
||||
meta.type = 'value'
|
||||
} else if (bufferUtils.isBuffer(value)) {
|
||||
meta.type = 'buffer'
|
||||
} else if (Array.isArray(value)) {
|
||||
meta.type = 'array'
|
||||
} else if (value instanceof Error) {
|
||||
meta.type = 'error'
|
||||
} else if (value instanceof Date) {
|
||||
meta.type = 'date'
|
||||
} else if (isPromise(value)) {
|
||||
meta.type = 'promise'
|
||||
} else if (hasProp.call(value, 'callee') && value.length != null) {
|
||||
// Treat the arguments object as array.
|
||||
meta.type = 'array'
|
||||
} else if (optimizeSimpleObject && v8Util.getHiddenValue(value, 'simple')) {
|
||||
// Treat simple objects as value.
|
||||
meta.type = 'value'
|
||||
}
|
||||
}
|
||||
|
||||
// Fill the meta object according to value's type.
|
||||
if (meta.type === 'array') {
|
||||
meta.members = value.map((el) => valueToMeta(sender, contextId, el, optimizeSimpleObject))
|
||||
} else if (meta.type === 'object' || meta.type === 'function') {
|
||||
meta.name = value.constructor ? value.constructor.name : ''
|
||||
|
||||
// Reference the original value if it's an object, because when it's
|
||||
// passed to renderer we would assume the renderer keeps a reference of
|
||||
// it.
|
||||
meta.id = objectsRegistry.add(sender, contextId, value)
|
||||
meta.members = getObjectMembers(value)
|
||||
meta.proto = getObjectPrototype(value)
|
||||
} else if (meta.type === 'buffer') {
|
||||
meta.value = bufferUtils.bufferToMeta(value)
|
||||
} else if (meta.type === 'promise') {
|
||||
// Add default handler to prevent unhandled rejections in main process
|
||||
// Instead they should appear in the renderer process
|
||||
value.then(function () {}, function () {})
|
||||
|
||||
meta.then = valueToMeta(sender, contextId, function (onFulfilled, onRejected) {
|
||||
value.then(onFulfilled, onRejected)
|
||||
})
|
||||
} else if (meta.type === 'error') {
|
||||
meta.members = plainObjectToMeta(value)
|
||||
|
||||
// Error.name is not part of own properties.
|
||||
meta.members.push({
|
||||
name: 'name',
|
||||
value: value.name
|
||||
})
|
||||
} else if (meta.type === 'date') {
|
||||
meta.value = value.getTime()
|
||||
} else {
|
||||
meta.type = 'value'
|
||||
meta.value = value
|
||||
}
|
||||
return meta
|
||||
}
|
||||
|
||||
// Convert object to meta by value.
|
||||
const plainObjectToMeta = function (obj) {
|
||||
return Object.getOwnPropertyNames(obj).map(function (name) {
|
||||
return {
|
||||
name: name,
|
||||
value: obj[name]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Convert Error into meta data.
|
||||
const exceptionToMeta = function (error) {
|
||||
return {
|
||||
type: 'exception',
|
||||
value: errorUtils.serialize(error)
|
||||
}
|
||||
}
|
||||
|
||||
const throwRPCError = function (message) {
|
||||
const error = new Error(message)
|
||||
error.code = 'EBADRPC'
|
||||
error.errno = -72
|
||||
throw error
|
||||
}
|
||||
|
||||
const removeRemoteListenersAndLogWarning = (sender, callIntoRenderer) => {
|
||||
const location = v8Util.getHiddenValue(callIntoRenderer, 'location')
|
||||
let message = `Attempting to call a function in a renderer window that has been closed or released.` +
|
||||
`\nFunction provided here: ${location}`
|
||||
|
||||
if (sender instanceof EventEmitter) {
|
||||
const remoteEvents = sender.eventNames().filter((eventName) => {
|
||||
return sender.listeners(eventName).includes(callIntoRenderer)
|
||||
})
|
||||
|
||||
if (remoteEvents.length > 0) {
|
||||
message += `\nRemote event names: ${remoteEvents.join(', ')}`
|
||||
remoteEvents.forEach((eventName) => {
|
||||
sender.removeListener(eventName, callIntoRenderer)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
console.warn(message)
|
||||
}
|
||||
|
||||
// Convert array of meta data from renderer into array of real values.
|
||||
const unwrapArgs = function (sender, frameId, contextId, args) {
|
||||
const metaToValue = function (meta) {
|
||||
switch (meta.type) {
|
||||
case 'value':
|
||||
return meta.value
|
||||
case 'remote-object':
|
||||
return objectsRegistry.get(meta.id)
|
||||
case 'array':
|
||||
return unwrapArgs(sender, frameId, contextId, meta.value)
|
||||
case 'buffer':
|
||||
return bufferUtils.metaToBuffer(meta.value)
|
||||
case 'date':
|
||||
return new Date(meta.value)
|
||||
case 'promise':
|
||||
return Promise.resolve({
|
||||
then: metaToValue(meta.then)
|
||||
})
|
||||
case 'object': {
|
||||
const ret = {}
|
||||
Object.defineProperty(ret.constructor, 'name', { value: meta.name })
|
||||
|
||||
for (const { name, value } of meta.members) {
|
||||
ret[name] = metaToValue(value)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
case 'function-with-return-value':
|
||||
const returnValue = metaToValue(meta.value)
|
||||
return function () {
|
||||
return returnValue
|
||||
}
|
||||
case 'function': {
|
||||
// Merge contextId and meta.id, since meta.id can be the same in
|
||||
// different webContents.
|
||||
const objectId = [contextId, meta.id]
|
||||
|
||||
// Cache the callbacks in renderer.
|
||||
if (rendererFunctions.has(objectId)) {
|
||||
return rendererFunctions.get(objectId)
|
||||
}
|
||||
|
||||
const callIntoRenderer = function (...args) {
|
||||
let succeed = false
|
||||
if (!sender.isDestroyed()) {
|
||||
succeed = sender._sendToFrameInternal(frameId, 'ELECTRON_RENDERER_CALLBACK', contextId, meta.id, valueToMeta(sender, contextId, args))
|
||||
}
|
||||
if (!succeed) {
|
||||
removeRemoteListenersAndLogWarning(this, callIntoRenderer)
|
||||
}
|
||||
}
|
||||
v8Util.setHiddenValue(callIntoRenderer, 'location', meta.location)
|
||||
Object.defineProperty(callIntoRenderer, 'length', { value: meta.length })
|
||||
|
||||
v8Util.setRemoteCallbackFreer(callIntoRenderer, contextId, meta.id, sender)
|
||||
rendererFunctions.set(objectId, callIntoRenderer)
|
||||
return callIntoRenderer
|
||||
}
|
||||
default:
|
||||
throw new TypeError(`Unknown type: ${meta.type}`)
|
||||
}
|
||||
}
|
||||
return args.map(metaToValue)
|
||||
}
|
||||
|
||||
const isRemoteModuleEnabledImpl = function (contents) {
|
||||
const webPreferences = contents.getLastWebPreferences() || {}
|
||||
return !!webPreferences.enableRemoteModule
|
||||
}
|
||||
|
||||
const isRemoteModuleEnabledCache = new WeakMap()
|
||||
|
||||
const isRemoteModuleEnabled = function (contents) {
|
||||
if (!isRemoteModuleEnabledCache.has(contents)) {
|
||||
isRemoteModuleEnabledCache.set(contents, isRemoteModuleEnabledImpl(contents))
|
||||
}
|
||||
|
||||
return isRemoteModuleEnabledCache.get(contents)
|
||||
}
|
||||
|
||||
const handleRemoteCommand = function (channel, handler) {
|
||||
ipcMainInternal.on(channel, (event, contextId, ...args) => {
|
||||
let returnValue
|
||||
if (!isRemoteModuleEnabled(event.sender)) {
|
||||
event.returnValue = null
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
returnValue = handler(event, contextId, ...args)
|
||||
} catch (error) {
|
||||
returnValue = exceptionToMeta(error)
|
||||
}
|
||||
|
||||
if (returnValue !== undefined) {
|
||||
event.returnValue = returnValue
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const emitCustomEvent = function (contents, eventName, ...args) {
|
||||
const event = eventBinding.createWithSender(contents)
|
||||
|
||||
electron.app.emit(eventName, event, contents, ...args)
|
||||
contents.emit(eventName, event, ...args)
|
||||
|
||||
return event
|
||||
}
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_WRONG_CONTEXT_ERROR', function (event, contextId, passedContextId, id) {
|
||||
const objectId = [passedContextId, id]
|
||||
if (!rendererFunctions.has(objectId)) {
|
||||
// Do nothing if the error has already been reported before.
|
||||
return
|
||||
}
|
||||
removeRemoteListenersAndLogWarning(event.sender, rendererFunctions.get(objectId))
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_REQUIRE', function (event, contextId, moduleName) {
|
||||
const customEvent = emitCustomEvent(event.sender, 'remote-require', moduleName)
|
||||
|
||||
if (customEvent.returnValue === undefined) {
|
||||
if (customEvent.defaultPrevented) {
|
||||
throw new Error(`Blocked remote.require('${moduleName}')`)
|
||||
} else {
|
||||
customEvent.returnValue = process.mainModule.require(moduleName)
|
||||
}
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, customEvent.returnValue)
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_GET_BUILTIN', function (event, contextId, moduleName) {
|
||||
const customEvent = emitCustomEvent(event.sender, 'remote-get-builtin', moduleName)
|
||||
|
||||
if (customEvent.returnValue === undefined) {
|
||||
if (customEvent.defaultPrevented) {
|
||||
throw new Error(`Blocked remote.getBuiltin('${moduleName}')`)
|
||||
} else {
|
||||
customEvent.returnValue = electron[moduleName]
|
||||
}
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, customEvent.returnValue)
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_GLOBAL', function (event, contextId, globalName) {
|
||||
const customEvent = emitCustomEvent(event.sender, 'remote-get-global', globalName)
|
||||
|
||||
if (customEvent.returnValue === undefined) {
|
||||
if (customEvent.defaultPrevented) {
|
||||
throw new Error(`Blocked remote.getGlobal('${globalName}')`)
|
||||
} else {
|
||||
customEvent.returnValue = global[globalName]
|
||||
}
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, customEvent.returnValue)
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_CURRENT_WINDOW', function (event, contextId) {
|
||||
const customEvent = emitCustomEvent(event.sender, 'remote-get-current-window')
|
||||
|
||||
if (customEvent.returnValue === undefined) {
|
||||
if (customEvent.defaultPrevented) {
|
||||
throw new Error('Blocked remote.getCurrentWindow()')
|
||||
} else {
|
||||
customEvent.returnValue = event.sender.getOwnerBrowserWindow()
|
||||
}
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, customEvent.returnValue)
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_CURRENT_WEB_CONTENTS', function (event, contextId) {
|
||||
const customEvent = emitCustomEvent(event.sender, 'remote-get-current-web-contents')
|
||||
|
||||
if (customEvent.returnValue === undefined) {
|
||||
if (customEvent.defaultPrevented) {
|
||||
throw new Error('Blocked remote.getCurrentWebContents()')
|
||||
} else {
|
||||
customEvent.returnValue = event.sender
|
||||
}
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, customEvent.returnValue)
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_CONSTRUCTOR', function (event, contextId, id, args) {
|
||||
args = unwrapArgs(event.sender, event.frameId, contextId, args)
|
||||
const constructor = objectsRegistry.get(id)
|
||||
|
||||
if (constructor == null) {
|
||||
throwRPCError(`Cannot call constructor on missing remote object ${id}`)
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, new constructor(...args))
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_FUNCTION_CALL', function (event, contextId, id, args) {
|
||||
args = unwrapArgs(event.sender, event.frameId, contextId, args)
|
||||
const func = objectsRegistry.get(id)
|
||||
|
||||
if (func == null) {
|
||||
throwRPCError(`Cannot call function on missing remote object ${id}`)
|
||||
}
|
||||
|
||||
try {
|
||||
return valueToMeta(event.sender, contextId, func(...args), true)
|
||||
} catch (error) {
|
||||
const err = new Error(`Could not call remote function '${func.name || 'anonymous'}'. Check that the function signature is correct. Underlying error: ${error.message}\nUnderlying stack: ${error.stack}\n`)
|
||||
err.cause = error
|
||||
throw err
|
||||
}
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_MEMBER_CONSTRUCTOR', function (event, contextId, id, method, args) {
|
||||
args = unwrapArgs(event.sender, event.frameId, contextId, args)
|
||||
const object = objectsRegistry.get(id)
|
||||
|
||||
if (object == null) {
|
||||
throwRPCError(`Cannot call constructor '${method}' on missing remote object ${id}`)
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, new object[method](...args))
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_MEMBER_CALL', function (event, contextId, id, method, args) {
|
||||
args = unwrapArgs(event.sender, event.frameId, contextId, args)
|
||||
const object = objectsRegistry.get(id)
|
||||
|
||||
if (object == null) {
|
||||
throwRPCError(`Cannot call method '${method}' on missing remote object ${id}`)
|
||||
}
|
||||
|
||||
try {
|
||||
return valueToMeta(event.sender, contextId, object[method](...args), true)
|
||||
} catch (error) {
|
||||
const err = new Error(`Could not call remote method '${method}'. Check that the method signature is correct. Underlying error: ${error.message}\nUnderlying stack: ${error.stack}\n`)
|
||||
err.cause = error
|
||||
throw err
|
||||
}
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_MEMBER_SET', function (event, contextId, id, name, args) {
|
||||
args = unwrapArgs(event.sender, event.frameId, contextId, args)
|
||||
const obj = objectsRegistry.get(id)
|
||||
|
||||
if (obj == null) {
|
||||
throwRPCError(`Cannot set property '${name}' on missing remote object ${id}`)
|
||||
}
|
||||
|
||||
obj[name] = args[0]
|
||||
return null
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_MEMBER_GET', function (event, contextId, id, name) {
|
||||
const obj = objectsRegistry.get(id)
|
||||
|
||||
if (obj == null) {
|
||||
throwRPCError(`Cannot get property '${name}' on missing remote object ${id}`)
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, obj[name])
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_DEREFERENCE', function (event, contextId, id, rendererSideRefCount) {
|
||||
objectsRegistry.remove(event.sender, contextId, id, rendererSideRefCount)
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_CONTEXT_RELEASE', (event, contextId) => {
|
||||
objectsRegistry.clear(event.sender, contextId)
|
||||
return null
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_GUEST_WEB_CONTENTS', function (event, contextId, guestInstanceId) {
|
||||
const guest = guestViewManager.getGuestForWebContents(guestInstanceId, event.sender)
|
||||
|
||||
const customEvent = emitCustomEvent(event.sender, 'remote-get-guest-web-contents', guest)
|
||||
|
||||
if (customEvent.returnValue === undefined) {
|
||||
if (customEvent.defaultPrevented) {
|
||||
throw new Error(`Blocked remote.getGuestForWebContents()`)
|
||||
} else {
|
||||
customEvent.returnValue = guest
|
||||
}
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, customEvent.returnValue)
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
isRemoteModuleEnabled
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
'use strict'
|
||||
|
||||
const electron = require('electron')
|
||||
const { EventEmitter } = require('events')
|
||||
const fs = require('fs')
|
||||
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
const eventBinding = process.electronBinding('event')
|
||||
const clipboard = process.electronBinding('clipboard')
|
||||
const features = process.electronBinding('features')
|
||||
@@ -12,269 +10,9 @@ const features = process.electronBinding('features')
|
||||
const { crashReporterInit } = require('@electron/internal/browser/crash-reporter-init')
|
||||
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
|
||||
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils')
|
||||
const objectsRegistry = require('@electron/internal/browser/objects-registry')
|
||||
const guestViewManager = require('@electron/internal/browser/guest-view-manager')
|
||||
const bufferUtils = require('@electron/internal/common/buffer-utils')
|
||||
const errorUtils = require('@electron/internal/common/error-utils')
|
||||
const clipboardUtils = require('@electron/internal/common/clipboard-utils')
|
||||
const { isPromise } = require('@electron/internal/common/is-promise')
|
||||
|
||||
const hasProp = {}.hasOwnProperty
|
||||
|
||||
// The internal properties of Function.
|
||||
const FUNCTION_PROPERTIES = [
|
||||
'length', 'name', 'arguments', 'caller', 'prototype'
|
||||
]
|
||||
|
||||
// The remote functions in renderer processes.
|
||||
// id => Function
|
||||
const rendererFunctions = v8Util.createDoubleIDWeakMap()
|
||||
|
||||
// Return the description of object's members:
|
||||
const getObjectMembers = function (object) {
|
||||
let names = Object.getOwnPropertyNames(object)
|
||||
// For Function, we should not override following properties even though they
|
||||
// are "own" properties.
|
||||
if (typeof object === 'function') {
|
||||
names = names.filter((name) => {
|
||||
return !FUNCTION_PROPERTIES.includes(name)
|
||||
})
|
||||
}
|
||||
// Map properties to descriptors.
|
||||
return names.map((name) => {
|
||||
const descriptor = Object.getOwnPropertyDescriptor(object, name)
|
||||
const member = { name, enumerable: descriptor.enumerable, writable: false }
|
||||
if (descriptor.get === undefined && typeof object[name] === 'function') {
|
||||
member.type = 'method'
|
||||
} else {
|
||||
if (descriptor.set || descriptor.writable) member.writable = true
|
||||
member.type = 'get'
|
||||
}
|
||||
return member
|
||||
})
|
||||
}
|
||||
|
||||
// Return the description of object's prototype.
|
||||
const getObjectPrototype = function (object) {
|
||||
const proto = Object.getPrototypeOf(object)
|
||||
if (proto === null || proto === Object.prototype) return null
|
||||
return {
|
||||
members: getObjectMembers(proto),
|
||||
proto: getObjectPrototype(proto)
|
||||
}
|
||||
}
|
||||
|
||||
// Convert a real value into meta data.
|
||||
const valueToMeta = function (sender, contextId, value, optimizeSimpleObject = false) {
|
||||
// Determine the type of value.
|
||||
const meta = { type: typeof value }
|
||||
if (meta.type === 'object') {
|
||||
// Recognize certain types of objects.
|
||||
if (value === null) {
|
||||
meta.type = 'value'
|
||||
} else if (bufferUtils.isBuffer(value)) {
|
||||
meta.type = 'buffer'
|
||||
} else if (Array.isArray(value)) {
|
||||
meta.type = 'array'
|
||||
} else if (value instanceof Error) {
|
||||
meta.type = 'error'
|
||||
} else if (value instanceof Date) {
|
||||
meta.type = 'date'
|
||||
} else if (isPromise(value)) {
|
||||
meta.type = 'promise'
|
||||
} else if (hasProp.call(value, 'callee') && value.length != null) {
|
||||
// Treat the arguments object as array.
|
||||
meta.type = 'array'
|
||||
} else if (optimizeSimpleObject && v8Util.getHiddenValue(value, 'simple')) {
|
||||
// Treat simple objects as value.
|
||||
meta.type = 'value'
|
||||
}
|
||||
}
|
||||
|
||||
// Fill the meta object according to value's type.
|
||||
if (meta.type === 'array') {
|
||||
meta.members = value.map((el) => valueToMeta(sender, contextId, el, optimizeSimpleObject))
|
||||
} else if (meta.type === 'object' || meta.type === 'function') {
|
||||
meta.name = value.constructor ? value.constructor.name : ''
|
||||
|
||||
// Reference the original value if it's an object, because when it's
|
||||
// passed to renderer we would assume the renderer keeps a reference of
|
||||
// it.
|
||||
meta.id = objectsRegistry.add(sender, contextId, value)
|
||||
meta.members = getObjectMembers(value)
|
||||
meta.proto = getObjectPrototype(value)
|
||||
} else if (meta.type === 'buffer') {
|
||||
meta.value = bufferUtils.bufferToMeta(value)
|
||||
} else if (meta.type === 'promise') {
|
||||
// Add default handler to prevent unhandled rejections in main process
|
||||
// Instead they should appear in the renderer process
|
||||
value.then(function () {}, function () {})
|
||||
|
||||
meta.then = valueToMeta(sender, contextId, function (onFulfilled, onRejected) {
|
||||
value.then(onFulfilled, onRejected)
|
||||
})
|
||||
} else if (meta.type === 'error') {
|
||||
meta.members = plainObjectToMeta(value)
|
||||
|
||||
// Error.name is not part of own properties.
|
||||
meta.members.push({
|
||||
name: 'name',
|
||||
value: value.name
|
||||
})
|
||||
} else if (meta.type === 'date') {
|
||||
meta.value = value.getTime()
|
||||
} else {
|
||||
meta.type = 'value'
|
||||
meta.value = value
|
||||
}
|
||||
return meta
|
||||
}
|
||||
|
||||
// Convert object to meta by value.
|
||||
const plainObjectToMeta = function (obj) {
|
||||
return Object.getOwnPropertyNames(obj).map(function (name) {
|
||||
return {
|
||||
name: name,
|
||||
value: obj[name]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Convert Error into meta data.
|
||||
const exceptionToMeta = function (error) {
|
||||
return {
|
||||
type: 'exception',
|
||||
value: errorUtils.serialize(error)
|
||||
}
|
||||
}
|
||||
|
||||
const throwRPCError = function (message) {
|
||||
const error = new Error(message)
|
||||
error.code = 'EBADRPC'
|
||||
error.errno = -72
|
||||
throw error
|
||||
}
|
||||
|
||||
const removeRemoteListenersAndLogWarning = (sender, callIntoRenderer) => {
|
||||
const location = v8Util.getHiddenValue(callIntoRenderer, 'location')
|
||||
let message = `Attempting to call a function in a renderer window that has been closed or released.` +
|
||||
`\nFunction provided here: ${location}`
|
||||
|
||||
if (sender instanceof EventEmitter) {
|
||||
const remoteEvents = sender.eventNames().filter((eventName) => {
|
||||
return sender.listeners(eventName).includes(callIntoRenderer)
|
||||
})
|
||||
|
||||
if (remoteEvents.length > 0) {
|
||||
message += `\nRemote event names: ${remoteEvents.join(', ')}`
|
||||
remoteEvents.forEach((eventName) => {
|
||||
sender.removeListener(eventName, callIntoRenderer)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
console.warn(message)
|
||||
}
|
||||
|
||||
// Convert array of meta data from renderer into array of real values.
|
||||
const unwrapArgs = function (sender, frameId, contextId, args) {
|
||||
const metaToValue = function (meta) {
|
||||
switch (meta.type) {
|
||||
case 'value':
|
||||
return meta.value
|
||||
case 'remote-object':
|
||||
return objectsRegistry.get(meta.id)
|
||||
case 'array':
|
||||
return unwrapArgs(sender, frameId, contextId, meta.value)
|
||||
case 'buffer':
|
||||
return bufferUtils.metaToBuffer(meta.value)
|
||||
case 'date':
|
||||
return new Date(meta.value)
|
||||
case 'promise':
|
||||
return Promise.resolve({
|
||||
then: metaToValue(meta.then)
|
||||
})
|
||||
case 'object': {
|
||||
const ret = {}
|
||||
Object.defineProperty(ret.constructor, 'name', { value: meta.name })
|
||||
|
||||
for (const { name, value } of meta.members) {
|
||||
ret[name] = metaToValue(value)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
case 'function-with-return-value':
|
||||
const returnValue = metaToValue(meta.value)
|
||||
return function () {
|
||||
return returnValue
|
||||
}
|
||||
case 'function': {
|
||||
// Merge contextId and meta.id, since meta.id can be the same in
|
||||
// different webContents.
|
||||
const objectId = [contextId, meta.id]
|
||||
|
||||
// Cache the callbacks in renderer.
|
||||
if (rendererFunctions.has(objectId)) {
|
||||
return rendererFunctions.get(objectId)
|
||||
}
|
||||
|
||||
const callIntoRenderer = function (...args) {
|
||||
let succeed = false
|
||||
if (!sender.isDestroyed()) {
|
||||
succeed = sender._sendToFrameInternal(frameId, 'ELECTRON_RENDERER_CALLBACK', contextId, meta.id, valueToMeta(sender, contextId, args))
|
||||
}
|
||||
if (!succeed) {
|
||||
removeRemoteListenersAndLogWarning(this, callIntoRenderer)
|
||||
}
|
||||
}
|
||||
v8Util.setHiddenValue(callIntoRenderer, 'location', meta.location)
|
||||
Object.defineProperty(callIntoRenderer, 'length', { value: meta.length })
|
||||
|
||||
v8Util.setRemoteCallbackFreer(callIntoRenderer, contextId, meta.id, sender)
|
||||
rendererFunctions.set(objectId, callIntoRenderer)
|
||||
return callIntoRenderer
|
||||
}
|
||||
default:
|
||||
throw new TypeError(`Unknown type: ${meta.type}`)
|
||||
}
|
||||
}
|
||||
return args.map(metaToValue)
|
||||
}
|
||||
|
||||
const isRemoteModuleEnabledImpl = function (contents) {
|
||||
const webPreferences = contents.getLastWebPreferences() || {}
|
||||
return !!webPreferences.enableRemoteModule
|
||||
}
|
||||
|
||||
const isRemoteModuleEnabledCache = new WeakMap()
|
||||
|
||||
const isRemoteModuleEnabled = function (contents) {
|
||||
if (!isRemoteModuleEnabledCache.has(contents)) {
|
||||
isRemoteModuleEnabledCache.set(contents, isRemoteModuleEnabledImpl(contents))
|
||||
}
|
||||
|
||||
return isRemoteModuleEnabledCache.get(contents)
|
||||
}
|
||||
|
||||
const handleRemoteCommand = function (channel, handler) {
|
||||
ipcMainInternal.on(channel, (event, contextId, ...args) => {
|
||||
let returnValue
|
||||
if (!isRemoteModuleEnabled(event.sender)) {
|
||||
event.returnValue = null
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
returnValue = handler(event, contextId, ...args)
|
||||
} catch (error) {
|
||||
returnValue = exceptionToMeta(error)
|
||||
}
|
||||
|
||||
if (returnValue !== undefined) {
|
||||
event.returnValue = returnValue
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const emitCustomEvent = function (contents, eventName, ...args) {
|
||||
const event = eventBinding.createWithSender(contents)
|
||||
@@ -285,188 +23,6 @@ const emitCustomEvent = function (contents, eventName, ...args) {
|
||||
return event
|
||||
}
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_WRONG_CONTEXT_ERROR', function (event, contextId, passedContextId, id) {
|
||||
const objectId = [passedContextId, id]
|
||||
if (!rendererFunctions.has(objectId)) {
|
||||
// Do nothing if the error has already been reported before.
|
||||
return
|
||||
}
|
||||
removeRemoteListenersAndLogWarning(event.sender, rendererFunctions.get(objectId))
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_REQUIRE', function (event, contextId, moduleName) {
|
||||
const customEvent = emitCustomEvent(event.sender, 'remote-require', moduleName)
|
||||
|
||||
if (customEvent.returnValue === undefined) {
|
||||
if (customEvent.defaultPrevented) {
|
||||
throw new Error(`Blocked remote.require('${moduleName}')`)
|
||||
} else {
|
||||
customEvent.returnValue = process.mainModule.require(moduleName)
|
||||
}
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, customEvent.returnValue)
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_GET_BUILTIN', function (event, contextId, moduleName) {
|
||||
const customEvent = emitCustomEvent(event.sender, 'remote-get-builtin', moduleName)
|
||||
|
||||
if (customEvent.returnValue === undefined) {
|
||||
if (customEvent.defaultPrevented) {
|
||||
throw new Error(`Blocked remote.getBuiltin('${moduleName}')`)
|
||||
} else {
|
||||
customEvent.returnValue = electron[moduleName]
|
||||
}
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, customEvent.returnValue)
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_GLOBAL', function (event, contextId, globalName) {
|
||||
const customEvent = emitCustomEvent(event.sender, 'remote-get-global', globalName)
|
||||
|
||||
if (customEvent.returnValue === undefined) {
|
||||
if (customEvent.defaultPrevented) {
|
||||
throw new Error(`Blocked remote.getGlobal('${globalName}')`)
|
||||
} else {
|
||||
customEvent.returnValue = global[globalName]
|
||||
}
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, customEvent.returnValue)
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_CURRENT_WINDOW', function (event, contextId) {
|
||||
const customEvent = emitCustomEvent(event.sender, 'remote-get-current-window')
|
||||
|
||||
if (customEvent.returnValue === undefined) {
|
||||
if (customEvent.defaultPrevented) {
|
||||
throw new Error('Blocked remote.getCurrentWindow()')
|
||||
} else {
|
||||
customEvent.returnValue = event.sender.getOwnerBrowserWindow()
|
||||
}
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, customEvent.returnValue)
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_CURRENT_WEB_CONTENTS', function (event, contextId) {
|
||||
const customEvent = emitCustomEvent(event.sender, 'remote-get-current-web-contents')
|
||||
|
||||
if (customEvent.returnValue === undefined) {
|
||||
if (customEvent.defaultPrevented) {
|
||||
throw new Error('Blocked remote.getCurrentWebContents()')
|
||||
} else {
|
||||
customEvent.returnValue = event.sender
|
||||
}
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, customEvent.returnValue)
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_CONSTRUCTOR', function (event, contextId, id, args) {
|
||||
args = unwrapArgs(event.sender, event.frameId, contextId, args)
|
||||
const constructor = objectsRegistry.get(id)
|
||||
|
||||
if (constructor == null) {
|
||||
throwRPCError(`Cannot call constructor on missing remote object ${id}`)
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, new constructor(...args))
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_FUNCTION_CALL', function (event, contextId, id, args) {
|
||||
args = unwrapArgs(event.sender, event.frameId, contextId, args)
|
||||
const func = objectsRegistry.get(id)
|
||||
|
||||
if (func == null) {
|
||||
throwRPCError(`Cannot call function on missing remote object ${id}`)
|
||||
}
|
||||
|
||||
try {
|
||||
return valueToMeta(event.sender, contextId, func(...args), true)
|
||||
} catch (error) {
|
||||
const err = new Error(`Could not call remote function '${func.name || 'anonymous'}'. Check that the function signature is correct. Underlying error: ${error.message}\nUnderlying stack: ${error.stack}\n`)
|
||||
err.cause = error
|
||||
throw err
|
||||
}
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_MEMBER_CONSTRUCTOR', function (event, contextId, id, method, args) {
|
||||
args = unwrapArgs(event.sender, event.frameId, contextId, args)
|
||||
const object = objectsRegistry.get(id)
|
||||
|
||||
if (object == null) {
|
||||
throwRPCError(`Cannot call constructor '${method}' on missing remote object ${id}`)
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, new object[method](...args))
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_MEMBER_CALL', function (event, contextId, id, method, args) {
|
||||
args = unwrapArgs(event.sender, event.frameId, contextId, args)
|
||||
const object = objectsRegistry.get(id)
|
||||
|
||||
if (object == null) {
|
||||
throwRPCError(`Cannot call method '${method}' on missing remote object ${id}`)
|
||||
}
|
||||
|
||||
try {
|
||||
return valueToMeta(event.sender, contextId, object[method](...args), true)
|
||||
} catch (error) {
|
||||
const err = new Error(`Could not call remote method '${method}'. Check that the method signature is correct. Underlying error: ${error.message}\nUnderlying stack: ${error.stack}\n`)
|
||||
err.cause = error
|
||||
throw err
|
||||
}
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_MEMBER_SET', function (event, contextId, id, name, args) {
|
||||
args = unwrapArgs(event.sender, event.frameId, contextId, args)
|
||||
const obj = objectsRegistry.get(id)
|
||||
|
||||
if (obj == null) {
|
||||
throwRPCError(`Cannot set property '${name}' on missing remote object ${id}`)
|
||||
}
|
||||
|
||||
obj[name] = args[0]
|
||||
return null
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_MEMBER_GET', function (event, contextId, id, name) {
|
||||
const obj = objectsRegistry.get(id)
|
||||
|
||||
if (obj == null) {
|
||||
throwRPCError(`Cannot get property '${name}' on missing remote object ${id}`)
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, obj[name])
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_DEREFERENCE', function (event, contextId, id, rendererSideRefCount) {
|
||||
objectsRegistry.remove(event.sender, contextId, id, rendererSideRefCount)
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_CONTEXT_RELEASE', (event, contextId) => {
|
||||
objectsRegistry.clear(event.sender, contextId)
|
||||
return null
|
||||
})
|
||||
|
||||
handleRemoteCommand('ELECTRON_BROWSER_GUEST_WEB_CONTENTS', function (event, contextId, guestInstanceId) {
|
||||
const guest = guestViewManager.getGuestForWebContents(guestInstanceId, event.sender)
|
||||
|
||||
const customEvent = emitCustomEvent(event.sender, 'remote-get-guest-web-contents', guest)
|
||||
|
||||
if (customEvent.returnValue === undefined) {
|
||||
if (customEvent.defaultPrevented) {
|
||||
throw new Error(`Blocked remote.getGuestForWebContents()`)
|
||||
} else {
|
||||
customEvent.returnValue = guest
|
||||
}
|
||||
}
|
||||
|
||||
return valueToMeta(event.sender, contextId, customEvent.returnValue)
|
||||
})
|
||||
|
||||
// Implements window.close()
|
||||
ipcMainInternal.on('ELECTRON_BROWSER_WINDOW_CLOSE', function (event) {
|
||||
const window = event.sender.getOwnerBrowserWindow()
|
||||
@@ -519,6 +75,10 @@ if (features.isDesktopCapturerEnabled()) {
|
||||
})
|
||||
}
|
||||
|
||||
const isRemoteModuleEnabled = features.isRemoteModuleEnabled()
|
||||
? require('@electron/internal/browser/remote/server').isRemoteModuleEnabled
|
||||
: () => false
|
||||
|
||||
const getPreloadScript = async function (preloadPath) {
|
||||
let preloadSrc = null
|
||||
let preloadError = null
|
||||
@@ -530,7 +90,7 @@ const getPreloadScript = async function (preloadPath) {
|
||||
return { preloadPath, preloadSrc, preloadError }
|
||||
}
|
||||
|
||||
if (process.electronBinding('features').isExtensionsEnabled()) {
|
||||
if (features.isExtensionsEnabled()) {
|
||||
ipcMainUtils.handleSync('ELECTRON_GET_CONTENT_SCRIPTS', () => [])
|
||||
} else {
|
||||
const { getContentScripts } = require('@electron/internal/browser/chrome-extension')
|
||||
@@ -541,7 +101,7 @@ ipcMainUtils.handleSync('ELECTRON_BROWSER_SANDBOX_LOAD', async function (event)
|
||||
const preloadPaths = event.sender._getPreloadPaths()
|
||||
|
||||
let contentScripts = []
|
||||
if (!process.electronBinding('features').isExtensionsEnabled()) {
|
||||
if (!features.isExtensionsEnabled()) {
|
||||
const { getContentScripts } = require('@electron/internal/browser/chrome-extension')
|
||||
contentScripts = getContentScripts()
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
export const commonModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'clipboard', loader: () => require('./clipboard') },
|
||||
{ name: 'nativeImage', loader: () => require('./native-image') },
|
||||
{ name: 'nativeTheme', loader: () => require('./native-theme') },
|
||||
{ name: 'shell', loader: () => require('./shell') },
|
||||
// The internal modules, invisible unless you know their names.
|
||||
{ name: 'deprecate', loader: () => require('./deprecate'), private: true }
|
||||
|
||||
@@ -14,6 +14,6 @@ if (features.isDesktopCapturerEnabled()) {
|
||||
rendererModuleList.push({ name: 'desktopCapturer', loader: () => require('./desktop-capturer') })
|
||||
}
|
||||
|
||||
if (enableRemoteModule) {
|
||||
if (features.isRemoteModuleEnabled() && enableRemoteModule) {
|
||||
rendererModuleList.push({ name: 'remote', loader: () => require('./remote') })
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
|
||||
const { CallbacksRegistry } = require('@electron/internal/renderer/callbacks-registry')
|
||||
const bufferUtils = require('@electron/internal/common/buffer-utils')
|
||||
const { CallbacksRegistry } = require('@electron/internal/renderer/remote/callbacks-registry')
|
||||
const bufferUtils = require('@electron/internal/common/remote/buffer-utils')
|
||||
const errorUtils = require('@electron/internal/common/error-utils')
|
||||
const { isPromise } = require('@electron/internal/common/is-promise')
|
||||
const { isPromise } = require('@electron/internal/common/remote/is-promise')
|
||||
const { ipcRendererInternal } = require('@electron/internal/renderer/ipc-renderer-internal')
|
||||
|
||||
const callbacksRegistry = new CallbacksRegistry()
|
||||
|
||||
@@ -32,7 +32,7 @@ if (features.isDesktopCapturerEnabled()) {
|
||||
})
|
||||
}
|
||||
|
||||
if (process.isRemoteModuleEnabled) {
|
||||
if (features.isRemoteModuleEnabled() && process.isRemoteModuleEnabled) {
|
||||
moduleList.push({
|
||||
name: 'remote',
|
||||
loader: () => require('@electron/internal/renderer/api/remote')
|
||||
|
||||
@@ -23,7 +23,7 @@ source_set("native_mate") {
|
||||
"native_mate/function_template.h",
|
||||
"native_mate/handle.h",
|
||||
"native_mate/object_template_builder.cc",
|
||||
"native_mate/object_template_builder.h",
|
||||
"native_mate/object_template_builder_deprecated.h",
|
||||
"native_mate/persistent_dictionary.cc",
|
||||
"native_mate/persistent_dictionary.h",
|
||||
"native_mate/scoped_persistent.h",
|
||||
|
||||
@@ -45,7 +45,7 @@ void Initialize(v8::Handle<v8::Object> exports) {
|
||||
types. You can define your own by specializing `Converter`.
|
||||
* `function_template.h` - Create JavaScript functions that dispatch to any C++
|
||||
function, member function pointer, or `base::Callback`.
|
||||
* `object_template_builder.h` - A handy utility for creation of `v8::ObjectTemplate`.
|
||||
* `object_template_builder_deprecated.h` - A handy utility for creation of `v8::ObjectTemplate`.
|
||||
* `wrappable.h` - Base class for C++ classes that want to be owned by the V8 GC.
|
||||
Wrappable objects are automatically deleted when GC discovers that nothing in
|
||||
the V8 heap refers to them. This is also an easy way to expose C++ objects to
|
||||
|
||||
@@ -159,7 +159,7 @@ bool Converter<std::string>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::String> str = v8::Local<v8::String>::Cast(val);
|
||||
int length = str->Utf8Length(isolate);
|
||||
out->resize(length);
|
||||
str->WriteUtf8(isolate, &(*out)[0], length, NULL,
|
||||
str->WriteUtf8(isolate, &(*out)[0], length, nullptr,
|
||||
v8::String::NO_NULL_TERMINATION);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define NATIVE_MATE_NATIVE_MATE_DICTIONARY_H_
|
||||
|
||||
#include "native_mate/converter.h"
|
||||
#include "native_mate/object_template_builder.h"
|
||||
#include "native_mate/object_template_builder_deprecated.h"
|
||||
|
||||
namespace mate {
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE.chromium file.
|
||||
|
||||
#include "native_mate/object_template_builder.h"
|
||||
#include "native_mate/object_template_builder_deprecated.h"
|
||||
|
||||
namespace mate {
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE.chromium file.
|
||||
|
||||
#ifndef NATIVE_MATE_NATIVE_MATE_OBJECT_TEMPLATE_BUILDER_H_
|
||||
#define NATIVE_MATE_NATIVE_MATE_OBJECT_TEMPLATE_BUILDER_H_
|
||||
#ifndef NATIVE_MATE_NATIVE_MATE_OBJECT_TEMPLATE_BUILDER_DEPRECATED_H_
|
||||
#define NATIVE_MATE_NATIVE_MATE_OBJECT_TEMPLATE_BUILDER_DEPRECATED_H_
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/callback.h"
|
||||
@@ -117,4 +117,4 @@ class ObjectTemplateBuilder {
|
||||
|
||||
} // namespace mate
|
||||
|
||||
#endif // NATIVE_MATE_NATIVE_MATE_OBJECT_TEMPLATE_BUILDER_H_
|
||||
#endif // NATIVE_MATE_NATIVE_MATE_OBJECT_TEMPLATE_BUILDER_DEPRECATED_H_
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "native_mate/dictionary.h"
|
||||
#include "native_mate/object_template_builder.h"
|
||||
#include "native_mate/object_template_builder_deprecated.h"
|
||||
|
||||
namespace mate {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "electron",
|
||||
"version": "8.0.0-nightly.20190912",
|
||||
"version": "8.0.0-nightly.20190919",
|
||||
"repository": "https://github.com/electron/electron",
|
||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||
"devDependencies": {
|
||||
|
||||
@@ -17,6 +17,7 @@ web_contents.patch
|
||||
webview_cross_drag.patch
|
||||
disable_user_gesture_requirement_for_beforeunload_dialogs.patch
|
||||
gin_enable_disable_v8_platform.patch
|
||||
gin_with_namespace.patch
|
||||
blink-worker-enable-csp-in-file-scheme.patch
|
||||
disable-redraw-lock.patch
|
||||
v8_context_snapshot_generator.patch
|
||||
@@ -36,7 +37,6 @@ mas-cgdisplayusesforcetogray.patch
|
||||
mas-audiodeviceduck.patch
|
||||
mas-lssetapplicationlaunchservicesserverconnectionstatus.patch
|
||||
ignore_rc_check.patch
|
||||
enable_widevine.patch
|
||||
chrome_key_systems.patch
|
||||
allow_nested_error_trackers.patch
|
||||
blink_initialization_order.patch
|
||||
@@ -62,7 +62,6 @@ unsandboxed_ppapi_processes_skip_zygote.patch
|
||||
patch_the_ensure_gn_version_py_script_to_work_on_mac_ci.patch
|
||||
build_add_electron_tracing_category.patch
|
||||
disable_custom_libcxx_on_windows.patch
|
||||
feat_offscreen_rendering_with_viz_compositor.patch
|
||||
worker_context_will_destroy.patch
|
||||
fix_breakpad_symbol_generation_on_linux_arm.patch
|
||||
frame_host_manager.patch
|
||||
@@ -78,3 +77,5 @@ disable_compositor_recycling.patch
|
||||
allow_new_privileges_in_unsandboxed_child_processes.patch
|
||||
expose_setuseragent_on_networkcontext.patch
|
||||
feat_add_set_theme_source_to_allow_apps_to.patch
|
||||
revert_cleanup_remove_menu_subtitles_sublabels.patch
|
||||
ui_views_fix_jumbo_build.patch
|
||||
|
||||
@@ -10,7 +10,7 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
|
||||
This should be upstreamed.
|
||||
|
||||
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
|
||||
index 46d92835eadd6429ea0c6a53c5a39ff04f1c2634..1b99a1e601f4226280cdf1382af555b4d61b92fa 100644
|
||||
index 4373f508964cb1e9fd51c952122ac2f41fb35ae9..065a7a57b77f1e3bf5e03fac900f1936d48ad4ff 100644
|
||||
--- a/content/gpu/gpu_main.cc
|
||||
+++ b/content/gpu/gpu_main.cc
|
||||
@@ -236,6 +236,10 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
|
||||
@@ -39,10 +39,10 @@ index 2aef366ac8194aa261cbca6abc051f7da8a988d3..3c7d66c81032636abcca4f1538ce9b7f
|
||||
|
||||
GIN_EXPORT static ArrayBufferAllocator* SharedInstance();
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
index 7ca876bc7f2afa192167f0689690d73d5a420c60..d58085e0b14241d666f533cb23dd89159c27d8b2 100644
|
||||
index 3eeafca490b1fbbedc2c16f203a4ac28b23da675..fee684296357c2c3af7395bdd17ac8b8445f55c4 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
@@ -642,6 +642,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
|
||||
@@ -647,6 +647,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
|
||||
size, WTF::ArrayBufferContents::kDontInitialize);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ index ac76d127b96b80c8260a7e2cda0b669cd98787ad..dcab64586700a8740262aede8dba2755
|
||||
Partitions::ArrayBufferPartition()->Free(data);
|
||||
}
|
||||
diff --git a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
|
||||
index ee7c89a4950d6b3c97a810c41a62fee7e372018d..c2b60f20a72cca46d05af369f33d9c19395b34ef 100644
|
||||
index 3f44cd2fdf648057be8defcf041574b4c91e0363..55c0e7c66649ae9d9cbef6179daac7ad771b755c 100644
|
||||
--- a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
|
||||
+++ b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
|
||||
@@ -140,6 +140,7 @@ class WTF_EXPORT ArrayBufferContents {
|
||||
|
||||
@@ -10,7 +10,7 @@ to fix electron/electron#13787. The backport landed in Chromium 67 but the
|
||||
DidCreateScriptContext re-ordering needs to be upstreamed or kept indefinitely
|
||||
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
index c0ec993ca6d96c5f95eb7b918ca9c37d9defff43..2522add8f9b1e3ada14fcc5c09d161b0820f4418 100644
|
||||
index 8331c466ac9ae91d79c32f17b815f048c7e30a8b..e066abfc3341ff620191116d87ff0e135cdf43e7 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
@@ -205,11 +205,10 @@ void LocalWindowProxy::Initialize() {
|
||||
@@ -24,5 +24,5 @@ index c0ec993ca6d96c5f95eb7b918ca9c37d9defff43..2522add8f9b1e3ada14fcc5c09d161b0
|
||||
- InstallConditionalFeatures();
|
||||
-
|
||||
// This needs to go after everything else since it accesses the window object.
|
||||
// WARNING: May modify the global object!
|
||||
InitializeV8ExtrasBinding(script_state_);
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ when there is code doing that.
|
||||
This patch reverts the change to fix the crash in Electron.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
index 488d9238eec29fd90540881d895f86d8597300be..b9cbd011d8ab5f86128590b2b98a517a5ad04c4e 100644
|
||||
index 1dc588e0683232fd40fea4fd4b9d4869ccacfaac..66107801f2a4ceddca509fc3737c750d4a798fbf 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -334,10 +334,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -338,10 +338,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
}
|
||||
CHECK(!view_ || !view_->IsAttached());
|
||||
|
||||
@@ -28,7 +28,7 @@ index 488d9238eec29fd90540881d895f86d8597300be..b9cbd011d8ab5f86128590b2b98a517a
|
||||
if (!Client())
|
||||
return;
|
||||
|
||||
@@ -355,6 +351,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -359,6 +355,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
// Notify ScriptController that the frame is closing, since its cleanup ends
|
||||
// up calling back to LocalFrameClient via WindowProxy.
|
||||
GetScriptController().ClearForClose();
|
||||
|
||||
@@ -19,10 +19,10 @@ index a781a44399a31f048419311d2317229c912752c2..131c0dcb125b00215e3ad469c11c4b47
|
||||
// that the script evaluated to with callback. Script execution can be
|
||||
// suspend.
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
index 85481bb0178d707bb52a4766521cdd8f740b0497..e3d4e5284c13383db47153adb5f8e3d9fce64dbf 100644
|
||||
index 0fccae4bfe95944bd203240524f358d8ea97f654..107593a056ab68b4e4aa1cd172c35334c5e0b0ea 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
@@ -874,6 +874,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
|
||||
@@ -877,6 +877,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
|
||||
return MainWorldScriptContext()->Global();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ categories in use are known / declared. This patch is required for us
|
||||
to introduce a new Electron category for Electron-specific tracing.
|
||||
|
||||
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
|
||||
index b50d4123e44ddee34af0b07bfe5d067c4ccc5809..3e2c639a067fb76848783f35ec112a380da2353e 100644
|
||||
index 6717a2bd93b7bec89934bb3e70cdfb5461dcc29b..ca2bd030d1f46b1a7294883e30274cd0da2e7f49 100644
|
||||
--- a/base/trace_event/builtin_categories.h
|
||||
+++ b/base/trace_event/builtin_categories.h
|
||||
@@ -61,6 +61,7 @@
|
||||
@@ -62,6 +62,7 @@
|
||||
X("dwrite") \
|
||||
X("DXVA Decoding") \
|
||||
X("EarlyJava") \
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: build_gn.patch
|
||||
|
||||
|
||||
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
|
||||
index 59ab7810e71916e8f0f2d69f06e3c2c3ebc99030..b144e800c94956429ca85fc0aefe6539a6246e4b 100644
|
||||
index f89e7e831b79f82bd11a5dd8cee6ab49d8de724e..f8a611bf0676ce323cdbb5d639333df9875dd0ca 100644
|
||||
--- a/build/config/BUILDCONFIG.gn
|
||||
+++ b/build/config/BUILDCONFIG.gn
|
||||
@@ -123,6 +123,9 @@ if (current_os == "") {
|
||||
@@ -18,8 +18,8 @@ index 59ab7810e71916e8f0f2d69f06e3c2c3ebc99030..b144e800c94956429ca85fc0aefe6539
|
||||
# Set to enable the official build level of optimization. This has nothing
|
||||
# to do with branding, but enables an additional level of optimization above
|
||||
# release (!is_debug). This might be better expressed as a tri-state
|
||||
@@ -437,6 +440,7 @@ default_compiler_configs = [
|
||||
"//build/config/compiler:thin_archive",
|
||||
@@ -438,6 +441,7 @@ default_compiler_configs = [
|
||||
"//build/config/compiler:default_init_stack_vars",
|
||||
"//build/config/coverage:default_coverage",
|
||||
"//build/config/sanitizers:default_sanitizer_flags",
|
||||
+ "//electron/build/config:mas_build",
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: can_create_window.patch
|
||||
|
||||
|
||||
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
|
||||
index c6381fe498311421d2568b6d91b33539eb72cb0b..90b2457b49cb9c68a0dd269e8e8f64a44cae80cf 100644
|
||||
index bfcb977fbf2400e4ae8c7ea0b69d2b733ed410dc..be064ded7bfa3f96b5230e5bf00f68a0a8f618c2 100644
|
||||
--- a/content/browser/frame_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/frame_host/render_frame_host_impl.cc
|
||||
@@ -3885,6 +3885,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -3985,6 +3985,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
last_committed_origin_, params->window_container_type,
|
||||
params->target_url, params->referrer.To<Referrer>(),
|
||||
params->frame_name, params->disposition, *params->features,
|
||||
@@ -17,10 +17,10 @@ index c6381fe498311421d2568b6d91b33539eb72cb0b..90b2457b49cb9c68a0dd269e8e8f64a4
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
|
||||
index e227f780d720a80a13699f475757142571094cd1..6984f69e6f9a0d3058b0054df8a3aa9d46f14dbd 100644
|
||||
index 94b48f4a88df48f51adff20bc7954b0989e5ae05..a8eb7ba81afd2c8fb87544fb70a8ef862811a014 100644
|
||||
--- a/content/common/frame.mojom
|
||||
+++ b/content/common/frame.mojom
|
||||
@@ -299,6 +299,10 @@ struct CreateNewWindowParams {
|
||||
@@ -307,6 +307,10 @@ struct CreateNewWindowParams {
|
||||
|
||||
// The window features to use for the new window.
|
||||
blink.mojom.WindowFeatures features;
|
||||
@@ -32,10 +32,10 @@ index e227f780d720a80a13699f475757142571094cd1..6984f69e6f9a0d3058b0054df8a3aa9d
|
||||
|
||||
// Operation result when the renderer asks the browser to create a new window.
|
||||
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
||||
index 1c904cd011b7a5ca9592a994cf4ba0be025eef55..15081967b0a29316ab82746ca6fe7d188a9efc58 100644
|
||||
index 6d2b19d1b65496425e0850d8c224b4bf9eefa567..df6f9848ba8ae1e8e7c6e5415b3a4c2efaf6f055 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -484,6 +484,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
@@ -493,6 +493,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -45,10 +45,10 @@ index 1c904cd011b7a5ca9592a994cf4ba0be025eef55..15081967b0a29316ab82746ca6fe7d18
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access) {
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index 07dc81e27ae92e4e7a872134dcdc6a3ba2e08ec5..678b25401338a624dc37a11c45331d65082934e9 100644
|
||||
index a9131e72beefd3fd706640d5eeb82646a7ffe65d..7578110f13b23e9585a181bba3e73a3996f60faf 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -178,6 +178,7 @@ class RenderFrameHost;
|
||||
@@ -179,6 +179,7 @@ class RenderFrameHost;
|
||||
class RenderProcessHost;
|
||||
class RenderViewHost;
|
||||
class ResourceContext;
|
||||
@@ -56,7 +56,7 @@ index 07dc81e27ae92e4e7a872134dcdc6a3ba2e08ec5..678b25401338a624dc37a11c45331d65
|
||||
class SerialDelegate;
|
||||
class SiteInstance;
|
||||
class SpeechRecognitionManagerDelegate;
|
||||
@@ -767,6 +768,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -779,6 +780,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -66,10 +66,10 @@ index 07dc81e27ae92e4e7a872134dcdc6a3ba2e08ec5..678b25401338a624dc37a11c45331d65
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access);
|
||||
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
||||
index a8a2d29739aabb0bd80cb77e28c46de57afe2b10..e3fa35b439e0f945e9e6a95587561fedd1ef4a2c 100644
|
||||
index f14d1f7fe20e81b9e488f787db00cd114cce16a7..94bfcf7ae25f6f5c2d1fdf93b96350bd229045e3 100644
|
||||
--- a/content/renderer/render_view_impl.cc
|
||||
+++ b/content/renderer/render_view_impl.cc
|
||||
@@ -75,6 +75,7 @@
|
||||
@@ -73,6 +73,7 @@
|
||||
#include "content/renderer/ime_event_guard.h"
|
||||
#include "content/renderer/internal_document_state_data.h"
|
||||
#include "content/renderer/loader/request_extra_data.h"
|
||||
@@ -77,7 +77,7 @@ index a8a2d29739aabb0bd80cb77e28c46de57afe2b10..e3fa35b439e0f945e9e6a95587561fed
|
||||
#include "content/renderer/media/audio/audio_device_factory.h"
|
||||
#include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
|
||||
#include "content/renderer/media/webrtc/rtc_peer_connection_handler.h"
|
||||
@@ -1346,6 +1347,8 @@ WebView* RenderViewImpl::CreateView(
|
||||
@@ -1325,6 +1326,8 @@ WebView* RenderViewImpl::CreateView(
|
||||
}
|
||||
params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features);
|
||||
|
||||
@@ -87,10 +87,10 @@ index a8a2d29739aabb0bd80cb77e28c46de57afe2b10..e3fa35b439e0f945e9e6a95587561fed
|
||||
// moved on send.
|
||||
bool is_background_tab =
|
||||
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.cc b/content/shell/browser/web_test/web_test_content_browser_client.cc
|
||||
index 1a159e8d2877e5b1c6778b68aec5b36fb88214fd..f9111b3e20fb7607faa4bb605be1ff4c385e40d6 100644
|
||||
index 5faaea374484d51b1af261ff93fb96aec2eaa4e1..786d3a904a765b5cb53859c35a045b9e04b6250b 100644
|
||||
--- a/content/shell/browser/web_test/web_test_content_browser_client.cc
|
||||
+++ b/content/shell/browser/web_test/web_test_content_browser_client.cc
|
||||
@@ -313,6 +313,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
|
||||
@@ -312,6 +312,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -100,10 +100,10 @@ index 1a159e8d2877e5b1c6778b68aec5b36fb88214fd..f9111b3e20fb7607faa4bb605be1ff4c
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access) {
|
||||
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.h b/content/shell/browser/web_test/web_test_content_browser_client.h
|
||||
index 1a714946de9f0dceaec008e93928d2c414ef01da..34423135e85b3ed7a54c9f22f6674f9c4026a67c 100644
|
||||
index 435f204a364e54b59c0bd651b760bf350ea94d11..1e6bee1fa08fa2d2a396678838d475e0e7e4ce0c 100644
|
||||
--- a/content/shell/browser/web_test/web_test_content_browser_client.h
|
||||
+++ b/content/shell/browser/web_test/web_test_content_browser_client.h
|
||||
@@ -67,6 +67,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
|
||||
@@ -68,6 +68,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
|
||||
@@ -8,10 +8,10 @@ run before shutdown. This is required to cleanup WebContents asynchronously
|
||||
in atom::CommonWebContentsDelegate::ResetManageWebContents.
|
||||
|
||||
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
|
||||
index 61324582c2dca5e1e5a75c0793034307b648cc98..c73c1e26c2f01713952840fadbd7e8975bcb9843 100644
|
||||
index 28521684fd37dca5ea4251c166be33470b5ae0d8..cd5f3ef6b679899cd28068e39715d5c4847595cc 100644
|
||||
--- a/content/browser/browser_main_loop.cc
|
||||
+++ b/content/browser/browser_main_loop.cc
|
||||
@@ -1496,7 +1496,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
|
||||
@@ -1505,7 +1505,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
|
||||
NOTREACHED();
|
||||
#else
|
||||
base::RunLoop run_loop;
|
||||
|
||||
@@ -17,10 +17,10 @@ only one or two specific checks fail. Then it's better to simply comment out the
|
||||
failing checks and allow the rest of the target to have them enabled.
|
||||
|
||||
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
|
||||
index 4bc8bd4c68015dd684702a6afbce74b36160e5a1..55dc200a73ef09b17c0e52d622f86956ba6a7bb7 100644
|
||||
index c8c28a5c1677b353e698b7fea91653fe08ebb77b..b5730d792e58ad090bb21a922fe828a53535bc4a 100644
|
||||
--- a/content/browser/frame_host/navigation_controller_impl.cc
|
||||
+++ b/content/browser/frame_host/navigation_controller_impl.cc
|
||||
@@ -1210,8 +1210,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
|
||||
@@ -1212,8 +1212,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
|
||||
return NAVIGATION_TYPE_NEW_SUBFRAME;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ index 4bc8bd4c68015dd684702a6afbce74b36160e5a1..55dc200a73ef09b17c0e52d622f86956
|
||||
|
||||
if (rfh->GetParent()) {
|
||||
// All manual subframes would be did_create_new_entry and handled above, so
|
||||
@@ -1463,7 +1465,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
|
||||
@@ -1465,7 +1467,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
|
||||
new_entry->GetFavicon() = GetLastCommittedEntry()->GetFavicon();
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ index 4bc8bd4c68015dd684702a6afbce74b36160e5a1..55dc200a73ef09b17c0e52d622f86956
|
||||
// navigation. Now we know that the renderer has updated its state accordingly
|
||||
// and it is safe to also clear the browser side history.
|
||||
diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
|
||||
index 87a82009c929ff73d3d9fe5b51907b9b4147f78f..32d2316d7553b672a28e84f9433c85d1be213623 100644
|
||||
index 34c13c28117fe5fced5ca3190c5f948168cd010f..554ddabee8952e578a61a9b9c3f358b2475abd69 100644
|
||||
--- a/ui/base/clipboard/clipboard_win.cc
|
||||
+++ b/ui/base/clipboard/clipboard_win.cc
|
||||
@@ -729,9 +729,9 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap,
|
||||
@@ -730,9 +730,9 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap,
|
||||
}
|
||||
|
||||
void ClipboardWin::WriteToClipboard(unsigned int format, HANDLE handle) {
|
||||
|
||||
@@ -133,7 +133,7 @@ index 47401abc984e6fe26c7f4c5399aa565c687060b0..ca6a527ffac877c27aac94337ec5a7b5
|
||||
protected:
|
||||
virtual ~DesktopMediaListObserver() {}
|
||||
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
index b2005c70acbc1c05c59bb2059b190ab78fb63a68..1a7188e2df76672d66da3206d4448df35a065754 100644
|
||||
index b2005c70acbc1c05c59bb2059b190ab78fb63a68..6cfc3007549b2e7992334b708e4e71a00974c2a3 100644
|
||||
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
@@ -8,14 +8,15 @@
|
||||
@@ -153,3 +153,12 @@ index b2005c70acbc1c05c59bb2059b190ab78fb63a68..1a7188e2df76672d66da3206d4448df3
|
||||
#include "media/base/video_util.h"
|
||||
#include "third_party/libyuv/include/libyuv/scale_argb.h"
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
@@ -218,6 +219,8 @@ void NativeDesktopMediaList::Worker::RefreshThumbnails(
|
||||
FROM_HERE, {BrowserThread::UI},
|
||||
base::BindOnce(&NativeDesktopMediaList::UpdateNativeThumbnailsFinished,
|
||||
media_list_));
|
||||
+
|
||||
+ capturer_.reset();
|
||||
}
|
||||
|
||||
void NativeDesktopMediaList::Worker::OnCaptureResult(
|
||||
|
||||
@@ -15,10 +15,10 @@ the redraw locking mechanism, which fixes these issues. The electron issue
|
||||
can be found at https://github.com/electron/electron/issues/1821
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 578b8414531f10ed1fe9d1590336a43ba8dd299f..82e1491988dc31573ae8b15bf6df16fabda1616e 100644
|
||||
index 0fa5dabec0ebb1dfe248eb5d71f45cc391883854..07e7c1480abfa158856a274b6b1668653121c9b4 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -331,6 +331,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
|
||||
@@ -332,6 +332,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -29,7 +29,7 @@ index 578b8414531f10ed1fe9d1590336a43ba8dd299f..82e1491988dc31573ae8b15bf6df16fa
|
||||
// A scoping class that prevents a window from being able to redraw in response
|
||||
// to invalidations that may occur within it for the lifetime of the object.
|
||||
//
|
||||
@@ -382,6 +386,7 @@ class HWNDMessageHandler::ScopedRedrawLock {
|
||||
@@ -383,6 +387,7 @@ class HWNDMessageHandler::ScopedRedrawLock {
|
||||
cancel_unlock_(false),
|
||||
should_lock_(owner_->IsVisible() && !owner->HasChildRenderingWindow() &&
|
||||
::IsWindow(hwnd_) &&
|
||||
@@ -49,7 +49,7 @@ index 578b8414531f10ed1fe9d1590336a43ba8dd299f..82e1491988dc31573ae8b15bf6df16fa
|
||||
// HWNDMessageHandler, gfx::WindowImpl overrides:
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
|
||||
index 57bf68676b697fa2d17c66f08b98d57809d4d20c..86ee2d878f2f310db2f50be05035f087ddb375ba 100644
|
||||
index 7223a9a61b9ad16ade315ed799d386a52688e16b..9817b49ba264775f88d3a22a825afc8833f2e28c 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.h
|
||||
+++ b/ui/views/win/hwnd_message_handler.h
|
||||
@@ -194,6 +194,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,
|
||||
@@ -62,7 +62,7 @@ index 57bf68676b697fa2d17c66f08b98d57809d4d20c..86ee2d878f2f310db2f50be05035f087
|
||||
HICON GetDefaultWindowIcon() const override;
|
||||
HICON GetSmallWindowIcon() const override;
|
||||
diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h
|
||||
index 45c4e5b29d05ea0323596fa2c5034c2e30a68f70..e25aac69b09954fbc267309beba98ec0877fa2ac 100644
|
||||
index ddc640e7a5d278e08c056f1989ac258c9ae8bfae..a5d050dadad3c565b0151ee945e5d17f42255aa3 100644
|
||||
--- a/ui/views/win/hwnd_message_handler_delegate.h
|
||||
+++ b/ui/views/win/hwnd_message_handler_delegate.h
|
||||
@@ -46,6 +46,8 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {
|
||||
|
||||
@@ -20,7 +20,7 @@ to deal with color spaces. That is being tracked at
|
||||
https://crbug.com/634542 and https://crbug.com/711107.
|
||||
|
||||
diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
|
||||
index d62c52b53268b4ffab702a0dac3652edc472ccb9..f1ed520f123802469d94c98c418b9f5c5d2032e0 100644
|
||||
index 18d99c39b5ec1ba5f8fdd808139f0b5a2de53f60..f03a6f00b9dcc044ef151466f6e16c983f73ce69 100644
|
||||
--- a/cc/trees/layer_tree_settings.h
|
||||
+++ b/cc/trees/layer_tree_settings.h
|
||||
@@ -95,6 +95,8 @@ class CC_EXPORT LayerTreeSettings {
|
||||
@@ -66,7 +66,7 @@ index f17aa1fa451f1b99d7f083e07edd49b11f7639e4..09f7c5d6a92d89c199b296771a8ff60c
|
||||
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
|
||||
#if defined(OS_MACOSX)
|
||||
diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc
|
||||
index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c1166404c4209b0 100644
|
||||
index 8c67161c4a4b970fb9393a9a73a239b5aecb95cf..99ea5a9832aca67030e92e4761209872190388eb 100644
|
||||
--- a/components/viz/service/display/gl_renderer.cc
|
||||
+++ b/components/viz/service/display/gl_renderer.cc
|
||||
@@ -81,6 +81,9 @@
|
||||
@@ -91,7 +91,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640
|
||||
|
||||
// Use the full quad_rect for debug quads to not move the edges based on
|
||||
// partial swaps.
|
||||
@@ -1448,7 +1452,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
|
||||
@@ -1455,7 +1459,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
|
||||
params->use_color_matrix, tint_gl_composited_content_,
|
||||
params->apply_shader_based_rounded_corner &&
|
||||
ShouldApplyRoundedCorner(params->quad)),
|
||||
@@ -101,7 +101,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640
|
||||
}
|
||||
|
||||
void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) {
|
||||
@@ -1919,8 +1924,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
||||
@@ -1926,8 +1931,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
||||
SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA,
|
||||
tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -112,7 +112,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640
|
||||
SetShaderColor(color, opacity);
|
||||
if (current_program_->rounded_corner_rect_location() != -1) {
|
||||
SetShaderRoundedCorner(
|
||||
@@ -2075,8 +2080,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
|
||||
@@ -2082,8 +2087,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
|
||||
: NON_PREMULTIPLIED_ALPHA,
|
||||
false, false, tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -123,7 +123,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640
|
||||
|
||||
if (current_program_->tint_color_matrix_location() != -1) {
|
||||
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
|
||||
@@ -2172,8 +2177,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
|
||||
@@ -2179,8 +2184,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
|
||||
!quad->ShouldDrawWithBlending(), has_tex_clamp_rect,
|
||||
tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -134,7 +134,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640
|
||||
|
||||
if (current_program_->tint_color_matrix_location() != -1) {
|
||||
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
|
||||
@@ -2276,7 +2281,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
|
||||
@@ -2283,7 +2288,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
|
||||
DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB());
|
||||
|
||||
gfx::ColorSpace dst_color_space =
|
||||
@@ -143,7 +143,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640
|
||||
// Force sRGB output on Windows for overlay candidate video quads to match
|
||||
// DirectComposition behavior in case these switch between overlays and
|
||||
// compositing. See https://crbug.com/811118 for details.
|
||||
@@ -2432,8 +2437,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
|
||||
@@ -2439,8 +2444,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
|
||||
|
||||
SetUseProgram(ProgramKey::VideoStream(tex_coord_precision,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -154,7 +154,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640
|
||||
|
||||
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
|
||||
gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
|
||||
@@ -2490,8 +2495,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
|
||||
@@ -2497,8 +2502,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
|
||||
draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
|
||||
|
||||
// Bind the program to the GL state.
|
||||
@@ -165,7 +165,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640
|
||||
|
||||
if (current_program_->rounded_corner_rect_location() != -1) {
|
||||
SetShaderRoundedCorner(
|
||||
@@ -3184,7 +3189,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
|
||||
@@ -3195,7 +3200,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
|
||||
void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color,
|
||||
const gfx::ColorSpace& src_color_space,
|
||||
const gfx::ColorSpace& dst_color_space) {
|
||||
@@ -176,7 +176,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640
|
||||
|
||||
gfx::ColorSpace adjusted_color_space = src_color_space;
|
||||
float sdr_white_level = current_frame()->sdr_white_level;
|
||||
@@ -3550,7 +3557,7 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
|
||||
@@ -3574,7 +3581,7 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
|
||||
|
||||
*overlay_texture = FindOrCreateOverlayTexture(
|
||||
params.quad->render_pass_id, iosurface_width, iosurface_height,
|
||||
@@ -185,7 +185,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640
|
||||
*new_bounds = gfx::RectF(updated_dst_rect.origin(),
|
||||
gfx::SizeF((*overlay_texture)->texture.size()));
|
||||
|
||||
@@ -3768,8 +3775,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
|
||||
@@ -3792,8 +3799,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
|
||||
|
||||
PrepareGeometry(SHARED_BINDING);
|
||||
|
||||
@@ -196,17 +196,17 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640
|
||||
|
||||
gfx::Transform render_matrix;
|
||||
render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(),
|
||||
@@ -3929,3 +3936,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
|
||||
@@ -3953,3 +3960,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
|
||||
}
|
||||
|
||||
} // namespace viz
|
||||
+
|
||||
+#undef PATCH_CS
|
||||
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
|
||||
index 157fbbc34a2217f58f3e5931e1d56d6db3b876cd..68bd4a84e6fe68a4741fcedc50fb47230b11ba37 100644
|
||||
index d38084e36ab82c3c91f7ab5504557707eedbb2fc..ede28387d3fa868c61e291202ab9e8f95f7aa870 100644
|
||||
--- a/content/browser/gpu/gpu_process_host.cc
|
||||
+++ b/content/browser/gpu/gpu_process_host.cc
|
||||
@@ -192,6 +192,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
|
||||
@@ -194,6 +194,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
|
||||
|
||||
// Command-line switches to propagate to the GPU process.
|
||||
static const char* const kSwitchNames[] = {
|
||||
@@ -215,10 +215,10 @@ index 157fbbc34a2217f58f3e5931e1d56d6db3b876cd..68bd4a84e6fe68a4741fcedc50fb4723
|
||||
service_manager::switches::kGpuSandboxAllowSysVShm,
|
||||
service_manager::switches::kGpuSandboxFailuresFatal,
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index 6302948343ee810a9d35a70be0c91a1ffbfb7647..6607c71fa295cda32c5ac00aafe642a103703a0e 100644
|
||||
index 2aaa6b123b917b9b819aa2a2d3fb27179a57a8ec..cfbb71f8ab6a192e49093cc214589ccb40f646b1 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -215,6 +215,7 @@
|
||||
@@ -219,6 +219,7 @@
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
#include "ui/base/ui_base_switches_util.h"
|
||||
#include "ui/display/display_switches.h"
|
||||
@@ -226,7 +226,7 @@ index 6302948343ee810a9d35a70be0c91a1ffbfb7647..6607c71fa295cda32c5ac00aafe642a1
|
||||
#include "ui/gl/gl_switches.h"
|
||||
#include "ui/native_theme/native_theme_features.h"
|
||||
#include "url/url_constants.h"
|
||||
@@ -2917,6 +2918,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
|
||||
@@ -2910,6 +2911,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
|
||||
// Propagate the following switches to the renderer command line (along
|
||||
// with any associated values) if present in the browser command line.
|
||||
static const char* const kSwitchNames[] = {
|
||||
@@ -235,10 +235,10 @@ index 6302948343ee810a9d35a70be0c91a1ffbfb7647..6607c71fa295cda32c5ac00aafe642a1
|
||||
network::switches::kExplicitlyAllowedPorts,
|
||||
service_manager::switches::kDisableInProcessStackTraces,
|
||||
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
|
||||
index 2f53bc7d22c175a41e71fcbf46b8ce2636e529e3..0eb3d2922453014e90a8f91e2f72aee3145f8cc6 100644
|
||||
index 928f3d91c3750482e0da1fa885c1e03fdd3285b6..42363587fdd1ebadf7042d2e1dde7442d86a5e4a 100644
|
||||
--- a/content/renderer/render_widget.cc
|
||||
+++ b/content/renderer/render_widget.cc
|
||||
@@ -2836,6 +2836,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
|
||||
@@ -2863,6 +2863,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
|
||||
settings.main_frame_before_activation_enabled =
|
||||
cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation);
|
||||
|
||||
@@ -249,7 +249,7 @@ index 2f53bc7d22c175a41e71fcbf46b8ce2636e529e3..0eb3d2922453014e90a8f91e2f72aee3
|
||||
// is what the renderer uses if its not threaded.
|
||||
settings.enable_checker_imaging =
|
||||
diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
|
||||
index 3d936357343e9829768891a45b6459d6a1bbb4f1..55062c91722b900bbbc775c0c88cfc6e57ddc04b 100644
|
||||
index 41f7fcbdd63af315f4b4e768bfef3b5004807a0b..398a4fdea3cc0ab4f5132deeb9365189f9c928c3 100644
|
||||
--- a/ui/gfx/mac/io_surface.cc
|
||||
+++ b/ui/gfx/mac/io_surface.cc
|
||||
@@ -16,6 +16,7 @@
|
||||
@@ -260,7 +260,7 @@ index 3d936357343e9829768891a45b6459d6a1bbb4f1..55062c91722b900bbbc775c0c88cfc6e
|
||||
|
||||
namespace gfx {
|
||||
|
||||
@@ -191,6 +192,11 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
|
||||
@@ -186,6 +187,11 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
|
||||
|
||||
// Ensure that all IOSurfaces start as sRGB.
|
||||
CGColorSpaceRef color_space = base::mac::GetSRGBColorSpace();
|
||||
@@ -272,7 +272,7 @@ index 3d936357343e9829768891a45b6459d6a1bbb4f1..55062c91722b900bbbc775c0c88cfc6e
|
||||
base::ScopedCFTypeRef<CFDataRef> color_space_icc(
|
||||
CGColorSpaceCopyICCProfile(color_space));
|
||||
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
|
||||
@@ -202,6 +208,14 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
|
||||
@@ -197,6 +203,14 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
|
||||
|
||||
void IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
|
||||
const ColorSpace& color_space) {
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: disable_hidden.patch
|
||||
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index 3925586d55cb79a26b231781a821c510dfe17bd4..1ccff96eccde8dbff2b972d53c05486fb160c5db 100644
|
||||
index 3f9d2f2a42106e3f4ab7539256021a0446e17a2a..ebe6315a98f9654d2cbc54c09f79a17f18e267a7 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -675,6 +675,9 @@ void RenderWidgetHostImpl::WasHidden() {
|
||||
@@ -19,10 +19,10 @@ index 3925586d55cb79a26b231781a821c510dfe17bd4..1ccff96eccde8dbff2b972d53c05486f
|
||||
|
||||
TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::WasHidden");
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
|
||||
index ef6276238004ff6e12de90d03be1f720c1ac266c..b8d981a45edb22a60cc439e881a4bc81854b35cd 100644
|
||||
index 58df8dfdd530a760fa8e9ecc9ef3901f444b255f..9ed9ebbbd01ff9d23b6cf0bd5cff1b19b9856077 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.h
|
||||
@@ -183,6 +183,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
@@ -185,6 +185,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
// RenderWidgetHostImpl.
|
||||
static RenderWidgetHostImpl* From(RenderWidgetHost* rwh);
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: disable_user_gesture_requirement_for_beforeunload_dialogs.patch
|
||||
See https://github.com/electron/electron/issues/10754
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
|
||||
index 88883a942c20494c9ee406da09e223ddce6307c4..27468bd09b573f6a7ca8edf86cbc5f272689376e 100644
|
||||
index f53c4cbadd759c4a0ba411c6a35c71ff269836a7..d643b0607ff9133b97f912c7f0a4e66ac2c01855 100644
|
||||
--- a/third_party/blink/renderer/core/dom/document.cc
|
||||
+++ b/third_party/blink/renderer/core/dom/document.cc
|
||||
@@ -4117,7 +4117,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
|
||||
@@ -4181,7 +4181,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
|
||||
"frame that never had a user gesture since its load. "
|
||||
"https://www.chromestatus.com/feature/5082396709879808";
|
||||
Intervention::GenerateReport(frame_, "BeforeUnloadNoGesture", message);
|
||||
|
||||
@@ -31,10 +31,10 @@ With that in mind, an acceptable alternative to disabling the limit at compile-t
|
||||
for a given `BrowserWindow` via a `webPreferences` option,
|
||||
similar to [`nodeIntegration`](https://electronjs.org/docs/tutorial/security#2-disable-nodejs-integration-for-remote-content).
|
||||
|
||||
diff --git a/content/common/dom_storage/dom_storage_types.h b/content/common/dom_storage/dom_storage_types.h
|
||||
index e87afe5b8ee07f7038a7cc9c40832b6cd27884da..61c9a0dfff60f79c7b36ff5c7d741c06dca03ada 100644
|
||||
--- a/content/common/dom_storage/dom_storage_types.h
|
||||
+++ b/content/common/dom_storage/dom_storage_types.h
|
||||
diff --git a/content/browser/dom_storage/dom_storage_types.h b/content/browser/dom_storage/dom_storage_types.h
|
||||
index 6c0b831ebaaa2c1749bbc7436ce1025656588310..b67767751cadc6072c133297c7a6cdcc6bfd0c98 100644
|
||||
--- a/content/browser/dom_storage/dom_storage_types.h
|
||||
+++ b/content/browser/dom_storage/dom_storage_types.h
|
||||
@@ -21,6 +21,7 @@ typedef std::map<base::string16, base::NullableString16> DOMStorageValuesMap;
|
||||
|
||||
// The quota for each storage area.
|
||||
|
||||
@@ -8,10 +8,10 @@ this but it is not a blocker for releasing Electron. This patch removes
|
||||
the hard fail on dylib resolve failure from dump_syms
|
||||
|
||||
diff --git a/components/crash/content/tools/generate_breakpad_symbols.py b/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
index cdd374c33a3edc12db9c9496a4ca765d2ba0ab5d..db04d39f8d263dc2b3b67b7f84470f557b519cfa 100755
|
||||
index 41895d64685930bf26fff821c12c6704a070e8bc..130ee13f8d5ecfcb5a303f7cc05af261693acf78 100755
|
||||
--- a/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
+++ b/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
@@ -175,7 +175,7 @@ def GetSharedLibraryDependenciesMac(binary, exe_path):
|
||||
@@ -188,7 +188,7 @@ def GetSharedLibraryDependenciesMac(binary, exe_path):
|
||||
'ERROR: failed to resolve %s, exe_path %s, loader_path %s, '
|
||||
'rpaths %s' % (m.group(1), exe_path, loader_path,
|
||||
', '.join(rpaths)))
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksei Kuzmin <alkuzmin@microsoft.com>
|
||||
Date: Thu, 20 Sep 2018 17:50:03 -0700
|
||||
Subject: enable_widevine.patch
|
||||
|
||||
Turns `enable_widevine` flag on by default on Mac and Windows.
|
||||
Electron needs that flag to be enabled on those paltforms,
|
||||
but there's no way to conditionally set it during a `gn gen` call.
|
||||
|
||||
diff --git a/third_party/widevine/cdm/widevine.gni b/third_party/widevine/cdm/widevine.gni
|
||||
index 1fe47e92ffb1442159ead7b696884bc8cc4bda83..72b39b83789cd1f67e10c743a3e729420c9b72ed 100644
|
||||
--- a/third_party/widevine/cdm/widevine.gni
|
||||
+++ b/third_party/widevine/cdm/widevine.gni
|
||||
@@ -10,7 +10,7 @@ declare_args() {
|
||||
# on Android.
|
||||
# Can be optionally enabled in Chromium on non-Android platforms. Please see
|
||||
# //src/third_party/widevine/LICENSE file for details.
|
||||
- enable_widevine = is_chrome_branded || is_android
|
||||
+ enable_widevine = is_chrome_branded || is_android || is_mac || is_win
|
||||
}
|
||||
|
||||
# Widevine CDM is available as a library CDM on the following platforms and
|
||||
@@ -7,10 +7,10 @@ Compilation of those files fails with the Chromium 68.
|
||||
Remove the patch during the Chromium 69 upgrade.
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
|
||||
index 4575cc246a5306f3fc245a0d296b81a4c0f5ae32..af8723a635530df4f14c13461feb737dcd1e7a54 100644
|
||||
index 7378cf2fc726289d0bdfafef41f190042e95072b..530ee5729291b5a6285ab22a4efaac4dad2b9766 100644
|
||||
--- a/third_party/blink/renderer/platform/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/platform/BUILD.gn
|
||||
@@ -1726,7 +1726,7 @@ jumbo_source_set("blink_platform_unittests_sources") {
|
||||
@@ -1774,7 +1774,7 @@ jumbo_source_set("blink_platform_unittests_sources") {
|
||||
"graphics/paint/drawing_display_item_test.cc",
|
||||
"graphics/paint/drawing_recorder_test.cc",
|
||||
"graphics/paint/float_clip_rect_test.cc",
|
||||
|
||||
@@ -33,10 +33,10 @@ index 0ccfe130f00ec3b6c75cd8ee04d5a2777e1fd00c..653829457d58bf92057cc36aa8a28970
|
||||
DISALLOW_COPY_AND_ASSIGN(StaticHttpUserAgentSettings);
|
||||
};
|
||||
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
||||
index 20243f6c333478f14e5bff3789e780b996887512..34e4fd20f78ee0376053720742fc9af60dae37e3 100644
|
||||
index c36657fc18c705c7224e6c57c8c50b7f641060fa..9a748d3a0cb7c8c6fd730404690c7c12b0974262 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -1095,6 +1095,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
@@ -917,6 +917,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
std::move(network_conditions));
|
||||
}
|
||||
|
||||
@@ -51,10 +51,10 @@ index 20243f6c333478f14e5bff3789e780b996887512..34e4fd20f78ee0376053720742fc9af6
|
||||
// This may only be called on NetworkContexts created with the constructor
|
||||
// that calls MakeURLRequestContext().
|
||||
diff --git a/services/network/network_context.h b/services/network/network_context.h
|
||||
index f117ba5edfa7da25efd25e52ac5fff8b37ba3de3..5a805b4ee688ee7a113c833535db861b0e3b2ef9 100644
|
||||
index 581196b6d4a0054bc213e4eada1a97a8e0453c5f..96fe00e951771ac0017ee4e60a545a9975153282 100644
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -213,6 +213,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
@@ -219,6 +219,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
void CloseIdleConnections(CloseIdleConnectionsCallback callback) override;
|
||||
void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
|
||||
mojom::NetworkConditionsPtr conditions) override;
|
||||
@@ -63,10 +63,10 @@ index f117ba5edfa7da25efd25e52ac5fff8b37ba3de3..5a805b4ee688ee7a113c833535db861b
|
||||
void SetEnableReferrers(bool enable_referrers) override;
|
||||
#if defined(OS_CHROMEOS)
|
||||
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
|
||||
index 034b5720ffa497429b2cdfcc06cd2d421f2db99c..aa2c88443e744396e381377ec20b03fb0e66d2db 100644
|
||||
index 6b7571dbf1464284ce30953a27c1ac2099f1872f..955e945c5f0f12a739d0cccaef41a241ea5557f8 100644
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -857,6 +857,9 @@ interface NetworkContext {
|
||||
@@ -889,6 +889,9 @@ interface NetworkContext {
|
||||
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
|
||||
NetworkConditions? conditions);
|
||||
|
||||
@@ -77,10 +77,10 @@ index 034b5720ffa497429b2cdfcc06cd2d421f2db99c..aa2c88443e744396e381377ec20b03fb
|
||||
SetAcceptLanguage(string new_accept_language);
|
||||
|
||||
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
|
||||
index aa21b8e434c01a866e3fae04b8de54a3cdfb725e..63880702102a396576c5825f8c5c7731cde091cc 100644
|
||||
index 34a8050d5900534663c285028eb42720a5bc8621..e5e361cd197d5080761d07a18f8af6727b395015 100644
|
||||
--- a/services/network/test/test_network_context.h
|
||||
+++ b/services/network/test/test_network_context.h
|
||||
@@ -93,6 +93,7 @@ class TestNetworkContext : public mojom::NetworkContext {
|
||||
@@ -95,6 +95,7 @@ class TestNetworkContext : public mojom::NetworkContext {
|
||||
void CloseIdleConnections(CloseIdleConnectionsCallback callback) override {}
|
||||
void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
|
||||
mojom::NetworkConditionsPtr conditions) override {}
|
||||
|
||||
@@ -13,7 +13,7 @@ uses internally for things like menus and devtools.
|
||||
We can remove this patch once it has in some shape been upstreamed.
|
||||
|
||||
diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc
|
||||
index 2370d15332c8c6c7dc7e3403b38891c885704d9f..171214379437f319d3feccc289a5d91e74b77f9e 100644
|
||||
index 929e339487b7d2b4407cff069944f7a2cc1266a4..4abf0933df57651f36dbb6a1652b2de534a82639 100644
|
||||
--- a/ui/native_theme/native_theme.cc
|
||||
+++ b/ui/native_theme/native_theme.cc
|
||||
@@ -40,6 +40,8 @@ NativeTheme::NativeTheme()
|
||||
@@ -75,10 +75,10 @@ index a8fbfee3b13672902aac05fd5a65fa8ee81f9f7e..1be6369acf0b7c02a6f862636c2b2de1
|
||||
}
|
||||
|
||||
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
|
||||
index 3003643bfb78cec2f5e84fc9e1471e1ef54aae41..06f2cbc84401958d49445f4ce6acb1b2fef0aa04 100644
|
||||
index 97e72bc38a7231ce295ad943e977c69586cc6e07..a60f7b618ddd29886aac70f16e07cbc871ce38af 100644
|
||||
--- a/ui/native_theme/native_theme_win.cc
|
||||
+++ b/ui/native_theme/native_theme_win.cc
|
||||
@@ -611,6 +611,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
|
||||
@@ -725,6 +725,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
|
||||
// ...unless --force-dark-mode was specified in which case caveat emptor.
|
||||
if (UsesHighContrastColors() && !IsForcedDarkMode())
|
||||
return false;
|
||||
|
||||
@@ -1,636 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Heilig Benedek <benecene@gmail.com>
|
||||
Date: Wed, 20 Mar 2019 20:30:44 +0100
|
||||
Subject: feat_offscreen_rendering_with_viz_compositor.patch
|
||||
|
||||
|
||||
diff --git a/components/viz/host/host_display_client.cc b/components/viz/host/host_display_client.cc
|
||||
index f5e18df4e06e24d3bdd51308abde48e217444848..41017d9d53b1c0d563ea0901f5cae407c6cf1560 100644
|
||||
--- a/components/viz/host/host_display_client.cc
|
||||
+++ b/components/viz/host/host_display_client.cc
|
||||
@@ -18,6 +18,10 @@
|
||||
|
||||
namespace viz {
|
||||
|
||||
+void HostDisplayClient::IsOffscreen(IsOffscreenCallback callback) {
|
||||
+ std::move(callback).Run(false);
|
||||
+}
|
||||
+
|
||||
HostDisplayClient::HostDisplayClient(gfx::AcceleratedWidget widget)
|
||||
: binding_(this) {
|
||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
||||
@@ -46,9 +50,9 @@ void HostDisplayClient::OnDisplayReceivedCALayerParams(
|
||||
}
|
||||
#endif
|
||||
|
||||
-#if defined(OS_WIN)
|
||||
void HostDisplayClient::CreateLayeredWindowUpdater(
|
||||
mojom::LayeredWindowUpdaterRequest request) {
|
||||
+#if defined(OS_WIN)
|
||||
if (!NeedsToUseLayerWindow(widget_)) {
|
||||
DLOG(ERROR) << "HWND shouldn't be using a layered window";
|
||||
return;
|
||||
@@ -56,8 +60,12 @@ void HostDisplayClient::CreateLayeredWindowUpdater(
|
||||
|
||||
layered_window_updater_ =
|
||||
std::make_unique<LayeredWindowUpdaterImpl>(widget_, std::move(request));
|
||||
-}
|
||||
+#else
|
||||
+ CHECK(false) << "Chromium is calling CreateLayeredWindowUpdater for non-OSR "
|
||||
+ "windows on POSIX platforms, something is wrong with "
|
||||
+ "Electron's OSR implementation.";
|
||||
#endif
|
||||
+}
|
||||
|
||||
#if defined(USE_X11)
|
||||
void HostDisplayClient::DidCompleteSwapWithNewSize(const gfx::Size& size) {
|
||||
diff --git a/components/viz/host/host_display_client.h b/components/viz/host/host_display_client.h
|
||||
index b8177277ebca471fc147f2d5b53521cbadd8fa2d..72a807e138f80b4ab37cb1d368bc968e299d903f 100644
|
||||
--- a/components/viz/host/host_display_client.h
|
||||
+++ b/components/viz/host/host_display_client.h
|
||||
@@ -30,17 +30,17 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient {
|
||||
mojom::DisplayClientPtr GetBoundPtr(
|
||||
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
|
||||
|
||||
- private:
|
||||
+ protected:
|
||||
// mojom::DisplayClient implementation:
|
||||
#if defined(OS_MACOSX)
|
||||
void OnDisplayReceivedCALayerParams(
|
||||
const gfx::CALayerParams& ca_layer_params) override;
|
||||
#endif
|
||||
|
||||
-#if defined(OS_WIN)
|
||||
+ void IsOffscreen(IsOffscreenCallback callback) override;
|
||||
+
|
||||
void CreateLayeredWindowUpdater(
|
||||
mojom::LayeredWindowUpdaterRequest request) override;
|
||||
-#endif
|
||||
|
||||
#if defined(USE_X11)
|
||||
void DidCompleteSwapWithNewSize(const gfx::Size& size) override;
|
||||
diff --git a/components/viz/host/layered_window_updater_impl.cc b/components/viz/host/layered_window_updater_impl.cc
|
||||
index 65c26e2f7ae813e50f6740f73a4d145467da4366..39c04c4d6b644a4ad7b13b4e932b085fad0b8293 100644
|
||||
--- a/components/viz/host/layered_window_updater_impl.cc
|
||||
+++ b/components/viz/host/layered_window_updater_impl.cc
|
||||
@@ -43,7 +43,9 @@ void LayeredWindowUpdaterImpl::OnAllocatedSharedMemory(
|
||||
// |region|'s handle will close when it goes out of scope.
|
||||
}
|
||||
|
||||
-void LayeredWindowUpdaterImpl::Draw(DrawCallback draw_callback) {
|
||||
+void LayeredWindowUpdaterImpl::Draw(
|
||||
+ const gfx::Rect& damage_rect,
|
||||
+ DrawCallback draw_callback) {
|
||||
TRACE_EVENT0("viz", "LayeredWindowUpdaterImpl::Draw");
|
||||
|
||||
if (!canvas_) {
|
||||
diff --git a/components/viz/host/layered_window_updater_impl.h b/components/viz/host/layered_window_updater_impl.h
|
||||
index ced30727ab67e557265c3a61f7c213763da973ce..f422786fe6cd9cab47494fe6028f3c3be8bc763e 100644
|
||||
--- a/components/viz/host/layered_window_updater_impl.h
|
||||
+++ b/components/viz/host/layered_window_updater_impl.h
|
||||
@@ -33,7 +33,7 @@ class VIZ_HOST_EXPORT LayeredWindowUpdaterImpl
|
||||
// mojom::LayeredWindowUpdater implementation.
|
||||
void OnAllocatedSharedMemory(const gfx::Size& pixel_size,
|
||||
base::UnsafeSharedMemoryRegion region) override;
|
||||
- void Draw(DrawCallback draw_callback) override;
|
||||
+ void Draw(const gfx::Rect& damage_rect, DrawCallback draw_callback) override;
|
||||
|
||||
private:
|
||||
const HWND hwnd_;
|
||||
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
|
||||
index ce7ceb3e82e95e49442d77a61d6bf765e8e86e4e..90db4660e0184daa773c9fbd1314cd64132ebd2e 100644
|
||||
--- a/components/viz/service/BUILD.gn
|
||||
+++ b/components/viz/service/BUILD.gn
|
||||
@@ -118,6 +118,8 @@ viz_component("service") {
|
||||
"display_embedder/output_surface_provider_impl.h",
|
||||
"display_embedder/server_shared_bitmap_manager.cc",
|
||||
"display_embedder/server_shared_bitmap_manager.h",
|
||||
+ "display_embedder/software_output_device_proxy.cc",
|
||||
+ "display_embedder/software_output_device_proxy.h",
|
||||
"display_embedder/software_output_surface.cc",
|
||||
"display_embedder/software_output_surface.h",
|
||||
"display_embedder/viz_process_context_provider.cc",
|
||||
diff --git a/components/viz/service/display_embedder/output_surface_provider_impl.cc b/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
index e3c8e9dbca69f2665e8dbbd798d45c3b7199e04c..d9fa2d536e977ac966065a9058661f887e995320 100644
|
||||
--- a/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
+++ b/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h"
|
||||
#include "components/viz/service/display_embedder/skia_output_surface_dependency_impl.h"
|
||||
#include "components/viz/service/display_embedder/skia_output_surface_impl.h"
|
||||
+#include "components/viz/service/display_embedder/software_output_device_proxy.h"
|
||||
#include "components/viz/service/display_embedder/software_output_surface.h"
|
||||
#include "components/viz/service/display_embedder/viz_process_context_provider.h"
|
||||
#include "components/viz/service/gl/gpu_service_impl.h"
|
||||
@@ -33,6 +34,7 @@
|
||||
#include "gpu/ipc/scheduler_sequence.h"
|
||||
#include "gpu/ipc/service/gpu_channel_manager_delegate.h"
|
||||
#include "gpu/ipc/service/image_transport_surface.h"
|
||||
+#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h"
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
#include "ui/gl/gl_context.h"
|
||||
#include "ui/gl/init/gl_factory.h"
|
||||
@@ -223,6 +225,19 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
|
||||
if (headless_)
|
||||
return std::make_unique<SoftwareOutputDevice>();
|
||||
|
||||
+#if !defined(OS_MACOSX)
|
||||
+ DCHECK(display_client);
|
||||
+ bool offscreen = false;
|
||||
+ if (display_client->IsOffscreen(&offscreen) && offscreen) {
|
||||
+ mojom::LayeredWindowUpdaterPtr layered_window_updater;
|
||||
+ display_client->CreateLayeredWindowUpdater(
|
||||
+ mojo::MakeRequest(&layered_window_updater));
|
||||
+
|
||||
+ return std::make_unique<SoftwareOutputDeviceProxy>(
|
||||
+ std::move(layered_window_updater));
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
#if defined(OS_WIN)
|
||||
return CreateSoftwareOutputDeviceWin(surface_handle, &output_device_backing_,
|
||||
display_client);
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_mac.cc b/components/viz/service/display_embedder/software_output_device_mac.cc
|
||||
index b9357082293cc55650144ccbc8bada8fe6d1cac4..b4cb07e26d1504719f80e5835c1cb5f138b9f1ab 100644
|
||||
--- a/components/viz/service/display_embedder/software_output_device_mac.cc
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_mac.cc
|
||||
@@ -102,6 +102,8 @@ void SoftwareOutputDeviceMac::UpdateAndCopyBufferDamage(
|
||||
|
||||
SkCanvas* SoftwareOutputDeviceMac::BeginPaint(
|
||||
const gfx::Rect& new_damage_rect) {
|
||||
+ last_damage = new_damage_rect;
|
||||
+
|
||||
// Record the previous paint buffer.
|
||||
Buffer* previous_paint_buffer =
|
||||
buffer_queue_.empty() ? nullptr : buffer_queue_.back().get();
|
||||
@@ -184,6 +186,7 @@ void SoftwareOutputDeviceMac::EndPaint() {
|
||||
ca_layer_params.is_empty = false;
|
||||
ca_layer_params.scale_factor = scale_factor_;
|
||||
ca_layer_params.pixel_size = pixel_size_;
|
||||
+ ca_layer_params.damage = last_damage;
|
||||
ca_layer_params.io_surface_mach_port.reset(
|
||||
IOSurfaceCreateMachPort(current_paint_buffer_->io_surface));
|
||||
client_->SoftwareDeviceUpdatedCALayerParams(ca_layer_params);
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_mac.h b/components/viz/service/display_embedder/software_output_device_mac.h
|
||||
index f3867356e3d641416e00e6d115ae9ae2a0be90ab..b1d192d2b20ccb63fba07093101d745e5ffe86dd 100644
|
||||
--- a/components/viz/service/display_embedder/software_output_device_mac.h
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_mac.h
|
||||
@@ -56,6 +56,7 @@ class VIZ_SERVICE_EXPORT SoftwareOutputDeviceMac : public SoftwareOutputDevice {
|
||||
void UpdateAndCopyBufferDamage(Buffer* previous_paint_buffer,
|
||||
const SkRegion& new_damage_rect);
|
||||
|
||||
+ gfx::Rect last_damage;
|
||||
gfx::Size pixel_size_;
|
||||
float scale_factor_ = 1;
|
||||
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_proxy.cc b/components/viz/service/display_embedder/software_output_device_proxy.cc
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c17b03e00089bfd301c63910426bb16afb8cdae7
|
||||
--- /dev/null
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_proxy.cc
|
||||
@@ -0,0 +1,156 @@
|
||||
+// Copyright 2014 The Chromium Authors. All rights reserved.
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+#include "components/viz/service/display_embedder/software_output_device_proxy.h"
|
||||
+
|
||||
+#include "base/memory/unsafe_shared_memory_region.h"
|
||||
+#include "base/threading/thread_checker.h"
|
||||
+#include "components/viz/common/resources/resource_sizes.h"
|
||||
+#include "components/viz/service/display_embedder/output_device_backing.h"
|
||||
+#include "mojo/public/cpp/system/platform_handle.h"
|
||||
+#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h"
|
||||
+#include "skia/ext/platform_canvas.h"
|
||||
+#include "third_party/skia/include/core/SkCanvas.h"
|
||||
+#include "ui/gfx/skia_util.h"
|
||||
+
|
||||
+#if defined(OS_WIN)
|
||||
+#include "skia/ext/skia_utils_win.h"
|
||||
+#include "ui/gfx/gdi_util.h"
|
||||
+#include "ui/gfx/win/hwnd_util.h"
|
||||
+#else
|
||||
+#include "mojo/public/cpp/base/shared_memory_utils.h"
|
||||
+#endif
|
||||
+
|
||||
+namespace viz {
|
||||
+
|
||||
+SoftwareOutputDeviceBase::~SoftwareOutputDeviceBase() {
|
||||
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
+ DCHECK(!in_paint_);
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceBase::Resize(const gfx::Size& viewport_pixel_size,
|
||||
+ float scale_factor) {
|
||||
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
+ DCHECK(!in_paint_);
|
||||
+
|
||||
+ if (viewport_pixel_size_ == viewport_pixel_size)
|
||||
+ return;
|
||||
+
|
||||
+ viewport_pixel_size_ = viewport_pixel_size;
|
||||
+ ResizeDelegated();
|
||||
+}
|
||||
+
|
||||
+SkCanvas* SoftwareOutputDeviceBase::BeginPaint(
|
||||
+ const gfx::Rect& damage_rect) {
|
||||
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
+ DCHECK(!in_paint_);
|
||||
+
|
||||
+ damage_rect_ = damage_rect;
|
||||
+ in_paint_ = true;
|
||||
+ return BeginPaintDelegated();
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceBase::EndPaint() {
|
||||
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
+ DCHECK(in_paint_);
|
||||
+
|
||||
+ in_paint_ = false;
|
||||
+
|
||||
+ gfx::Rect intersected_damage_rect = damage_rect_;
|
||||
+ intersected_damage_rect.Intersect(gfx::Rect(viewport_pixel_size_));
|
||||
+ if (intersected_damage_rect.IsEmpty())
|
||||
+ return;
|
||||
+
|
||||
+ EndPaintDelegated(intersected_damage_rect);
|
||||
+}
|
||||
+
|
||||
+SoftwareOutputDeviceProxy::~SoftwareOutputDeviceProxy() = default;
|
||||
+
|
||||
+SoftwareOutputDeviceProxy::SoftwareOutputDeviceProxy(
|
||||
+ mojom::LayeredWindowUpdaterPtr layered_window_updater)
|
||||
+ : layered_window_updater_(std::move(layered_window_updater)) {
|
||||
+ DCHECK(layered_window_updater_.is_bound());
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceProxy::OnSwapBuffers(
|
||||
+ SoftwareOutputDevice::SwapBuffersCallback swap_ack_callback) {
|
||||
+ DCHECK(swap_ack_callback_.is_null());
|
||||
+
|
||||
+ // We aren't waiting on DrawAck() and can immediately run the callback.
|
||||
+ if (!waiting_on_draw_ack_) {
|
||||
+ task_runner_->PostTask(FROM_HERE,
|
||||
+ base::BindOnce(std::move(swap_ack_callback), viewport_pixel_size_));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ swap_ack_callback_ = std::move(swap_ack_callback);
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceProxy::ResizeDelegated() {
|
||||
+ canvas_.reset();
|
||||
+
|
||||
+ size_t required_bytes;
|
||||
+ if (!ResourceSizes::MaybeSizeInBytes(
|
||||
+ viewport_pixel_size_, ResourceFormat::RGBA_8888, &required_bytes)) {
|
||||
+ DLOG(ERROR) << "Invalid viewport size " << viewport_pixel_size_.ToString();
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ base::UnsafeSharedMemoryRegion region =
|
||||
+ base::UnsafeSharedMemoryRegion::Create(required_bytes);
|
||||
+ if (!region.IsValid()) {
|
||||
+ DLOG(ERROR) << "Failed to allocate " << required_bytes << " bytes";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ #if defined(WIN32)
|
||||
+ canvas_ = skia::CreatePlatformCanvasWithSharedSection(
|
||||
+ viewport_pixel_size_.width(), viewport_pixel_size_.height(), false,
|
||||
+ region.GetPlatformHandle(), skia::CRASH_ON_FAILURE);
|
||||
+ #else
|
||||
+ shm_mapping_ = region.Map();
|
||||
+ if (!shm_mapping_.IsValid()) {
|
||||
+ DLOG(ERROR) << "Failed to map " << required_bytes << " bytes";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ canvas_ = skia::CreatePlatformCanvasWithPixels(
|
||||
+ viewport_pixel_size_.width(), viewport_pixel_size_.height(), false,
|
||||
+ static_cast<uint8_t*>(shm_mapping_.memory()), skia::CRASH_ON_FAILURE);
|
||||
+ #endif
|
||||
+
|
||||
+ // Transfer region ownership to the browser process.
|
||||
+ layered_window_updater_->OnAllocatedSharedMemory(viewport_pixel_size_,
|
||||
+ std::move(region));
|
||||
+}
|
||||
+
|
||||
+SkCanvas* SoftwareOutputDeviceProxy::BeginPaintDelegated() {
|
||||
+ return canvas_.get();
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceProxy::EndPaintDelegated(
|
||||
+ const gfx::Rect& damage_rect) {
|
||||
+ DCHECK(!waiting_on_draw_ack_);
|
||||
+
|
||||
+ if (!canvas_)
|
||||
+ return;
|
||||
+
|
||||
+ layered_window_updater_->Draw(damage_rect, base::BindOnce(
|
||||
+ &SoftwareOutputDeviceProxy::DrawAck, base::Unretained(this)));
|
||||
+ waiting_on_draw_ack_ = true;
|
||||
+
|
||||
+ TRACE_EVENT_ASYNC_BEGIN0("viz", "SoftwareOutputDeviceProxy::Draw", this);
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceProxy::DrawAck() {
|
||||
+ DCHECK(waiting_on_draw_ack_);
|
||||
+ DCHECK(!swap_ack_callback_.is_null());
|
||||
+
|
||||
+ TRACE_EVENT_ASYNC_END0("viz", "SoftwareOutputDeviceProxy::Draw", this);
|
||||
+
|
||||
+ waiting_on_draw_ack_ = false;
|
||||
+ std::move(swap_ack_callback_).Run(viewport_pixel_size_);
|
||||
+}
|
||||
+
|
||||
+} // namespace viz
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_proxy.h b/components/viz/service/display_embedder/software_output_device_proxy.h
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3865939d0445a23a468770f57207ba5ef23277ed
|
||||
--- /dev/null
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_proxy.h
|
||||
@@ -0,0 +1,88 @@
|
||||
+// Copyright 2014 The Chromium Authors. All rights reserved.
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
|
||||
+#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
|
||||
+
|
||||
+#if defined(OS_WIN)
|
||||
+#include <windows.h>
|
||||
+#endif
|
||||
+
|
||||
+#include <memory>
|
||||
+
|
||||
+#include "components/viz/host/host_display_client.h"
|
||||
+#include "components/viz/service/display/software_output_device.h"
|
||||
+#include "components/viz/service/viz_service_export.h"
|
||||
+#include "services/viz/privileged/mojom/compositing/display_private.mojom.h"
|
||||
+#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h"
|
||||
+
|
||||
+namespace viz {
|
||||
+
|
||||
+// Shared base class for SoftwareOutputDevice implementations.
|
||||
+class SoftwareOutputDeviceBase : public SoftwareOutputDevice {
|
||||
+ public:
|
||||
+ SoftwareOutputDeviceBase() = default;
|
||||
+ ~SoftwareOutputDeviceBase() override;
|
||||
+
|
||||
+ // SoftwareOutputDevice implementation.
|
||||
+ void Resize(const gfx::Size& viewport_pixel_size,
|
||||
+ float scale_factor) override;
|
||||
+ SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override;
|
||||
+ void EndPaint() override;
|
||||
+
|
||||
+ // Called from Resize() if |viewport_pixel_size_| has changed.
|
||||
+ virtual void ResizeDelegated() = 0;
|
||||
+
|
||||
+ // Called from BeginPaint() and should return an SkCanvas.
|
||||
+ virtual SkCanvas* BeginPaintDelegated() = 0;
|
||||
+
|
||||
+ // Called from EndPaint() if there is damage.
|
||||
+ virtual void EndPaintDelegated(const gfx::Rect& damage_rect) = 0;
|
||||
+
|
||||
+ private:
|
||||
+ bool in_paint_ = false;
|
||||
+
|
||||
+ THREAD_CHECKER(thread_checker_);
|
||||
+
|
||||
+ DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceBase);
|
||||
+};
|
||||
+
|
||||
+// SoftwareOutputDevice implementation that draws indirectly. An implementation
|
||||
+// of mojom::LayeredWindowUpdater in the browser process handles the actual
|
||||
+// drawing. Pixel backing is in SharedMemory so no copying between processes
|
||||
+// is required.
|
||||
+class SoftwareOutputDeviceProxy : public SoftwareOutputDeviceBase {
|
||||
+ public:
|
||||
+ explicit SoftwareOutputDeviceProxy(
|
||||
+ mojom::LayeredWindowUpdaterPtr layered_window_updater);
|
||||
+ ~SoftwareOutputDeviceProxy() override;
|
||||
+
|
||||
+ // SoftwareOutputDevice implementation.
|
||||
+ void OnSwapBuffers(SoftwareOutputDevice::SwapBuffersCallback swap_ack_callback) override;
|
||||
+
|
||||
+ // SoftwareOutputDeviceBase implementation.
|
||||
+ void ResizeDelegated() override;
|
||||
+ SkCanvas* BeginPaintDelegated() override;
|
||||
+ void EndPaintDelegated(const gfx::Rect& rect) override;
|
||||
+
|
||||
+ private:
|
||||
+ // Runs |swap_ack_callback_| after draw has happened.
|
||||
+ void DrawAck();
|
||||
+
|
||||
+ mojom::LayeredWindowUpdaterPtr layered_window_updater_;
|
||||
+
|
||||
+ std::unique_ptr<SkCanvas> canvas_;
|
||||
+ bool waiting_on_draw_ack_ = false;
|
||||
+ SoftwareOutputDevice::SwapBuffersCallback swap_ack_callback_;
|
||||
+
|
||||
+#if !defined(WIN32)
|
||||
+ base::WritableSharedMemoryMapping shm_mapping_;
|
||||
+#endif
|
||||
+
|
||||
+ DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceProxy);
|
||||
+};
|
||||
+
|
||||
+} // namespace viz
|
||||
+
|
||||
+#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_win.cc b/components/viz/service/display_embedder/software_output_device_win.cc
|
||||
index 74316edc0e0bd28b1772e9d7cf34327d113462c4..9cbe5400458ce6e0b8ea9edfa3f0969fb936ee1e 100644
|
||||
--- a/components/viz/service/display_embedder/software_output_device_win.cc
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_win.cc
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "components/viz/common/display/use_layered_window.h"
|
||||
#include "components/viz/common/resources/resource_sizes.h"
|
||||
#include "components/viz/service/display_embedder/output_device_backing.h"
|
||||
+#include "components/viz/service/display_embedder/software_output_device_proxy.h"
|
||||
#include "mojo/public/cpp/system/platform_handle.h"
|
||||
#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h"
|
||||
#include "skia/ext/platform_canvas.h"
|
||||
@@ -265,7 +266,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated(
|
||||
if (!canvas_)
|
||||
return;
|
||||
|
||||
- layered_window_updater_->Draw(base::BindOnce(
|
||||
+ layered_window_updater_->Draw(damage_rect, base::BindOnce(
|
||||
&SoftwareOutputDeviceWinProxy::DrawAck, base::Unretained(this)));
|
||||
waiting_on_draw_ack_ = true;
|
||||
|
||||
@@ -297,8 +298,13 @@ std::unique_ptr<SoftwareOutputDevice> CreateSoftwareOutputDeviceWin(
|
||||
display_client->CreateLayeredWindowUpdater(
|
||||
mojo::MakeRequest(&layered_window_updater));
|
||||
|
||||
- return std::make_unique<SoftwareOutputDeviceWinProxy>(
|
||||
- hwnd, std::move(layered_window_updater));
|
||||
+ bool offscreen = false;
|
||||
+ if (display_client->IsOffscreen(&offscreen) && offscreen)
|
||||
+ return std::make_unique<SoftwareOutputDeviceProxy>(
|
||||
+ std::move(layered_window_updater));
|
||||
+ else
|
||||
+ return std::make_unique<SoftwareOutputDeviceWinProxy>(
|
||||
+ hwnd, std::move(layered_window_updater));
|
||||
} else {
|
||||
return std::make_unique<SoftwareOutputDeviceWinDirect>(hwnd, backing);
|
||||
}
|
||||
diff --git a/services/viz/privileged/mojom/compositing/display_private.mojom b/services/viz/privileged/mojom/compositing/display_private.mojom
|
||||
index 5c6292cfb3b8b46802c772d202d19c78e4782488..ed27af3ab0b383553b4d9492d29cec2b91bee807 100644
|
||||
--- a/services/viz/privileged/mojom/compositing/display_private.mojom
|
||||
+++ b/services/viz/privileged/mojom/compositing/display_private.mojom
|
||||
@@ -79,12 +79,14 @@ interface DisplayPrivate {
|
||||
};
|
||||
|
||||
interface DisplayClient {
|
||||
+ [Sync]
|
||||
+ IsOffscreen() => (bool success);
|
||||
+
|
||||
[EnableIf=is_mac]
|
||||
OnDisplayReceivedCALayerParams(gfx.mojom.CALayerParams ca_layer_params);
|
||||
|
||||
// Creates a LayeredWindowUpdater implementation to draw into a layered
|
||||
// window.
|
||||
- [EnableIf=is_win]
|
||||
CreateLayeredWindowUpdater(LayeredWindowUpdater& layered_window_updater);
|
||||
|
||||
// Notifies that a swap has occurred and provides information about the pixel
|
||||
diff --git a/services/viz/privileged/mojom/compositing/layered_window_updater.mojom b/services/viz/privileged/mojom/compositing/layered_window_updater.mojom
|
||||
index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a285498c3f8e72 100644
|
||||
--- a/services/viz/privileged/mojom/compositing/layered_window_updater.mojom
|
||||
+++ b/services/viz/privileged/mojom/compositing/layered_window_updater.mojom
|
||||
@@ -26,5 +26,5 @@ interface LayeredWindowUpdater {
|
||||
// Draws to the HWND by copying pixels from shared memory. Callback must be
|
||||
// called after draw operation is complete to signal shared memory can be
|
||||
// modified.
|
||||
- Draw() => ();
|
||||
+ Draw(gfx.mojom.Rect damage_rect) => ();
|
||||
};
|
||||
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
|
||||
index 359e7d21a4a5e7acaed9bd7f42f40019e650a182..cd90aab9d3a7b5335c829d964d92e3fa62401408 100644
|
||||
--- a/ui/compositor/compositor.h
|
||||
+++ b/ui/compositor/compositor.h
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "cc/trees/layer_tree_host_single_thread_client.h"
|
||||
#include "components/viz/common/frame_sinks/begin_frame_args.h"
|
||||
#include "components/viz/common/surfaces/frame_sink_id.h"
|
||||
+#include "components/viz/host/host_display_client.h"
|
||||
#include "components/viz/host/host_frame_sink_client.h"
|
||||
#include "services/viz/privileged/mojom/compositing/vsync_parameter_observer.mojom-forward.h"
|
||||
#include "third_party/skia/include/core/SkColor.h"
|
||||
@@ -194,6 +195,15 @@ class COMPOSITOR_EXPORT ContextFactory {
|
||||
virtual bool SyncTokensRequiredForDisplayCompositor() = 0;
|
||||
};
|
||||
|
||||
+class COMPOSITOR_EXPORT CompositorDelegate {
|
||||
+ public:
|
||||
+ virtual std::unique_ptr<viz::HostDisplayClient> CreateHostDisplayClient(
|
||||
+ ui::Compositor* compositor) = 0;
|
||||
+
|
||||
+ protected:
|
||||
+ virtual ~CompositorDelegate() {}
|
||||
+};
|
||||
+
|
||||
// Compositor object to take care of GPU painting.
|
||||
// A Browser compositor object is responsible for generating the final
|
||||
// displayable form of pixels comprising a single widget's contents. It draws an
|
||||
@@ -233,6 +243,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
// Schedules a redraw of the layer tree associated with this compositor.
|
||||
void ScheduleDraw();
|
||||
|
||||
+ CompositorDelegate* delegate() const { return delegate_; }
|
||||
+ void SetDelegate(CompositorDelegate* delegate) { delegate_ = delegate; }
|
||||
+
|
||||
// Sets the root of the layer tree drawn by this Compositor. The root layer
|
||||
// must have no parent. The compositor's root layer is reset if the root layer
|
||||
// is destroyed. NULL can be passed to reset the root layer, in which case the
|
||||
@@ -448,6 +461,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
ui::ContextFactory* context_factory_;
|
||||
ui::ContextFactoryPrivate* context_factory_private_;
|
||||
|
||||
+ CompositorDelegate* delegate_ = nullptr;
|
||||
+
|
||||
// The root of the Layer tree drawn by this compositor.
|
||||
Layer* root_layer_ = nullptr;
|
||||
|
||||
diff --git a/ui/compositor/host/host_context_factory_private.cc b/ui/compositor/host/host_context_factory_private.cc
|
||||
index 84b2623bd3dd8a7fdfa8e453eda3574e3b71ef99..974eb17c1d1f50c45b4d3a539a8d1a67b687642d 100644
|
||||
--- a/ui/compositor/host/host_context_factory_private.cc
|
||||
+++ b/ui/compositor/host/host_context_factory_private.cc
|
||||
@@ -99,8 +99,12 @@ void HostContextFactoryPrivate::ConfigureCompositor(
|
||||
mojo::MakeRequest(&root_params->compositor_frame_sink_client);
|
||||
root_params->display_private =
|
||||
mojo::MakeRequest(&compositor_data.display_private);
|
||||
- compositor_data.display_client =
|
||||
- std::make_unique<HostDisplayClient>(compositor);
|
||||
+ if (compositor->delegate())
|
||||
+ compositor_data.display_client = compositor->delegate()->CreateHostDisplayClient(
|
||||
+ compositor);
|
||||
+ else
|
||||
+ compositor_data.display_client =
|
||||
+ std::make_unique<HostDisplayClient>(compositor);
|
||||
root_params->display_client =
|
||||
compositor_data.display_client->GetBoundPtr(resize_task_runner_)
|
||||
.PassInterface();
|
||||
diff --git a/ui/gfx/ca_layer_params.h b/ui/gfx/ca_layer_params.h
|
||||
index 4014e64a75da88cf66c02e8adb71171c2666cab7..25e57784e1a1ffc546b003daa4cd0059c468432f 100644
|
||||
--- a/ui/gfx/ca_layer_params.h
|
||||
+++ b/ui/gfx/ca_layer_params.h
|
||||
@@ -6,6 +6,7 @@
|
||||
#define UI_GFX_CA_LAYER_PARAMS_H_
|
||||
|
||||
#include "build/build_config.h"
|
||||
+#include "ui/gfx/geometry/rect.h"
|
||||
#include "ui/gfx/geometry/size.h"
|
||||
#include "ui/gfx/gfx_export.h"
|
||||
|
||||
@@ -41,6 +42,8 @@ struct GFX_EXPORT CALayerParams {
|
||||
gfx::ScopedRefCountedIOSurfaceMachPort io_surface_mach_port;
|
||||
#endif
|
||||
|
||||
+ gfx::Rect damage;
|
||||
+
|
||||
// The geometry of the frame.
|
||||
gfx::Size pixel_size;
|
||||
float scale_factor = 1.f;
|
||||
diff --git a/ui/gfx/mojom/ca_layer_params.mojom b/ui/gfx/mojom/ca_layer_params.mojom
|
||||
index a73b2e678ffe0a682d0aa5409724fb441768bec5..6c36626d204c77ef51278b9e8f6fc6ee24a7a9ab 100644
|
||||
--- a/ui/gfx/mojom/ca_layer_params.mojom
|
||||
+++ b/ui/gfx/mojom/ca_layer_params.mojom
|
||||
@@ -18,5 +18,6 @@ struct CALayerParams {
|
||||
bool is_empty;
|
||||
CALayerContent content;
|
||||
gfx.mojom.Size pixel_size;
|
||||
+ gfx.mojom.Rect damage;
|
||||
float scale_factor;
|
||||
};
|
||||
diff --git a/ui/gfx/mojom/ca_layer_params_mojom_traits.cc b/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
|
||||
index 843d5c24ec33de07c12d4417eb111f91dbcd42fe..0ea594950fcd2686f1b07248dbc8ceb257d89dca 100644
|
||||
--- a/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
|
||||
+++ b/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
|
||||
@@ -52,6 +52,9 @@ bool StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams>::Read(
|
||||
if (!data.ReadPixelSize(&out->pixel_size))
|
||||
return false;
|
||||
|
||||
+ if (!data.ReadDamage(&out->damage))
|
||||
+ return false;
|
||||
+
|
||||
out->scale_factor = data.scale_factor();
|
||||
return true;
|
||||
}
|
||||
diff --git a/ui/gfx/mojom/ca_layer_params_mojom_traits.h b/ui/gfx/mojom/ca_layer_params_mojom_traits.h
|
||||
index 4cac766eae3161baedac4202f694129cd90c80de..0821495ad22944d8856bb750cac8912a2f8328c3 100644
|
||||
--- a/ui/gfx/mojom/ca_layer_params_mojom_traits.h
|
||||
+++ b/ui/gfx/mojom/ca_layer_params_mojom_traits.h
|
||||
@@ -20,6 +20,10 @@ struct StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams> {
|
||||
return ca_layer_params.pixel_size;
|
||||
}
|
||||
|
||||
+ static gfx::Rect damage(const gfx::CALayerParams& ca_layer_params) {
|
||||
+ return ca_layer_params.damage;
|
||||
+ }
|
||||
+
|
||||
static float scale_factor(const gfx::CALayerParams& ca_layer_params) {
|
||||
return ca_layer_params.scale_factor;
|
||||
}
|
||||
@@ -7,7 +7,7 @@ Fixes broken Linux ARM breakpad symbol generation by patching
|
||||
out an `ldd`-related call that was throwing.
|
||||
|
||||
diff --git a/components/crash/content/tools/generate_breakpad_symbols.py b/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
index edb3fa5c125fae7858a1f36495410baf47d58484..05a1385e13d282a63975143cbc6e157984bbd992 100755
|
||||
index fe6d008b910942a59e31371ec08179b23a6fa0bb..c8736ae3c5e5a4bc78786aa8ab8e21b69a0d262b 100755
|
||||
--- a/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
+++ b/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
@@ -67,7 +67,8 @@ def GetSharedLibraryDependenciesLinux(binary, options):
|
||||
|
||||
@@ -7,7 +7,7 @@ Subject:
|
||||
Disable usage of pthread_fchdir_np and pthread_chdir_np in MAS builds.
|
||||
|
||||
diff --git a/base/process/launch_mac.cc b/base/process/launch_mac.cc
|
||||
index 1119fb3f97b1..b0efe96063b9 100644
|
||||
index 1119fb3f97b116028d78fdf42c1d336440a1681f..264178186f3f780b2b33de7649b1321b23964515 100644
|
||||
--- a/base/process/launch_mac.cc
|
||||
+++ b/base/process/launch_mac.cc
|
||||
@@ -26,8 +26,10 @@ extern "C" {
|
||||
@@ -21,7 +21,7 @@ index 1119fb3f97b1..b0efe96063b9 100644
|
||||
|
||||
int responsibility_spawnattrs_setdisclaim(posix_spawnattr_t attrs, int disclaim)
|
||||
API_AVAILABLE(macosx(10.14));
|
||||
@@ -95,21 +97,29 @@ class PosixSpawnFileActions {
|
||||
@@ -98,21 +100,29 @@ class PosixSpawnFileActions {
|
||||
};
|
||||
|
||||
int ChangeCurrentThreadDirectory(const char* path) {
|
||||
@@ -51,7 +51,7 @@ index 1119fb3f97b1..b0efe96063b9 100644
|
||||
}
|
||||
|
||||
struct GetAppOutputOptions {
|
||||
@@ -238,11 +238,13 @@ Process LaunchProcess(const std::vector<std::string>& argv,
|
||||
@@ -228,11 +238,13 @@ Process LaunchProcess(const std::vector<std::string>& argv,
|
||||
file_actions.Inherit(STDERR_FILENO);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,10 +42,10 @@ index 906a1ee4ac58b0744a32153bbaafeac4322a60e4..c90f4aead36cbf3767dc5094728963c2
|
||||
// another SiteInstance for the same site.
|
||||
void RegisterSiteInstance(SiteInstanceImpl* site_instance);
|
||||
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
|
||||
index b95ab6369324c29763d4320dcc4b16820a0e5e95..a0179277fe51d336cbcb19d76e28d2111926184a 100644
|
||||
index c51d888191854be22038380462dce27ea5d51319..ce07eb7a9079a16f59dddf836a9d2b705ce3d5f3 100644
|
||||
--- a/content/browser/frame_host/render_frame_host_manager.cc
|
||||
+++ b/content/browser/frame_host/render_frame_host_manager.cc
|
||||
@@ -2228,6 +2228,21 @@ bool RenderFrameHostManager::InitRenderView(
|
||||
@@ -2219,6 +2219,21 @@ bool RenderFrameHostManager::InitRenderView(
|
||||
scoped_refptr<SiteInstance>
|
||||
RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
const NavigationRequest& request) {
|
||||
@@ -67,7 +67,7 @@ index b95ab6369324c29763d4320dcc4b16820a0e5e95..a0179277fe51d336cbcb19d76e28d211
|
||||
SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance();
|
||||
|
||||
// All children of MHTML documents must be MHTML documents. They all live in
|
||||
@@ -2265,6 +2280,59 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
@@ -2263,6 +2278,59 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
request.common_params().url);
|
||||
no_renderer_swap_allowed |=
|
||||
request.from_begin_navigation() && !can_renderer_initiate_transfer;
|
||||
@@ -127,7 +127,7 @@ index b95ab6369324c29763d4320dcc4b16820a0e5e95..a0179277fe51d336cbcb19d76e28d211
|
||||
} else {
|
||||
// Subframe navigations will use the current renderer, unless specifically
|
||||
// allowed to swap processes.
|
||||
@@ -2276,23 +2344,28 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
@@ -2274,23 +2342,28 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
if (no_renderer_swap_allowed && !should_swap_for_error_isolation)
|
||||
return scoped_refptr<SiteInstance>(current_site_instance);
|
||||
|
||||
@@ -149,7 +149,7 @@ index b95ab6369324c29763d4320dcc4b16820a0e5e95..a0179277fe51d336cbcb19d76e28d211
|
||||
+ request.dest_site_instance(), candidate_site_instance.get(),
|
||||
request.common_params().transition,
|
||||
request.state() == NavigationRequest::FAILED,
|
||||
request.restore_type() != RestoreType::NONE, request.is_view_source(),
|
||||
request.GetRestoreType() != RestoreType::NONE, request.is_view_source(),
|
||||
was_server_redirect);
|
||||
|
||||
+ GetContentClient()->browser()->RegisterPendingSiteInstance(
|
||||
@@ -159,10 +159,10 @@ index b95ab6369324c29763d4320dcc4b16820a0e5e95..a0179277fe51d336cbcb19d76e28d211
|
||||
}
|
||||
|
||||
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
|
||||
index 47067d774c0490e3f0daf1f0d7ee60e4f51fc110..54aab183e80538173045c68d539c197af8b8d063 100644
|
||||
index d0d4e89f4190752fa00a575bb91842a72f4c0070..7b8d9af4005c6c7b7f4ebf0090d718fd276d012b 100644
|
||||
--- a/content/browser/site_instance_impl.cc
|
||||
+++ b/content/browser/site_instance_impl.cc
|
||||
@@ -367,6 +367,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
|
||||
@@ -368,6 +368,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
|
||||
return browsing_instance_->HasSiteInstance(url);
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ index 1edb9fd6b0c383f291735dd1a952fcb7b17cc87f..23967f040eb346be265faa2a92562e1f
|
||||
size_t GetRelatedActiveContentsCount() override;
|
||||
bool RequiresDedicatedProcess() override;
|
||||
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
||||
index 15081967b0a29316ab82746ca6fe7d188a9efc58..2f894fdcc72f9e31e62f660e2eaff686b0bde95a 100644
|
||||
index df6f9848ba8ae1e8e7c6e5415b3a4c2efaf6f055..d032d13c4395fc00ccc548d6241b298965b23d20 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -44,6 +44,21 @@
|
||||
@@ -212,10 +212,10 @@ index 15081967b0a29316ab82746ca6fe7d188a9efc58..2f894fdcc72f9e31e62f660e2eaff686
|
||||
const MainFunctionParams& parameters) {
|
||||
return nullptr;
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index 678b25401338a624dc37a11c45331d65082934e9..bed09d49f1f8ca3a14a5306144faf4ae4d1f7de9 100644
|
||||
index 7578110f13b23e9585a181bba3e73a3996f60faf..cbb1eed3af4e8b56c07786a5f35525e5dee629f4 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -205,8 +205,45 @@ struct WebPreferences;
|
||||
@@ -206,8 +206,45 @@ struct WebPreferences;
|
||||
// the observer interfaces.)
|
||||
class CONTENT_EXPORT ContentBrowserClient {
|
||||
public:
|
||||
|
||||
83
patches/chromium/gin_with_namespace.patch
Normal file
83
patches/chromium/gin_with_namespace.patch
Normal file
@@ -0,0 +1,83 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:47:44 -0700
|
||||
Subject: gin_with_namespace.patch
|
||||
|
||||
When using gin with native_mate together we may have C++ confused with
|
||||
finding the correct ConvertFromV8. We add gin:: namespace explicitly in
|
||||
those calls to work around the ambiguous compilation error.
|
||||
|
||||
Note that this is only a work around to make it easier to remove
|
||||
native_mate, and we should remove this patch once native_mate is erased
|
||||
from Electron.
|
||||
|
||||
diff --git a/gin/arguments.h b/gin/arguments.h
|
||||
index eaded13e2991..03e1495566d1 100644
|
||||
--- a/gin/arguments.h
|
||||
+++ b/gin/arguments.h
|
||||
@@ -28,14 +28,14 @@ class GIN_EXPORT Arguments {
|
||||
v8::Local<v8::Object> holder = is_for_property_
|
||||
? info_for_property_->Holder()
|
||||
: info_for_function_->Holder();
|
||||
- return ConvertFromV8(isolate_, holder, out);
|
||||
+ return gin::ConvertFromV8(isolate_, holder, out);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool GetData(T* out) {
|
||||
v8::Local<v8::Value> data = is_for_property_ ? info_for_property_->Data()
|
||||
: info_for_function_->Data();
|
||||
- return ConvertFromV8(isolate_, data, out);
|
||||
+ return gin::ConvertFromV8(isolate_, data, out);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@@ -45,7 +45,7 @@ class GIN_EXPORT Arguments {
|
||||
return false;
|
||||
}
|
||||
v8::Local<v8::Value> val = (*info_for_function_)[next_++];
|
||||
- return ConvertFromV8(isolate_, val, out);
|
||||
+ return gin::ConvertFromV8(isolate_, val, out);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@@ -58,7 +58,7 @@ class GIN_EXPORT Arguments {
|
||||
out->resize(remaining);
|
||||
for (int i = 0; i < remaining; ++i) {
|
||||
v8::Local<v8::Value> val = (*info_for_function_)[next_++];
|
||||
- if (!ConvertFromV8(isolate_, val, &out->at(i)))
|
||||
+ if (!gin::ConvertFromV8(isolate_, val, &out->at(i)))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -80,7 +80,7 @@ class GIN_EXPORT Arguments {
|
||||
template<typename T>
|
||||
void Return(T val) {
|
||||
v8::Local<v8::Value> v8_value;
|
||||
- if (!TryConvertToV8(isolate_, val, &v8_value))
|
||||
+ if (!gin::TryConvertToV8(isolate_, val, &v8_value))
|
||||
return;
|
||||
(is_for_property_ ? info_for_property_->GetReturnValue()
|
||||
: info_for_function_->GetReturnValue())
|
||||
diff --git a/gin/converter.h b/gin/converter.h
|
||||
index 27b4d0acd016..b19209a8534a 100644
|
||||
--- a/gin/converter.h
|
||||
+++ b/gin/converter.h
|
||||
@@ -250,7 +250,7 @@ std::enable_if_t<ToV8ReturnsMaybe<T>::value, bool> TryConvertToV8(
|
||||
v8::Isolate* isolate,
|
||||
const T& input,
|
||||
v8::Local<v8::Value>* output) {
|
||||
- return ConvertToV8(isolate, input).ToLocal(output);
|
||||
+ return gin::ConvertToV8(isolate, input).ToLocal(output);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@@ -258,7 +258,7 @@ std::enable_if_t<!ToV8ReturnsMaybe<T>::value, bool> TryConvertToV8(
|
||||
v8::Isolate* isolate,
|
||||
const T& input,
|
||||
v8::Local<v8::Value>* output) {
|
||||
- *output = ConvertToV8(isolate, input);
|
||||
+ *output = gin::ConvertToV8(isolate, input);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ Dont compare RC.exe and RC.py output.
|
||||
FIXME: It has to be reverted once the script is fixed.
|
||||
|
||||
diff --git a/build/toolchain/win/tool_wrapper.py b/build/toolchain/win/tool_wrapper.py
|
||||
index 1ad37129bb5663b547a1f1c32d09b9427d9d4434..6516ab892aa7032722fbe6af5991fc076314013c 100644
|
||||
index 3834cf2c01a9c63bfe7a6fc9e7549930a5eda01c..454b831a37c13fdd2fe4d8953d60dab661386f9a 100644
|
||||
--- a/build/toolchain/win/tool_wrapper.py
|
||||
+++ b/build/toolchain/win/tool_wrapper.py
|
||||
@@ -241,7 +241,11 @@ class WinTool(object):
|
||||
@@ -250,7 +250,11 @@ class WinTool(object):
|
||||
if rc_exe_exit_code == 0:
|
||||
import filecmp
|
||||
# Strip "/fo" prefix.
|
||||
|
||||
@@ -7,7 +7,7 @@ Removes usage of the _LSSetApplicationLaunchServicesServerConnectionStatus
|
||||
private API.
|
||||
|
||||
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
|
||||
index 6779f6d70c1a69cd5668cf3a328cf56a492983e2..46d92835eadd6429ea0c6a53c5a39ff04f1c2634 100644
|
||||
index d257830f5943937a634aa85539ad654310579e2c..4373f508964cb1e9fd51c952122ac2f41fb35ae9 100644
|
||||
--- a/content/gpu/gpu_main.cc
|
||||
+++ b/content/gpu/gpu_main.cc
|
||||
@@ -286,8 +286,10 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
|
||||
@@ -38,10 +38,10 @@ index 743d1364bcd13e24ecbe5ced730161d15b8c3e93..a7e81072194c00baa0aa3159a6bfe374
|
||||
// is concerned.
|
||||
@property(nonatomic, readonly) NSString* subrole;
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
||||
index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc150834055 100644
|
||||
index 62f17dcca78fc7d9f851456120f7ddde09208dbe..95ec2b203d243a33383c022506ea0a572334043d 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
|
||||
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
||||
@@ -219,6 +219,7 @@
|
||||
@@ -225,6 +225,7 @@
|
||||
// VoiceOver uses -1 to mean "no limit" for AXResultsLimit.
|
||||
const int kAXResultsLimitNoLimit = -1;
|
||||
|
||||
@@ -49,7 +49,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1
|
||||
extern "C" {
|
||||
|
||||
// The following are private accessibility APIs required for cursor navigation
|
||||
@@ -420,6 +421,7 @@ void AddMisspelledTextAttributes(const AXPlatformRange& ax_range,
|
||||
@@ -422,6 +423,7 @@ void AddMisspelledTextAttributes(const AXPlatformRange& ax_range,
|
||||
AddMisspelledTextAttributes(ax_range, attributed_text);
|
||||
return attributed_text;
|
||||
}
|
||||
@@ -57,7 +57,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1
|
||||
|
||||
// Returns an autoreleased copy of the AXNodeData's attribute.
|
||||
NSString* NSStringForStringAttribute(BrowserAccessibility* browserAccessibility,
|
||||
@@ -687,7 +689,9 @@ + (void)initialize {
|
||||
@@ -689,7 +691,9 @@ + (void)initialize {
|
||||
{NSAccessibilityEditableAncestorAttribute, @"editableAncestor"},
|
||||
{NSAccessibilityElementBusyAttribute, @"elementBusy"},
|
||||
{NSAccessibilityEnabledAttribute, @"enabled"},
|
||||
@@ -67,7 +67,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1
|
||||
{NSAccessibilityExpandedAttribute, @"expanded"},
|
||||
{NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"},
|
||||
{NSAccessibilityFocusedAttribute, @"focused"},
|
||||
@@ -722,13 +726,17 @@ + (void)initialize {
|
||||
@@ -724,13 +728,17 @@ + (void)initialize {
|
||||
{NSAccessibilityRowsAttribute, @"rows"},
|
||||
// TODO(aboxhall): expose
|
||||
// NSAccessibilityServesAsTitleForUIElementsAttribute
|
||||
@@ -85,7 +85,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1
|
||||
{NSAccessibilitySizeAttribute, @"size"},
|
||||
{NSAccessibilitySortDirectionAttribute, @"sortDirection"},
|
||||
{NSAccessibilitySubroleAttribute, @"subrole"},
|
||||
@@ -1226,6 +1234,7 @@ - (NSNumber*)enabled {
|
||||
@@ -1228,6 +1236,7 @@ - (NSNumber*)enabled {
|
||||
ax::mojom::Restriction::kDisabled];
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1
|
||||
// Returns a text marker that points to the last character in the document that
|
||||
// can be selected with VoiceOver.
|
||||
- (id)endTextMarker {
|
||||
@@ -1236,6 +1245,7 @@ - (id)endTextMarker {
|
||||
@@ -1238,6 +1247,7 @@ - (id)endTextMarker {
|
||||
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
|
||||
return CreateTextMarker(position->CreatePositionAtEndOfAnchor());
|
||||
}
|
||||
@@ -101,7 +101,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1
|
||||
|
||||
- (NSNumber*)expanded {
|
||||
if (![self instanceActive])
|
||||
@@ -2107,6 +2117,7 @@ - (NSValue*)selectedTextRange {
|
||||
@@ -2112,6 +2122,7 @@ - (NSValue*)selectedTextRange {
|
||||
return [NSValue valueWithRange:NSMakeRange(selStart, selLength)];
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1
|
||||
- (id)selectedTextMarkerRange {
|
||||
if (![self instanceActive])
|
||||
return nil;
|
||||
@@ -2142,6 +2153,7 @@ - (id)selectedTextMarkerRange {
|
||||
@@ -2147,6 +2158,7 @@ - (id)selectedTextMarkerRange {
|
||||
CreateAXPlatformRange(*anchorObject, anchorOffset, anchorAffinity,
|
||||
*focusObject, focusOffset, focusAffinity));
|
||||
}
|
||||
@@ -117,7 +117,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1
|
||||
|
||||
- (NSValue*)size {
|
||||
if (![self instanceActive])
|
||||
@@ -2174,6 +2186,7 @@ - (NSString*)sortDirection {
|
||||
@@ -2179,6 +2191,7 @@ - (NSString*)sortDirection {
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1
|
||||
// Returns a text marker that points to the first character in the document that
|
||||
// can be selected with VoiceOver.
|
||||
- (id)startTextMarker {
|
||||
@@ -2184,6 +2197,7 @@ - (id)startTextMarker {
|
||||
@@ -2189,6 +2202,7 @@ - (id)startTextMarker {
|
||||
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
|
||||
return CreateTextMarker(position->CreatePositionAtStartOfAnchor());
|
||||
}
|
||||
@@ -133,7 +133,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1
|
||||
|
||||
// Returns a subrole based upon the role.
|
||||
- (NSString*)subrole {
|
||||
@@ -2475,11 +2489,13 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
|
||||
@@ -2480,11 +2494,13 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
|
||||
NSMutableAttributedString* attributedValue =
|
||||
[[[NSMutableAttributedString alloc] initWithString:value] autorelease];
|
||||
|
||||
@@ -147,7 +147,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1
|
||||
|
||||
return [attributedValue attributedSubstringFromRange:range];
|
||||
}
|
||||
@@ -2562,9 +2578,8 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
@@ -2567,9 +2583,8 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
return ToBrowserAccessibilityCocoa(cell);
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1
|
||||
BrowserAccessibilityPositionInstance position =
|
||||
CreatePositionFromTextMarker(parameter);
|
||||
if (!position->IsNullPosition())
|
||||
@@ -2854,6 +2869,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
@@ -2859,6 +2874,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
|
||||
return CreateTextMarker(root->CreatePositionAt(index));
|
||||
}
|
||||
@@ -167,7 +167,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1
|
||||
|
||||
if ([attribute isEqualToString:
|
||||
NSAccessibilityBoundsForRangeParameterizedAttribute]) {
|
||||
@@ -2887,6 +2903,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
@@ -2892,6 +2908,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1
|
||||
if ([attribute
|
||||
isEqualToString:
|
||||
NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
|
||||
@@ -2967,6 +2984,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition(
|
||||
@@ -2972,6 +2989,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition(
|
||||
|
||||
return @(child->GetIndexInParent());
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: network_service_allow_remote_certificate_verification_logic.patch
|
||||
|
||||
|
||||
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
||||
index 41e3a4960bfa4909c54b1d3db214fa943bff65b6..781053c8650d98ee39d39e9057159f9a9c923789 100644
|
||||
index fd4c3971348e1e1b6e4368840f1271659bcdafd3..c36657fc18c705c7224e6c57c8c50b7f641060fa 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -91,6 +91,11 @@
|
||||
@@ -89,6 +89,11 @@
|
||||
#include "services/network/url_loader.h"
|
||||
#include "services/network/url_request_context_builder_mojo.h"
|
||||
|
||||
@@ -20,7 +20,7 @@ index 41e3a4960bfa4909c54b1d3db214fa943bff65b6..781053c8650d98ee39d39e9057159f9a
|
||||
#if BUILDFLAG(IS_CT_SUPPORTED)
|
||||
#include "components/certificate_transparency/chrome_ct_policy_enforcer.h"
|
||||
#include "components/certificate_transparency/chrome_require_ct_delegate.h"
|
||||
@@ -319,6 +324,75 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) {
|
||||
@@ -317,6 +322,79 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) {
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -30,8 +30,12 @@ index 41e3a4960bfa4909c54b1d3db214fa943bff65b6..781053c8650d98ee39d39e9057159f9a
|
||||
+ }
|
||||
+ ~RemoteCertVerifier() override = default;
|
||||
+
|
||||
+ void Bind(mojom::CertVerifierClientPtr client_info) {
|
||||
+ client_ = std::move(client_info);
|
||||
+ void Bind(
|
||||
+ mojo::PendingRemote<mojom::CertVerifierClient> client_info) {
|
||||
+ client_.reset();
|
||||
+ if (client_info.is_valid()) {
|
||||
+ client_.Bind(std::move(client_info));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // CertVerifier implementation
|
||||
@@ -60,7 +64,7 @@ index 41e3a4960bfa4909c54b1d3db214fa943bff65b6..781053c8650d98ee39d39e9057159f9a
|
||||
+ }
|
||||
+
|
||||
+ void OnRequestFinished(const RequestParams& params, net::CompletionOnceCallback callback, net::CertVerifyResult* verify_result, int error) {
|
||||
+ if (client_) {
|
||||
+ if (client_.is_bound()) {
|
||||
+ client_->Verify(error, *verify_result, params.certificate(),
|
||||
+ params.hostname(), params.flags(), params.ocsp_response(),
|
||||
+ base::BindOnce(&RemoteCertVerifier::OnRemoteResponse,
|
||||
@@ -90,17 +94,18 @@ index 41e3a4960bfa4909c54b1d3db214fa943bff65b6..781053c8650d98ee39d39e9057159f9a
|
||||
+ }
|
||||
+ private:
|
||||
+ std::unique_ptr<net::CertVerifier> upstream_;
|
||||
+ mojom::CertVerifierClientPtr client_;
|
||||
+ mojo::Remote<mojom::CertVerifierClient> client_;
|
||||
+};
|
||||
+
|
||||
constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
|
||||
constexpr bool NetworkContext::enable_resource_scheduler_;
|
||||
|
||||
@@ -650,6 +724,12 @@ void NetworkContext::SetClient(mojom::NetworkContextClientPtr client) {
|
||||
client_ = std::move(client);
|
||||
NetworkContext::PendingCertVerify::PendingCertVerify() = default;
|
||||
@@ -466,6 +544,13 @@ void NetworkContext::SetClient(
|
||||
client_.Bind(std::move(client));
|
||||
}
|
||||
|
||||
+void NetworkContext::SetCertVerifierClient(mojom::CertVerifierClientPtr client) {
|
||||
+void NetworkContext::SetCertVerifierClient(
|
||||
+ mojo::PendingRemote<mojom::CertVerifierClient> client) {
|
||||
+ if (remote_cert_verifier_) {
|
||||
+ remote_cert_verifier_->Bind(std::move(client));
|
||||
+ }
|
||||
@@ -109,8 +114,8 @@ index 41e3a4960bfa4909c54b1d3db214fa943bff65b6..781053c8650d98ee39d39e9057159f9a
|
||||
void NetworkContext::CreateURLLoaderFactory(
|
||||
mojom::URLLoaderFactoryRequest request,
|
||||
mojom::URLLoaderFactoryParamsPtr params) {
|
||||
@@ -1727,12 +1807,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
|
||||
cert_net_fetcher_, /*system_trust_store_provider=*/nullptr)));
|
||||
@@ -1541,12 +1626,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
|
||||
net::SystemTrustStoreProvider::CreateDefaultForSSL())));
|
||||
}
|
||||
#endif
|
||||
- if (!cert_verifier)
|
||||
@@ -131,10 +136,10 @@ index 41e3a4960bfa4909c54b1d3db214fa943bff65b6..781053c8650d98ee39d39e9057159f9a
|
||||
+
|
||||
+ builder.SetCertVerifier(std::move(cert_verifier));
|
||||
|
||||
std::unique_ptr<net::NetworkDelegate> network_delegate =
|
||||
std::make_unique<NetworkServiceNetworkDelegate>(this);
|
||||
std::unique_ptr<NetworkServiceNetworkDelegate> network_delegate =
|
||||
std::make_unique<NetworkServiceNetworkDelegate>(
|
||||
diff --git a/services/network/network_context.h b/services/network/network_context.h
|
||||
index 12806873427b070beed2ec3a2a02c58791aa126d..b64485726b76b5a2939a33b9dd3a193d4fff8f6d 100644
|
||||
index 21dd391b7330c362e3795fddc2943ed6832d0383..581196b6d4a0054bc213e4eada1a97a8e0453c5f 100644
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -80,6 +80,7 @@ class DomainReliabilityMonitor;
|
||||
@@ -145,15 +150,16 @@ index 12806873427b070beed2ec3a2a02c58791aa126d..b64485726b76b5a2939a33b9dd3a193d
|
||||
class CookieManager;
|
||||
class ExpectCTReporter;
|
||||
class HostResolver;
|
||||
@@ -165,6 +166,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
|
||||
@@ -169,6 +170,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
// mojom::NetworkContext implementation:
|
||||
void SetClient(mojom::NetworkContextClientPtr client) override;
|
||||
+ void SetCertVerifierClient(mojom::CertVerifierClientPtr client) override;
|
||||
void SetClient(
|
||||
mojo::PendingRemote<mojom::NetworkContextClient> client) override;
|
||||
+ void SetCertVerifierClient(
|
||||
+ mojo::PendingRemote<mojom::CertVerifierClient> client) override;
|
||||
void CreateURLLoaderFactory(mojom::URLLoaderFactoryRequest request,
|
||||
mojom::URLLoaderFactoryParamsPtr params) override;
|
||||
void ResetURLLoaderFactories() override;
|
||||
@@ -556,6 +558,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
@@ -560,6 +563,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
std::unique_ptr<network::NSSTempCertsCacheChromeOS> nss_temp_certs_cache_;
|
||||
#endif
|
||||
|
||||
@@ -163,11 +169,11 @@ index 12806873427b070beed2ec3a2a02c58791aa126d..b64485726b76b5a2939a33b9dd3a193d
|
||||
// CertNetFetcher is not used by the current platform.
|
||||
scoped_refptr<net::CertNetFetcherImpl> cert_net_fetcher_;
|
||||
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
|
||||
index 59c05e850bba0c30871fb40f898e9f0b9ce7af36..cd617733773b81aa2e57176c46f392a6a124b7c9 100644
|
||||
index fe7ed5d396d9cba480a785f46d0df471c117c86e..6b7571dbf1464284ce30953a27c1ac2099f1872f 100644
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -162,6 +162,17 @@ interface TrustedURLLoaderHeaderClient {
|
||||
OnLoaderCreated(int32 request_id, TrustedHeaderClient& header_client);
|
||||
@@ -165,6 +165,17 @@ interface TrustedURLLoaderHeaderClient {
|
||||
pending_receiver<TrustedHeaderClient> header_client);
|
||||
};
|
||||
|
||||
+interface CertVerifierClient {
|
||||
@@ -184,12 +190,12 @@ index 59c05e850bba0c30871fb40f898e9f0b9ce7af36..cd617733773b81aa2e57176c46f392a6
|
||||
// Parameters for constructing a network context.
|
||||
struct NetworkContextParams {
|
||||
// Name used by memory tools to identify the context.
|
||||
@@ -587,6 +598,9 @@ interface NetworkContext {
|
||||
@@ -727,6 +738,9 @@ interface NetworkContext {
|
||||
// Sets a client for this network context.
|
||||
SetClient(NetworkContextClient client);
|
||||
SetClient(pending_remote<NetworkContextClient> client);
|
||||
|
||||
+ // Sets a certificate verifier client for this network context.
|
||||
+ SetCertVerifierClient(CertVerifierClient? client);
|
||||
+ SetCertVerifierClient(pending_remote<CertVerifierClient>? client);
|
||||
+
|
||||
// Creates a new URLLoaderFactory with the given |params|.
|
||||
CreateURLLoaderFactory(URLLoaderFactory& url_loader_factory,
|
||||
|
||||
@@ -55,7 +55,7 @@ index 5253f6be778cc78571b3df0a33d364a9b1e6ef52..dc5307e6500b0bfb5da83e8d8ff8886b
|
||||
|
||||
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
|
||||
diff --git a/content/browser/notifications/blink_notification_service_impl_unittest.cc b/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
||||
index f64eb733ede38501c34b2af89f42255189abd982..3c2dfad7ac9ba64b0b49ebef41a303edd1470cb1 100644
|
||||
index ce997528ce2973b54dbbf965220cc30bcb19a094..e84b0b62d853b044e590a0c764f1b21ad3210886 100644
|
||||
--- a/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
||||
+++ b/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
||||
@@ -138,7 +138,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test {
|
||||
@@ -108,10 +108,10 @@ index 4bf25bf1fa69f7d3869369172d375e2e489e62a1..f80ef2cecc8b111dc54e109646573a59
|
||||
mojo::PendingReceiver<blink::mojom::NotificationService> receiver);
|
||||
|
||||
diff --git a/content/browser/renderer_interface_binders.cc b/content/browser/renderer_interface_binders.cc
|
||||
index 63e8a6a260c0a63d4eee365330352b3112878384..2d20c32e631bc7edf51f02d7d10e8fbbf1516f90 100644
|
||||
index cf4be3849726b3beb1dd47b8c44f7524e7ee2014..14e7551d62688dc59a24eb67a29f7ab05eb44527 100644
|
||||
--- a/content/browser/renderer_interface_binders.cc
|
||||
+++ b/content/browser/renderer_interface_binders.cc
|
||||
@@ -200,7 +200,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
|
||||
@@ -231,7 +231,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
|
||||
RenderProcessHost* host, const url::Origin& origin) {
|
||||
static_cast<StoragePartitionImpl*>(host->GetStoragePartition())
|
||||
->GetPlatformNotificationContext()
|
||||
@@ -142,10 +142,10 @@ index ca61088079c4150fcf389504ddcf26bcf6bf69cd..d9c034c39890eef1fe3d95c6d7c0ae68
|
||||
const GURL& origin,
|
||||
const blink::PlatformNotificationData& notification_data,
|
||||
diff --git a/content/test/mock_platform_notification_service.cc b/content/test/mock_platform_notification_service.cc
|
||||
index ba5982883a3821b42c47c80187af2e4d1b3f0ffb..720965aa1df6b415e12a85dd2b2e4475facab019 100644
|
||||
index 73a1af201b12bf818af2eafadad478b8c422826c..fc7e74c0bf900d475fc134a7b606c5f9e404f934 100644
|
||||
--- a/content/test/mock_platform_notification_service.cc
|
||||
+++ b/content/test/mock_platform_notification_service.cc
|
||||
@@ -29,6 +29,7 @@ MockPlatformNotificationService::MockPlatformNotificationService(
|
||||
@@ -31,6 +31,7 @@ MockPlatformNotificationService::MockPlatformNotificationService(
|
||||
MockPlatformNotificationService::~MockPlatformNotificationService() = default;
|
||||
|
||||
void MockPlatformNotificationService::DisplayNotification(
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: out_of_process_instance.patch
|
||||
|
||||
|
||||
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
|
||||
index 9c77f6422edbb42da34abb4320e0d5103cca5eea..8419b1ce6ed543b150c31d41dc8575e98c203427 100644
|
||||
index c6b9448faffb8b66c45c643b6fd756e6bc6a32e1..834f387c2f17bfab48a451f0eec634682e97e82d 100644
|
||||
--- a/pdf/out_of_process_instance.cc
|
||||
+++ b/pdf/out_of_process_instance.cc
|
||||
@@ -477,7 +477,9 @@ bool OutOfProcessInstance::Init(uint32_t argc,
|
||||
@@ -478,7 +478,9 @@ bool OutOfProcessInstance::Init(uint32_t argc,
|
||||
std::string document_url = document_url_var.AsString();
|
||||
base::StringPiece document_url_piece(document_url);
|
||||
is_print_preview_ = IsPrintPreviewUrl(document_url_piece);
|
||||
|
||||
@@ -61,7 +61,7 @@ index 37245c48cacbc5db164c61e4499f34ee83e0fce7..0fef12892e965e319e45f5dd1a9c5c9f
|
||||
+ return PP_OK;
|
||||
}
|
||||
diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
|
||||
index c6c2ac11fd5551fe03978b947d2dda4c016e59ae..2dc392a6eab17b048df730e294398a3a0fb2eb8d 100644
|
||||
index 91c1562d9894e57fd5c3abfde157127144b31a91..8f4caca848d649db9bd26a4ce37509b29865f3c1 100644
|
||||
--- a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
|
||||
+++ b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
|
||||
@@ -8,9 +8,11 @@
|
||||
@@ -132,10 +132,10 @@ index c6c2ac11fd5551fe03978b947d2dda4c016e59ae..2dc392a6eab17b048df730e294398a3a
|
||||
device::mojom::WakeLock* PepperFlashBrowserHost::GetWakeLock() {
|
||||
// Here is a lazy binding, and will not reconnect after connection error.
|
||||
diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h
|
||||
index f2f40b636a41649199a38c663f03e6182df82520..41d11d1f1f9921d4b4deaaf4b2d8ab4be910e8fe 100644
|
||||
index 6b13bae8def62d9a26d68ac8396b4bf6f7439c1a..d92b5a5855c0cebf94922a31f686e15e3a6cd833 100644
|
||||
--- a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h
|
||||
+++ b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h
|
||||
@@ -23,9 +23,11 @@ namespace content {
|
||||
@@ -24,9 +24,11 @@ namespace content {
|
||||
class BrowserPpapiHost;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ index f2f40b636a41649199a38c663f03e6182df82520..41d11d1f1f9921d4b4deaaf4b2d8ab4b
|
||||
|
||||
class GURL;
|
||||
|
||||
@@ -49,15 +51,19 @@ class PepperFlashBrowserHost : public ppapi::host::ResourceHost {
|
||||
@@ -50,15 +52,19 @@ class PepperFlashBrowserHost : public ppapi::host::ResourceHost {
|
||||
const base::Time& t);
|
||||
int32_t OnGetLocalDataRestrictions(ppapi::host::HostMessageContext* context);
|
||||
|
||||
@@ -167,8 +167,8 @@ index f2f40b636a41649199a38c663f03e6182df82520..41d11d1f1f9921d4b4deaaf4b2d8ab4b
|
||||
int render_process_id_;
|
||||
|
||||
// Requests a wake lock to prevent going to sleep, and a timer to cancel it
|
||||
@@ -65,8 +71,10 @@ class PepperFlashBrowserHost : public ppapi::host::ResourceHost {
|
||||
device::mojom::WakeLockPtr wake_lock_;
|
||||
@@ -66,8 +72,10 @@ class PepperFlashBrowserHost : public ppapi::host::ResourceHost {
|
||||
mojo::Remote<device::mojom::WakeLock> wake_lock_;
|
||||
base::DelayTimer delay_timer_;
|
||||
|
||||
+#if 0
|
||||
|
||||
@@ -9,45 +9,32 @@ index 8e4deafa1746eeb48802a0503fefb37bedb33d04..127c62efd2327e1f3f09e9b93a0b8344
|
||||
--- a/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc
|
||||
+++ b/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
#include "chrome/browser/ui/views/overlay/back_to_tab_image_button.h"
|
||||
|
||||
|
||||
-#include "chrome/grit/generated_resources.h"
|
||||
+#include "electron/grit/electron_resources.h"
|
||||
#include "third_party/skia/include/core/SkColor.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/gfx/color_palette.h"
|
||||
diff --git a/chrome/browser/ui/views/overlay/close_image_button.cc b/chrome/browser/ui/views/overlay/close_image_button.cc
|
||||
index 0aca25164dcad26cc000e289d6eb9010e336e6fc..70114b5aa865b96d3ace898d1faf515b9098abd9 100644
|
||||
index e9b64a823ae7e25361f37190d247af0fa6a6f68a..43fdb0ad50d2b11a1bc28aa0f358c6dd6feb72b8 100644
|
||||
--- a/chrome/browser/ui/views/overlay/close_image_button.cc
|
||||
+++ b/chrome/browser/ui/views/overlay/close_image_button.cc
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
#include "chrome/browser/ui/views/overlay/close_image_button.h"
|
||||
|
||||
|
||||
-#include "chrome/grit/generated_resources.h"
|
||||
+#include "electron/grit/electron_resources.h"
|
||||
#include "third_party/skia/include/core/SkColor.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/gfx/color_palette.h"
|
||||
diff --git a/chrome/browser/ui/views/overlay/mute_image_button.cc b/chrome/browser/ui/views/overlay/mute_image_button.cc
|
||||
index 8c88ef08dd5165c0429dd90e8a76b711ac15a4df..ebdb06a6391b8108fa51796a4ad5f3a8ca489b60 100644
|
||||
--- a/chrome/browser/ui/views/overlay/mute_image_button.cc
|
||||
+++ b/chrome/browser/ui/views/overlay/mute_image_button.cc
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "chrome/browser/ui/views/overlay/mute_image_button.h"
|
||||
|
||||
#include "chrome/app/vector_icons/vector_icons.h"
|
||||
-#include "chrome/grit/generated_resources.h"
|
||||
+#include "electron/grit/electron_resources.h"
|
||||
#include "components/vector_icons/vector_icons.h"
|
||||
#include "third_party/skia/include/core/SkColor.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
diff --git a/chrome/browser/ui/views/overlay/overlay_window_views.cc b/chrome/browser/ui/views/overlay/overlay_window_views.cc
|
||||
index 780863193ca12ec1295752969dfc47ac06a9ae64..e2947b893cfcdb1beaa27beac80a1885ed011ce4 100644
|
||||
index 027fb9dddff339e67600b83c79c209656d210a90..e9dfd515aadfb4442da7a7b574a3891fe2a8d8bb 100644
|
||||
--- a/chrome/browser/ui/views/overlay/overlay_window_views.cc
|
||||
+++ b/chrome/browser/ui/views/overlay/overlay_window_views.cc
|
||||
@@ -20,7 +20,7 @@
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "chrome/browser/ui/views/overlay/resize_handle_button.h"
|
||||
#include "chrome/browser/ui/views/overlay/skip_ad_label_button.h"
|
||||
#include "chrome/browser/ui/views/overlay/track_image_button.h"
|
||||
@@ -62,7 +49,7 @@ index d9e5174ed622fb030bc37d32fbb40b132d7c4c23..1bf19c344721e74bb29c11a4c5c762a7
|
||||
+++ b/chrome/browser/ui/views/overlay/playback_image_button.cc
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "chrome/browser/ui/views/overlay/playback_image_button.h"
|
||||
|
||||
|
||||
#include "chrome/app/vector_icons/vector_icons.h"
|
||||
-#include "chrome/grit/generated_resources.h"
|
||||
+#include "electron/grit/electron_resources.h"
|
||||
@@ -70,12 +57,12 @@ index d9e5174ed622fb030bc37d32fbb40b132d7c4c23..1bf19c344721e74bb29c11a4c5c762a7
|
||||
#include "third_party/skia/include/core/SkColor.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
diff --git a/chrome/browser/ui/views/overlay/resize_handle_button.cc b/chrome/browser/ui/views/overlay/resize_handle_button.cc
|
||||
index ee6b3612d7bdda591e05e5af338a80167ce6cd53..af093f14f1ef49c6de7228b296c32532203ca568 100644
|
||||
index aeba6fba215677c2c54a40791986c464fa112486..ebcef6ab0b651c274aa530b1e8d25d3eebcf4f3f 100644
|
||||
--- a/chrome/browser/ui/views/overlay/resize_handle_button.cc
|
||||
+++ b/chrome/browser/ui/views/overlay/resize_handle_button.cc
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "chrome/browser/ui/views/overlay/resize_handle_button.h"
|
||||
|
||||
|
||||
#include "chrome/app/vector_icons/vector_icons.h"
|
||||
-#include "chrome/grit/generated_resources.h"
|
||||
+#include "electron/grit/electron_resources.h"
|
||||
@@ -87,9 +74,9 @@ index da780c96bb757d7382df5f419e2c0fd644ac72b0..ae520bcf73cf6c39ca428c03975746e2
|
||||
--- a/chrome/browser/ui/views/overlay/skip_ad_label_button.cc
|
||||
+++ b/chrome/browser/ui/views/overlay/skip_ad_label_button.cc
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
#include "chrome/browser/ui/views/overlay/skip_ad_label_button.h"
|
||||
|
||||
|
||||
-#include "chrome/grit/generated_resources.h"
|
||||
+#include "electron/grit/electron_resources.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
@@ -101,7 +88,7 @@ index 8f42277409a216f81d21723eb03045ac54525b0e..f7a15bfde9a43c15b18e8afbd60a0b19
|
||||
+++ b/chrome/browser/ui/views/overlay/track_image_button.cc
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "chrome/browser/ui/views/overlay/track_image_button.h"
|
||||
|
||||
|
||||
#include "chrome/app/vector_icons/vector_icons.h"
|
||||
-#include "chrome/grit/generated_resources.h"
|
||||
+#include "electron/grit/electron_resources.h"
|
||||
|
||||
@@ -8,10 +8,10 @@ this patch removes that dependency so we can reuse it.
|
||||
Ideally we would change this class in upstream to not depend on Profile.
|
||||
|
||||
diff --git a/chrome/browser/predictors/preconnect_manager.cc b/chrome/browser/predictors/preconnect_manager.cc
|
||||
index cdee4d11f2d2..7312fb4e4ea5 100644
|
||||
index c3c7d4220f7ea612e5b86645854e4f426066e18c..969dd6659bfdc0fa3cf3edf494f1623ba10134a5 100644
|
||||
--- a/chrome/browser/predictors/preconnect_manager.cc
|
||||
+++ b/chrome/browser/predictors/preconnect_manager.cc
|
||||
@@ -71,7 +71,7 @@ PreresolveJob::PreresolveJob(PreresolveJob&& other) = default;
|
||||
@@ -70,7 +70,7 @@ PreresolveJob::PreresolveJob(PreresolveJob&& other) = default;
|
||||
PreresolveJob::~PreresolveJob() = default;
|
||||
|
||||
PreconnectManager::PreconnectManager(base::WeakPtr<Delegate> delegate,
|
||||
@@ -20,7 +20,7 @@ index cdee4d11f2d2..7312fb4e4ea5 100644
|
||||
: delegate_(std::move(delegate)),
|
||||
profile_(profile),
|
||||
inflight_preresolves_count_(0) {
|
||||
@@ -327,11 +327,13 @@ network::mojom::NetworkContext* PreconnectManager::GetNetworkContext() const {
|
||||
@@ -317,11 +317,13 @@ network::mojom::NetworkContext* PreconnectManager::GetNetworkContext() const {
|
||||
if (network_context_)
|
||||
return network_context_;
|
||||
|
||||
@@ -35,7 +35,7 @@ index cdee4d11f2d2..7312fb4e4ea5 100644
|
||||
return content::BrowserContext::GetDefaultStoragePartition(profile_)
|
||||
->GetNetworkContext();
|
||||
diff --git a/chrome/browser/predictors/preconnect_manager.h b/chrome/browser/predictors/preconnect_manager.h
|
||||
index 51a842d2e44f..097316e0cfb6 100644
|
||||
index e35163576b55d772098ae2a2138c4c1cf8438eac..70cad725f9476175b31859867c640ca8c66816a8 100644
|
||||
--- a/chrome/browser/predictors/preconnect_manager.h
|
||||
+++ b/chrome/browser/predictors/preconnect_manager.h
|
||||
@@ -22,6 +22,10 @@
|
||||
@@ -58,7 +58,7 @@ index 51a842d2e44f..097316e0cfb6 100644
|
||||
virtual ~PreconnectManager();
|
||||
|
||||
// Starts preconnect and preresolve jobs keyed by |url|.
|
||||
@@ -202,7 +206,7 @@ class PreconnectManager {
|
||||
@@ -196,7 +200,7 @@ class PreconnectManager {
|
||||
network::mojom::NetworkContext* GetNetworkContext() const;
|
||||
|
||||
base::WeakPtr<Delegate> delegate_;
|
||||
|
||||
@@ -61,7 +61,7 @@ index 13f9d7af3ae796ecec3a9189aa59f4b20171fd7a..9c35b294340cce070a9f428dac6aa587
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
|
||||
index 97079241f54b876c6863097ab523daed4884f410..628a3892a6f5de1247313b64a00cdae2a8557c57 100644
|
||||
index 7d1e56b3b1a8691477598b0103e2c69c171ec2c8..980971e2b8dd143fde3376f17352f672f2c3a8ad 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.cc
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.cc
|
||||
@@ -27,10 +27,7 @@
|
||||
@@ -180,16 +180,16 @@ index 97079241f54b876c6863097ab523daed4884f410..628a3892a6f5de1247313b64a00cdae2
|
||||
|
||||
// We can't print if there is no renderer.
|
||||
if (!web_contents()->GetRenderViewHost() ||
|
||||
@@ -554,8 +561,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
DCHECK(!print_job_);
|
||||
print_job_ = base::MakeRefCounted<PrintJob>();
|
||||
print_job_->Initialize(std::move(query), RenderSourceName(), number_pages_);
|
||||
@@ -558,8 +565,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
print_job_->SetSource(PrintJob::Source::PRINT_PREVIEW, /*source_id=*/"");
|
||||
#endif // defined(OS_CHROMEOS)
|
||||
|
||||
- registrar_.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
||||
- content::Source<PrintJob>(print_job_.get()));
|
||||
printing_succeeded_ = false;
|
||||
return true;
|
||||
}
|
||||
@@ -604,6 +609,13 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
@@ -608,6 +613,13 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
content::RenderFrameHost* rfh = printing_rfh_;
|
||||
printing_rfh_ = nullptr;
|
||||
|
||||
@@ -203,7 +203,7 @@ index 97079241f54b876c6863097ab523daed4884f410..628a3892a6f5de1247313b64a00cdae2
|
||||
if (!print_job_)
|
||||
return;
|
||||
|
||||
@@ -613,8 +625,9 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
@@ -617,8 +629,9 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
rfh->Send(msg.release());
|
||||
}
|
||||
|
||||
@@ -215,9 +215,9 @@ index 97079241f54b876c6863097ab523daed4884f410..628a3892a6f5de1247313b64a00cdae2
|
||||
// Don't close the worker thread.
|
||||
print_job_ = nullptr;
|
||||
}
|
||||
@@ -684,6 +697,9 @@ bool PrintViewManagerBase::PrintNowInternal(
|
||||
@@ -693,6 +706,9 @@ bool PrintViewManagerBase::PrintNowInternal(
|
||||
// Don't print / print preview interstitials or crashed tabs.
|
||||
if (web_contents()->ShowingInterstitialPage() || web_contents()->IsCrashed())
|
||||
if (IsInterstitialOrCrashed())
|
||||
return false;
|
||||
+
|
||||
+ registrar_.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
||||
@@ -226,7 +226,7 @@ index 97079241f54b876c6863097ab523daed4884f410..628a3892a6f5de1247313b64a00cdae2
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
|
||||
index 49d3f53ec30e9c9c86f8399511a7086afa4342e1..ea5791daf2f3941b5da8ecae28f5b3eb661858e2 100644
|
||||
index af49d3e2f8abaf7dc4d82dc3f9beccdf4fbd9f18..dd9eb11d31b4ee3d415b1fca7d97872da132203d 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.h
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.h
|
||||
@@ -33,6 +33,8 @@ class PrintJob;
|
||||
@@ -249,7 +249,7 @@ index 49d3f53ec30e9c9c86f8399511a7086afa4342e1..ea5791daf2f3941b5da8ecae28f5b3eb
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
// Prints the document in |print_data| with settings specified in
|
||||
@@ -198,9 +202,15 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
||||
@@ -206,9 +210,15 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
||||
// The current RFH that is printing with a system printing dialog.
|
||||
content::RenderFrameHost* printing_rfh_;
|
||||
|
||||
@@ -378,10 +378,10 @@ index 9fbea6d0a2dbe55b1d600fbc217dee5aa8ae8cd5..de9bd267e408c02fd4da7d903523c0e6
|
||||
// content::BrowserMessageFilter:
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
diff --git a/components/printing/common/print_messages.h b/components/printing/common/print_messages.h
|
||||
index a134a000bd3ccb229a26b3e2cb3425f91a85618e..fd768d372ac15be9b0553fd7d98ce5e27ed19f5a 100644
|
||||
index f9f5d1c07e4068d0706770ca81bd92ce166c3822..9f0e079b941296fa27b8cf0a66abfa45a6183b42 100644
|
||||
--- a/components/printing/common/print_messages.h
|
||||
+++ b/components/printing/common/print_messages.h
|
||||
@@ -368,7 +368,9 @@ IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu)
|
||||
@@ -365,7 +365,9 @@ IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu)
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
// Tells the RenderFrame to switch the CSS to print media type, renders every
|
||||
// requested pages and switch back the CSS to display media type.
|
||||
@@ -393,18 +393,18 @@ index a134a000bd3ccb229a26b3e2cb3425f91a85618e..fd768d372ac15be9b0553fd7d98ce5e2
|
||||
// Like PrintMsg_PrintPages, but using the print preview document's frame/node.
|
||||
IPC_MESSAGE_ROUTED0(PrintMsg_PrintForSystemDialog)
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
|
||||
index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a6947384f8e4 100644
|
||||
index fa6f27bf54f1877438a106961b6d236c771d6800..aeb45309624b0ddce874bb85db3f0cea2c48245a 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -37,6 +37,7 @@
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "printing/metafile_skia.h"
|
||||
+#include "printing/print_settings.h"
|
||||
#include "printing/units.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
|
||||
#include "third_party/blink/public/common/frame/frame_owner_element_type.h"
|
||||
#include "third_party/blink/public/common/frame/sandbox_flags.h"
|
||||
@@ -1117,7 +1118,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
@@ -1146,7 +1147,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
web_frame->DispatchBeforePrintEvent();
|
||||
if (!weak_this)
|
||||
return;
|
||||
@@ -414,8 +414,8 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694
|
||||
if (weak_this)
|
||||
web_frame->DispatchAfterPrintEvent();
|
||||
}
|
||||
@@ -1165,7 +1167,9 @@ void PrintRenderFrameHelper::OnDestruct() {
|
||||
delete this;
|
||||
@@ -1224,7 +1226,9 @@ void PrintRenderFrameHelper::InitiatePrintPreview(
|
||||
#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
}
|
||||
|
||||
-void PrintRenderFrameHelper::OnPrintPages() {
|
||||
@@ -425,7 +425,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694
|
||||
if (ipc_nesting_level_ > 1)
|
||||
return;
|
||||
|
||||
@@ -1178,7 +1182,8 @@ void PrintRenderFrameHelper::OnPrintPages() {
|
||||
@@ -1237,7 +1241,8 @@ void PrintRenderFrameHelper::OnPrintPages() {
|
||||
// If we are printing a PDF extension frame, find the plugin node and print
|
||||
// that instead.
|
||||
auto plugin = delegate_->GetPdfElement(frame);
|
||||
@@ -435,7 +435,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694
|
||||
if (weak_this)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1195,7 +1200,7 @@ void PrintRenderFrameHelper::OnPrintForSystemDialog() {
|
||||
@@ -1254,7 +1259,7 @@ void PrintRenderFrameHelper::OnPrintForSystemDialog() {
|
||||
}
|
||||
auto weak_this = weak_ptr_factory_.GetWeakPtr();
|
||||
Print(frame, print_preview_context_.source_node(),
|
||||
@@ -444,7 +444,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694
|
||||
if (weak_this)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1231,6 +1236,8 @@ void PrintRenderFrameHelper::OnPrintPreview(
|
||||
@@ -1290,6 +1295,8 @@ void PrintRenderFrameHelper::OnPrintPreview(
|
||||
if (ipc_nesting_level_ > 1)
|
||||
return;
|
||||
|
||||
@@ -453,7 +453,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694
|
||||
print_preview_context_.OnPrintPreview();
|
||||
|
||||
UMA_HISTOGRAM_ENUMERATION("PrintPreview.PreviewEvent",
|
||||
@@ -1623,7 +1630,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -1663,7 +1670,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
|
||||
@@ -464,7 +464,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694
|
||||
// Check if |this| is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -1634,7 +1643,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -1674,7 +1683,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
@@ -475,7 +475,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694
|
||||
// If still not finished with earlier print request simply ignore.
|
||||
if (prep_frame_view_)
|
||||
return;
|
||||
@@ -1642,7 +1653,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -1682,7 +1693,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
FrameReference frame_ref(frame);
|
||||
|
||||
int expected_page_count = 0;
|
||||
@@ -484,7 +484,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694
|
||||
DidFinishPrinting(FAIL_PRINT_INIT);
|
||||
return; // Failed to init print page settings.
|
||||
}
|
||||
@@ -1662,8 +1673,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -1702,8 +1713,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
|
||||
PrintMsg_PrintPages_Params print_settings;
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
@@ -498,7 +498,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694
|
||||
// Check if |this| is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -1870,10 +1884,23 @@ std::vector<int> PrintRenderFrameHelper::GetPrintedPages(
|
||||
@@ -1910,10 +1924,23 @@ std::vector<int> PrintRenderFrameHelper::GetPrintedPages(
|
||||
return printed_pages;
|
||||
}
|
||||
|
||||
@@ -525,7 +525,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694
|
||||
// Check if the printer returned any settings, if the settings is empty, we
|
||||
// can safely assume there are no printer drivers configured. So we safely
|
||||
// terminate.
|
||||
@@ -1893,12 +1920,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
@@ -1933,12 +1960,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -545,11 +545,11 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694
|
||||
Send(new PrintHostMsg_ShowInvalidPrinterSettingsError(routing_id()));
|
||||
return false;
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h
|
||||
index 71c0c15217b62cd7a6087c6d9ae50481f9041d5f..18d853d7f808aaf816de86e8c5b8231738d16f55 100644
|
||||
index a4f11e5e5ab7e00522fff073d89b5e7638a19d21..1d94e895ff1d8b86e8e8e6a4189b08471e2728d5 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.h
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.h
|
||||
@@ -193,7 +193,8 @@ class PrintRenderFrameHelper
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
@@ -204,7 +204,8 @@ class PrintRenderFrameHelper
|
||||
bool has_selection) override;
|
||||
|
||||
// Message handlers ---------------------------------------------------------
|
||||
- void OnPrintPages();
|
||||
@@ -557,8 +557,8 @@ index 71c0c15217b62cd7a6087c6d9ae50481f9041d5f..18d853d7f808aaf816de86e8c5b82317
|
||||
+ const base::DictionaryValue& settings);
|
||||
void OnPrintForSystemDialog();
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
void OnInitiatePrintPreview(bool has_selection);
|
||||
@@ -243,7 +244,9 @@ class PrintRenderFrameHelper
|
||||
void OnPrintPreview(const base::DictionaryValue& settings);
|
||||
@@ -253,7 +254,9 @@ class PrintRenderFrameHelper
|
||||
// WARNING: |this| may be gone after this method returns.
|
||||
void Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
@@ -569,7 +569,7 @@ index 71c0c15217b62cd7a6087c6d9ae50481f9041d5f..18d853d7f808aaf816de86e8c5b82317
|
||||
|
||||
// Notification when printing is done - signal tear-down/free resources.
|
||||
void DidFinishPrinting(PrintingResult result);
|
||||
@@ -252,12 +255,14 @@ class PrintRenderFrameHelper
|
||||
@@ -262,12 +265,14 @@ class PrintRenderFrameHelper
|
||||
|
||||
// Initialize print page settings with default settings.
|
||||
// Used only for native printing workflow.
|
||||
@@ -587,7 +587,7 @@ index 71c0c15217b62cd7a6087c6d9ae50481f9041d5f..18d853d7f808aaf816de86e8c5b82317
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
// Set options for print preset from source PDF document.
|
||||
diff --git a/printing/print_settings_conversion.cc b/printing/print_settings_conversion.cc
|
||||
index 17c363ff9aa2e2262cacd0c9baea3820334bf67b..5b02461c2e9afe254405ddacd904e4bdbddd0b8b 100644
|
||||
index 7403d3ea6200e2443ca23cb483c2a36fa6ff5027..05fcb8c2ef6d1074cf37b8974830d3fe1dd6e011 100644
|
||||
--- a/printing/print_settings_conversion.cc
|
||||
+++ b/printing/print_settings_conversion.cc
|
||||
@@ -184,11 +184,12 @@ bool PrintSettingsFromJobSettings(const base::Value& job_settings,
|
||||
@@ -618,7 +618,7 @@ index cd5c27c87df175676504a06b4e1904f6b836dc90..c4f6acf66bc69f1e7db633aa5b3b03a9
|
||||
NOTREACHED();
|
||||
return OnError();
|
||||
diff --git a/printing/printing_context.h b/printing/printing_context.h
|
||||
index 6a5a7c90ef5b..a033c58076ff 100644
|
||||
index 6a5a7c90ef5ba82837095c7bb934881b108797f7..a033c58076ff229ae45ed7c454fc60a57e5707b7 100644
|
||||
--- a/printing/printing_context.h
|
||||
+++ b/printing/printing_context.h
|
||||
@@ -131,12 +131,12 @@ class PRINTING_EXPORT PrintingContext {
|
||||
|
||||
@@ -8,7 +8,7 @@ needed in chromium but our autofill implementation uses them. This patch can be
|
||||
our autofill implementation to work like Chromium's.
|
||||
|
||||
diff --git a/chrome/browser/ui/libgtkui/native_theme_gtk.cc b/chrome/browser/ui/libgtkui/native_theme_gtk.cc
|
||||
index b77b8a53b0246b05e3c45e74eaf2b5c44c6dad88..7af171f6cd5d76e87e2fca32f5dbcc34d7e0a974 100644
|
||||
index 80542c2cab345f991079453b66f58439d0f214eb..d460eb8d2432df1209412a28cecc22f2db9af99b 100644
|
||||
--- a/chrome/browser/ui/libgtkui/native_theme_gtk.cc
|
||||
+++ b/chrome/browser/ui/libgtkui/native_theme_gtk.cc
|
||||
@@ -279,6 +279,27 @@ SkColor SkColorFromColorId(ui::NativeTheme::ColorId color_id) {
|
||||
@@ -40,7 +40,7 @@ index b77b8a53b0246b05e3c45e74eaf2b5c44c6dad88..7af171f6cd5d76e87e2fca32f5dbcc34
|
||||
// TODO(thomasanderson): Render GtkSpinner directly.
|
||||
case ui::NativeTheme::kColorId_ThrobberSpinningColor:
|
||||
diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc
|
||||
index af391345a4c893e3fbde4f750af429a0567188d2..febfb06f18b6f51e6ebcc0c59e2a81b259e97997 100644
|
||||
index 7fd49a2e26968daaa16ed3322b516f53ff60fb56..f902910ecc8e5b4945187e836655362ebba49204 100644
|
||||
--- a/ui/native_theme/common_theme.cc
|
||||
+++ b/ui/native_theme/common_theme.cc
|
||||
@@ -56,6 +56,14 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
|
||||
@@ -58,7 +58,7 @@ index af391345a4c893e3fbde4f750af429a0567188d2..febfb06f18b6f51e6ebcc0c59e2a81b2
|
||||
// FocusableBorder
|
||||
case NativeTheme::kColorId_FocusedBorderColor:
|
||||
return SkColorSetA(gfx::kGoogleBlue300, 0x66);
|
||||
@@ -357,6 +365,18 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
|
||||
@@ -359,6 +367,18 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
|
||||
case NativeTheme::kColorId_UnfocusedBorderColor:
|
||||
return SkColorSetA(SK_ColorBLACK, 0x66);
|
||||
|
||||
@@ -94,10 +94,10 @@ index 3604105e43ee1866a8517c52ed05205b3ed10b56..70389e0245993faa2c17e9deefeb0002
|
||||
kColorId_ThrobberSpinningColor,
|
||||
kColorId_ThrobberWaitingColor,
|
||||
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
|
||||
index 257206023976b889590bc225f6542881e8a5d463..3003643bfb78cec2f5e84fc9e1471e1ef54aae41 100644
|
||||
index 5b1804538c2e78af23c797004f250369580b4178..97e72bc38a7231ce295ad943e977c69586cc6e07 100644
|
||||
--- a/ui/native_theme/native_theme_win.cc
|
||||
+++ b/ui/native_theme/native_theme_win.cc
|
||||
@@ -559,6 +559,17 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id,
|
||||
@@ -673,6 +673,17 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id,
|
||||
case kColorId_TableGroupingIndicatorColor:
|
||||
return system_colors_[SystemThemeColor::kGrayText];
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: render_widget_host_view_base.patch
|
||||
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
index f41270e262784602c90b79b7aefbcd1a7af43dd8..a28ea7ee72fbf596b2b1d10cacaad4068d62e4d4 100644
|
||||
index dbfcd1da5c853a396b6a44c1a2968cc317d10125..3dc776ac982fdd5d4d15bd3afdf208810340db4e 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
@@ -627,6 +627,15 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor(
|
||||
@@ -631,6 +631,15 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor(
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ index f41270e262784602c90b79b7aefbcd1a7af43dd8..a28ea7ee72fbf596b2b1d10cacaad406
|
||||
const blink::WebMouseEvent& event,
|
||||
const ui::LatencyInfo& latency) {
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
index 41288f633262f49ed7fb174c1af4e1834061c940..7fac11ee38f50165a0089473de5be601b1edf040 100644
|
||||
index 2bd5d56bc37daa97e32cb2be20f9d1b49abd91a2..77674ba193fa3fee3ff0dc5c83cc36c50fbcba68 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
@@ -24,9 +24,11 @@
|
||||
@@ -52,7 +52,7 @@ index 41288f633262f49ed7fb174c1af4e1834061c940..7fac11ee38f50165a0089473de5be601
|
||||
class WebCursor;
|
||||
class DelegatedFrameHost;
|
||||
struct TextInputState;
|
||||
@@ -131,6 +135,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
|
||||
@@ -132,6 +136,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
|
||||
bool destination_is_loaded,
|
||||
bool destination_is_frozen) final;
|
||||
|
||||
@@ -62,7 +62,7 @@ index 41288f633262f49ed7fb174c1af4e1834061c940..7fac11ee38f50165a0089473de5be601
|
||||
// This only needs to be overridden by RenderWidgetHostViewBase subclasses
|
||||
// that handle content embedded within other RenderWidgetHostViews.
|
||||
gfx::PointF TransformPointToRootCoordSpaceF(
|
||||
@@ -348,6 +355,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
|
||||
@@ -349,6 +356,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
|
||||
virtual void ProcessGestureEvent(const blink::WebGestureEvent& event,
|
||||
const ui::LatencyInfo& latency);
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: render_widget_host_view_mac.patch
|
||||
|
||||
|
||||
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
index a9654d8c1a9e15a3f90ec54a0b8e1bc61ce1f803..6c1e802fda70968cbcbea157fc982653de1c70c7 100644
|
||||
index d8de080eb6a30f16282661941b9a95da4fa41d70..326c5a13f6924643c699ca3cc2f98262a21fd907 100644
|
||||
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
@@ -152,6 +152,11 @@ void ExtractUnderlines(NSAttributedString* string,
|
||||
@@ -153,6 +153,11 @@ void ExtractUnderlines(NSAttributedString* string,
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -20,7 +20,7 @@ index a9654d8c1a9e15a3f90ec54a0b8e1bc61ce1f803..6c1e802fda70968cbcbea157fc982653
|
||||
// These are not documented, so use only after checking -respondsToSelector:.
|
||||
@interface NSApplication (UndocumentedSpeechMethods)
|
||||
- (void)speakString:(NSString*)string;
|
||||
@@ -569,6 +574,9 @@ - (BOOL)acceptsMouseEventsWhenInactive {
|
||||
@@ -572,6 +577,9 @@ - (BOOL)acceptsMouseEventsWhenInactive {
|
||||
}
|
||||
|
||||
- (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {
|
||||
@@ -30,7 +30,7 @@ index a9654d8c1a9e15a3f90ec54a0b8e1bc61ce1f803..6c1e802fda70968cbcbea157fc982653
|
||||
return [self acceptsMouseEventsWhenInactive];
|
||||
}
|
||||
|
||||
@@ -988,6 +996,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv {
|
||||
@@ -990,6 +998,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv {
|
||||
eventType == NSKeyDown &&
|
||||
!(modifierFlags & NSCommandKeyMask);
|
||||
|
||||
@@ -41,7 +41,7 @@ index a9654d8c1a9e15a3f90ec54a0b8e1bc61ce1f803..6c1e802fda70968cbcbea157fc982653
|
||||
// We only handle key down events and just simply forward other events.
|
||||
if (eventType != NSKeyDown) {
|
||||
hostHelper_->ForwardKeyboardEvent(event, latency_info);
|
||||
@@ -1767,9 +1779,11 @@ - (NSAccessibilityRole)accessibilityRole {
|
||||
@@ -1769,9 +1781,11 @@ - (NSAccessibilityRole)accessibilityRole {
|
||||
// Since this implementation doesn't have to wait any IPC calls, this doesn't
|
||||
// make any key-typing jank. --hbono 7/23/09
|
||||
//
|
||||
@@ -53,7 +53,7 @@ index a9654d8c1a9e15a3f90ec54a0b8e1bc61ce1f803..6c1e802fda70968cbcbea157fc982653
|
||||
|
||||
- (NSArray*)validAttributesForMarkedText {
|
||||
// This code is just copied from WebKit except renaming variables.
|
||||
@@ -1778,7 +1792,10 @@ - (NSArray*)validAttributesForMarkedText {
|
||||
@@ -1780,7 +1794,10 @@ - (NSArray*)validAttributesForMarkedText {
|
||||
initWithObjects:NSUnderlineStyleAttributeName,
|
||||
NSUnderlineColorAttributeName,
|
||||
NSMarkedClauseSegmentAttributeName,
|
||||
@@ -66,7 +66,7 @@ index a9654d8c1a9e15a3f90ec54a0b8e1bc61ce1f803..6c1e802fda70968cbcbea157fc982653
|
||||
return validAttributesForMarkedText_.get();
|
||||
}
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
index f52e0750f337dde0a1f3e7d6d36bac8a62094316..0aac157ae84f975acd6a944c63194bf2ed233188 100644
|
||||
index ed9ea51809ec7f06b246b933281dc22b9b0055f7..32f3f2cceb742065db8b52a9f6aa814cfc30f955 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
@@ -63,6 +63,7 @@
|
||||
|
||||
@@ -52,10 +52,10 @@ Some alternatives to this patch:
|
||||
None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
|
||||
|
||||
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
|
||||
index a9814f1349d886c0ec1968fa9bf4e2695c475307..e54ad878e0815c0210f8627816ae1be3151bfb34 100644
|
||||
index 03dcf65c25ddeb6ae6074435f37b24b4b54cfc57..0e33dfbadf723b9a578c79725ad535ad24820db7 100644
|
||||
--- a/chrome/BUILD.gn
|
||||
+++ b/chrome/BUILD.gn
|
||||
@@ -1624,7 +1624,7 @@ if (is_chrome_branded && !is_android) {
|
||||
@@ -1599,7 +1599,7 @@ if (is_chrome_branded && !is_android) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ index a9814f1349d886c0ec1968fa9bf4e2695c475307..e54ad878e0815c0210f8627816ae1be3
|
||||
chrome_paks("packed_resources") {
|
||||
if (is_mac) {
|
||||
output_dir = "$root_gen_dir/repack"
|
||||
@@ -1648,6 +1648,12 @@ if (!is_android) {
|
||||
@@ -1623,6 +1623,12 @@ if (!is_android) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,531 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sattard@slack-corp.com>
|
||||
Date: Wed, 28 Aug 2019 14:00:54 -0700
|
||||
Subject: Revert "Cleanup: Remove Menu Subtitles/Sublabels"
|
||||
|
||||
This reverts commit 27a7b3648684204ccb16ede5cf3947579bd6c222.
|
||||
|
||||
diff --git a/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc b/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc
|
||||
index 273666e278b3c6d1ac1e203f51a6a701366cdf2f..e9ab80665fd54b13c4211016e1607dc6cc5d53c2 100644
|
||||
--- a/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc
|
||||
+++ b/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc
|
||||
@@ -157,7 +157,7 @@ void MockRenderViewContextMenu::AppendSubMenuItems(ui::MenuModel* model) {
|
||||
sub_item.enabled = model->IsEnabledAt(i);
|
||||
sub_item.checked = model->IsItemCheckedAt(i);
|
||||
sub_item.hidden = false;
|
||||
- sub_item.title = model->GetLabelAt(i);
|
||||
+ sub_item.title = model->GetSublabelAt(i);
|
||||
items_.push_back(sub_item);
|
||||
}
|
||||
}
|
||||
diff --git a/chrome/browser/status_icons/status_icon_menu_model.cc b/chrome/browser/status_icons/status_icon_menu_model.cc
|
||||
index 35d5182b293bcc5e013654f71e2366afef7f3e24..6deae7c286e9da72ab6a35d2e973da7fb32353d6 100644
|
||||
--- a/chrome/browser/status_icons/status_icon_menu_model.cc
|
||||
+++ b/chrome/browser/status_icons/status_icon_menu_model.cc
|
||||
@@ -20,6 +20,7 @@ struct StatusIconMenuModel::ItemState {
|
||||
bool is_dynamic;
|
||||
ui::Accelerator accelerator;
|
||||
base::string16 label;
|
||||
+ base::string16 sublabel;
|
||||
gfx::Image icon;
|
||||
};
|
||||
|
||||
@@ -61,6 +62,13 @@ void StatusIconMenuModel::ChangeLabelForCommandId(int command_id,
|
||||
NotifyMenuStateChanged();
|
||||
}
|
||||
|
||||
+void StatusIconMenuModel::ChangeSublabelForCommandId(
|
||||
+ int command_id, const base::string16& sublabel) {
|
||||
+ item_states_[command_id].is_dynamic = true;
|
||||
+ item_states_[command_id].sublabel = sublabel;
|
||||
+ NotifyMenuStateChanged();
|
||||
+}
|
||||
+
|
||||
void StatusIconMenuModel::ChangeIconForCommandId(
|
||||
int command_id, const gfx::Image& icon) {
|
||||
item_states_[command_id].is_dynamic = true;
|
||||
@@ -122,6 +130,14 @@ base::string16 StatusIconMenuModel::GetLabelForCommandId(int command_id) const {
|
||||
return base::string16();
|
||||
}
|
||||
|
||||
+base::string16 StatusIconMenuModel::GetSublabelForCommandId(
|
||||
+ int command_id) const {
|
||||
+ auto iter = item_states_.find(command_id);
|
||||
+ if (iter != item_states_.end())
|
||||
+ return iter->second.sublabel;
|
||||
+ return base::string16();
|
||||
+}
|
||||
+
|
||||
bool StatusIconMenuModel::GetIconForCommandId(int command_id,
|
||||
gfx::Image* image_skia) const {
|
||||
auto iter = item_states_.find(command_id);
|
||||
diff --git a/chrome/browser/status_icons/status_icon_menu_model.h b/chrome/browser/status_icons/status_icon_menu_model.h
|
||||
index f40a33f7ce6ef9c9c538f44a86a404925eec32b5..556f531fcb66072828f3b5c2c07cd9d6a744ad53 100644
|
||||
--- a/chrome/browser/status_icons/status_icon_menu_model.h
|
||||
+++ b/chrome/browser/status_icons/status_icon_menu_model.h
|
||||
@@ -61,9 +61,11 @@ class StatusIconMenuModel
|
||||
|
||||
// Calling any of these "change" methods will mark the menu item as "dynamic"
|
||||
// (see menu_model.h:IsItemDynamicAt) which many platforms take as a cue to
|
||||
- // refresh the label and icon of the menu item each time the menu is
|
||||
+ // refresh the label, sublabel and icon of the menu item each time the menu is
|
||||
// shown.
|
||||
void ChangeLabelForCommandId(int command_id, const base::string16& label);
|
||||
+ void ChangeSublabelForCommandId(
|
||||
+ int command_id, const base::string16& sublabel);
|
||||
void ChangeIconForCommandId(int command_id, const gfx::Image& icon);
|
||||
|
||||
void AddObserver(Observer* observer);
|
||||
@@ -77,6 +79,7 @@ class StatusIconMenuModel
|
||||
ui::Accelerator* accelerator) const override;
|
||||
bool IsItemForCommandIdDynamic(int command_id) const override;
|
||||
base::string16 GetLabelForCommandId(int command_id) const override;
|
||||
+ base::string16 GetSublabelForCommandId(int command_id) const override;
|
||||
bool GetIconForCommandId(int command_id, gfx::Image* icon) const override;
|
||||
|
||||
protected:
|
||||
diff --git a/chrome/browser/status_icons/status_icon_menu_model_unittest.cc b/chrome/browser/status_icons/status_icon_menu_model_unittest.cc
|
||||
index a258d038da4a2bbfc6ec13c250781166235c1fbc..f6dbaa19cdb8938204c3452622589708c7bc3bb2 100644
|
||||
--- a/chrome/browser/status_icons/status_icon_menu_model_unittest.cc
|
||||
+++ b/chrome/browser/status_icons/status_icon_menu_model_unittest.cc
|
||||
@@ -90,6 +90,10 @@ TEST_F(StatusIconMenuModelTest, SetProperties) {
|
||||
menu_model()->ChangeLabelForCommandId(0, ASCIIToUTF16("label2"));
|
||||
EXPECT_EQ(ASCIIToUTF16("label2"), menu_model()->GetLabelForCommandId(0));
|
||||
|
||||
+ // Set the sublabel and icon image for the second menu item.
|
||||
+ menu_model()->ChangeSublabelForCommandId(1, ASCIIToUTF16("sublabel"));
|
||||
+ EXPECT_EQ(ASCIIToUTF16("sublabel"), menu_model()->GetSublabelForCommandId(1));
|
||||
+
|
||||
// Try setting icon image and changing it.
|
||||
menu_model()->ChangeIconForCommandId(1, test_image1);
|
||||
EXPECT_TRUE(menu_model()->GetIconForCommandId(1, &image_arg));
|
||||
@@ -98,8 +102,9 @@ TEST_F(StatusIconMenuModelTest, SetProperties) {
|
||||
// Ensure changes to one menu item does not affect the other menu item.
|
||||
EXPECT_FALSE(menu_model()->GetAcceleratorForCommandId(1, &accel_arg));
|
||||
EXPECT_EQ(base::string16(), menu_model()->GetLabelForCommandId(1));
|
||||
+ EXPECT_EQ(base::string16(), menu_model()->GetSublabelForCommandId(0));
|
||||
EXPECT_FALSE(menu_model()->GetIconForCommandId(0, &image_arg));
|
||||
|
||||
- // Menu state should have changed 6 times in this test.
|
||||
- EXPECT_EQ(6, changed_count());
|
||||
+ // Menu state should have changed 7 times in this test.
|
||||
+ EXPECT_EQ(7, changed_count());
|
||||
}
|
||||
diff --git a/chrome/browser/ui/views/menu_item_view_interactive_uitest.cc b/chrome/browser/ui/views/menu_item_view_interactive_uitest.cc
|
||||
index 654d0bf906c4785321a1fcdad9e12a22dbbbc170..6159eca4a400112f10647defe857c72740ff2779 100644
|
||||
--- a/chrome/browser/ui/views/menu_item_view_interactive_uitest.cc
|
||||
+++ b/chrome/browser/ui/views/menu_item_view_interactive_uitest.cc
|
||||
@@ -91,8 +91,8 @@ class MenuItemViewTestInsert : public MenuTestBase {
|
||||
|
||||
inserted_item_ = menu()->AddMenuItemAt(
|
||||
INSERT_INDEX, 1000, ASCIIToUTF16("inserted item"), base::string16(),
|
||||
- nullptr, gfx::ImageSkia(), nullptr, views::MenuItemView::NORMAL,
|
||||
- ui::NORMAL_SEPARATOR);
|
||||
+ base::string16(), nullptr, gfx::ImageSkia(), nullptr,
|
||||
+ views::MenuItemView::NORMAL, ui::NORMAL_SEPARATOR);
|
||||
ASSERT_TRUE(inserted_item_);
|
||||
menu()->ChildrenChanged();
|
||||
|
||||
@@ -186,8 +186,8 @@ class MenuItemViewTestInsertWithSubmenu : public MenuTestBase {
|
||||
void Step2() {
|
||||
inserted_item_ = menu()->AddMenuItemAt(
|
||||
INSERT_INDEX, 1000, ASCIIToUTF16("inserted item"), base::string16(),
|
||||
- nullptr, gfx::ImageSkia(), nullptr, views::MenuItemView::NORMAL,
|
||||
- ui::NORMAL_SEPARATOR);
|
||||
+ base::string16(), nullptr, gfx::ImageSkia(), nullptr,
|
||||
+ views::MenuItemView::NORMAL, ui::NORMAL_SEPARATOR);
|
||||
ASSERT_TRUE(inserted_item_);
|
||||
menu()->ChildrenChanged();
|
||||
|
||||
diff --git a/chrome/browser/ui/views/status_icons/concat_menu_model.cc b/chrome/browser/ui/views/status_icons/concat_menu_model.cc
|
||||
index ead2226583589c2921db7a0d5e97dc6388c49b6c..d537405caad6c30af0f48a168a17252756250e46 100644
|
||||
--- a/chrome/browser/ui/views/status_icons/concat_menu_model.cc
|
||||
+++ b/chrome/browser/ui/views/status_icons/concat_menu_model.cc
|
||||
@@ -33,6 +33,10 @@ base::string16 ConcatMenuModel::GetLabelAt(int index) const {
|
||||
return GetterImpl(&ui::MenuModel::GetLabelAt, index);
|
||||
}
|
||||
|
||||
+base::string16 ConcatMenuModel::GetSublabelAt(int index) const {
|
||||
+ return GetterImpl(&ui::MenuModel::GetSublabelAt, index);
|
||||
+}
|
||||
+
|
||||
base::string16 ConcatMenuModel::GetMinorTextAt(int index) const {
|
||||
return GetterImpl(&ui::MenuModel::GetMinorTextAt, index);
|
||||
}
|
||||
diff --git a/chrome/browser/ui/views/status_icons/concat_menu_model.h b/chrome/browser/ui/views/status_icons/concat_menu_model.h
|
||||
index 0ad30d57d6d13bc8d42920010145595ce0031573..7b73b5753cfd4595121e5b81fd3c95682869e17b 100644
|
||||
--- a/chrome/browser/ui/views/status_icons/concat_menu_model.h
|
||||
+++ b/chrome/browser/ui/views/status_icons/concat_menu_model.h
|
||||
@@ -23,6 +23,7 @@ class ConcatMenuModel : public ui::MenuModel {
|
||||
ui::MenuSeparatorType GetSeparatorTypeAt(int index) const override;
|
||||
int GetCommandIdAt(int index) const override;
|
||||
base::string16 GetLabelAt(int index) const override;
|
||||
+ base::string16 GetSublabelAt(int index) const override;
|
||||
base::string16 GetMinorTextAt(int index) const override;
|
||||
const gfx::VectorIcon* GetMinorIconAt(int index) const override;
|
||||
bool IsItemDynamicAt(int index) const override;
|
||||
diff --git a/ui/base/models/menu_model.cc b/ui/base/models/menu_model.cc
|
||||
index 73f0ab6d84d2cab6732866a6dc4b781faf630c0e..3319d058e8303066e0159d02d27ee2e8a46b38ec 100644
|
||||
--- a/ui/base/models/menu_model.cc
|
||||
+++ b/ui/base/models/menu_model.cc
|
||||
@@ -46,6 +46,10 @@ bool MenuModel::GetModelAndIndexForCommandId(int command_id,
|
||||
return false;
|
||||
}
|
||||
|
||||
+base::string16 MenuModel::GetSublabelAt(int index) const {
|
||||
+ return base::string16();
|
||||
+}
|
||||
+
|
||||
base::string16 MenuModel::GetMinorTextAt(int index) const {
|
||||
return base::string16();
|
||||
}
|
||||
diff --git a/ui/base/models/menu_model.h b/ui/base/models/menu_model.h
|
||||
index e0324ff11fb8c6b578ea7e902488235c33ec5485..690aa082b6be0bd576770d03ac94075183c1f9d6 100644
|
||||
--- a/ui/base/models/menu_model.h
|
||||
+++ b/ui/base/models/menu_model.h
|
||||
@@ -64,6 +64,10 @@ class UI_BASE_EXPORT MenuModel {
|
||||
// Returns the label of the item at the specified index.
|
||||
virtual base::string16 GetLabelAt(int index) const = 0;
|
||||
|
||||
+ // Returns the sublabel of the item at the specified index. The sublabel
|
||||
+ // is rendered beneath the label and using the font GetLabelFontAt().
|
||||
+ virtual base::string16 GetSublabelAt(int index) const;
|
||||
+
|
||||
// Returns the minor text of the item at the specified index. The minor text
|
||||
// is rendered to the right of the label and using the font GetLabelFontAt().
|
||||
virtual base::string16 GetMinorTextAt(int index) const;
|
||||
diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc
|
||||
index 0aeeb3e47074590834de6d9ca7e3eb7dbf6a7793..5efc0589644e243a095765710302af992d53f5b8 100644
|
||||
--- a/ui/base/models/simple_menu_model.cc
|
||||
+++ b/ui/base/models/simple_menu_model.cc
|
||||
@@ -42,6 +42,11 @@ base::string16 SimpleMenuModel::Delegate::GetLabelForCommandId(
|
||||
return base::string16();
|
||||
}
|
||||
|
||||
+base::string16 SimpleMenuModel::Delegate::GetSublabelForCommandId(
|
||||
+ int command_id) const {
|
||||
+ return base::string16();
|
||||
+}
|
||||
+
|
||||
base::string16 SimpleMenuModel::Delegate::GetMinorTextForCommandId(
|
||||
int command_id) const {
|
||||
return base::string16();
|
||||
@@ -324,6 +329,11 @@ void SimpleMenuModel::SetLabel(int index, const base::string16& label) {
|
||||
MenuItemsChanged();
|
||||
}
|
||||
|
||||
+void SimpleMenuModel::SetSublabel(int index, const base::string16& sublabel) {
|
||||
+ items_[ValidateItemIndex(index)].sublabel = sublabel;
|
||||
+ MenuItemsChanged();
|
||||
+}
|
||||
+
|
||||
void SimpleMenuModel::SetMinorText(int index,
|
||||
const base::string16& minor_text) {
|
||||
items_[ValidateItemIndex(index)].minor_text = minor_text;
|
||||
@@ -398,6 +408,12 @@ base::string16 SimpleMenuModel::GetLabelAt(int index) const {
|
||||
return items_[ValidateItemIndex(index)].label;
|
||||
}
|
||||
|
||||
+base::string16 SimpleMenuModel::GetSublabelAt(int index) const {
|
||||
+ if (IsItemDynamicAt(index))
|
||||
+ return delegate_->GetSublabelForCommandId(GetCommandIdAt(index));
|
||||
+ return items_[ValidateItemIndex(index)].sublabel;
|
||||
+}
|
||||
+
|
||||
base::string16 SimpleMenuModel::GetMinorTextAt(int index) const {
|
||||
if (IsItemDynamicAt(index))
|
||||
return delegate_->GetMinorTextForCommandId(GetCommandIdAt(index));
|
||||
diff --git a/ui/base/models/simple_menu_model.h b/ui/base/models/simple_menu_model.h
|
||||
index 3cc9d686da8f64ddc8bdc66df40b1866bdd20607..dfacbdd4a55b5f5aa4d8c67136c607f75a880278 100644
|
||||
--- a/ui/base/models/simple_menu_model.h
|
||||
+++ b/ui/base/models/simple_menu_model.h
|
||||
@@ -44,10 +44,11 @@ class UI_BASE_EXPORT SimpleMenuModel : public MenuModel {
|
||||
// Delegate should return true if |command_id| should be visible.
|
||||
virtual bool IsCommandIdVisible(int command_id) const;
|
||||
|
||||
- // Some command ids have labels, minor text and icons that change over
|
||||
- // time.
|
||||
+ // Some command ids have labels, sublabels, minor text and icons that change
|
||||
+ // over time.
|
||||
virtual bool IsItemForCommandIdDynamic(int command_id) const;
|
||||
virtual base::string16 GetLabelForCommandId(int command_id) const;
|
||||
+ virtual base::string16 GetSublabelForCommandId(int command_id) const;
|
||||
virtual base::string16 GetMinorTextForCommandId(int command_id) const;
|
||||
// Gets the icon for the item with the specified id, returning true if there
|
||||
// is an icon, false otherwise.
|
||||
@@ -175,6 +176,9 @@ class UI_BASE_EXPORT SimpleMenuModel : public MenuModel {
|
||||
// Sets the label for the item at |index|.
|
||||
void SetLabel(int index, const base::string16& label);
|
||||
|
||||
+ // Sets the sublabel for the item at |index|.
|
||||
+ void SetSublabel(int index, const base::string16& sublabel);
|
||||
+
|
||||
// Sets the minor text for the item at |index|.
|
||||
void SetMinorText(int index, const base::string16& minor_text);
|
||||
|
||||
@@ -201,6 +205,7 @@ class UI_BASE_EXPORT SimpleMenuModel : public MenuModel {
|
||||
ui::MenuSeparatorType GetSeparatorTypeAt(int index) const override;
|
||||
int GetCommandIdAt(int index) const override;
|
||||
base::string16 GetLabelAt(int index) const override;
|
||||
+ base::string16 GetSublabelAt(int index) const override;
|
||||
base::string16 GetMinorTextAt(int index) const override;
|
||||
const gfx::VectorIcon* GetMinorIconAt(int index) const override;
|
||||
bool IsItemDynamicAt(int index) const override;
|
||||
@@ -236,6 +241,7 @@ class UI_BASE_EXPORT SimpleMenuModel : public MenuModel {
|
||||
int command_id = 0;
|
||||
ItemType type = TYPE_COMMAND;
|
||||
base::string16 label;
|
||||
+ base::string16 sublabel;
|
||||
base::string16 minor_text;
|
||||
const gfx::VectorIcon* minor_icon = nullptr;
|
||||
gfx::Image icon;
|
||||
diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc
|
||||
index 729e5ec0b3df05ac96460498612d3fa6742de61a..cfcb44804073da550b77878b0ca216cd3d46da95 100644
|
||||
--- a/ui/views/controls/menu/menu_item_view.cc
|
||||
+++ b/ui/views/controls/menu/menu_item_view.cc
|
||||
@@ -277,6 +277,7 @@ MenuItemView* MenuItemView::AddMenuItemAt(
|
||||
int index,
|
||||
int item_id,
|
||||
const base::string16& label,
|
||||
+ const base::string16& sublabel,
|
||||
const base::string16& minor_text,
|
||||
const gfx::VectorIcon* minor_icon,
|
||||
const gfx::ImageSkia& icon,
|
||||
@@ -297,6 +298,7 @@ MenuItemView* MenuItemView::AddMenuItemAt(
|
||||
item->SetTitle(GetDelegate()->GetLabel(item_id));
|
||||
else
|
||||
item->SetTitle(label);
|
||||
+ item->SetSubtitle(sublabel);
|
||||
item->SetMinorText(minor_text);
|
||||
item->SetMinorIcon(minor_icon);
|
||||
if (vector_icon) {
|
||||
@@ -338,21 +340,23 @@ void MenuItemView::RemoveAllMenuItems() {
|
||||
MenuItemView* MenuItemView::AppendMenuItem(int item_id,
|
||||
const base::string16& label,
|
||||
Type type) {
|
||||
- return AppendMenuItemImpl(item_id, label, base::string16(), nullptr,
|
||||
- gfx::ImageSkia(), type, ui::NORMAL_SEPARATOR);
|
||||
+ return AppendMenuItemImpl(item_id, label, base::string16(), base::string16(),
|
||||
+ nullptr, gfx::ImageSkia(), type,
|
||||
+ ui::NORMAL_SEPARATOR);
|
||||
}
|
||||
|
||||
MenuItemView* MenuItemView::AppendSubMenu(int item_id,
|
||||
const base::string16& label) {
|
||||
- return AppendMenuItemImpl(item_id, label, base::string16(), nullptr,
|
||||
- gfx::ImageSkia(), SUBMENU, ui::NORMAL_SEPARATOR);
|
||||
+ return AppendMenuItemImpl(item_id, label, base::string16(), base::string16(),
|
||||
+ nullptr, gfx::ImageSkia(), SUBMENU,
|
||||
+ ui::NORMAL_SEPARATOR);
|
||||
}
|
||||
|
||||
MenuItemView* MenuItemView::AppendSubMenuWithIcon(int item_id,
|
||||
const base::string16& label,
|
||||
const gfx::ImageSkia& icon) {
|
||||
- return AppendMenuItemImpl(item_id, label, base::string16(), nullptr, icon,
|
||||
- SUBMENU, ui::NORMAL_SEPARATOR);
|
||||
+ return AppendMenuItemImpl(item_id, label, base::string16(), base::string16(),
|
||||
+ nullptr, icon, SUBMENU, ui::NORMAL_SEPARATOR);
|
||||
}
|
||||
|
||||
MenuItemView* MenuItemView::AppendMenuItemWithLabel(
|
||||
@@ -366,12 +370,14 @@ MenuItemView* MenuItemView::AppendDelegateMenuItem(int item_id) {
|
||||
}
|
||||
|
||||
void MenuItemView::AppendSeparator() {
|
||||
- AppendMenuItemImpl(0, base::string16(), base::string16(), nullptr,
|
||||
- gfx::ImageSkia(), SEPARATOR, ui::NORMAL_SEPARATOR);
|
||||
+ AppendMenuItemImpl(0, base::string16(), base::string16(), base::string16(),
|
||||
+ nullptr, gfx::ImageSkia(), SEPARATOR,
|
||||
+ ui::NORMAL_SEPARATOR);
|
||||
}
|
||||
|
||||
void MenuItemView::AddSeparatorAt(int index) {
|
||||
AddMenuItemAt(index, /*item_id=*/0, /*label=*/base::string16(),
|
||||
+ /*sub_label=*/base::string16(),
|
||||
/*minor_text=*/base::string16(), /*minor_icon=*/nullptr,
|
||||
/*icon=*/gfx::ImageSkia(), /*vector_icon=*/nullptr,
|
||||
/*type=*/SEPARATOR,
|
||||
@@ -381,21 +387,22 @@ void MenuItemView::AddSeparatorAt(int index) {
|
||||
MenuItemView* MenuItemView::AppendMenuItemWithIcon(int item_id,
|
||||
const base::string16& label,
|
||||
const gfx::ImageSkia& icon) {
|
||||
- return AppendMenuItemImpl(item_id, label, base::string16(), nullptr, icon,
|
||||
- NORMAL, ui::NORMAL_SEPARATOR);
|
||||
+ return AppendMenuItemImpl(item_id, label, base::string16(), base::string16(),
|
||||
+ nullptr, icon, NORMAL, ui::NORMAL_SEPARATOR);
|
||||
}
|
||||
|
||||
MenuItemView* MenuItemView::AppendMenuItemImpl(
|
||||
int item_id,
|
||||
const base::string16& label,
|
||||
+ const base::string16& sublabel,
|
||||
const base::string16& minor_text,
|
||||
const gfx::VectorIcon* minor_icon,
|
||||
const gfx::ImageSkia& icon,
|
||||
Type type,
|
||||
ui::MenuSeparatorType separator_style) {
|
||||
const int index = submenu_ ? int{submenu_->children().size()} : 0;
|
||||
- return AddMenuItemAt(index, item_id, label, minor_text, minor_icon, icon,
|
||||
- nullptr, type, separator_style);
|
||||
+ return AddMenuItemAt(index, item_id, label, sublabel, minor_text, minor_icon,
|
||||
+ icon, nullptr, type, separator_style);
|
||||
}
|
||||
|
||||
SubmenuView* MenuItemView::CreateSubmenu() {
|
||||
@@ -427,6 +434,11 @@ void MenuItemView::SetTitle(const base::string16& title) {
|
||||
invalidate_dimensions(); // Triggers preferred size recalculation.
|
||||
}
|
||||
|
||||
+void MenuItemView::SetSubtitle(const base::string16& subtitle) {
|
||||
+ subtitle_ = subtitle;
|
||||
+ invalidate_dimensions(); // Triggers preferred size recalculation.
|
||||
+}
|
||||
+
|
||||
void MenuItemView::SetMinorText(const base::string16& minor_text) {
|
||||
minor_text_ = minor_text;
|
||||
invalidate_dimensions(); // Triggers preferred size recalculation.
|
||||
@@ -1016,13 +1028,23 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
|
||||
(!delegate ||
|
||||
delegate->ShouldReserveSpaceForSubmenuIndicator() ?
|
||||
item_right_margin_ : config.arrow_to_edge_padding);
|
||||
- gfx::Rect text_bounds(label_start, top_margin, width, available_height);
|
||||
+ gfx::Rect text_bounds(label_start, top_margin, width,
|
||||
+ subtitle_.empty() ? available_height
|
||||
+ : available_height / 2);
|
||||
text_bounds.set_x(GetMirroredXForRect(text_bounds));
|
||||
int flags = GetDrawStringFlags();
|
||||
if (mode == PB_FOR_DRAG)
|
||||
flags |= gfx::Canvas::NO_SUBPIXEL_RENDERING;
|
||||
canvas->DrawStringRectWithFlags(title(), style.font_list, style.foreground,
|
||||
text_bounds, flags);
|
||||
+ if (!subtitle_.empty()) {
|
||||
+ canvas->DrawStringRectWithFlags(
|
||||
+ subtitle_, style.font_list,
|
||||
+ GetNativeTheme()->GetSystemColor(
|
||||
+ ui::NativeTheme::kColorId_MenuItemMinorTextColor),
|
||||
+ text_bounds + gfx::Vector2d(0, style.font_list.GetHeight()), flags);
|
||||
+ }
|
||||
+
|
||||
PaintMinorIconAndText(canvas, style);
|
||||
|
||||
// Set the submenu indicator (arrow) image and color.
|
||||
@@ -1274,6 +1296,11 @@ MenuItemView::MenuItemDimensions MenuItemView::CalculateDimensions() const {
|
||||
|
||||
// Determine the length of the label text.
|
||||
int string_width = gfx::GetStringWidth(title_, style.font_list);
|
||||
+ if (!subtitle_.empty()) {
|
||||
+ string_width =
|
||||
+ std::max(string_width, gfx::GetStringWidth(subtitle_, style.font_list));
|
||||
+ }
|
||||
+
|
||||
dimensions.standard_width = string_width + label_start +
|
||||
item_right_margin_;
|
||||
// Determine the length of the right-side text.
|
||||
@@ -1281,9 +1308,10 @@ MenuItemView::MenuItemDimensions MenuItemView::CalculateDimensions() const {
|
||||
minor_text.empty() ? 0 : gfx::GetStringWidth(minor_text, style.font_list);
|
||||
|
||||
// Determine the height to use.
|
||||
- dimensions.height =
|
||||
- std::max(dimensions.height, style.font_list.GetHeight() +
|
||||
- GetBottomMargin() + GetTopMargin());
|
||||
+ dimensions.height = std::max(
|
||||
+ dimensions.height, (subtitle_.empty() ? 0 : style.font_list.GetHeight()) +
|
||||
+ style.font_list.GetHeight() + GetBottomMargin() +
|
||||
+ GetTopMargin());
|
||||
dimensions.height =
|
||||
std::max(dimensions.height, MenuConfig::instance().item_min_height);
|
||||
|
||||
diff --git a/ui/views/controls/menu/menu_item_view.h b/ui/views/controls/menu/menu_item_view.h
|
||||
index 0e97c35a8a452e8c602f08e2f2b72fc71becfa4b..332b11faae5eb05291dfd268f1b951a134b559c4 100644
|
||||
--- a/ui/views/controls/menu/menu_item_view.h
|
||||
+++ b/ui/views/controls/menu/menu_item_view.h
|
||||
@@ -151,6 +151,7 @@ class VIEWS_EXPORT MenuItemView : public View {
|
||||
MenuItemView* AddMenuItemAt(int index,
|
||||
int item_id,
|
||||
const base::string16& label,
|
||||
+ const base::string16& sublabel,
|
||||
const base::string16& minor_text,
|
||||
const gfx::VectorIcon* minor_icon,
|
||||
const gfx::ImageSkia& icon,
|
||||
@@ -214,6 +215,7 @@ class VIEWS_EXPORT MenuItemView : public View {
|
||||
// All the AppendXXX methods funnel into this.
|
||||
MenuItemView* AppendMenuItemImpl(int item_id,
|
||||
const base::string16& label,
|
||||
+ const base::string16& sublabel,
|
||||
const base::string16& minor_text,
|
||||
const gfx::VectorIcon* minor_icon,
|
||||
const gfx::ImageSkia& icon,
|
||||
@@ -241,6 +243,9 @@ class VIEWS_EXPORT MenuItemView : public View {
|
||||
void SetTitle(const base::string16& title);
|
||||
const base::string16& title() const { return title_; }
|
||||
|
||||
+ // Sets the subtitle.
|
||||
+ void SetSubtitle(const base::string16& subtitle);
|
||||
+
|
||||
// Sets the minor text.
|
||||
void SetMinorText(const base::string16& minor_text);
|
||||
|
||||
@@ -451,7 +456,7 @@ class VIEWS_EXPORT MenuItemView : public View {
|
||||
void DestroyAllMenuHosts();
|
||||
|
||||
// Returns the text that should be displayed on the end (right) of the menu
|
||||
- // item. This will be the accelerator (if one exists).
|
||||
+ // item. This will be the accelerator (if one exists), otherwise |subtitle_|.
|
||||
base::string16 GetMinorText() const;
|
||||
|
||||
// Returns the icon that should be displayed to the left of the minor text.
|
||||
@@ -542,6 +547,9 @@ class VIEWS_EXPORT MenuItemView : public View {
|
||||
// Title.
|
||||
base::string16 title_;
|
||||
|
||||
+ // Subtitle/sublabel.
|
||||
+ base::string16 subtitle_;
|
||||
+
|
||||
// Minor text.
|
||||
base::string16 minor_text_;
|
||||
|
||||
diff --git a/ui/views/controls/menu/menu_item_view_unittest.cc b/ui/views/controls/menu/menu_item_view_unittest.cc
|
||||
index f51bd9d85dad7771f18fc535b55b30a855eac48f..63aa8eddf51cb4821517902564e94813f6a42c02 100644
|
||||
--- a/ui/views/controls/menu/menu_item_view_unittest.cc
|
||||
+++ b/ui/views/controls/menu/menu_item_view_unittest.cc
|
||||
@@ -324,10 +324,10 @@ class MenuItemViewPaintUnitTest : public ViewsTestBase {
|
||||
// Provides assertion coverage for painting minor text and icons.
|
||||
TEST_F(MenuItemViewPaintUnitTest, MinorTextAndIconAssertionCoverage) {
|
||||
auto AddItem = [this](auto label, auto minor_label, auto minor_icon) {
|
||||
- menu_item_view()->AddMenuItemAt(0, 1000, base::ASCIIToUTF16(label),
|
||||
- minor_label, minor_icon, gfx::ImageSkia(),
|
||||
- nullptr, views::MenuItemView::NORMAL,
|
||||
- ui::NORMAL_SEPARATOR);
|
||||
+ menu_item_view()->AddMenuItemAt(
|
||||
+ 0, 1000, base::ASCIIToUTF16(label), base::string16(), minor_label,
|
||||
+ minor_icon, gfx::ImageSkia(), nullptr, views::MenuItemView::NORMAL,
|
||||
+ ui::NORMAL_SEPARATOR);
|
||||
};
|
||||
AddItem("No minor content", base::string16(), nullptr);
|
||||
AddItem("Minor text only", base::ASCIIToUTF16("minor text"), nullptr);
|
||||
diff --git a/ui/views/controls/menu/menu_model_adapter.cc b/ui/views/controls/menu/menu_model_adapter.cc
|
||||
index 09b72733e66d1e13182730e475b781ffefe649c0..e45e249f2a89e1bfd31cc82341a65341571ffc21 100644
|
||||
--- a/ui/views/controls/menu/menu_model_adapter.cc
|
||||
+++ b/ui/views/controls/menu/menu_model_adapter.cc
|
||||
@@ -96,8 +96,8 @@ MenuItemView* MenuModelAdapter::AddMenuItemFromModelAt(ui::MenuModel* model,
|
||||
|
||||
if (*type == MenuItemView::SEPARATOR) {
|
||||
return menu->AddMenuItemAt(menu_index, item_id, base::string16(),
|
||||
- base::string16(), nullptr, gfx::ImageSkia(),
|
||||
- nullptr, *type,
|
||||
+ base::string16(), base::string16(), nullptr,
|
||||
+ gfx::ImageSkia(), nullptr, *type,
|
||||
model->GetSeparatorTypeAt(model_index));
|
||||
}
|
||||
|
||||
@@ -105,7 +105,8 @@ MenuItemView* MenuModelAdapter::AddMenuItemFromModelAt(ui::MenuModel* model,
|
||||
model->GetIconAt(model_index, &icon);
|
||||
return menu->AddMenuItemAt(
|
||||
menu_index, item_id, model->GetLabelAt(model_index),
|
||||
- model->GetMinorTextAt(model_index), model->GetMinorIconAt(model_index),
|
||||
+ model->GetSublabelAt(model_index), model->GetMinorTextAt(model_index),
|
||||
+ model->GetMinorIconAt(model_index),
|
||||
icon.IsEmpty() ? gfx::ImageSkia() : *icon.ToImageSkia(),
|
||||
icon.IsEmpty() ? model->GetVectorIconAt(model_index) : nullptr, *type,
|
||||
ui::NORMAL_SEPARATOR);
|
||||
@@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch
|
||||
Patch to make scrollBounce option work.
|
||||
|
||||
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
|
||||
index cc9e8ad658a018bef04a2f3f40288543ab243443..eb1a89bba7f5d81ebd324bc7b5cf61914ef3ce32 100644
|
||||
index 56bff36825b02d3aa5ec1ded29b1dc7265df4f7e..569c83ae7cdcc0c7b3c3edf352b379c3b427e651 100644
|
||||
--- a/content/renderer/render_thread_impl.cc
|
||||
+++ b/content/renderer/render_thread_impl.cc
|
||||
@@ -1539,7 +1539,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
|
||||
@@ -1523,7 +1523,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
|
||||
}
|
||||
|
||||
bool RenderThreadImpl::IsElasticOverscrollEnabled() {
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: ssl_security_state_tab_helper.patch
|
||||
Allows populating security tab info for devtools in Electron.
|
||||
|
||||
diff --git a/chrome/browser/ssl/security_state_tab_helper.cc b/chrome/browser/ssl/security_state_tab_helper.cc
|
||||
index 26ec105bf873bd0e802c2c7e65e5e82f2abcfd85..b5e94e434ad7c22de2b59ae1bd0640d55da690a2 100644
|
||||
index 887cdd11fbbd9df44edef1548a89891c5cf23cee..12da72449622289ec467d284f616bbf937ff1865 100644
|
||||
--- a/chrome/browser/ssl/security_state_tab_helper.cc
|
||||
+++ b/chrome/browser/ssl/security_state_tab_helper.cc
|
||||
@@ -13,16 +13,20 @@
|
||||
@@ -39,19 +39,7 @@ index 26ec105bf873bd0e802c2c7e65e5e82f2abcfd85..b5e94e434ad7c22de2b59ae1bd0640d5
|
||||
#include "chrome/browser/safe_browsing/chrome_password_protection_service.h"
|
||||
#endif
|
||||
|
||||
@@ -64,6 +68,7 @@ void RecordSecurityLevel(
|
||||
}
|
||||
}
|
||||
|
||||
+#if 0
|
||||
security_state::SafetyTipStatus GetSecurityStateSafetyTipType(
|
||||
safety_tips::SafetyTipType type) {
|
||||
switch (type) {
|
||||
@@ -76,11 +81,13 @@ security_state::SafetyTipStatus GetSecurityStateSafetyTipType(
|
||||
return security_state::SafetyTipStatus::SAFETY_TIP_STATUS_NONE;
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
@@ -66,8 +70,9 @@ void RecordSecurityLevel(
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -62,7 +50,7 @@ index 26ec105bf873bd0e802c2c7e65e5e82f2abcfd85..b5e94e434ad7c22de2b59ae1bd0640d5
|
||||
|
||||
SecurityStateTabHelper::SecurityStateTabHelper(
|
||||
content::WebContents* web_contents)
|
||||
@@ -102,6 +109,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() const {
|
||||
@@ -89,6 +94,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() const {
|
||||
// information is still being initialized, thus no need to check for that.
|
||||
state->malicious_content_status = GetMaliciousContentStatus();
|
||||
|
||||
@@ -70,15 +58,15 @@ index 26ec105bf873bd0e802c2c7e65e5e82f2abcfd85..b5e94e434ad7c22de2b59ae1bd0640d5
|
||||
safety_tips::ReputationWebContentsObserver* reputation_web_contents_observer =
|
||||
safety_tips::ReputationWebContentsObserver::FromWebContents(
|
||||
web_contents());
|
||||
@@ -110,6 +118,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() const {
|
||||
? GetSecurityStateSafetyTipType(
|
||||
reputation_web_contents_observer->last_shown_safety_tip_type())
|
||||
: security_state::SafetyTipStatus::SAFETY_TIP_STATUS_NONE;
|
||||
@@ -97,6 +103,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() const {
|
||||
? reputation_web_contents_observer
|
||||
->GetSafetyTipStatusForVisibleNavigation()
|
||||
: security_state::SafetyTipStatus::kUnknown;
|
||||
+#endif
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -176,6 +185,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
|
||||
@@ -164,6 +171,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
|
||||
web_contents()->GetController().GetVisibleEntry();
|
||||
if (!entry)
|
||||
return security_state::MALICIOUS_CONTENT_STATUS_NONE;
|
||||
@@ -86,7 +74,7 @@ index 26ec105bf873bd0e802c2c7e65e5e82f2abcfd85..b5e94e434ad7c22de2b59ae1bd0640d5
|
||||
safe_browsing::SafeBrowsingService* sb_service =
|
||||
g_browser_process->safe_browsing_service();
|
||||
if (!sb_service)
|
||||
@@ -254,6 +264,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
|
||||
@@ -242,6 +250,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,21 +22,22 @@ However, the patch would need to be reviewed by the security team, as it
|
||||
does touch a security-sensitive class.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index 20d0b4a801bdbe0300f878f369fc9017fc8aea3f..6302948343ee810a9d35a70be0c91a1ffbfb7647 100644
|
||||
index 25fd6ca609bdffcd62b5d16c7da9fbd37490b993..2aaa6b123b917b9b819aa2a2d3fb27179a57a8ec 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -378,6 +378,10 @@ class RendererSandboxedProcessLauncherDelegate
|
||||
: public SandboxedProcessLauncherDelegate {
|
||||
public:
|
||||
RendererSandboxedProcessLauncherDelegate() {}
|
||||
@@ -390,6 +390,11 @@ class RendererSandboxedProcessLauncherDelegate
|
||||
{
|
||||
}
|
||||
|
||||
+#if BUILDFLAG(USE_ZYGOTE_HANDLE)
|
||||
+ RendererSandboxedProcessLauncherDelegate(bool use_zygote):
|
||||
+ use_zygote_(use_zygote) {}
|
||||
+#endif
|
||||
|
||||
+
|
||||
~RendererSandboxedProcessLauncherDelegate() override {}
|
||||
|
||||
@@ -397,6 +401,9 @@ class RendererSandboxedProcessLauncherDelegate
|
||||
#if defined(OS_WIN)
|
||||
@@ -411,6 +416,9 @@ class RendererSandboxedProcessLauncherDelegate
|
||||
|
||||
#if BUILDFLAG(USE_ZYGOTE_HANDLE)
|
||||
service_manager::ZygoteHandle GetZygote() override {
|
||||
@@ -46,19 +47,22 @@ index 20d0b4a801bdbe0300f878f369fc9017fc8aea3f..6302948343ee810a9d35a70be0c91a1f
|
||||
const base::CommandLine& browser_command_line =
|
||||
*base::CommandLine::ForCurrentProcess();
|
||||
base::CommandLine::StringType renderer_prefix =
|
||||
@@ -410,6 +417,11 @@ class RendererSandboxedProcessLauncherDelegate
|
||||
service_manager::SandboxType GetSandboxType() override {
|
||||
@@ -425,10 +433,13 @@ class RendererSandboxedProcessLauncherDelegate
|
||||
return service_manager::SANDBOX_TYPE_RENDERER;
|
||||
}
|
||||
+
|
||||
+ private:
|
||||
|
||||
-#if defined(OS_WIN)
|
||||
private:
|
||||
+#if defined(OS_WIN)
|
||||
const bool renderer_code_integrity_enabled_;
|
||||
#endif
|
||||
+#if BUILDFLAG(USE_ZYGOTE_HANDLE)
|
||||
+ bool use_zygote_ = true;
|
||||
+#endif
|
||||
};
|
||||
|
||||
const char kSessionStorageHolderKey[] = "kSessionStorageHolderKey";
|
||||
@@ -1746,11 +1758,18 @@ bool RenderProcessHostImpl::Init() {
|
||||
@@ -1688,11 +1699,18 @@ bool RenderProcessHostImpl::Init() {
|
||||
cmd_line->PrependWrapper(renderer_prefix);
|
||||
AppendRendererCommandLine(cmd_line.get());
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ Make chrome's install-sysroot scripts point to our custom sysroot builds,
|
||||
which include extra deps that Electron needs (e.g. libnotify)
|
||||
|
||||
diff --git a/build/linux/sysroot_scripts/install-sysroot.py b/build/linux/sysroot_scripts/install-sysroot.py
|
||||
index 2e756f75d243c558c03c720a1a9c90911f2bb121..5b8cc02c3cb9b257bbe9c93cf7ce329272403607 100755
|
||||
index 165551a2948b74c024459be42d1a9a3d96878a10..5c9272a512e22dfe2e90f6665083f53f0fa8979e 100755
|
||||
--- a/build/linux/sysroot_scripts/install-sysroot.py
|
||||
+++ b/build/linux/sysroot_scripts/install-sysroot.py
|
||||
@@ -37,9 +37,11 @@ except ImportError:
|
||||
|
||||
@@ -10,7 +10,7 @@ Subject: tts.patch
|
||||
destruction from content layer.
|
||||
|
||||
diff --git a/chrome/browser/speech/tts_controller_delegate_impl.cc b/chrome/browser/speech/tts_controller_delegate_impl.cc
|
||||
index e96b0cef21bec8925d4adf1e8692dc00f5ec6f5f..7ec07534aa3628873c9fe784fa0235f3c5c7f15f 100644
|
||||
index cce8cad71b9f620a3d26946a7df937a1336d741e..ea5db4e66f1cbbb2728558091dc07a413a536e1f 100644
|
||||
--- a/chrome/browser/speech/tts_controller_delegate_impl.cc
|
||||
+++ b/chrome/browser/speech/tts_controller_delegate_impl.cc
|
||||
@@ -213,6 +213,7 @@ void TtsControllerDelegateImpl::UpdateUtteranceDefaultsFromPrefs(
|
||||
@@ -29,145 +29,3 @@ index e96b0cef21bec8925d4adf1e8692dc00f5ec6f5f..7ec07534aa3628873c9fe784fa0235f3
|
||||
return prefs;
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/speech/tts_message_filter.cc b/chrome/browser/speech/tts_message_filter.cc
|
||||
index cf0841622b99ad6637314284bcdbd83060a404cc..779b51992c180a76ed8a2c492297416aa557d214 100644
|
||||
--- a/chrome/browser/speech/tts_message_filter.cc
|
||||
+++ b/chrome/browser/speech/tts_message_filter.cc
|
||||
@@ -10,8 +10,11 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/task/post_task.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
+#if 0
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
+#endif
|
||||
#include "chrome/common/tts_messages.h"
|
||||
+#include "components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
@@ -19,6 +22,29 @@
|
||||
|
||||
using content::BrowserThread;
|
||||
|
||||
+namespace {
|
||||
+
|
||||
+class TtsMessageFilterShutdownNotifierFactory
|
||||
+ : public BrowserContextKeyedServiceShutdownNotifierFactory {
|
||||
+ public:
|
||||
+ static TtsMessageFilterShutdownNotifierFactory* GetInstance() {
|
||||
+ return base::Singleton<TtsMessageFilterShutdownNotifierFactory>::get();
|
||||
+ }
|
||||
+
|
||||
+ private:
|
||||
+ friend struct base::DefaultSingletonTraits<
|
||||
+ TtsMessageFilterShutdownNotifierFactory>;
|
||||
+
|
||||
+ TtsMessageFilterShutdownNotifierFactory()
|
||||
+ : BrowserContextKeyedServiceShutdownNotifierFactory("TtsMessageFilter") {}
|
||||
+
|
||||
+ ~TtsMessageFilterShutdownNotifierFactory() override {}
|
||||
+
|
||||
+ DISALLOW_COPY_AND_ASSIGN(TtsMessageFilterShutdownNotifierFactory);
|
||||
+};
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
TtsMessageFilter::TtsMessageFilter(content::BrowserContext* browser_context)
|
||||
: BrowserMessageFilter(TtsMsgStart),
|
||||
browser_context_(browser_context),
|
||||
@@ -26,28 +52,27 @@ TtsMessageFilter::TtsMessageFilter(content::BrowserContext* browser_context)
|
||||
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
content::TtsController::GetInstance()->AddVoicesChangedDelegate(this);
|
||||
|
||||
- // TODO(dmazzoni): make it so that we can listen for a BrowserContext
|
||||
- // being destroyed rather than a Profile. http://crbug.com/444668
|
||||
- Profile* profile = Profile::FromBrowserContext(browser_context);
|
||||
- notification_registrar_.Add(this,
|
||||
- chrome::NOTIFICATION_PROFILE_DESTROYED,
|
||||
- content::Source<Profile>(profile));
|
||||
+ browser_context_shutdown_notifier_ =
|
||||
+ TtsMessageFilterShutdownNotifierFactory::GetInstance()
|
||||
+ ->Get(browser_context)
|
||||
+ ->Subscribe(base::Bind(&TtsMessageFilter::BrowserContextDestroyed,
|
||||
+ base::RetainedRef(this)));
|
||||
|
||||
// Balanced in OnChannelClosingInUIThread() to keep the ref-count be non-zero
|
||||
// until all pointers to this class are invalidated.
|
||||
AddRef();
|
||||
}
|
||||
|
||||
-void TtsMessageFilter::OverrideThreadForMessage(
|
||||
- const IPC::Message& message, BrowserThread::ID* thread) {
|
||||
+void TtsMessageFilter::OverrideThreadForMessage(const IPC::Message& message,
|
||||
+ BrowserThread::ID* thread) {
|
||||
switch (message.type()) {
|
||||
- case TtsHostMsg_InitializeVoiceList::ID:
|
||||
- case TtsHostMsg_Speak::ID:
|
||||
- case TtsHostMsg_Pause::ID:
|
||||
- case TtsHostMsg_Resume::ID:
|
||||
- case TtsHostMsg_Cancel::ID:
|
||||
- *thread = BrowserThread::UI;
|
||||
- break;
|
||||
+ case TtsHostMsg_InitializeVoiceList::ID:
|
||||
+ case TtsHostMsg_Speak::ID:
|
||||
+ case TtsHostMsg_Pause::ID:
|
||||
+ case TtsHostMsg_Resume::ID:
|
||||
+ case TtsHostMsg_Cancel::ID:
|
||||
+ *thread = BrowserThread::UI;
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,10 +236,8 @@ void TtsMessageFilter::Cleanup() {
|
||||
content::TtsController::GetInstance()->RemoveUtteranceEventDelegate(this);
|
||||
}
|
||||
|
||||
-void TtsMessageFilter::Observe(
|
||||
- int type,
|
||||
- const content::NotificationSource& source,
|
||||
- const content::NotificationDetails& details) {
|
||||
+void TtsMessageFilter::BrowserContextDestroyed() {
|
||||
+ CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
browser_context_ = nullptr;
|
||||
- notification_registrar_.RemoveAll();
|
||||
+ browser_context_shutdown_notifier_.reset();
|
||||
}
|
||||
diff --git a/chrome/browser/speech/tts_message_filter.h b/chrome/browser/speech/tts_message_filter.h
|
||||
index ffb607fbb275b0a75dba592f2f5f5afb881214e2..99780e56674af749a231f0e85b89e6a6ed3743d6 100644
|
||||
--- a/chrome/browser/speech/tts_message_filter.h
|
||||
+++ b/chrome/browser/speech/tts_message_filter.h
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
+#include "components/keyed_service/core/keyed_service_shutdown_notifier.h"
|
||||
#include "content/public/browser/browser_message_filter.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/notification_observer.h"
|
||||
@@ -21,7 +22,6 @@ class BrowserContext;
|
||||
struct TtsUtteranceRequest;
|
||||
|
||||
class TtsMessageFilter : public content::BrowserMessageFilter,
|
||||
- public content::NotificationObserver,
|
||||
public content::UtteranceEventDelegate,
|
||||
public content::VoicesChangedDelegate {
|
||||
public:
|
||||
@@ -64,15 +64,13 @@ class TtsMessageFilter : public content::BrowserMessageFilter,
|
||||
// about to be deleted.
|
||||
bool Valid();
|
||||
|
||||
- // content::NotificationObserver implementation.
|
||||
- void Observe(int type,
|
||||
- const content::NotificationSource& source,
|
||||
- const content::NotificationDetails& details) override;
|
||||
+ void BrowserContextDestroyed();
|
||||
|
||||
+ std::unique_ptr<KeyedServiceShutdownNotifier::Subscription>
|
||||
+ browser_context_shutdown_notifier_;
|
||||
content::BrowserContext* browser_context_;
|
||||
mutable base::Lock mutex_;
|
||||
mutable bool valid_;
|
||||
- content::NotificationRegistrar notification_registrar_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TtsMessageFilter);
|
||||
};
|
||||
|
||||
29
patches/chromium/ui_views_fix_jumbo_build.patch
Normal file
29
patches/chromium/ui_views_fix_jumbo_build.patch
Normal file
@@ -0,0 +1,29 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Deepak Mohan <hop2deep@gmail.com>
|
||||
Date: Wed, 11 Sep 2019 16:09:34 -0700
|
||||
Subject: ui/views: fix namespace qualification with jumbo_build
|
||||
|
||||
In file included from gen/ui/views/views_jumbo_4.cc:45:
|
||||
.\../../ui/views/widget/widget_hwnd_utils.cc(112,11): error: no member named 'IsFormControlsRefreshEnabled'
|
||||
in namespace 'views::features'; did you mean '::features::IsFormControlsRefreshEnabled'?
|
||||
if (features::IsFormControlsRefreshEnabled() &&
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
::features::IsFormControlsRefreshEnabled
|
||||
../..\ui/base/ui_base_features.h(72,41): note: '::features::IsFormControlsRefreshEnabled' declared here
|
||||
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsFormControlsRefreshEnabled();
|
||||
^
|
||||
1 error generated.
|
||||
ninja: build stopped: subcommand failed.
|
||||
|
||||
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn
|
||||
index b12b2137e8cd24c28d9c9e6845161ac1756f6425..a6df1985f24b023355b0643c12d5685463dd187e 100644
|
||||
--- a/ui/views/BUILD.gn
|
||||
+++ b/ui/views/BUILD.gn
|
||||
@@ -580,6 +580,7 @@ jumbo_component("views") {
|
||||
"win/pen_event_processor.cc",
|
||||
"win/scoped_fullscreen_visibility.cc",
|
||||
]
|
||||
+ jumbo_excluded_sources = [ "widget/widget_hwnd_utils.cc" ]
|
||||
libs = [
|
||||
"dwmapi.lib",
|
||||
"imm32.lib",
|
||||
@@ -6,7 +6,7 @@ Subject: unsandboxed_ppapi_processes_skip_zygote.patch
|
||||
Unsandboxed ppapi processes should skip zygote.
|
||||
|
||||
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
|
||||
index 301349f721145f3fdbf8624e276a0c414ffa14bd..dddc9f959fcf2e6036f3de01738d9ad3eea457a9 100644
|
||||
index 86c23036817bc69ed44331acb5257582a3c66ff9..f3e184daf801dacb6a1a57ace82d22734ba770c5 100644
|
||||
--- a/content/browser/ppapi_plugin_process_host.cc
|
||||
+++ b/content/browser/ppapi_plugin_process_host.cc
|
||||
@@ -128,6 +128,9 @@ class PpapiPluginSandboxedProcessLauncherDelegate
|
||||
|
||||
@@ -7,7 +7,7 @@ Temporarily add additional debugging statements to
|
||||
generate_breakpad_symbols.py to determine why it is hanging.
|
||||
|
||||
diff --git a/components/crash/content/tools/generate_breakpad_symbols.py b/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
index db04d39f8d263dc2b3b67b7f84470f557b519cfa..edb3fa5c125fae7858a1f36495410baf47d58484 100755
|
||||
index 130ee13f8d5ecfcb5a303f7cc05af261693acf78..fe6d008b910942a59e31371ec08179b23a6fa0bb 100755
|
||||
--- a/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
+++ b/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
@@ -60,7 +60,10 @@ def Resolve(path, exe_path, loader_path, rpaths):
|
||||
@@ -32,7 +32,7 @@ index db04d39f8d263dc2b3b67b7f84470f557b519cfa..edb3fa5c125fae7858a1f36495410baf
|
||||
return result
|
||||
|
||||
|
||||
@@ -183,7 +189,7 @@ def GetSharedLibraryDependencies(options, binary, exe_path):
|
||||
@@ -196,7 +202,7 @@ def GetSharedLibraryDependencies(options, binary, exe_path):
|
||||
"""Return absolute paths to all shared library dependencies of the binary."""
|
||||
deps = []
|
||||
if options.platform == 'linux2':
|
||||
@@ -41,7 +41,7 @@ index db04d39f8d263dc2b3b67b7f84470f557b519cfa..edb3fa5c125fae7858a1f36495410baf
|
||||
elif options.platform == 'android':
|
||||
deps = GetSharedLibraryDependenciesAndroid(binary)
|
||||
elif options.platform == 'darwin':
|
||||
@@ -257,7 +263,8 @@ def CreateSymbolDir(options, output_dir, relative_hash_dir):
|
||||
@@ -270,7 +276,8 @@ def CreateSymbolDir(options, output_dir, relative_hash_dir):
|
||||
|
||||
def GenerateSymbols(options, binaries):
|
||||
"""Dumps the symbols of binary and places them in the given directory."""
|
||||
@@ -51,7 +51,7 @@ index db04d39f8d263dc2b3b67b7f84470f557b519cfa..edb3fa5c125fae7858a1f36495410baf
|
||||
queue = Queue.Queue()
|
||||
print_lock = threading.Lock()
|
||||
|
||||
@@ -277,8 +284,15 @@ def GenerateSymbols(options, binaries):
|
||||
@@ -290,8 +297,15 @@ def GenerateSymbols(options, binaries):
|
||||
reason = "Could not locate dump_syms executable."
|
||||
break
|
||||
|
||||
@@ -67,7 +67,7 @@ index db04d39f8d263dc2b3b67b7f84470f557b519cfa..edb3fa5c125fae7858a1f36495410baf
|
||||
if not binary_info:
|
||||
should_dump_syms = False
|
||||
reason = "Could not obtain binary information."
|
||||
@@ -296,8 +310,14 @@ def GenerateSymbols(options, binaries):
|
||||
@@ -309,8 +323,14 @@ def GenerateSymbols(options, binaries):
|
||||
# See if there is a symbol file already found next to the binary
|
||||
potential_symbol_files = glob.glob('%s.breakpad*' % binary)
|
||||
for potential_symbol_file in potential_symbol_files:
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: web_contents.patch
|
||||
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 30c4165bdb6af4cbab48954570c55cbe60cb598d..337c2bade32055f813009e0dbd33621499a921bf 100644
|
||||
index f194fb62a05aafdc617f6ce56bc2f447fd8b5d15..6f18e4888a345de3941b0a19ef91239f435671f3 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -2136,6 +2136,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
@@ -2137,6 +2137,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
std::string unique_name;
|
||||
frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
|
||||
|
||||
@@ -21,7 +21,7 @@ index 30c4165bdb6af4cbab48954570c55cbe60cb598d..337c2bade32055f813009e0dbd336214
|
||||
WebContentsViewDelegate* delegate =
|
||||
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
||||
|
||||
@@ -2151,6 +2157,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
@@ -2152,6 +2158,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
&render_view_host_delegate_view_);
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ index 30c4165bdb6af4cbab48954570c55cbe60cb598d..337c2bade32055f813009e0dbd336214
|
||||
CHECK(view_.get());
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_view_guest.cc b/content/browser/web_contents/web_contents_view_guest.cc
|
||||
index ecaf30bcb7b916a92a69641dd7b96a3633d407c0..0af625928ca6227a21cd4263a14a42b72095399c 100644
|
||||
index c45581fd22b7ba28b76bdebfffdc872b820798c8..f22ac0e611cc79aa1bc7f85836d69e3a8e326a6e 100644
|
||||
--- a/content/browser/web_contents/web_contents_view_guest.cc
|
||||
+++ b/content/browser/web_contents/web_contents_view_guest.cc
|
||||
@@ -68,19 +68,27 @@ gfx::NativeWindow WebContentsViewGuest::GetTopLevelNativeWindow() const {
|
||||
@@ -64,7 +64,7 @@ index ecaf30bcb7b916a92a69641dd7b96a3633d407c0..0af625928ca6227a21cd4263a14a42b7
|
||||
#endif // defined(USE_AURA)
|
||||
}
|
||||
|
||||
@@ -132,11 +140,22 @@ RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget(
|
||||
@@ -130,11 +138,22 @@ RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget(
|
||||
render_widget_host->GetView());
|
||||
}
|
||||
|
||||
@@ -92,10 +92,10 @@ index ecaf30bcb7b916a92a69641dd7b96a3633d407c0..0af625928ca6227a21cd4263a14a42b7
|
||||
|
||||
RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForChildWidget(
|
||||
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
|
||||
index 4ff447d0615d0e14995581ca07bba5118750c29a..818e357453e9b14a62b1b461bb41f85fc74e033d 100644
|
||||
index 9dd92030f9a4a0405c9d7724817a5fc3bf497da1..9bef76029aa3e71cf9ac3d2ac5a5e3a66e60c165 100644
|
||||
--- a/content/public/browser/web_contents.h
|
||||
+++ b/content/public/browser/web_contents.h
|
||||
@@ -76,9 +76,12 @@ class BrowserPluginGuestDelegate;
|
||||
@@ -79,9 +79,12 @@ class BrowserPluginGuestDelegate;
|
||||
class InterstitialPage;
|
||||
class RenderFrameHost;
|
||||
class RenderViewHost;
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: webview_cross_drag.patch
|
||||
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
|
||||
index dda92e4006db1d9a1b68459644d252a3e1dfa4a2..3ed0b3ec3badc9f558f78adbdb31c680ff2631f4 100644
|
||||
index ac096c72a956ecb7e6bacb72452b44f6b00ed251..741f6d44d06bb3abe547184403d0e8cccb00d0ce 100644
|
||||
--- a/content/browser/web_contents/web_contents_view_aura.cc
|
||||
+++ b/content/browser/web_contents/web_contents_view_aura.cc
|
||||
@@ -777,6 +777,7 @@ gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: worker_context_will_destroy.patch
|
||||
|
||||
|
||||
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
|
||||
index 76d775b20307a3c9a779489e754c6849a0f21d64..533a1621e82461d8611ba1d8f2ed2fc527085a03 100644
|
||||
index 7ae6603144706803b04c6583bad366197e20f456..db2e164f0415b511a8d19d18f197d82e8a447ad8 100644
|
||||
--- a/content/public/renderer/content_renderer_client.h
|
||||
+++ b/content/public/renderer/content_renderer_client.h
|
||||
@@ -384,6 +384,11 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
@@ -383,6 +383,11 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
virtual void DidInitializeWorkerContextOnWorkerThread(
|
||||
v8::Local<v8::Context> context) {}
|
||||
|
||||
@@ -21,10 +21,10 @@ index 76d775b20307a3c9a779489e754c6849a0f21d64..533a1621e82461d8611ba1d8f2ed2fc5
|
||||
// An empty URL is returned if the URL is not overriden.
|
||||
virtual GURL OverrideFlashEmbedWithHTML(const GURL& url);
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
|
||||
index a61bc92743c4bdf0b011c451cfc341cb4442a4bb..191e9aa21d2b766e2cc696bdf7963b15baf787d3 100644
|
||||
index 7f3c8fbb4c1870a4313280d00371eea65c718d16..302a23981a0b3b056260f598d22259c57c469ee4 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.cc
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.cc
|
||||
@@ -923,6 +923,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
|
||||
@@ -1002,6 +1002,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
|
||||
WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread();
|
||||
}
|
||||
|
||||
@@ -38,10 +38,10 @@ index a61bc92743c4bdf0b011c451cfc341cb4442a4bb..191e9aa21d2b766e2cc696bdf7963b15
|
||||
const v8::Local<v8::Context>& worker) {
|
||||
GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread(
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h
|
||||
index fb807df3f015c6d9a3a18608301b2781596415de..a08e9fb3a30bf401b204c206ef9f2aa289890b39 100644
|
||||
index b183977096477563043b288b33d90d3ce9fbd8de..87bd2530eb060c8e68a5a2ca090ce80cd63b942e 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.h
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.h
|
||||
@@ -190,6 +190,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
@@ -200,6 +200,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
void DidStartWorkerThread() override;
|
||||
void WillStopWorkerThread() override;
|
||||
void WorkerContextCreated(const v8::Local<v8::Context>& worker) override;
|
||||
@@ -50,10 +50,10 @@ index fb807df3f015c6d9a3a18608301b2781596415de..a08e9fb3a30bf401b204c206ef9f2aa2
|
||||
const blink::WebString& header_name) override;
|
||||
|
||||
diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h
|
||||
index 814efddb679051d2bd916ee565d117669c254751..f2ac53df9091a7d5b4ca6b0e5b724a1f058f04e8 100644
|
||||
index cd9572908f0c8b80341f28facfe4256df30b27ff..d9ff47fac2590b1a0fa2a8faf803bc0fa875ae25 100644
|
||||
--- a/third_party/blink/public/platform/platform.h
|
||||
+++ b/third_party/blink/public/platform/platform.h
|
||||
@@ -677,6 +677,7 @@ class BLINK_PLATFORM_EXPORT Platform {
|
||||
@@ -693,6 +693,7 @@ class BLINK_PLATFORM_EXPORT Platform {
|
||||
virtual void DidStartWorkerThread() {}
|
||||
virtual void WillStopWorkerThread() {}
|
||||
virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}
|
||||
@@ -62,10 +62,10 @@ index 814efddb679051d2bd916ee565d117669c254751..f2ac53df9091a7d5b4ca6b0e5b724a1f
|
||||
const WebSecurityOrigin& script_origin) {
|
||||
return false;
|
||||
diff --git a/third_party/blink/renderer/core/workers/worker_thread.cc b/third_party/blink/renderer/core/workers/worker_thread.cc
|
||||
index 391a9d1099ac3226c6c0d42e74e672f958e5a58b..3d66c80a190a533fade36d452f8093116a0d6c1b 100644
|
||||
index d16b0ea72e4d0c0371bbb145c4f4c26b4d5c19e2..bd4af3ae2df62968aaf9001db8eda006a96d307b 100644
|
||||
--- a/third_party/blink/renderer/core/workers/worker_thread.cc
|
||||
+++ b/third_party/blink/renderer/core/workers/worker_thread.cc
|
||||
@@ -658,6 +658,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
|
||||
@@ -680,6 +680,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
|
||||
nested_runner_->QuitNow();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
"src/electron/patches/boringssl": "src/third_party/boringssl/src",
|
||||
|
||||
"src/electron/patches/perfetto": "src/third_party/perfetto",
|
||||
|
||||
"src/electron/patches/v8": "src/v8",
|
||||
|
||||
"src/electron/patches/node": "src/third_party/electron_node"
|
||||
|
||||
2
patches/perfetto/.patches
Normal file
2
patches/perfetto/.patches
Normal file
@@ -0,0 +1,2 @@
|
||||
revert_fix_chrome_roll_update_protoc_host_toolchain_rules.patch
|
||||
revert_make_trace_processor_a_host-only_target.patch
|
||||
@@ -0,0 +1,134 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Wed, 11 Sep 2019 12:40:20 -0700
|
||||
Subject: Revert "Fix chrome roll: update protoc host toolchain rules"
|
||||
|
||||
This reverts commit b7ebffd32830be65b752841d37de5455d84b42b8.
|
||||
|
||||
diff --git a/gn/BUILD.gn b/gn/BUILD.gn
|
||||
index a8aecc1ac1aa0af60df335fafeee56dff337a189..5ead1b50fb43047081b29fa55d5c0eda7a5c8142 100644
|
||||
--- a/gn/BUILD.gn
|
||||
+++ b/gn/BUILD.gn
|
||||
@@ -182,30 +182,28 @@ whitelisted_protobuf_full_deps = [
|
||||
"../src/trace_processor:trace_processor_shell",
|
||||
]
|
||||
|
||||
-group("protoc") {
|
||||
- public_deps = [
|
||||
- "${perfetto_protobuf_target_prefix}:protoc($host_toolchain)",
|
||||
- ]
|
||||
-}
|
||||
+if (current_toolchain == host_toolchain) {
|
||||
+ group("protoc") {
|
||||
+ public_deps = [
|
||||
+ "${perfetto_protobuf_target_prefix}:protoc",
|
||||
+ ]
|
||||
+ }
|
||||
+} # current_toolchain == host_toolchain
|
||||
|
||||
# protoc compiler library, it's used for building protoc plugins and by
|
||||
# trace_processor_shell to dynamically load .proto files for metrics.
|
||||
group("protoc_lib") {
|
||||
visibility = whitelisted_protobuf_full_deps
|
||||
- if (current_toolchain == host_toolchain) {
|
||||
- public_deps = [
|
||||
- "${perfetto_protobuf_target_prefix}:protoc_lib",
|
||||
- ]
|
||||
- }
|
||||
+ public_deps = [
|
||||
+ "${perfetto_protobuf_target_prefix}:protoc_lib",
|
||||
+ ]
|
||||
}
|
||||
|
||||
group("protobuf_full") {
|
||||
visibility = whitelisted_protobuf_full_deps
|
||||
- if (current_toolchain == host_toolchain) {
|
||||
- public_deps = [
|
||||
- "${perfetto_protobuf_target_prefix}:protobuf_full",
|
||||
- ]
|
||||
- }
|
||||
+ public_deps = [
|
||||
+ "${perfetto_protobuf_target_prefix}:protobuf_full",
|
||||
+ ]
|
||||
}
|
||||
|
||||
group("protobuf_lite") {
|
||||
diff --git a/gn/perfetto.gni b/gn/perfetto.gni
|
||||
index 4bf62528336b5b6c8ce6eb932c18dcb6912422da..78aa3a63a677afc8789f58bb48e1dfac8a671eb9 100644
|
||||
--- a/gn/perfetto.gni
|
||||
+++ b/gn/perfetto.gni
|
||||
@@ -161,8 +161,7 @@ declare_args() {
|
||||
|
||||
# Misc host executable under tools/.
|
||||
enable_perfetto_tools =
|
||||
- (perfetto_build_standalone && current_toolchain == host_toolchain) ||
|
||||
- perfetto_build_with_android
|
||||
+ perfetto_build_standalone || perfetto_build_with_android
|
||||
|
||||
# Allows to build the UI (TypeScript/ HTML / WASM)
|
||||
enable_perfetto_ui = perfetto_build_standalone
|
||||
diff --git a/tools/gen_android_bp b/tools/gen_android_bp
|
||||
index 05a7d508bd51dc83f4b7039fccbb2b7415c0b208..f01e95d5de4bbfd1c8658bfbb6b7e061bfe6b632 100755
|
||||
--- a/tools/gen_android_bp
|
||||
+++ b/tools/gen_android_bp
|
||||
@@ -136,12 +136,23 @@ additional_args = {
|
||||
def enable_gmock(module):
|
||||
module.static_libs.append('libgmock')
|
||||
|
||||
+
|
||||
+def enable_gtest_prod(module):
|
||||
+ module.static_libs.append('libgtest_prod')
|
||||
+
|
||||
+
|
||||
+def enable_gtest(module):
|
||||
+ assert module.type == 'cc_test'
|
||||
+
|
||||
+
|
||||
def enable_protobuf_full(module):
|
||||
module.shared_libs.append('libprotobuf-cpp-full')
|
||||
|
||||
+
|
||||
def enable_protobuf_lite(module):
|
||||
module.shared_libs.append('libprotobuf-cpp-lite')
|
||||
|
||||
+
|
||||
def enable_protoc_lib(module):
|
||||
module.shared_libs.append('libprotoc')
|
||||
|
||||
@@ -171,14 +182,16 @@ def enable_zlib(module):
|
||||
# Android equivalents for third-party libraries that the upstream project
|
||||
# depends on.
|
||||
builtin_deps = {
|
||||
- '//gn:gtest_and_gmock': enable_gmock,
|
||||
- '//gn:libunwind': enable_libunwind,
|
||||
- '//gn:protobuf_full': enable_protobuf_full,
|
||||
- '//gn:protobuf_lite': enable_protobuf_lite,
|
||||
- '//gn:protoc_lib': enable_protoc_lib,
|
||||
- '//gn:libunwindstack': enable_libunwindstack,
|
||||
- '//gn:sqlite': enable_sqlite,
|
||||
- '//gn:zlib': enable_zlib,
|
||||
+ '//buildtools:gmock': enable_gmock,
|
||||
+ '//buildtools:gtest': enable_gtest,
|
||||
+ '//buildtools:gtest_main': enable_gtest,
|
||||
+ '//buildtools:libunwind': enable_libunwind,
|
||||
+ '//buildtools:protobuf_full': enable_protobuf_full,
|
||||
+ '//buildtools:protobuf_lite': enable_protobuf_lite,
|
||||
+ '//buildtools:protoc_lib': enable_protoc_lib,
|
||||
+ '//buildtools:libunwindstack': enable_libunwindstack,
|
||||
+ '//buildtools:sqlite': enable_sqlite,
|
||||
+ '//buildtools:zlib': enable_zlib,
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
@@ -401,10 +414,7 @@ def apply_module_dependency(blueprint, desc, module, dep_name):
|
||||
dep_name: GN target of the dependency.
|
||||
"""
|
||||
# If the dependency refers to a library which we can replace with an Android
|
||||
- # equivalent, stop recursing and patch the dependency in. Don't recurse into
|
||||
- # //buildtools, builtin_deps are intercepted at the //gn:xxx level.
|
||||
- if dep_name.startswith('//buildtools'):
|
||||
- return
|
||||
+ # equivalent, stop recursing and patch the dependency in.
|
||||
if gn_utils.label_without_toolchain(dep_name) in builtin_deps:
|
||||
builtin_deps[gn_utils.label_without_toolchain(dep_name)](module)
|
||||
return
|
||||
@@ -0,0 +1,389 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Wed, 11 Sep 2019 12:40:33 -0700
|
||||
Subject: Revert "Make trace_processor a host-only target"
|
||||
|
||||
This reverts commit d0001c31122289ab00ca03dc493f622aeb8a2e81.
|
||||
|
||||
diff --git a/Android.bp b/Android.bp
|
||||
index 1d3c676bed57846207d68a5d1193991e688655c9..59eaefb7a4a91019eaf9c14d7c078d5aeb4073d5 100644
|
||||
--- a/Android.bp
|
||||
+++ b/Android.bp
|
||||
@@ -4660,7 +4660,7 @@ cc_test {
|
||||
}
|
||||
|
||||
// GN target: //src/trace_processor:trace_processor_shell
|
||||
-cc_binary_host {
|
||||
+cc_binary {
|
||||
name: "trace_processor_shell",
|
||||
srcs: [
|
||||
":perfetto_protos_perfetto_common_zero_gen",
|
||||
@@ -4783,12 +4783,10 @@ cc_binary_host {
|
||||
],
|
||||
shared_libs: [
|
||||
"liblog",
|
||||
- "libprotoc",
|
||||
+ "libprotobuf-cpp-full",
|
||||
"libz",
|
||||
],
|
||||
- static_libs: [
|
||||
- "libsqlite",
|
||||
- ],
|
||||
+ host_supported: true,
|
||||
generated_headers: [
|
||||
"gen_merged_sql_metrics",
|
||||
"perfetto_protos_perfetto_common_zero_gen_headers",
|
||||
@@ -4828,6 +4826,21 @@ cc_binary_host {
|
||||
"-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
|
||||
"-DHAVE_HIDDEN",
|
||||
],
|
||||
+ target: {
|
||||
+ android: {
|
||||
+ shared_libs: [
|
||||
+ "libandroidicu",
|
||||
+ "liblog",
|
||||
+ "libsqlite",
|
||||
+ "libutils",
|
||||
+ ],
|
||||
+ },
|
||||
+ host: {
|
||||
+ static_libs: [
|
||||
+ "libsqlite",
|
||||
+ ],
|
||||
+ },
|
||||
+ },
|
||||
}
|
||||
|
||||
// GN target: //tools/trace_to_text:trace_to_text
|
||||
diff --git a/buildtools/BUILD.gn b/buildtools/BUILD.gn
|
||||
index 220fb8ba22d228b95c6b14247edebf54dc9db6c2..cdbdb6a5548df3e984bde1f5406767aa1accf97a 100644
|
||||
--- a/buildtools/BUILD.gn
|
||||
+++ b/buildtools/BUILD.gn
|
||||
@@ -273,111 +273,111 @@ source_set("protobuf_full") {
|
||||
public_configs = [ ":protobuf_gen_config" ]
|
||||
}
|
||||
|
||||
-source_set("protoc_lib") {
|
||||
- visibility = _buildtools_visibility
|
||||
- deps = [
|
||||
- ":protobuf_full",
|
||||
- "//gn:default_deps",
|
||||
- ]
|
||||
- sources = [
|
||||
- "protobuf/src/google/protobuf/compiler/code_generator.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/command_line_interface.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/cpp/cpp_enum.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/cpp/cpp_extension.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/cpp/cpp_file.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/cpp/cpp_generator.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_enum.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_generator.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_message.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_context.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_doc_comment.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_enum.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_enum_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_enum_field_lite.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_extension.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_extension_lite.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_file.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_generator.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_generator_factory.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_helpers.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_map_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_map_field_lite.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_message.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_message_builder.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_message_builder_lite.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_message_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_message_field_lite.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_message_lite.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_name_resolver.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_primitive_field_lite.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_service.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_shared_code_generator.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_string_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/java/java_string_field_lite.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/javanano/javanano_enum.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/javanano/javanano_enum_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/javanano/javanano_extension.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/javanano/javanano_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/javanano/javanano_file.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/javanano/javanano_generator.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/javanano/javanano_helpers.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/javanano/javanano_map_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/javanano/javanano_message.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/javanano/javanano_message_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/js/js_generator.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_extension.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_generator.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/plugin.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/plugin.pb.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/python/python_generator.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/ruby/ruby_generator.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/subprocess.cc",
|
||||
- "protobuf/src/google/protobuf/compiler/zip_writer.cc",
|
||||
- ]
|
||||
- configs -= [ "//gn/standalone:extra_warnings" ]
|
||||
- configs += [ ":protobuf_config" ]
|
||||
- public_configs = [ ":protobuf_gen_config" ]
|
||||
-}
|
||||
-
|
||||
if (current_toolchain == host_toolchain) {
|
||||
+ source_set("protoc_lib") {
|
||||
+ visibility = _buildtools_visibility
|
||||
+ deps = [
|
||||
+ ":protobuf_full",
|
||||
+ "//gn:default_deps",
|
||||
+ ]
|
||||
+ sources = [
|
||||
+ "protobuf/src/google/protobuf/compiler/code_generator.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/command_line_interface.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/cpp/cpp_enum.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/cpp/cpp_extension.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/cpp/cpp_file.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/cpp/cpp_generator.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_enum.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_generator.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_message.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_context.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_doc_comment.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_enum.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_enum_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_enum_field_lite.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_extension.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_extension_lite.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_file.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_generator.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_generator_factory.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_helpers.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_map_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_map_field_lite.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_message.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_message_builder.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_message_builder_lite.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_message_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_message_field_lite.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_message_lite.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_name_resolver.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_primitive_field_lite.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_service.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_shared_code_generator.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_string_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/java/java_string_field_lite.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/javanano/javanano_enum.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/javanano/javanano_enum_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/javanano/javanano_extension.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/javanano/javanano_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/javanano/javanano_file.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/javanano/javanano_generator.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/javanano/javanano_helpers.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/javanano/javanano_map_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/javanano/javanano_message.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/javanano/javanano_message_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/js/js_generator.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_extension.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_generator.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/plugin.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/plugin.pb.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/python/python_generator.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/ruby/ruby_generator.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/subprocess.cc",
|
||||
+ "protobuf/src/google/protobuf/compiler/zip_writer.cc",
|
||||
+ ]
|
||||
+ configs -= [ "//gn/standalone:extra_warnings" ]
|
||||
+ configs += [ ":protobuf_config" ]
|
||||
+ public_configs = [ ":protobuf_gen_config" ]
|
||||
+ }
|
||||
+
|
||||
executable("protoc") {
|
||||
visibility = _buildtools_visibility
|
||||
deps = [
|
||||
diff --git a/gn/BUILD.gn b/gn/BUILD.gn
|
||||
index 5ead1b50fb43047081b29fa55d5c0eda7a5c8142..529b4e24c5aa9532e4945c0826231ec60ce78b6d 100644
|
||||
--- a/gn/BUILD.gn
|
||||
+++ b/gn/BUILD.gn
|
||||
@@ -173,34 +173,23 @@ group("gtest_main") {
|
||||
}
|
||||
}
|
||||
|
||||
-# Full protobuf is just for host tools .No binary shipped on device should
|
||||
-# depend on this.
|
||||
-whitelisted_protobuf_full_deps = [
|
||||
- "../tools/*",
|
||||
- "../src/ipc/protoc_plugin:*",
|
||||
- "../src/protozero/protoc_plugin:*",
|
||||
- "../src/trace_processor:trace_processor_shell",
|
||||
-]
|
||||
-
|
||||
+# protoc compiler library, for building protoc plugins on the host.
|
||||
if (current_toolchain == host_toolchain) {
|
||||
+ group("protoc_lib") {
|
||||
+ public_deps = [
|
||||
+ "${perfetto_protobuf_target_prefix}:protoc_lib",
|
||||
+ ]
|
||||
+ }
|
||||
+
|
||||
group("protoc") {
|
||||
public_deps = [
|
||||
"${perfetto_protobuf_target_prefix}:protoc",
|
||||
]
|
||||
}
|
||||
-} # current_toolchain == host_toolchain
|
||||
-
|
||||
-# protoc compiler library, it's used for building protoc plugins and by
|
||||
-# trace_processor_shell to dynamically load .proto files for metrics.
|
||||
-group("protoc_lib") {
|
||||
- visibility = whitelisted_protobuf_full_deps
|
||||
- public_deps = [
|
||||
- "${perfetto_protobuf_target_prefix}:protoc_lib",
|
||||
- ]
|
||||
}
|
||||
|
||||
group("protobuf_full") {
|
||||
- visibility = whitelisted_protobuf_full_deps
|
||||
+ testonly = true
|
||||
public_deps = [
|
||||
"${perfetto_protobuf_target_prefix}:protobuf_full",
|
||||
]
|
||||
diff --git a/src/trace_processor/BUILD.gn b/src/trace_processor/BUILD.gn
|
||||
index 952dd65d9ad1c5f4d4ee0443007bfaf6110c8dfb..12e0d800b5673af1785e5a09e49847702442d2a1 100644
|
||||
--- a/src/trace_processor/BUILD.gn
|
||||
+++ b/src/trace_processor/BUILD.gn
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
import("../../gn/fuzzer.gni")
|
||||
import("../../gn/perfetto.gni")
|
||||
-import("../../gn/perfetto_host_executable.gni")
|
||||
import("../../gn/test.gni")
|
||||
import("../../gn/wasm.gni")
|
||||
|
||||
@@ -229,11 +228,12 @@ source_set("common") {
|
||||
]
|
||||
}
|
||||
|
||||
-perfetto_host_executable("trace_processor_shell") {
|
||||
+executable("trace_processor_shell") {
|
||||
+ testonly = true # We need this for proto full.
|
||||
deps = [
|
||||
":lib",
|
||||
"../../gn:default_deps",
|
||||
- "../../gn:protoc_lib",
|
||||
+ "../../gn:protobuf_full",
|
||||
"../base",
|
||||
"metrics:lib",
|
||||
]
|
||||
diff --git a/tools/gen_android_bp b/tools/gen_android_bp
|
||||
index f01e95d5de4bbfd1c8658bfbb6b7e061bfe6b632..0d6b01a8cc838efda58634d21298243f2a649da8 100755
|
||||
--- a/tools/gen_android_bp
|
||||
+++ b/tools/gen_android_bp
|
||||
@@ -61,6 +61,11 @@ default_targets = [
|
||||
'//tools/trace_to_text:trace_to_text',
|
||||
]
|
||||
|
||||
+# Targets which are testonly but should still be a cc_binary.
|
||||
+non_test_binaries = [
|
||||
+ '//src/trace_processor:trace_processor_shell',
|
||||
+]
|
||||
+
|
||||
# Defines a custom init_rc argument to be applied to the corresponding output
|
||||
# blueprint target.
|
||||
target_initrc = {
|
||||
@@ -70,11 +75,11 @@ target_initrc = {
|
||||
|
||||
target_host_supported = [
|
||||
'//protos/perfetto/trace:perfetto_trace_protos',
|
||||
+ '//src/trace_processor:trace_processor_shell',
|
||||
]
|
||||
|
||||
target_host_only = [
|
||||
'//tools/trace_to_text:trace_to_text',
|
||||
- '//src/trace_processor:trace_processor_shell',
|
||||
]
|
||||
|
||||
# All module names are prefixed with this string to avoid collisions.
|
||||
@@ -640,7 +645,7 @@ def create_modules_from_target(blueprint, desc, target_name):
|
||||
if target['type'] == 'executable':
|
||||
if 'host' in target['toolchain'] or target_name in target_host_only:
|
||||
module_type = 'cc_binary_host'
|
||||
- elif target.get('testonly'):
|
||||
+ elif target.get('testonly') and target_name not in non_test_binaries:
|
||||
module_type = 'cc_test'
|
||||
else:
|
||||
module_type = 'cc_binary'
|
||||
@@ -6,3 +6,4 @@ dcheck.patch
|
||||
export_symbols_needed_for_windows_build.patch
|
||||
workaround_an_undefined_symbol_error.patch
|
||||
do_not_export_private_v8_symbols_on_windows.patch
|
||||
revert_cleanup_switch_offset_of_to_offsetof_where_possible.patch
|
||||
|
||||
@@ -12,10 +12,10 @@ when we override ReallocateBufferMemory, so we therefore need to implement
|
||||
Realloc on the v8 side.
|
||||
|
||||
diff --git a/include/v8.h b/include/v8.h
|
||||
index ca96c32088df3983c796a807b2ce76017e0fa2df..db972ab5ce249927d9f6e738263600c30c2e176c 100644
|
||||
index 24052f25bf7499743d1bf59846325274c3fd81c0..c5f0436eb771b6ca86fdf8e0dc195221c6b481f4 100644
|
||||
--- a/include/v8.h
|
||||
+++ b/include/v8.h
|
||||
@@ -4651,6 +4651,13 @@ class V8_EXPORT ArrayBuffer : public Object {
|
||||
@@ -4748,6 +4748,13 @@ class V8_EXPORT ArrayBuffer : public Object {
|
||||
*/
|
||||
virtual void* AllocateUninitialized(size_t length) = 0;
|
||||
|
||||
@@ -30,10 +30,10 @@ index ca96c32088df3983c796a807b2ce76017e0fa2df..db972ab5ce249927d9f6e738263600c3
|
||||
* Free the memory block of size |length|, pointed to by |data|.
|
||||
* That memory is guaranteed to be previously allocated by |Allocate|.
|
||||
diff --git a/src/api/api.cc b/src/api/api.cc
|
||||
index e02c74416b81c67e2bcdfa6bca5d06efd261153a..c41692ca40057efa39440239cda217ae1e39afe8 100644
|
||||
index b03cc11532e0ec1d0e047bd794d15416cb343670..e9e46fd117dbf67a0fb7bdf560e152daa8624ff8 100644
|
||||
--- a/src/api/api.cc
|
||||
+++ b/src/api/api.cc
|
||||
@@ -507,6 +507,10 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) {
|
||||
@@ -518,6 +518,10 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) {
|
||||
i::V8::SetSnapshotBlob(snapshot_blob);
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user