mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
Compare commits
31 Commits
close-wind
...
docs/win-a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5cce352fb5 | ||
|
|
72c2b9e862 | ||
|
|
08241669bc | ||
|
|
6e36153799 | ||
|
|
4f76fff978 | ||
|
|
c82ec0c72b | ||
|
|
c57ce31e84 | ||
|
|
32b44aa5c8 | ||
|
|
7032c0d03c | ||
|
|
b9c4b27781 | ||
|
|
8c427253b3 | ||
|
|
ed28ead8ac | ||
|
|
90a7e5acae | ||
|
|
707b9a58cc | ||
|
|
a32705fd30 | ||
|
|
00e3445f8a | ||
|
|
1036d824fe | ||
|
|
587b66acc1 | ||
|
|
040acaaf30 | ||
|
|
dd3fd78e63 | ||
|
|
61ddb1aa07 | ||
|
|
00da7279cb | ||
|
|
7609156ae1 | ||
|
|
66dec24e32 | ||
|
|
433d6c33d8 | ||
|
|
b02918883f | ||
|
|
1cd7419718 | ||
|
|
daecbb90fe | ||
|
|
193e162ec6 | ||
|
|
3759e59bbd | ||
|
|
41b2102d10 |
@@ -75,10 +75,6 @@ executors:
|
||||
resource_class: << parameters.size >>
|
||||
|
||||
# Electron Runners
|
||||
apple-silicon:
|
||||
resource_class: electronjs/macos-arm64
|
||||
machine: true
|
||||
|
||||
linux-arm:
|
||||
resource_class: electronjs/aks-linux-arm-test
|
||||
docker:
|
||||
@@ -2298,8 +2294,10 @@ jobs:
|
||||
- electron-tests:
|
||||
artifact-key: darwin-x64
|
||||
|
||||
darwin-testing-arm64-tests:
|
||||
executor: apple-silicon
|
||||
darwin-testing-arm64-tests:
|
||||
executor:
|
||||
name: macos
|
||||
size: macos.m1.medium.gen1
|
||||
environment:
|
||||
<<: *env-mac-large
|
||||
<<: *env-stack-dumping
|
||||
@@ -2323,7 +2321,9 @@ jobs:
|
||||
artifact-key: mas-x64
|
||||
|
||||
mas-testing-arm64-tests:
|
||||
executor: apple-silicon
|
||||
executor:
|
||||
name: macos
|
||||
size: macos.m1.medium.gen1
|
||||
environment:
|
||||
<<: *env-mac-large
|
||||
<<: *env-stack-dumping
|
||||
|
||||
18
.github/workflows/issue-labeled.yml
vendored
18
.github/workflows/issue-labeled.yml
vendored
@@ -8,6 +8,24 @@ permissions: # added using https://github.com/step-security/secure-workflows
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
issue-labeled-with-status:
|
||||
name: status/{confirmed,reviewed} label added
|
||||
if: github.event.label.name == 'status/confirmed' || github.event.label.name == 'status/reviewed'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Set status
|
||||
uses: dsanders11/project-actions/edit-item@82e99438bd44a14ad18d92d036dbc25cbfb9a8c4 # v1.2.0
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
project-number: 90
|
||||
field: Status
|
||||
field-value: ✅ Triaged
|
||||
issue-labeled-blocked:
|
||||
name: blocked/* label added
|
||||
if: startsWith(github.event.label.name, 'blocked/')
|
||||
|
||||
41
.github/workflows/issue-opened.yml
vendored
41
.github/workflows/issue-opened.yml
vendored
@@ -25,3 +25,44 @@ jobs:
|
||||
field-value: ${{ github.event.issue.user.login }}
|
||||
project-number: 90
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
set-labels:
|
||||
if: ${{ contains(github.event.issue.labels.*.name, 'bug :beetle:') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- run: npm install mdast-util-from-markdown@2.0.0 unist-util-select@5.1.0
|
||||
- name: Add labels
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
env:
|
||||
ISSUE_BODY: ${{ github.event.issue.body }}
|
||||
with:
|
||||
github-token: ${{ steps.generate-token.outputs.token }}
|
||||
script: |
|
||||
const { fromMarkdown } = await import('${{ github.workspace }}/node_modules/mdast-util-from-markdown/index.js');
|
||||
const { select } = await import('${{ github.workspace }}/node_modules/unist-util-select/index.js');
|
||||
|
||||
const [ owner, repo ] = '${{ github.repository }}'.split('/');
|
||||
const issue_number = ${{ github.event.issue.number }};
|
||||
|
||||
const tree = fromMarkdown(process.env.ISSUE_BODY);
|
||||
|
||||
const labels = [];
|
||||
|
||||
const gistUrl = select('heading:has(> text[value="Testcase Gist URL"]) + paragraph > text', tree)?.value.trim();
|
||||
if (gistUrl !== undefined && gistUrl.startsWith('https://gist.github.com/')) {
|
||||
labels.push('has-repro-gist');
|
||||
}
|
||||
|
||||
if (labels.length) {
|
||||
await github.rest.issues.addLabels({
|
||||
owner,
|
||||
repo,
|
||||
issue_number,
|
||||
labels,
|
||||
});
|
||||
}
|
||||
|
||||
2
BUILD.gn
2
BUILD.gn
@@ -855,7 +855,7 @@ if (is_mac) {
|
||||
if (is_asan) {
|
||||
# crashpad_handler requires the ASan runtime at its @executable_path.
|
||||
sources += [ "$root_out_dir/libclang_rt.asan_osx_dynamic.dylib" ]
|
||||
public_deps += [ "//build/config/sanitizers:copy_asan_runtime" ]
|
||||
public_deps += [ "//build/config/sanitizers:copy_sanitizer_runtime" ]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
DEPS
2
DEPS
@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'124.0.6353.0',
|
||||
'124.0.6359.0',
|
||||
'node_version':
|
||||
'v20.11.1',
|
||||
'nan_version':
|
||||
|
||||
@@ -112,4 +112,4 @@ and more can be found on the [Community page](https://www.electronjs.org/communi
|
||||
|
||||
[MIT](https://github.com/electron/electron/blob/main/LICENSE)
|
||||
|
||||
When using Electron logos, make sure to follow [OpenJS Foundation Trademark Policy](https://openjsf.org/wp-content/uploads/sites/84/2021/01/OpenJS-Foundation-Trademark-Policy-2021-01-12.docx.pdf).
|
||||
When using Electron logos, make sure to follow [OpenJS Foundation Trademark Policy](https://trademark-policy.openjsf.org/).
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
version: 1.0.{build}
|
||||
build_cloud: electronhq-16-core
|
||||
image: e-124.0.6351.0
|
||||
image: e-124.0.6359.0
|
||||
environment:
|
||||
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
||||
ELECTRON_OUT_DIR: Default
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
version: 1.0.{build}
|
||||
build_cloud: electronhq-16-core
|
||||
image: e-124.0.6351.0
|
||||
image: e-124.0.6359.0
|
||||
environment:
|
||||
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
||||
ELECTRON_OUT_DIR: Default
|
||||
|
||||
@@ -32,7 +32,7 @@ In most cases, you should do everything in the `ready` event handler.
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `launchInfo` Record<string, any> | [NotificationResponse](structures/notification-response.md) _macOS_
|
||||
* `launchInfo` Record\<string, any\> | [NotificationResponse](structures/notification-response.md) _macOS_
|
||||
|
||||
Emitted once, when Electron has finished initializing. On macOS, `launchInfo`
|
||||
holds the `userInfo` of the [`NSUserNotification`](https://developer.apple.com/documentation/foundation/nsusernotification)
|
||||
@@ -970,7 +970,7 @@ app.setJumpList([
|
||||
|
||||
### `app.requestSingleInstanceLock([additionalData])`
|
||||
|
||||
* `additionalData` Record<any, any> (optional) - A JSON object containing additional data to send to the first instance.
|
||||
* `additionalData` Record\<any, any\> (optional) - A JSON object containing additional data to send to the first instance.
|
||||
|
||||
Returns `boolean`
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ The `autoUpdater` object has the following methods:
|
||||
|
||||
* `options` Object
|
||||
* `url` string
|
||||
* `headers` Record<string, string> (optional) _macOS_ - HTTP request headers.
|
||||
* `headers` Record\<string, string\> (optional) _macOS_ - HTTP request headers.
|
||||
* `serverType` string (optional) _macOS_ - Can be `json` or `default`, see the [Squirrel.Mac][squirrel-mac]
|
||||
README for more information.
|
||||
|
||||
|
||||
@@ -656,7 +656,7 @@ Closes the currently open [Quick Look][quick-look] panel.
|
||||
|
||||
#### `win.setBounds(bounds[, animate])`
|
||||
|
||||
* `bounds` Partial<[Rectangle](structures/rectangle.md)>
|
||||
* `bounds` Partial\<[Rectangle](structures/rectangle.md)\>
|
||||
* `animate` boolean (optional) _macOS_
|
||||
|
||||
Resizes and moves the window to the supplied bounds. Any properties that are not supplied will default to their current values.
|
||||
|
||||
@@ -779,7 +779,7 @@ Closes the currently open [Quick Look][quick-look] panel.
|
||||
|
||||
#### `win.setBounds(bounds[, animate])`
|
||||
|
||||
* `bounds` Partial<[Rectangle](structures/rectangle.md)>
|
||||
* `bounds` Partial\<[Rectangle](structures/rectangle.md)\>
|
||||
* `animate` boolean (optional) _macOS_
|
||||
|
||||
Resizes and moves the window to the supplied bounds. Any properties that are not supplied will default to their current values.
|
||||
@@ -1215,7 +1215,7 @@ win.loadURL('http://localhost:8000/post', {
|
||||
|
||||
* `filePath` string
|
||||
* `options` Object (optional)
|
||||
* `query` Record<string, string> (optional) - Passed to `url.format()`.
|
||||
* `query` Record\<string, string\> (optional) - Passed to `url.format()`.
|
||||
* `search` string (optional) - Passed to `url.format()`.
|
||||
* `hash` string (optional) - Passed to `url.format()`.
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ Returns:
|
||||
* `statusCode` Integer
|
||||
* `method` string
|
||||
* `redirectUrl` string
|
||||
* `responseHeaders` Record<string, string[]>
|
||||
* `responseHeaders` Record\<string, string[]\>
|
||||
|
||||
Emitted when the server returns a redirect response (e.g. 301 Moved
|
||||
Permanently). Calling [`request.followRedirect`](#requestfollowredirect) will
|
||||
|
||||
@@ -59,14 +59,14 @@ The `crashReporter` module has the following methods:
|
||||
number of crashes uploaded to 1/hour. Default is `false`.
|
||||
* `compress` boolean (optional) - If true, crash reports will be compressed
|
||||
and uploaded with `Content-Encoding: gzip`. Default is `true`.
|
||||
* `extra` Record<string, string> (optional) - Extra string key/value
|
||||
* `extra` Record\<string, string\> (optional) - Extra string key/value
|
||||
annotations that will be sent along with crash reports that are generated
|
||||
in the main process. Only string values are supported. Crashes generated in
|
||||
child processes will not contain these extra
|
||||
parameters to crash reports generated from child processes, call
|
||||
[`addExtraParameter`](#crashreporteraddextraparameterkey-value) from the
|
||||
child process.
|
||||
* `globalExtra` Record<string, string> (optional) - Extra string key/value
|
||||
* `globalExtra` Record\<string, string\> (optional) - Extra string key/value
|
||||
annotations that will be sent along with any crash reports generated in any
|
||||
process. These annotations cannot be changed once the crash reporter has
|
||||
been started. If a key is present in both the global extra parameters and
|
||||
|
||||
@@ -72,7 +72,7 @@ Removes listeners of the specified `channel`.
|
||||
### `ipcMain.handle(channel, listener)`
|
||||
|
||||
* `channel` string
|
||||
* `listener` Function<Promise\<any> | any>
|
||||
* `listener` Function\<Promise\<any\> | any\>
|
||||
* `event` [IpcMainInvokeEvent][ipc-main-invoke-event]
|
||||
* `...args` any[]
|
||||
|
||||
@@ -109,7 +109,7 @@ provided to the renderer process. Please refer to
|
||||
### `ipcMain.handleOnce(channel, listener)`
|
||||
|
||||
* `channel` string
|
||||
* `listener` Function<Promise\<any> | any>
|
||||
* `listener` Function\<Promise\<any\> | any\>
|
||||
* `event` [IpcMainInvokeEvent][ipc-main-invoke-event]
|
||||
* `...args` any[]
|
||||
|
||||
|
||||
29
docs/api/navigation-history.md
Normal file
29
docs/api/navigation-history.md
Normal file
@@ -0,0 +1,29 @@
|
||||
## Class: NavigationHistory
|
||||
|
||||
> Manage a list of navigation entries, representing the user's browsing history within the application.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)<br />
|
||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||
|
||||
Each navigation entry corresponds to a specific page. The indexing system follows a sequential order, where the first available navigation entry is at index 0, representing the earliest visited page, and the latest navigation entry is at index N, representing the most recent page. Maintaining this ordered list of navigation entries enables seamless navigation both backward and forward through the user's browsing history.
|
||||
|
||||
### Instance Methods
|
||||
|
||||
#### `navigationHistory.getActiveIndex()`
|
||||
|
||||
Returns `Integer` - The index of the current page, from which we would go back/forward or reload.
|
||||
|
||||
#### `navigationHistory.getEntryAtIndex(index)`
|
||||
|
||||
* `index` Integer
|
||||
|
||||
Returns `Object`:
|
||||
|
||||
* `url` string - The URL of the navigation entry at the given index.
|
||||
* `title` string - The page title of the navigation entry at the given index.
|
||||
|
||||
If index is out of bounds (greater than history length or less than 0), null will be returned.
|
||||
|
||||
#### `navigationHistory.length()`
|
||||
|
||||
Returns `Integer` - History length.
|
||||
@@ -111,7 +111,7 @@ expect streaming responses.
|
||||
|
||||
* `scheme` string - scheme to handle, for example `https` or `my-app`. This is
|
||||
the bit before the `:` in a URL.
|
||||
* `handler` Function<[GlobalResponse](https://nodejs.org/api/globals.html#response) | Promise<GlobalResponse>>
|
||||
* `handler` Function\<[GlobalResponse](https://nodejs.org/api/globals.html#response) | Promise\<GlobalResponse\>\>
|
||||
* `request` [GlobalRequest](https://nodejs.org/api/globals.html#request)
|
||||
|
||||
Register a protocol handler for `scheme`. Requests made to URLs with this
|
||||
|
||||
@@ -27,7 +27,7 @@ The `pushNotification` module emits the following events:
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `userInfo` Record<String, any>
|
||||
* `userInfo` Record\<String, any\>
|
||||
|
||||
Emitted when the app receives a remote notification while running.
|
||||
See: https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428430-application?language=objc
|
||||
|
||||
@@ -814,6 +814,8 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
|
||||
* `keyboardLock` - Request capture of keypresses for any or all of the keys on the physical keyboard via the [Keyboard Lock API](https://developer.mozilla.org/en-US/docs/Web/API/Keyboard/lock). These requests always appear to originate from the main frame.
|
||||
* `openExternal` - Request to open links in external applications.
|
||||
* `speaker-selection` - Request to enumerate and select audio output devices via the [speaker-selection permissions policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permissions-Policy/speaker-selection).
|
||||
* `storage-access` - Allows content loaded in a third-party context to request access to third-party cookies using the [Storage Access API](https://developer.mozilla.org/en-US/docs/Web/API/Storage_Access_API).
|
||||
* `top-level-storage-access` - Allow top-level sites to request third-party cookie access on behalf of embedded content originating from another site in the same related website set using the [Storage Access API](https://developer.mozilla.org/en-US/docs/Web/API/Storage_Access_API).
|
||||
* `window-management` - Request access to enumerate screens using the [`getScreenDetails`](https://developer.chrome.com/en/articles/multi-screen-window-placement/) API.
|
||||
* `unknown` - An unrecognized permission request.
|
||||
* `callback` Function
|
||||
@@ -862,6 +864,8 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents
|
||||
* `openExternal` - Open links in external applications.
|
||||
* `pointerLock` - Directly interpret mouse movements as an input method via the [Pointer Lock API](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API). These requests always appear to originate from the main frame.
|
||||
* `serial` - Read from and write to serial devices with the [Web Serial API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Serial_API).
|
||||
* `storage-access` - Allows content loaded in a third-party context to request access to third-party cookies using the [Storage Access API](https://developer.mozilla.org/en-US/docs/Web/API/Storage_Access_API).
|
||||
* `top-level-storage-access` - Allow top-level sites to request third-party cookie access on behalf of embedded content originating from another site in the same related website set using the [Storage Access API](https://developer.mozilla.org/en-US/docs/Web/API/Storage_Access_API).
|
||||
* `usb` - Expose non-standard Universal Serial Bus (USB) compatible devices services to the web with the [WebUSB API](https://developer.mozilla.org/en-US/docs/Web/API/WebUSB_API).
|
||||
* `requestingOrigin` string - The origin URL of the permission check
|
||||
* `details` Object - Some properties are only available on certain permission types.
|
||||
@@ -1216,7 +1220,7 @@ Returns `Promise<Buffer>` - resolves with blob data.
|
||||
|
||||
* `url` string
|
||||
* `options` Object (optional)
|
||||
* `headers` Record<string, string> (optional) - HTTP request headers.
|
||||
* `headers` Record\<string, string\> (optional) - HTTP request headers.
|
||||
|
||||
Initiates a download of the resource at `url`.
|
||||
The API will generate a [DownloadItem](download-item.md) that can be accessed
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# FilePathWithHeaders Object
|
||||
|
||||
* `path` string - The path to the file to send.
|
||||
* `headers` Record<string, string> (optional) - Additional headers to be sent.
|
||||
* `headers` Record\<string, string\> (optional) - Additional headers to be sent.
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
* `actionIdentifier` string - The identifier string of the action that the user selected.
|
||||
* `date` number - The delivery date of the notification.
|
||||
* `identifier` string - The unique identifier for this notification request.
|
||||
* `userInfo` Record<string, any> - A dictionary of custom information associated with the notification.
|
||||
* `userInfo` Record\<string, any\> - A dictionary of custom information associated with the notification.
|
||||
* `userText` string (optional) - The text entered or chosen by the user.
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
* `referrer` string
|
||||
* `method` string
|
||||
* `uploadData` [UploadData[]](upload-data.md) (optional)
|
||||
* `headers` Record<string, string>
|
||||
* `headers` Record\<string, string\>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
`"text/html"`. Setting `mimeType` would implicitly set the `content-type`
|
||||
header in response, but if `content-type` is already set in `headers`, the
|
||||
`mimeType` would be ignored.
|
||||
* `headers` Record<string, string | string[]> (optional) - An object containing the response headers. The
|
||||
* `headers` Record\<string, string | string[]\> (optional) - An object containing the response headers. The
|
||||
keys must be string, and values must be either string or Array of string.
|
||||
* `data` (Buffer | string | ReadableStream) (optional) - The response body. When
|
||||
returning stream as response, this is a Node.js readable stream representing
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
include in the trace. If not specified, trace all processes.
|
||||
* `histogram_names` string[] (optional) - a list of [histogram][] names to report
|
||||
with the trace.
|
||||
* `memory_dump_config` Record<string, any> (optional) - if the
|
||||
* `memory_dump_config` Record\<string, any\> (optional) - if the
|
||||
`disabled-by-default-memory-infra` category is enabled, this contains
|
||||
optional additional configuration for data collection. See the [Chromium
|
||||
memory-infra docs][memory-infra docs] for more information.
|
||||
|
||||
@@ -36,7 +36,7 @@ Returns `boolean` - Whether the Swipe between pages setting is on.
|
||||
### `systemPreferences.postNotification(event, userInfo[, deliverImmediately])` _macOS_
|
||||
|
||||
* `event` string
|
||||
* `userInfo` Record<string, any>
|
||||
* `userInfo` Record\<string, any\>
|
||||
* `deliverImmediately` boolean (optional) - `true` to post notifications immediately even when the subscribing app is inactive.
|
||||
|
||||
Posts `event` as native notifications of macOS. The `userInfo` is an Object
|
||||
@@ -45,7 +45,7 @@ that contains the user information dictionary sent along with the notification.
|
||||
### `systemPreferences.postLocalNotification(event, userInfo)` _macOS_
|
||||
|
||||
* `event` string
|
||||
* `userInfo` Record<string, any>
|
||||
* `userInfo` Record\<string, any\>
|
||||
|
||||
Posts `event` as native notifications of macOS. The `userInfo` is an Object
|
||||
that contains the user information dictionary sent along with the notification.
|
||||
@@ -53,7 +53,7 @@ that contains the user information dictionary sent along with the notification.
|
||||
### `systemPreferences.postWorkspaceNotification(event, userInfo)` _macOS_
|
||||
|
||||
* `event` string
|
||||
* `userInfo` Record<string, any>
|
||||
* `userInfo` Record\<string, any\>
|
||||
|
||||
Posts `event` as native notifications of macOS. The `userInfo` is an Object
|
||||
that contains the user information dictionary sent along with the notification.
|
||||
@@ -63,7 +63,7 @@ that contains the user information dictionary sent along with the notification.
|
||||
* `event` string | null
|
||||
* `callback` Function
|
||||
* `event` string
|
||||
* `userInfo` Record<string, unknown>
|
||||
* `userInfo` Record\<string, unknown\>
|
||||
* `object` string
|
||||
|
||||
Returns `number` - The ID of this subscription
|
||||
@@ -92,7 +92,7 @@ If `event` is null, the `NSDistributedNotificationCenter` doesn’t use it as cr
|
||||
* `event` string | null
|
||||
* `callback` Function
|
||||
* `event` string
|
||||
* `userInfo` Record<string, unknown>
|
||||
* `userInfo` Record\<string, unknown\>
|
||||
* `object` string
|
||||
|
||||
Returns `number` - The ID of this subscription
|
||||
@@ -107,7 +107,7 @@ If `event` is null, the `NSNotificationCenter` doesn’t use it as criteria for
|
||||
* `event` string | null
|
||||
* `callback` Function
|
||||
* `event` string
|
||||
* `userInfo` Record<string, unknown>
|
||||
* `userInfo` Record\<string, unknown\>
|
||||
* `object` string
|
||||
|
||||
Returns `number` - The ID of this subscription
|
||||
@@ -137,7 +137,7 @@ Same as `unsubscribeNotification`, but removes the subscriber from `NSWorkspace.
|
||||
|
||||
### `systemPreferences.registerDefaults(defaults)` _macOS_
|
||||
|
||||
* `defaults` Record<string, string | boolean | number> - a dictionary of (`key: value`) user defaults
|
||||
* `defaults` Record\<string, string | boolean | number\> - a dictionary of (`key: value`) user defaults
|
||||
|
||||
Add the specified defaults to your application's `NSUserDefaults`.
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ See [`window.open()`](window-open.md) for more details and how to use this in co
|
||||
|
||||
Returns:
|
||||
|
||||
* `details` Event<>
|
||||
* `details` Event\<\>
|
||||
* `url` string - The URL the frame is navigating to.
|
||||
* `isSameDocument` boolean - This event does not fire for same document navigations using window.history api and reference fragment navigations.
|
||||
This property is always set to `false` for this event.
|
||||
@@ -270,7 +270,7 @@ Calling `event.preventDefault()` will prevent the navigation.
|
||||
|
||||
Returns:
|
||||
|
||||
* `details` Event<>
|
||||
* `details` Event\<\>
|
||||
* `url` string - The URL the frame is navigating to.
|
||||
* `isSameDocument` boolean - This event does not fire for same document navigations using window.history api and reference fragment navigations.
|
||||
This property is always set to `false` for this event.
|
||||
@@ -300,7 +300,7 @@ Calling `event.preventDefault()` will prevent the navigation.
|
||||
|
||||
Returns:
|
||||
|
||||
* `details` Event<>
|
||||
* `details` Event\<\>
|
||||
* `url` string - The URL the frame is navigating to.
|
||||
* `isSameDocument` boolean - Whether the navigation happened without changing
|
||||
document. Examples of same document navigations are reference fragment
|
||||
@@ -324,7 +324,7 @@ Emitted when any frame (including main) starts navigating.
|
||||
|
||||
Returns:
|
||||
|
||||
* `details` Event<>
|
||||
* `details` Event\<\>
|
||||
* `url` string - The URL the frame is navigating to.
|
||||
* `isSameDocument` boolean - Whether the navigation happened without changing
|
||||
document. Examples of same document navigations are reference fragment
|
||||
@@ -355,7 +355,7 @@ redirect).
|
||||
|
||||
Returns:
|
||||
|
||||
* `details` Event<>
|
||||
* `details` Event\<\>
|
||||
* `url` string - The URL the frame is navigating to.
|
||||
* `isSameDocument` boolean - Whether the navigation happened without changing
|
||||
document. Examples of same document navigations are reference fragment
|
||||
@@ -683,7 +683,7 @@ Emitted when media is paused or done playing.
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event<>
|
||||
* `event` Event\<\>
|
||||
* `audible` boolean - True if one or more frames or child `webContents` are emitting audio.
|
||||
|
||||
Emitted when media becomes audible or inaudible.
|
||||
@@ -900,7 +900,7 @@ Returns:
|
||||
* `webPreferences` [WebPreferences](structures/web-preferences.md) - The web preferences that will be used by the guest
|
||||
page. This object can be modified to adjust the preferences for the guest
|
||||
page.
|
||||
* `params` Record<string, string> - The other `<webview>` parameters such as the `src` URL.
|
||||
* `params` Record\<string, string\> - The other `<webview>` parameters such as the `src` URL.
|
||||
This object can be modified to adjust the parameters of the guest page.
|
||||
|
||||
Emitted when a `<webview>`'s web contents is being attached to this web
|
||||
@@ -1020,7 +1020,7 @@ win.webContents.loadURL('https://github.com', options)
|
||||
|
||||
* `filePath` string
|
||||
* `options` Object (optional)
|
||||
* `query` Record<string, string> (optional) - Passed to `url.format()`.
|
||||
* `query` Record\<string, string\> (optional) - Passed to `url.format()`.
|
||||
* `search` string (optional) - Passed to `url.format()`.
|
||||
* `hash` string (optional) - Passed to `url.format()`.
|
||||
|
||||
@@ -1051,7 +1051,7 @@ win.loadFile('src/index.html')
|
||||
|
||||
* `url` string
|
||||
* `options` Object (optional)
|
||||
* `headers` Record<string, string> (optional) - HTTP request headers.
|
||||
* `headers` Record\<string, string\> (optional) - HTTP request headers.
|
||||
|
||||
Initiates a download of the resource at `url` without navigating. The
|
||||
`will-download` event of `session` will be triggered.
|
||||
@@ -1288,7 +1288,7 @@ Ignore application menu shortcuts while this web contents is focused.
|
||||
|
||||
#### `contents.setWindowOpenHandler(handler)`
|
||||
|
||||
* `handler` Function<[WindowOpenHandlerResponse](structures/window-open-handler-response.md)>
|
||||
* `handler` Function\<[WindowOpenHandlerResponse](structures/window-open-handler-response.md)\>
|
||||
* `details` Object
|
||||
* `url` string - The _resolved_ version of the URL passed to `window.open()`. e.g. opening a window with `window.open('foo')` will yield something like `https://the-origin/the/current/path/foo`.
|
||||
* `frameName` string - Name of the window provided in `window.open()`
|
||||
@@ -1583,7 +1583,7 @@ Returns `Promise<PrinterInfo[]>` - Resolves with a [`PrinterInfo[]`](structures/
|
||||
* `from` number - Index of the first page to print (0-based).
|
||||
* `to` number - Index of the last page to print (inclusive) (0-based).
|
||||
* `duplexMode` string (optional) - Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or `longEdge`.
|
||||
* `dpi` Record<string, number> (optional)
|
||||
* `dpi` Record\<string, number\> (optional)
|
||||
* `horizontal` number (optional) - The horizontal dpi.
|
||||
* `vertical` number (optional) - The vertical dpi.
|
||||
* `header` string (optional) - string to be printed as page header.
|
||||
@@ -2223,6 +2223,10 @@ A `Integer` representing the unique ID of this WebContents. Each ID is unique am
|
||||
|
||||
A [`Session`](session.md) used by this webContents.
|
||||
|
||||
#### `contents.navigationHistory` _Readonly_
|
||||
|
||||
A [`NavigationHistory`](navigation-history.md) used by this webContents.
|
||||
|
||||
#### `contents.hostWebContents` _Readonly_
|
||||
|
||||
A [`WebContents`](web-contents.md) instance that might own this `WebContents`.
|
||||
|
||||
@@ -99,11 +99,11 @@ Some examples of valid `urls`:
|
||||
* `referrer` string
|
||||
* `timestamp` Double
|
||||
* `uploadData` [UploadData[]](structures/upload-data.md) (optional)
|
||||
* `requestHeaders` Record<string, string>
|
||||
* `requestHeaders` Record\<string, string\>
|
||||
* `callback` Function
|
||||
* `beforeSendResponse` Object
|
||||
* `cancel` boolean (optional)
|
||||
* `requestHeaders` Record<string, string | string[]> (optional) - When provided, request will be made
|
||||
* `requestHeaders` Record\<string, string | string[]\> (optional) - When provided, request will be made
|
||||
with these headers.
|
||||
|
||||
The `listener` will be called with `listener(details, callback)` before sending
|
||||
@@ -126,7 +126,7 @@ The `callback` has to be called with a `response` object.
|
||||
* `resourceType` string - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
||||
* `referrer` string
|
||||
* `timestamp` Double
|
||||
* `requestHeaders` Record<string, string>
|
||||
* `requestHeaders` Record\<string, string\>
|
||||
|
||||
The `listener` will be called with `listener(details)` just before a request is
|
||||
going to be sent to the server, modifications of previous `onBeforeSendHeaders`
|
||||
@@ -148,11 +148,11 @@ response are visible by the time this listener is fired.
|
||||
* `timestamp` Double
|
||||
* `statusLine` string
|
||||
* `statusCode` Integer
|
||||
* `responseHeaders` Record<string, string[]> (optional)
|
||||
* `responseHeaders` Record\<string, string[]\> (optional)
|
||||
* `callback` Function
|
||||
* `headersReceivedResponse` Object
|
||||
* `cancel` boolean (optional)
|
||||
* `responseHeaders` Record<string, string | string[]> (optional) - When provided, the server is assumed
|
||||
* `responseHeaders` Record\<string, string | string[]\> (optional) - When provided, the server is assumed
|
||||
to have responded with these headers.
|
||||
* `statusLine` string (optional) - Should be provided when overriding
|
||||
`responseHeaders` to change header status otherwise original response
|
||||
@@ -177,7 +177,7 @@ The `callback` has to be called with a `response` object.
|
||||
* `resourceType` string - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
||||
* `referrer` string
|
||||
* `timestamp` Double
|
||||
* `responseHeaders` Record<string, string[]> (optional)
|
||||
* `responseHeaders` Record\<string, string[]\> (optional)
|
||||
* `fromCache` boolean - Indicates whether the response was fetched from disk
|
||||
cache.
|
||||
* `statusCode` Integer
|
||||
@@ -207,7 +207,7 @@ and response headers are available.
|
||||
* `ip` string (optional) - The server IP address that the request was
|
||||
actually sent to.
|
||||
* `fromCache` boolean
|
||||
* `responseHeaders` Record<string, string[]> (optional)
|
||||
* `responseHeaders` Record\<string, string[]\> (optional)
|
||||
|
||||
The `listener` will be called with `listener(details)` when a server initiated
|
||||
redirect is about to occur.
|
||||
@@ -226,7 +226,7 @@ redirect is about to occur.
|
||||
* `resourceType` string - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`.
|
||||
* `referrer` string
|
||||
* `timestamp` Double
|
||||
* `responseHeaders` Record<string, string[]> (optional)
|
||||
* `responseHeaders` Record\<string, string[]\> (optional)
|
||||
* `fromCache` boolean
|
||||
* `statusCode` Integer
|
||||
* `statusLine` string
|
||||
|
||||
@@ -287,7 +287,7 @@ e.g. the `http://` or `file://`.
|
||||
|
||||
* `url` string
|
||||
* `options` Object (optional)
|
||||
* `headers` Record<string, string> (optional) - HTTP request headers.
|
||||
* `headers` Record\<string, string\> (optional) - HTTP request headers.
|
||||
|
||||
Initiates a download of the resource at `url` without navigating.
|
||||
|
||||
@@ -580,7 +580,7 @@ Stops any `findInPage` request for the `webview` with the provided `action`.
|
||||
* `from` number - Index of the first page to print (0-based).
|
||||
* `to` number - Index of the last page to print (inclusive) (0-based).
|
||||
* `duplexMode` string (optional) - Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or `longEdge`.
|
||||
* `dpi` Record<string, number> (optional)
|
||||
* `dpi` Record\<string, number\> (optional)
|
||||
* `horizontal` number (optional) - The horizontal dpi.
|
||||
* `vertical` number (optional) - The vertical dpi.
|
||||
* `header` string (optional) - string to be printed as page header.
|
||||
|
||||
@@ -1686,7 +1686,7 @@ folder
|
||||
└── file3
|
||||
```
|
||||
|
||||
In Electron <=6, this would return a `FileList` with a `File` object for:
|
||||
In Electron <=6, this would return a `FileList` with a `File` object for:
|
||||
|
||||
```console
|
||||
path/to/folder
|
||||
|
||||
@@ -7,19 +7,23 @@ hide_title: false
|
||||
|
||||
## Platform Support
|
||||
|
||||
Currently ASAR integrity checking is only supported on macOS.
|
||||
Currently ASAR integrity checking is supported on:
|
||||
* macOS as of Electron `>=16.0.0`
|
||||
* Windows as of Electron `>=30.0.0`
|
||||
|
||||
## Requirements
|
||||
|
||||
### Electron Forge / Electron Packager
|
||||
|
||||
If you are using `>= @electron/packager`, `>= electron-packager@15.4.0` or `>= @electron-forge/core@6.0.0-beta.61` then all these requirements are met for you automatically and you can skip to [Toggling the Fuse](#toggling-the-fuse).
|
||||
If you are using `>= electron-packager@18.3.1` or `>= @electron-forge/core@7.4.0` then all these requirements are met for you automatically and you can skip to [Toggling the Fuse](#toggling-the-fuse).
|
||||
|
||||
### Other build systems
|
||||
|
||||
In order to enable ASAR integrity checking you need to ensure that your `app.asar` file was generated by a version of the `asar` npm package that supports asar integrity. Support was introduced in version `3.1.0`.
|
||||
|
||||
Your must then populate a valid `ElectronAsarIntegrity` dictionary block in your packaged apps `Info.plist`. An example is included below.
|
||||
### macOS
|
||||
|
||||
When packaging for macOS you must populate a valid `ElectronAsarIntegrity` dictionary block in your packaged apps `Info.plist`. An example is included below.
|
||||
|
||||
```plist
|
||||
<key>ElectronAsarIntegrity</key>
|
||||
@@ -36,6 +40,19 @@ Your must then populate a valid `ElectronAsarIntegrity` dictionary block in your
|
||||
|
||||
Valid `algorithm` values are currently `SHA256` only. The `hash` is a hash of the ASAR header using the given algorithm. The `asar` package exposes a `getRawHeader` method whose result can then be hashed to generate this value.
|
||||
|
||||
### Windows
|
||||
|
||||
When packaging for Windows you must populate a valid resource entry of type `Integrity` and name `ElectronAsar`. The value of this resource should be a JSON encoded dictionary in the form included below:
|
||||
|
||||
```json
|
||||
{
|
||||
"resources/app.asar": {
|
||||
"algorithm": "SHA256",
|
||||
"hash": "9d1f61ea03c4bb62b4416387a521101b81151da0cfbe18c9f8c8b818c5cebfac"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Toggling the Fuse
|
||||
|
||||
ASAR integrity checking is currently disabled by default and can be enabled by toggling a fuse. See [Electron Fuses](fuses.md) for more information on what Electron Fuses are and how they work. When enabling this fuse you typically also want to enable the `onlyLoadAppFromAsar` fuse otherwise the validity checking can be bypassed via the Electron app code search path.
|
||||
|
||||
@@ -34,6 +34,7 @@ auto_filenames = {
|
||||
"docs/api/message-port-main.md",
|
||||
"docs/api/native-image.md",
|
||||
"docs/api/native-theme.md",
|
||||
"docs/api/navigation-history.md",
|
||||
"docs/api/net-log.md",
|
||||
"docs/api/net.md",
|
||||
"docs/api/notification.md",
|
||||
|
||||
@@ -583,6 +583,8 @@ filenames = {
|
||||
"shell/common/gin_converters/hid_device_info_converter.h",
|
||||
"shell/common/gin_converters/image_converter.cc",
|
||||
"shell/common/gin_converters/image_converter.h",
|
||||
"shell/common/gin_converters/login_item_settings_converter.cc",
|
||||
"shell/common/gin_converters/login_item_settings_converter.h",
|
||||
"shell/common/gin_converters/media_converter.cc",
|
||||
"shell/common/gin_converters/media_converter.h",
|
||||
"shell/common/gin_converters/message_box_converter.cc",
|
||||
|
||||
@@ -533,6 +533,17 @@ WebContents.prototype._init = function () {
|
||||
enumerable: true
|
||||
});
|
||||
|
||||
// Add navigationHistory property which handles session history,
|
||||
// maintaining a list of navigation entries for backward and forward navigation.
|
||||
Object.defineProperty(this, 'navigationHistory', {
|
||||
value: {
|
||||
getActiveIndex: this._getActiveIndex.bind(this),
|
||||
length: this._historyLength.bind(this),
|
||||
getEntryAtIndex: this._getNavigationEntryAtIndex.bind(this)
|
||||
},
|
||||
writable: false
|
||||
});
|
||||
|
||||
// Dispatch IPC messages to the ipc module.
|
||||
this.on('-ipc-message' as any, function (this: Electron.WebContents, event: Electron.IpcMainEvent, internal: boolean, channel: string, args: any[]) {
|
||||
addSenderToEvent(event, this);
|
||||
|
||||
@@ -209,6 +209,22 @@ type ExtraURLLoaderOptions = {
|
||||
headers: Record<string, { name: string, value: string | string[] }>;
|
||||
allowNonHttpProtocols: boolean;
|
||||
}
|
||||
|
||||
function validateHeader (name: any, value: any): void {
|
||||
if (typeof name !== 'string') {
|
||||
throw new TypeError('`name` should be a string in setHeader(name, value)');
|
||||
}
|
||||
if (value == null) {
|
||||
throw new Error('`value` required in setHeader("' + name + '", value)');
|
||||
}
|
||||
if (!isValidHeaderName(name)) {
|
||||
throw new Error(`Invalid header name: '${name}'`);
|
||||
}
|
||||
if (!isValidHeaderValue(value.toString())) {
|
||||
throw new Error(`Invalid value for header '${name}': '${value}'`);
|
||||
}
|
||||
}
|
||||
|
||||
function parseOptions (optionsIn: ClientRequestConstructorOptions | string): NodeJS.CreateURLLoaderOptions & ExtraURLLoaderOptions {
|
||||
// eslint-disable-next-line node/no-deprecated-api
|
||||
const options: any = typeof optionsIn === 'string' ? url.parse(optionsIn) : { ...optionsIn };
|
||||
@@ -275,12 +291,7 @@ function parseOptions (optionsIn: ClientRequestConstructorOptions | string): Nod
|
||||
};
|
||||
const headers: Record<string, string | string[]> = options.headers || {};
|
||||
for (const [name, value] of Object.entries(headers)) {
|
||||
if (!isValidHeaderName(name)) {
|
||||
throw new Error(`Invalid header name: '${name}'`);
|
||||
}
|
||||
if (!isValidHeaderValue(value.toString())) {
|
||||
throw new Error(`Invalid value for header '${name}': '${value}'`);
|
||||
}
|
||||
validateHeader(name, value);
|
||||
const key = name.toLowerCase();
|
||||
urlLoaderOptions.headers[key] = { name, value };
|
||||
}
|
||||
@@ -351,21 +362,10 @@ export class ClientRequest extends Writable implements Electron.ClientRequest {
|
||||
}
|
||||
|
||||
setHeader (name: string, value: string) {
|
||||
if (typeof name !== 'string') {
|
||||
throw new TypeError('`name` should be a string in setHeader(name, value)');
|
||||
}
|
||||
if (value == null) {
|
||||
throw new Error('`value` required in setHeader("' + name + '", value)');
|
||||
}
|
||||
if (this._started || this._firstWrite) {
|
||||
throw new Error('Can\'t set headers after they are sent');
|
||||
}
|
||||
if (!isValidHeaderName(name)) {
|
||||
throw new Error(`Invalid header name: '${name}'`);
|
||||
}
|
||||
if (!isValidHeaderValue(value.toString())) {
|
||||
throw new Error(`Invalid value for header '${name}': '${value}'`);
|
||||
}
|
||||
validateHeader(name, value);
|
||||
|
||||
const key = name.toLowerCase();
|
||||
this._urlLoaderOptions.headers[key] = { name, value };
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Buffer } from 'buffer';
|
||||
import { constants } from 'fs';
|
||||
import { Dirent, constants } from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as util from 'util';
|
||||
|
||||
@@ -46,7 +46,17 @@ process._getOrCreateArchive = getOrCreateArchive;
|
||||
|
||||
const asarRe = /\.asar/i;
|
||||
|
||||
const { getValidatedPath } = __non_webpack_require__('internal/fs/utils');
|
||||
const {
|
||||
getValidatedPath,
|
||||
getOptions,
|
||||
getDirent
|
||||
} = __non_webpack_require__('internal/fs/utils');
|
||||
|
||||
const {
|
||||
validateBoolean,
|
||||
validateFunction
|
||||
} = __non_webpack_require__('internal/validators');
|
||||
|
||||
// In the renderer node internals use the node global URL but we do not set that to be
|
||||
// the global URL instance. We need to do instanceof checks against the internal URL impl
|
||||
const { URL: NodeURL } = __non_webpack_require__('internal/url');
|
||||
@@ -78,6 +88,23 @@ const gid = process.getgid?.() ?? 0;
|
||||
|
||||
const fakeTime = new Date();
|
||||
|
||||
function getDirents (p: string, { 0: names, 1: types }: any[][]): Dirent[] {
|
||||
for (let i = 0; i < names.length; i++) {
|
||||
let type = types[i];
|
||||
const info = splitPath(path.join(p, names[i]));
|
||||
if (info.isAsar) {
|
||||
const archive = getOrCreateArchive(info.asarPath);
|
||||
if (!archive) continue;
|
||||
const stats = archive.stat(info.filePath);
|
||||
if (!stats) continue;
|
||||
type = stats.type;
|
||||
}
|
||||
names[i] = getDirent(p, names[i], type);
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
enum AsarFileType {
|
||||
kFile = (constants as any).UV_DIRENT_FILE,
|
||||
kDirectory = (constants as any).UV_DIRENT_DIR,
|
||||
@@ -662,13 +689,27 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
return (encoding) ? buffer.toString(encoding) : buffer;
|
||||
};
|
||||
|
||||
type ReaddirOptions = { encoding: BufferEncoding | null; withFileTypes?: false, recursive?: false } | undefined | null;
|
||||
type ReaddirCallback = (err: NodeJS.ErrnoException | null, files: string[]) => void;
|
||||
|
||||
const { readdir } = fs;
|
||||
fs.readdir = function (pathArgument: string, options?: { encoding?: string | null; withFileTypes?: boolean } | null, callback?: Function) {
|
||||
const pathInfo = splitPath(pathArgument);
|
||||
if (typeof options === 'function') {
|
||||
callback = options;
|
||||
options = undefined;
|
||||
fs.readdir = function (pathArgument: string, options: ReaddirOptions, callback: ReaddirCallback) {
|
||||
callback = typeof options === 'function' ? options : callback;
|
||||
validateFunction(callback, 'callback');
|
||||
|
||||
options = getOptions(options);
|
||||
pathArgument = getValidatedPath(pathArgument);
|
||||
|
||||
if (options?.recursive != null) {
|
||||
validateBoolean(options?.recursive, 'options.recursive');
|
||||
}
|
||||
|
||||
if (options?.recursive) {
|
||||
nextTick(callback!, [null, readdirSyncRecursive(pathArgument, options)]);
|
||||
return;
|
||||
}
|
||||
|
||||
const pathInfo = splitPath(pathArgument);
|
||||
if (!pathInfo.isAsar) return readdir.apply(this, arguments);
|
||||
const { asarPath, filePath } = pathInfo;
|
||||
|
||||
@@ -705,12 +746,62 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
nextTick(callback!, [null, files]);
|
||||
};
|
||||
|
||||
fs.promises.readdir = util.promisify(fs.readdir);
|
||||
const { readdir: readdirPromise } = require('fs').promises;
|
||||
fs.promises.readdir = async function (pathArgument: string, options: ReaddirOptions) {
|
||||
options = getOptions(options);
|
||||
pathArgument = getValidatedPath(pathArgument);
|
||||
|
||||
type ReaddirSyncOptions = { encoding: BufferEncoding | null; withFileTypes?: false };
|
||||
if (options?.recursive != null) {
|
||||
validateBoolean(options?.recursive, 'options.recursive');
|
||||
}
|
||||
|
||||
if (options?.recursive) {
|
||||
return readdirRecursive(pathArgument, options);
|
||||
}
|
||||
|
||||
const pathInfo = splitPath(pathArgument);
|
||||
if (!pathInfo.isAsar) return readdirPromise(pathArgument, options);
|
||||
const { asarPath, filePath } = pathInfo;
|
||||
|
||||
const archive = getOrCreateArchive(asarPath);
|
||||
if (!archive) {
|
||||
return Promise.reject(createError(AsarError.INVALID_ARCHIVE, { asarPath }));
|
||||
}
|
||||
|
||||
const files = archive.readdir(filePath);
|
||||
if (!files) {
|
||||
return Promise.reject(createError(AsarError.NOT_FOUND, { asarPath, filePath }));
|
||||
}
|
||||
|
||||
if (options?.withFileTypes) {
|
||||
const dirents = [];
|
||||
for (const file of files) {
|
||||
const childPath = path.join(filePath, file);
|
||||
const stats = archive.stat(childPath);
|
||||
if (!stats) {
|
||||
throw createError(AsarError.NOT_FOUND, { asarPath, filePath: childPath });
|
||||
}
|
||||
dirents.push(new fs.Dirent(file, stats.type));
|
||||
}
|
||||
return Promise.resolve(dirents);
|
||||
}
|
||||
|
||||
return Promise.resolve(files);
|
||||
};
|
||||
|
||||
const { readdirSync } = fs;
|
||||
fs.readdirSync = function (pathArgument: string, options: ReaddirSyncOptions | BufferEncoding | null) {
|
||||
fs.readdirSync = function (pathArgument: string, options: ReaddirOptions) {
|
||||
options = getOptions(options);
|
||||
pathArgument = getValidatedPath(pathArgument);
|
||||
|
||||
if (options?.recursive != null) {
|
||||
validateBoolean(options?.recursive, 'options.recursive');
|
||||
}
|
||||
|
||||
if (options?.recursive) {
|
||||
return readdirSyncRecursive(pathArgument, options);
|
||||
}
|
||||
|
||||
const pathInfo = splitPath(pathArgument);
|
||||
if (!pathInfo.isAsar) return readdirSync.apply(this, arguments);
|
||||
const { asarPath, filePath } = pathInfo;
|
||||
@@ -725,7 +816,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
throw createError(AsarError.NOT_FOUND, { asarPath, filePath });
|
||||
}
|
||||
|
||||
if (options && (options as ReaddirSyncOptions).withFileTypes) {
|
||||
if (options?.withFileTypes) {
|
||||
const dirents = [];
|
||||
for (const file of files) {
|
||||
const childPath = path.join(filePath, file);
|
||||
@@ -741,7 +832,8 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
return files;
|
||||
};
|
||||
|
||||
const { internalModuleReadJSON } = internalBinding('fs');
|
||||
const binding = internalBinding('fs');
|
||||
const { internalModuleReadJSON, kUsePromises } = binding;
|
||||
internalBinding('fs').internalModuleReadJSON = (pathArgument: string) => {
|
||||
const pathInfo = splitPath(pathArgument);
|
||||
if (!pathInfo.isAsar) return internalModuleReadJSON(pathArgument);
|
||||
@@ -787,6 +879,187 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
return (stats.type === AsarFileType.kDirectory) ? 1 : 0;
|
||||
};
|
||||
|
||||
async function readdirRecursive (originalPath: string, options: ReaddirOptions) {
|
||||
const result: any[] = [];
|
||||
|
||||
const pathInfo = splitPath(originalPath);
|
||||
let queue: [string, string[]][] = [];
|
||||
const withFileTypes = Boolean(options?.withFileTypes);
|
||||
|
||||
let initialItem = [];
|
||||
if (pathInfo.isAsar) {
|
||||
const archive = getOrCreateArchive(pathInfo.asarPath);
|
||||
if (!archive) return result;
|
||||
const files = archive.readdir(pathInfo.filePath);
|
||||
if (!files) return result;
|
||||
|
||||
// If we're in an asar dir, we need to ensure the result is in the same format as the
|
||||
// native call to readdir withFileTypes i.e. an array of arrays.
|
||||
initialItem = files;
|
||||
if (withFileTypes) {
|
||||
initialItem = [
|
||||
[...initialItem], initialItem.map((p: string) => {
|
||||
return internalBinding('fs').internalModuleStat(path.join(originalPath, p));
|
||||
})
|
||||
];
|
||||
}
|
||||
} else {
|
||||
initialItem = await binding.readdir(
|
||||
path.toNamespacedPath(originalPath),
|
||||
options!.encoding,
|
||||
withFileTypes,
|
||||
kUsePromises
|
||||
);
|
||||
}
|
||||
|
||||
queue = [[originalPath, initialItem]];
|
||||
|
||||
if (withFileTypes) {
|
||||
while (queue.length > 0) {
|
||||
// @ts-expect-error this is a valid array destructure assignment.
|
||||
const { 0: pathArg, 1: readDir } = queue.pop();
|
||||
for (const dirent of getDirents(pathArg, readDir)) {
|
||||
result.push(dirent);
|
||||
if (dirent.isDirectory()) {
|
||||
const direntPath = path.join(pathArg, dirent.name);
|
||||
const info = splitPath(direntPath);
|
||||
let readdirResult;
|
||||
if (info.isAsar) {
|
||||
const archive = getOrCreateArchive(info.asarPath);
|
||||
if (!archive) continue;
|
||||
const files = archive.readdir(info.filePath);
|
||||
if (!files) continue;
|
||||
|
||||
readdirResult = [
|
||||
[...files], files.map((p: string) => {
|
||||
return internalBinding('fs').internalModuleStat(path.join(direntPath, p));
|
||||
})
|
||||
];
|
||||
} else {
|
||||
readdirResult = await binding.readdir(
|
||||
direntPath,
|
||||
options!.encoding,
|
||||
true,
|
||||
kUsePromises
|
||||
);
|
||||
}
|
||||
queue.push([direntPath, readdirResult]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
while (queue.length > 0) {
|
||||
// @ts-expect-error this is a valid array destructure assignment.
|
||||
const { 0: pathArg, 1: readDir } = queue.pop();
|
||||
for (const ent of readDir) {
|
||||
const direntPath = path.join(pathArg, ent);
|
||||
const stat = internalBinding('fs').internalModuleStat(direntPath);
|
||||
result.push(path.relative(originalPath, direntPath));
|
||||
|
||||
if (stat === 1) {
|
||||
const subPathInfo = splitPath(direntPath);
|
||||
let item = [];
|
||||
if (subPathInfo.isAsar) {
|
||||
const archive = getOrCreateArchive(subPathInfo.asarPath);
|
||||
if (!archive) return;
|
||||
const files = archive.readdir(subPathInfo.filePath);
|
||||
if (!files) return result;
|
||||
item = files;
|
||||
} else {
|
||||
item = await binding.readdir(
|
||||
path.toNamespacedPath(direntPath),
|
||||
options!.encoding,
|
||||
false,
|
||||
kUsePromises
|
||||
);
|
||||
}
|
||||
queue.push([direntPath, item]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function readdirSyncRecursive (basePath: string, options: ReaddirOptions) {
|
||||
const withFileTypes = Boolean(options!.withFileTypes);
|
||||
const encoding = options!.encoding;
|
||||
|
||||
const readdirResults: string[] = [];
|
||||
const pathsQueue = [basePath];
|
||||
|
||||
function read (pathArg: string) {
|
||||
let readdirResult;
|
||||
|
||||
const pathInfo = splitPath(pathArg);
|
||||
if (pathInfo.isAsar) {
|
||||
const { asarPath, filePath } = pathInfo;
|
||||
const archive = getOrCreateArchive(asarPath);
|
||||
if (!archive) return;
|
||||
|
||||
readdirResult = archive.readdir(filePath);
|
||||
if (!readdirResult) return;
|
||||
// If we're in an asar dir, we need to ensure the result is in the same format as the
|
||||
// native call to readdir withFileTypes i.e. an array of arrays.
|
||||
if (withFileTypes) {
|
||||
readdirResult = [
|
||||
[...readdirResult], readdirResult.map((p: string) => {
|
||||
return internalBinding('fs').internalModuleStat(path.join(pathArg, p));
|
||||
})
|
||||
];
|
||||
}
|
||||
} else {
|
||||
readdirResult = binding.readdir(
|
||||
path.toNamespacedPath(pathArg),
|
||||
encoding,
|
||||
withFileTypes
|
||||
);
|
||||
}
|
||||
|
||||
if (readdirResult === undefined) return;
|
||||
|
||||
if (withFileTypes) {
|
||||
const length = readdirResult[0].length;
|
||||
for (let i = 0; i < length; i++) {
|
||||
const resultPath = path.join(pathArg, readdirResult[0][i]);
|
||||
const info = splitPath(resultPath);
|
||||
|
||||
let type = readdirResult[1][i];
|
||||
if (info.isAsar) {
|
||||
const archive = getOrCreateArchive(info.asarPath);
|
||||
if (!archive) return;
|
||||
const stats = archive.stat(info.filePath);
|
||||
if (!stats) continue;
|
||||
type = stats.type;
|
||||
}
|
||||
|
||||
const dirent = getDirent(pathArg, readdirResult[0][i], type);
|
||||
|
||||
readdirResults.push(dirent);
|
||||
if (dirent.isDirectory()) {
|
||||
pathsQueue.push(path.join(dirent.path, dirent.name));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < readdirResult.length; i++) {
|
||||
const resultPath = path.join(pathArg, readdirResult[i]);
|
||||
const relativeResultPath = path.relative(basePath, resultPath);
|
||||
const stat = internalBinding('fs').internalModuleStat(resultPath);
|
||||
|
||||
readdirResults.push(relativeResultPath);
|
||||
if (stat === 1) pathsQueue.push(resultPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < pathsQueue.length; i++) {
|
||||
read(pathsQueue[i]);
|
||||
}
|
||||
|
||||
return readdirResults;
|
||||
}
|
||||
|
||||
// Calling mkdir for directory inside asar archive should throw ENOTDIR
|
||||
// error, but on Windows it throws ENOENT.
|
||||
if (process.platform === 'win32') {
|
||||
|
||||
@@ -20,10 +20,10 @@ index 2ca14efae5ea478f43794a81883b00dfdb1a37b0..d73055fbf39334925ef4b4804bbaca57
|
||||
|
||||
case ssl_open_record_error:
|
||||
diff --git a/ssl/ssl_lib.cc b/ssl/ssl_lib.cc
|
||||
index 81a98071315214e3cf446b340fa9186f760bf370..e6a020fcab39391e7b014e324208b454e2fee95d 100644
|
||||
index 98f97ebb28a06dfde00082922a1aff24f8aa154c..8ec11f0e839760ace90bd88e096ffbd17508e224 100644
|
||||
--- a/ssl/ssl_lib.cc
|
||||
+++ b/ssl/ssl_lib.cc
|
||||
@@ -1331,7 +1331,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
|
||||
@@ -1334,7 +1334,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
|
||||
}
|
||||
|
||||
if (ret_code == 0) {
|
||||
@@ -32,7 +32,7 @@ index 81a98071315214e3cf446b340fa9186f760bf370..e6a020fcab39391e7b014e324208b454
|
||||
return SSL_ERROR_ZERO_RETURN;
|
||||
}
|
||||
// An EOF was observed which violates the protocol, and the underlying
|
||||
@@ -2687,13 +2687,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
|
||||
@@ -2701,13 +2701,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
|
||||
return CRYPTO_get_ex_data(&ctx->ex_data, idx);
|
||||
}
|
||||
|
||||
|
||||
@@ -129,4 +129,3 @@ build_run_reclient_cfg_generator_after_chrome.patch
|
||||
fix_suppress_clang_-wimplicit-const-int-float-conversion_in.patch
|
||||
fix_getcursorscreenpoint_wrongly_returns_0_0.patch
|
||||
fix_add_support_for_skipping_first_2_no-op_refreshes_in_thumb_cap.patch
|
||||
fix_add_missing_perfetto_flow_and_trace_event_includes.patch
|
||||
|
||||
@@ -23,10 +23,10 @@ index 289a8c25f14cad42b9178ce94b11f67870be7434..5b91eadb698eeb5a87c9d0b2edf7e5cc
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 9012fbd732b8e134609b187f3718652888c31af4..0ecde1e5a5e6bdd5f1fe1601901d8ee084b8a0a2 100644
|
||||
index 0eed4c5645d4e119393e9e0fbd770847eaf01030..95eb5224b90268937c1d24190c1234a5f42cb235 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4683,6 +4683,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
@@ -4684,6 +4684,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
observer.DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ index 9012fbd732b8e134609b187f3718652888c31af4..0ecde1e5a5e6bdd5f1fe1601901d8ee0
|
||||
int world_id) {
|
||||
for (auto& observer : observers_)
|
||||
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
||||
index 9e0c4a2d908a50723827cd86bdedb20119fb8f47..db408d515739f331dea4a33b27b0cf75437e6c30 100644
|
||||
index e3350ff445fcffca7efb2b11eba66f4c84e05f14..46f2142ac5bb840f20f244d96384024431ea11c6 100644
|
||||
--- a/content/renderer/render_frame_impl.h
|
||||
+++ b/content/renderer/render_frame_impl.h
|
||||
@@ -639,6 +639,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
@@ -640,6 +640,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
void DidObserveLayoutShift(double score, bool after_input_or_scroll) override;
|
||||
void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int world_id) override;
|
||||
@@ -53,10 +53,10 @@ index 9e0c4a2d908a50723827cd86bdedb20119fb8f47..db408d515739f331dea4a33b27b0cf75
|
||||
int world_id) override;
|
||||
void DidChangeScrollOffset() override;
|
||||
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
|
||||
index 4f33fd08886890ebe8c853760f9ab506834006e1..25e7c24542505eea06afb0a85131c23ef6467375 100644
|
||||
index ace1251d03266e3c5ae75c2059ba8c575725222d..37e0a30d87529e5de27fef40d8e7de0f7c27f0cd 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame_client.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame_client.h
|
||||
@@ -637,6 +637,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
@@ -638,6 +638,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
|
||||
@@ -92,10 +92,10 @@ index 7a5d4721f7bd3012351f17053e188505f26f1979..4c415c2464fee49581efa307070ffad9
|
||||
int32_t world_id) = 0;
|
||||
virtual bool AllowScriptExtensions() = 0;
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
index af0dbbfa237511d91c6fd2df4d2aceec6f94fae8..b3ff4e56ba203fb381635f5cc7fe6011d2faa778 100644
|
||||
index 015daaa60e46a106bf2f36a2bd967c892bc299da..c07e4bc3b7dd937ef14a72506cd6f2299bc511f4 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
@@ -291,6 +291,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
@@ -292,6 +292,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
web_frame_->Client()->DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,10 +49,10 @@ index 0a742bbbd5e8e1eb3610cc32f785f779e8907e75..26967019244d409dadf4533405d4d5d2
|
||||
// its owning reference back to our owning LocalFrame.
|
||||
client_->Detached(type);
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
index cd0dec9dca7ec98e97ef90c43378460c843956d4..e84ae764c9d47bfb78d01aa20695e03b07787136 100644
|
||||
index 81e90b80d4ff25c7003e4e98f071848be98280d6..92cfe0001933cd18ecb7384ead1dda26f563e62b 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -682,10 +682,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -684,10 +684,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
}
|
||||
DCHECK(!view_ || !view_->IsAttached());
|
||||
|
||||
@@ -63,7 +63,7 @@ index cd0dec9dca7ec98e97ef90c43378460c843956d4..e84ae764c9d47bfb78d01aa20695e03b
|
||||
if (!Client())
|
||||
return false;
|
||||
|
||||
@@ -733,6 +729,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -738,6 +734,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
DCHECK(!view_->IsAttached());
|
||||
Client()->WillBeDetached();
|
||||
|
||||
|
||||
@@ -33,10 +33,10 @@ index 4af5b8d5da1c0ae4c5603f49e3a1dbfec422f55e..d21e450d1ee387a72bbe601412856260
|
||||
"//base",
|
||||
"//build:branding_buildflags",
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index 55cf82494dcdb97adda4816c349e224eb33213ed..731f56fcabacf4280bab9a7f7fae14ae96277add 100644
|
||||
index 34cdca093a7fb4cf849c2964e6542558966bf3b1..e0ac5b6c7412a017077c342ef2f3d13cc0123008 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -4791,7 +4791,7 @@ static_library("browser") {
|
||||
@@ -4793,7 +4793,7 @@ static_library("browser") {
|
||||
|
||||
# On Windows, the hashes are embedded in //chrome:chrome_initial rather
|
||||
# than here in :chrome_dll.
|
||||
@@ -46,10 +46,10 @@ index 55cf82494dcdb97adda4816c349e224eb33213ed..731f56fcabacf4280bab9a7f7fae14ae
|
||||
sources += [ "certificate_viewer_stub.cc" ]
|
||||
}
|
||||
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
|
||||
index 07795d851c5a8d55f94d17dac471c287837e0863..5bebaf9fe6a845b1df8364a332857bf5dc49ee70 100644
|
||||
index bfb0033d1536941b52592a834b0c64d15cc1ed2c..2313065706e3c4531dfa8179a8b0ff26266aa7d9 100644
|
||||
--- a/chrome/test/BUILD.gn
|
||||
+++ b/chrome/test/BUILD.gn
|
||||
@@ -7179,9 +7179,12 @@ test("unit_tests") {
|
||||
@@ -7195,9 +7195,12 @@ test("unit_tests") {
|
||||
"//chrome/browser/safe_browsing/incident_reporting/verifier_test:verifier_test_dll_2",
|
||||
]
|
||||
|
||||
@@ -63,7 +63,7 @@ index 07795d851c5a8d55f94d17dac471c287837e0863..5bebaf9fe6a845b1df8364a332857bf5
|
||||
"//chrome//services/util_win:unit_tests",
|
||||
"//chrome/app:chrome_dll_resources",
|
||||
"//chrome/app:win_unit_tests",
|
||||
@@ -8160,6 +8163,10 @@ test("unit_tests") {
|
||||
@@ -8176,6 +8179,10 @@ test("unit_tests") {
|
||||
"../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc",
|
||||
]
|
||||
|
||||
@@ -74,7 +74,7 @@ index 07795d851c5a8d55f94d17dac471c287837e0863..5bebaf9fe6a845b1df8364a332857bf5
|
||||
sources += [
|
||||
# The importer code is not used on Android.
|
||||
"../common/importer/firefox_importer_utils_unittest.cc",
|
||||
@@ -8229,7 +8236,6 @@ test("unit_tests") {
|
||||
@@ -8245,7 +8252,6 @@ test("unit_tests") {
|
||||
}
|
||||
|
||||
deps += [
|
||||
|
||||
@@ -7,7 +7,7 @@ These are variables we add to the root BUILDCONFIG so that they're available
|
||||
everywhere, without having to import("//electron/.../flags.gni").
|
||||
|
||||
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
|
||||
index 1ed842b7790ff1415157c75a9debaac4a8b2f73c..d5ddc210503f091b3563ce738b70f2fa0ac88c95 100644
|
||||
index 26a23e459a62ddb6adff2748a70882aaa091a40a..237827d7a88ace74ec28208b0f879ae8354d7623 100644
|
||||
--- a/build/config/BUILDCONFIG.gn
|
||||
+++ b/build/config/BUILDCONFIG.gn
|
||||
@@ -123,6 +123,9 @@ if (current_os == "") {
|
||||
|
||||
@@ -9,10 +9,10 @@ potentially prevent a window from being created.
|
||||
TODO(loc): this patch is currently broken.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
index 441cf9208e50ed4fab3e6392996bdbb511b0ad76..39b46b4f5bb3adb18d903c0ca4c65f212138590b 100644
|
||||
index 06360bebe3baaa7571c412c7182ccd1fd1078fda..c36367b28a627f7e6e77bcf3fc10f907b131523b 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -8383,6 +8383,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -8389,6 +8389,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,
|
||||
@@ -21,10 +21,10 @@ index 441cf9208e50ed4fab3e6392996bdbb511b0ad76..39b46b4f5bb3adb18d903c0ca4c65f21
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 275988bd9d0dbbe3360b081078149e3304d891ae..b2866d3d050b57f5b3f6483634dbe3facaee83dd 100644
|
||||
index bfb696d17099ce153366f031a56b6ac74ce28d38..6475b9fd000fb83c4562f7d91a30c80e5dddf35e 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4580,6 +4580,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4585,6 +4585,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
|
||||
auto* new_contents_impl = new_contents.get();
|
||||
|
||||
@@ -37,7 +37,7 @@ index 275988bd9d0dbbe3360b081078149e3304d891ae..b2866d3d050b57f5b3f6483634dbe3fa
|
||||
// If the new frame has a name, make sure any SiteInstances that can find
|
||||
// this named frame have proxies for it. Must be called after
|
||||
// SetSessionStorageNamespace, since this calls CreateRenderView, which uses
|
||||
@@ -4621,12 +4627,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4626,12 +4632,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
AddWebContentsDestructionObserver(new_contents_impl);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ index 268f150c1cc987ea020192a86ab886ed206a0064..05856b853112072a18ec16589f2b442f
|
||||
|
||||
// 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 97be51019b36fef0b95b4812f682ff41544cbfe3..f013173e680898584561734942364755d3676363 100644
|
||||
index 05d036b9262689f2103a3df1ee30b7ec16c96a34..952356fa426c6cb7df85b837ccdff3661fa90531 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -725,6 +725,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
@@ -79,7 +79,7 @@ index 97be51019b36fef0b95b4812f682ff41544cbfe3..f013173e680898584561734942364755
|
||||
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 ac3754651b1569a07b666d8a101a08386393137c..25641beab08c2f575494f23850b1e22f1958569b 100644
|
||||
index 48e6a6c74004650b5b07ce24f6476d7c9a306236..b777041ec1111444d690d1d188dd622ce4677d4c 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -183,6 +183,7 @@ class NetworkService;
|
||||
@@ -90,7 +90,7 @@ index ac3754651b1569a07b666d8a101a08386393137c..25641beab08c2f575494f23850b1e22f
|
||||
} // namespace network
|
||||
|
||||
namespace sandbox {
|
||||
@@ -1219,6 +1220,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -1221,6 +1222,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -100,7 +100,7 @@ index ac3754651b1569a07b666d8a101a08386393137c..25641beab08c2f575494f23850b1e22f
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access);
|
||||
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
|
||||
index 3f445d481b7b1931eba7870f90ba8bc5e1206a8f..8930b2f6c532418a5de97813645783bc2bbad1ba 100644
|
||||
index a354e100b04423b9793bc17473711fab9ca91c7e..2b03b5b0152678a4f2fa64cabab0dc511cea0f79 100644
|
||||
--- a/content/public/browser/web_contents_delegate.cc
|
||||
+++ b/content/public/browser/web_contents_delegate.cc
|
||||
@@ -30,6 +30,17 @@ namespace content {
|
||||
@@ -122,7 +122,7 @@ index 3f445d481b7b1931eba7870f90ba8bc5e1206a8f..8930b2f6c532418a5de97813645783bc
|
||||
const OpenURLParams& params) {
|
||||
return nullptr;
|
||||
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
|
||||
index 6e73009a7a4263f8d910071be1b64ce0c6e1b7cc..db2a1bc02f7a90fba1eda99b444c64576df859a8 100644
|
||||
index c44ef9991cbb07ab2895a28a890466ce1bc8235f..1384a322617b4be4b4ffbda5c44b41ac05bc8977 100644
|
||||
--- a/content/public/browser/web_contents_delegate.h
|
||||
+++ b/content/public/browser/web_contents_delegate.h
|
||||
@@ -17,6 +17,7 @@
|
||||
@@ -133,7 +133,7 @@ index 6e73009a7a4263f8d910071be1b64ce0c6e1b7cc..db2a1bc02f7a90fba1eda99b444c6457
|
||||
#include "content/public/browser/eye_dropper.h"
|
||||
#include "content/public/browser/fullscreen_types.h"
|
||||
#include "content/public/browser/invalidate_type.h"
|
||||
@@ -349,6 +350,13 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
@@ -347,6 +348,13 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
const StoragePartitionConfig& partition_config,
|
||||
SessionStorageNamespace* session_storage_namespace);
|
||||
|
||||
@@ -148,10 +148,10 @@ index 6e73009a7a4263f8d910071be1b64ce0c6e1b7cc..db2a1bc02f7a90fba1eda99b444c6457
|
||||
// typically happens when popups are created.
|
||||
virtual void WebContentsCreated(WebContents* source_contents,
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 115a9e0e74969e224acb15f4b37d0d280b129f32..9012fbd732b8e134609b187f3718652888c31af4 100644
|
||||
index e131d7d256bad0ce6080e9817f196e60ca6c883c..0eed4c5645d4e119393e9e0fbd770847eaf01030 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -6685,6 +6685,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
|
||||
@@ -6686,6 +6686,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
|
||||
request.HasUserGesture(), GetWebFrame()->IsAdFrame(),
|
||||
GetWebFrame()->IsAdScriptInStack());
|
||||
|
||||
|
||||
@@ -80,10 +80,10 @@ index aaaa61d5c3a1d5ade2fd355e38a3985ef5cc4e7d..b45746ba0f38a381a2ee5ca17f3a1685
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
|
||||
index a3855799f5e896861726b599dcd48c8fa13a5e09..30750a8b03300e84dccc38c2e48dcde618016962 100644
|
||||
index 3d985470f60d1c8f63d6794ad2bcf5954defe8db..cf96fc1321da45bcf1efa8e0b1655bbc924d7d41 100644
|
||||
--- a/chrome/browser/ui/browser.cc
|
||||
+++ b/chrome/browser/ui/browser.cc
|
||||
@@ -1937,12 +1937,11 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
@@ -1933,12 +1933,11 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -99,10 +99,10 @@ index a3855799f5e896861726b599dcd48c8fa13a5e09..30750a8b03300e84dccc38c2e48dcde6
|
||||
|
||||
WebContents* Browser::CreateCustomWebContents(
|
||||
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
|
||||
index 36ae82017f790810f58eb85b478c5d26acd20e05..42bbd163d82e99054435ec0459282c0c5fb61cbd 100644
|
||||
index 4f393fa78e991fbaf5eed7a5a21414c0399753d6..5fe424e119fd843ba9245354a2cf409532252b49 100644
|
||||
--- a/chrome/browser/ui/browser.h
|
||||
+++ b/chrome/browser/ui/browser.h
|
||||
@@ -924,8 +924,7 @@ class Browser : public TabStripModelObserver,
|
||||
@@ -923,8 +923,7 @@ class Browser : public TabStripModelObserver,
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -218,10 +218,10 @@ index c5b0d3b23b8da318ae55fcac2515a1187f261469..16ed1f46c9afde0ff25750128b4fcff6
|
||||
void AddNewContents(content::WebContents* source,
|
||||
std::unique_ptr<content::WebContents> new_contents,
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 73df439b9efd501aee94fd7b19e834ad82a5b39c..11ed98cbe928b4c1efe1b34feec1a79cbe06a00a 100644
|
||||
index 94cdebc2ae552106bdeb7d3619dc9281c4fb4063..257b9f8ae014f577a9e2de35a3b251efda451fbe 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4486,8 +4486,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4491,8 +4491,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
|
||||
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
|
||||
source_site_instance, params.window_container_type,
|
||||
@@ -232,7 +232,7 @@ index 73df439b9efd501aee94fd7b19e834ad82a5b39c..11ed98cbe928b4c1efe1b34feec1a79c
|
||||
static_cast<WebContentsImpl*>(delegate_->CreateCustomWebContents(
|
||||
opener, source_site_instance, is_new_browsing_instance,
|
||||
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
|
||||
index 8930b2f6c532418a5de97813645783bc2bbad1ba..cfa7dc3805897a7e7b09bcf3fa4ebde05092c510 100644
|
||||
index 2b03b5b0152678a4f2fa64cabab0dc511cea0f79..35fbc8503bb5a153e9b640e3a68dfab6e0f046f2 100644
|
||||
--- a/content/public/browser/web_contents_delegate.cc
|
||||
+++ b/content/public/browser/web_contents_delegate.cc
|
||||
@@ -138,8 +138,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden(
|
||||
@@ -246,10 +246,10 @@ index 8930b2f6c532418a5de97813645783bc2bbad1ba..cfa7dc3805897a7e7b09bcf3fa4ebde0
|
||||
}
|
||||
|
||||
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
|
||||
index db2a1bc02f7a90fba1eda99b444c64576df859a8..8685c010eadbf4896ed19bdc61b415beea8cbd94 100644
|
||||
index 1384a322617b4be4b4ffbda5c44b41ac05bc8977..dc586cd35ec336d5843447320520e433404e169d 100644
|
||||
--- a/content/public/browser/web_contents_delegate.h
|
||||
+++ b/content/public/browser/web_contents_delegate.h
|
||||
@@ -328,8 +328,7 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
@@ -326,8 +326,7 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
SiteInstance* source_site_instance,
|
||||
mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
|
||||
@@ -7,7 +7,7 @@ By default, chromium sets up one v8 snapshot to be used in all v8 contexts. This
|
||||
to have a dedicated browser process v8 snapshot defined by the file `browser_v8_context_snapshot.bin`.
|
||||
|
||||
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
|
||||
index 1db5e8e422b62d6d92b50d600b1490bc5ac6042e..00aac10693e51c5e296bacc4fda9d801f803af73 100644
|
||||
index 48d3c60ac1b5691da1b5ae28aed9fd4085f71325..1213080cce1a3d456bc2ee08024b175b2c517e30 100644
|
||||
--- a/content/app/content_main_runner_impl.cc
|
||||
+++ b/content/app/content_main_runner_impl.cc
|
||||
@@ -39,6 +39,7 @@
|
||||
@@ -102,10 +102,10 @@ index 2b0919b9a56bd37a398109777dfd199d777a9f74..823f44ab0303ccd6c7502ec65560ddb5
|
||||
friend class ContentClientCreator;
|
||||
friend class ContentClientInitializer;
|
||||
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
|
||||
index 0b8e6108b3ae445ddecc5d9dc1fcb03cf16c6619..18eb32143645730afdf823a2ea8c6ee1aa8b3179 100644
|
||||
index bf101d76e22d80fe909d0eebe1f5c2c399cb09b9..3f8ca1e015e88a5d50d80903ecd0526778af0d58 100644
|
||||
--- a/gin/v8_initializer.cc
|
||||
+++ b/gin/v8_initializer.cc
|
||||
@@ -570,8 +570,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
|
||||
@@ -575,8 +575,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
|
||||
|
||||
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
|
||||
|
||||
@@ -115,7 +115,7 @@ index 0b8e6108b3ae445ddecc5d9dc1fcb03cf16c6619..18eb32143645730afdf823a2ea8c6ee1
|
||||
if (g_mapped_snapshot) {
|
||||
// TODO(crbug.com/802962): Confirm not loading different type of snapshot
|
||||
// files in a process.
|
||||
@@ -580,10 +579,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
|
||||
@@ -585,10 +584,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
|
||||
|
||||
base::MemoryMappedFile::Region file_region;
|
||||
base::File file =
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: disable_hidden.patch
|
||||
Electron uses this to disable background throttling for hidden windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index 7696ac81e79206c09fd74566c416cec0f337747c..f74ee0d5239ea8d27174e334408a82c42fe78421 100644
|
||||
index 7f63e954dc68a82699e06b5e611c590faf342a6b..df4a7d191281af4602517ecc7300235ceb4e6799 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -749,6 +749,9 @@ void RenderWidgetHostImpl::WasHidden() {
|
||||
|
||||
@@ -393,10 +393,10 @@ index ce9644d33fe83379127b01bf9a2b1c4badc3bc7c..fd486d4637ae4766ed78571dee7f9ceb
|
||||
if (schemes.allow_non_standard_schemes_in_origins)
|
||||
url::EnableNonStandardSchemesForAndroidWebView();
|
||||
diff --git a/content/public/common/content_client.h b/content/public/common/content_client.h
|
||||
index 5d1484651fb8c3e03337665d3d5342ba51df3154..d4432a660d6c5a5e937dedabb7e4b71b87c9504b 100644
|
||||
index 2387517cfddbd9277739265ae648ba6a2a4ebb50..eb64b73515b0f4d925157ad769df283168983e31 100644
|
||||
--- a/content/public/common/content_client.h
|
||||
+++ b/content/public/common/content_client.h
|
||||
@@ -139,6 +139,9 @@ class CONTENT_EXPORT ContentClient {
|
||||
@@ -142,6 +142,9 @@ class CONTENT_EXPORT ContentClient {
|
||||
// Registers a URL scheme as strictly empty documents, allowing them to
|
||||
// commit synchronously.
|
||||
std::vector<std::string> empty_document_schemes;
|
||||
@@ -407,7 +407,7 @@ index 5d1484651fb8c3e03337665d3d5342ba51df3154..d4432a660d6c5a5e937dedabb7e4b71b
|
||||
std::vector<std::string> extension_schemes;
|
||||
// Registers a URL scheme with a predefined default custom handler.
|
||||
diff --git a/url/url_util.cc b/url/url_util.cc
|
||||
index 16875957448d2c10c889bb406a5e749cfae41ddc..038037d558ad4deedcbfc5c7c8264a8eab93c0d7 100644
|
||||
index 82b27b8f596843b4b7e8e9a07909ccecb7ada6b3..c5e07f7875152ed638b59c286919296335c785e0 100644
|
||||
--- a/url/url_util.cc
|
||||
+++ b/url/url_util.cc
|
||||
@@ -115,6 +115,9 @@ struct SchemeRegistry {
|
||||
@@ -437,7 +437,7 @@ index 16875957448d2c10c889bb406a5e749cfae41ddc..038037d558ad4deedcbfc5c7c8264a8e
|
||||
DoAddSchemeWithHandler(
|
||||
new_scheme, handler,
|
||||
diff --git a/url/url_util.h b/url/url_util.h
|
||||
index 8c94c7a4f6d5f653d326199e5b43452f969911d4..518ea53a033233ca88b411200e008beb7bbd75ef 100644
|
||||
index b044801738627c36c136459dc605c5b6e58b8423..cfce25d7e2729b5d3c86353d8df8b0c864238247 100644
|
||||
--- a/url/url_util.h
|
||||
+++ b/url/url_util.h
|
||||
@@ -115,6 +115,15 @@ COMPONENT_EXPORT(URL) const std::vector<std::string>& GetCSPBypassingSchemes();
|
||||
|
||||
@@ -520,7 +520,7 @@ index 796ae2688436eb07f19909641d1620dd02f10cdb..c9e0eee0b329caf46669b419b1cd10cf
|
||||
waiting_on_draw_ack_ = true;
|
||||
|
||||
diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
|
||||
index c11057917af819fc1e4f343ba28d01db464d00eb..425394c38ddd8aa01e64d4f77c704370d1f6299a 100644
|
||||
index f8e148cb3b61f398db71fbb2933f9f264567508a..b9fd9314a2c27bd08c341171d6abef0bfb1d946c 100644
|
||||
--- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
|
||||
+++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
|
||||
@@ -100,7 +100,8 @@ RootCompositorFrameSinkImpl::Create(
|
||||
@@ -595,10 +595,10 @@ index d7deccb6e6ec63592cd840a05403f402238e645e..4c4356b8def15ed3156db38d0a593b83
|
||||
|
||||
// Sends the created child window to the browser process so that it can be
|
||||
diff --git a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom
|
||||
index fe4b73a47c9fa1bce506cf3159c38dce1ae1b51e..1ab474693850cd710d33ee7f3410e8263653efe7 100644
|
||||
index b8792901aeb7d1f8ee459bab05c3cc592f38aaa1..04a8c6f55e2308e0ee545072f2fe5c53641a8607 100644
|
||||
--- a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom
|
||||
+++ b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom
|
||||
@@ -30,6 +30,7 @@ struct RootCompositorFrameSinkParams {
|
||||
@@ -31,6 +31,7 @@ struct RootCompositorFrameSinkParams {
|
||||
bool send_swap_size_notifications = false;
|
||||
// Disables begin frame rate limiting for the display compositor.
|
||||
bool disable_frame_rate_limit = false;
|
||||
@@ -618,7 +618,7 @@ index 2f462f0deb5fc8a637457243fb5d5849fc214d14..695869b83cefaa24af93a2e11b39de05
|
||||
+ Draw(gfx.mojom.Rect damage_rect) => ();
|
||||
};
|
||||
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
|
||||
index 3d486e85cbb1cd10b73b981824eebcbe3299f7ac..29e8cbde697ca4815275d87e04ee1311d14f1ecb 100644
|
||||
index 5d3dbdb5016a266aa59df2a2954608ed377bb0a8..579b7f45fabdbf326995e3a20b5e509c859f178f 100644
|
||||
--- a/ui/compositor/compositor.h
|
||||
+++ b/ui/compositor/compositor.h
|
||||
@@ -89,6 +89,7 @@ namespace mojom {
|
||||
|
||||
@@ -112,7 +112,7 @@ index e1fb008d12ae863df30dbffb07c7ec53f29f1333..3f5074bde0de54dc3fd57da756982634
|
||||
string mime_type;
|
||||
|
||||
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
|
||||
index 82b5b7332864bc317d867d17a6a112d24cc12ceb..7dd4325014a19b7ffe43c45d42c38530c3c6bdc1 100644
|
||||
index f1be4c7bd7a72846ac31463b422b615010253722..cecce7ffc5970c2869d80d78d90e5074ab2ac402 100644
|
||||
--- a/services/network/url_loader.cc
|
||||
+++ b/services/network/url_loader.cc
|
||||
@@ -692,6 +692,7 @@ URLLoader::URLLoader(
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Tue, 12 Mar 2024 12:18:24 +0100
|
||||
Subject: fix: add missing perfetto::Flow and TRACE_EVENT includes
|
||||
|
||||
Refs https://chromium-review.googlesource.com/c/chromium/src/+/5022285
|
||||
|
||||
Fixes the following build errors:
|
||||
|
||||
../../third_party/blink/renderer/core/workers/worker_global_scope.cc:581:19: error: no member named 'Flow' in namespace 'perfetto'
|
||||
581 | perfetto::Flow::Global(message_event->GetTraceId()));
|
||||
| ~~~~~~~~~~^
|
||||
|
||||
../../third_party/blink/renderer/core/workers/dedicated_worker_messaging_proxy.cc:245:19: error: no member named 'Flow' in namespace 'perfetto'
|
||||
245 | perfetto::Flow::Global(event->GetTraceId()));
|
||||
| ~~~~~~~~~~^
|
||||
|
||||
../../third_party/blink/renderer/core/workers/worker_global_scope.cc:576:5: error: use of undeclared identifier 'TRACE_EVENT'
|
||||
576 | TRACE_EVENT(
|
||||
| ^
|
||||
|
||||
../../third_party/blink/renderer/core/workers/dedicated_worker_messaging_proxy.cc:240:5: error: use of undeclared identifier 'TRACE_EVENT'
|
||||
240 | TRACE_EVENT(
|
||||
| ^
|
||||
|
||||
resultant of missing includes for:
|
||||
|
||||
- base/trace_event/typed_macros.h
|
||||
- third_party/perfetto/include/perfetto/tracing/track_event_args.h
|
||||
|
||||
Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/5365462.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/workers/dedicated_worker_messaging_proxy.cc b/third_party/blink/renderer/core/workers/dedicated_worker_messaging_proxy.cc
|
||||
index c45d61a923ab391933bf3852add770fc18942bf5..c4af39b8b29dcf8f59214bb2054c74b9988253ff 100644
|
||||
--- a/third_party/blink/renderer/core/workers/dedicated_worker_messaging_proxy.cc
|
||||
+++ b/third_party/blink/renderer/core/workers/dedicated_worker_messaging_proxy.cc
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <memory>
|
||||
#include "base/feature_list.h"
|
||||
+#include "base/trace_event/typed_macros.h"
|
||||
#include "services/network/public/mojom/fetch_api.mojom-blink.h"
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/common/tokens/tokens.h"
|
||||
@@ -33,6 +34,7 @@
|
||||
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/wtf.h"
|
||||
+#include "third_party/perfetto/include/perfetto/tracing/track_event_args.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/workers/worker_global_scope.cc b/third_party/blink/renderer/core/workers/worker_global_scope.cc
|
||||
index 996e5b563ee486f50aada96aaa9f25ac392e6424..3422670a53aeb8cd55174cc1af482aef086005e1 100644
|
||||
--- a/third_party/blink/renderer/core/workers/worker_global_scope.cc
|
||||
+++ b/third_party/blink/renderer/core/workers/worker_global_scope.cc
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "third_party/blink/renderer/core/workers/worker_global_scope.h"
|
||||
|
||||
#include "base/memory/scoped_refptr.h"
|
||||
+#include "base/trace_event/typed_macros.h"
|
||||
#include "mojo/public/cpp/bindings/pending_remote.h"
|
||||
#include "services/metrics/public/cpp/mojo_ukm_recorder.h"
|
||||
#include "third_party/blink/public/common/privacy_budget/identifiability_study_settings.h"
|
||||
@@ -88,6 +89,7 @@
|
||||
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"
|
||||
#include "third_party/blink/renderer/platform/weborigin/security_policy.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
|
||||
+#include "third_party/perfetto/include/perfetto/tracing/track_event_args.h"
|
||||
|
||||
namespace blink {
|
||||
namespace {
|
||||
@@ -23,10 +23,10 @@ Upstream bug https://bugs.chromium.org/p/chromium/issues/detail?id=1081397.
|
||||
Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3856266.
|
||||
|
||||
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
|
||||
index 43f45a17a2d2556a12941fb431708ea9e0ce3ada..b5b143415450f02660901cf48c7ea2968ed67206 100644
|
||||
index 1ca5ce3110edea41fde30db79b384489d0297977..072d02f2130294d59176e510caafade29feca96f 100644
|
||||
--- a/content/browser/renderer_host/navigation_request.cc
|
||||
+++ b/content/browser/renderer_host/navigation_request.cc
|
||||
@@ -10374,6 +10374,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
|
||||
@@ -10420,6 +10420,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
|
||||
return std::make_pair(parent->GetLastCommittedOrigin(), "about_srcdoc");
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ invisible state of the `viz::DisplayScheduler` owned
|
||||
by the `ui::Compositor`.
|
||||
|
||||
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
|
||||
index 3bb35f0d0686df1718cc62c6d4ab42817477dd26..43a53e4b91747b3224ee8ac8002a4c8a9ed8a092 100644
|
||||
index 58c898eae10ecca9741d89e5a211b7c25c6d5a0b..ddd00f284e3e1efb810bf0202eb3b7838ac4d7e6 100644
|
||||
--- a/ui/compositor/compositor.cc
|
||||
+++ b/ui/compositor/compositor.cc
|
||||
@@ -339,7 +339,8 @@ void Compositor::SetLayerTreeFrameSink(
|
||||
@@ -54,7 +54,7 @@ index 3bb35f0d0686df1718cc62c6d4ab42817477dd26..43a53e4b91747b3224ee8ac8002a4c8a
|
||||
+
|
||||
} // namespace ui
|
||||
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
|
||||
index 29e8cbde697ca4815275d87e04ee1311d14f1ecb..ecc0de0ecb32f7bfd5624b017588f75bb88ab7f3 100644
|
||||
index 579b7f45fabdbf326995e3a20b5e509c859f178f..c6b9846574afdf6d6badaca8263221894b4763f8 100644
|
||||
--- a/ui/compositor/compositor.h
|
||||
+++ b/ui/compositor/compositor.h
|
||||
@@ -508,6 +508,10 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
|
||||
|
||||
@@ -87,10 +87,10 @@ index 0c7d5b2c1d3e97420913bd643bb2a524a76fc286..653793fa480f035ce11e079b370bf5ed
|
||||
// The view with active text input state, i.e., a focused <input> element.
|
||||
// It will be nullptr if no such view exists. Note that the active view
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 459d9057d4155f83f6c184d654930f10f2a3241a..7f061765a05ca246e942e38f312e780000978ced 100644
|
||||
index d9646348e5b21618e013e04c5ec43868163c1d5b..9614ffb57e2d9b9d70f8affcefbed03f05c30f1f 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -8837,7 +8837,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
|
||||
@@ -8870,7 +8870,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
|
||||
"WebContentsImpl::OnFocusedElementChangedInFrame",
|
||||
"render_frame_host", frame);
|
||||
RenderWidgetHostViewBase* root_view =
|
||||
|
||||
@@ -7,7 +7,7 @@ This tweaks Chrome's Accessibility support at chrome://accessibility
|
||||
to make it usable from Electron by removing Profile references.
|
||||
|
||||
diff --git a/chrome/browser/ui/webui/accessibility/accessibility_ui.cc b/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
|
||||
index a2c6fc542c041d0878dfd62f7641820a9e3bfbc6..6f0cab0eb2dabe23feb1c2ff4850b39cb428faf1 100644
|
||||
index 180e18a01f82542b55fc9d7b8615b1731ff31d75..f9289b0103d85083c936788ed0c165b661a91cb9 100644
|
||||
--- a/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
|
||||
@@ -22,7 +22,10 @@
|
||||
@@ -41,7 +41,7 @@ index a2c6fc542c041d0878dfd62f7641820a9e3bfbc6..6f0cab0eb2dabe23feb1c2ff4850b39c
|
||||
#include "ui/views/accessibility/widget_ax_tree_id_map.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
#include "ui/views/widget/widget_delegate.h"
|
||||
@@ -164,7 +170,7 @@ base::Value::Dict BuildTargetDescriptor(content::RenderViewHost* rvh) {
|
||||
@@ -165,7 +171,7 @@ base::Value::Dict BuildTargetDescriptor(content::RenderViewHost* rvh) {
|
||||
accessibility_mode);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ index a2c6fc542c041d0878dfd62f7641820a9e3bfbc6..6f0cab0eb2dabe23feb1c2ff4850b39c
|
||||
base::Value::Dict BuildTargetDescriptor(Browser* browser) {
|
||||
base::Value::Dict target_data;
|
||||
target_data.Set(kSessionIdField, browser->session_id().id());
|
||||
@@ -198,7 +204,9 @@ void HandleAccessibilityRequestCallback(
|
||||
@@ -199,7 +205,9 @@ void HandleAccessibilityRequestCallback(
|
||||
DCHECK(ShouldHandleAccessibilityRequestCallback(path));
|
||||
|
||||
base::Value::Dict data;
|
||||
@@ -60,7 +60,7 @@ index a2c6fc542c041d0878dfd62f7641820a9e3bfbc6..6f0cab0eb2dabe23feb1c2ff4850b39c
|
||||
ui::AXMode mode =
|
||||
content::BrowserAccessibilityState::GetInstance()->GetAccessibilityMode();
|
||||
bool is_native_enabled = content::BrowserAccessibilityState::GetInstance()
|
||||
@@ -230,7 +238,7 @@ void HandleAccessibilityRequestCallback(
|
||||
@@ -231,7 +239,7 @@ void HandleAccessibilityRequestCallback(
|
||||
// enabled.
|
||||
data.Set(kViewsAccessibility, features::IsAccessibilityTreeForViewsEnabled());
|
||||
|
||||
@@ -68,8 +68,8 @@ index a2c6fc542c041d0878dfd62f7641820a9e3bfbc6..6f0cab0eb2dabe23feb1c2ff4850b39c
|
||||
+ bool show_internal = true;
|
||||
data.Set(kInternal, show_internal ? kOn : kOff);
|
||||
|
||||
base::Value::List page_list;
|
||||
@@ -273,11 +281,11 @@ void HandleAccessibilityRequestCallback(
|
||||
bool is_mode_locked = !content::BrowserAccessibilityState::GetInstance()
|
||||
@@ -278,11 +286,11 @@ void HandleAccessibilityRequestCallback(
|
||||
data.Set(kPagesField, std::move(page_list));
|
||||
|
||||
base::Value::List browser_list;
|
||||
@@ -83,7 +83,7 @@ index a2c6fc542c041d0878dfd62f7641820a9e3bfbc6..6f0cab0eb2dabe23feb1c2ff4850b39c
|
||||
data.Set(kBrowsersField, std::move(browser_list));
|
||||
|
||||
base::Value::List widgets_list;
|
||||
@@ -549,8 +557,10 @@ void AccessibilityUIMessageHandler::SetGlobalFlag(
|
||||
@@ -554,8 +562,10 @@ void AccessibilityUIMessageHandler::SetGlobalFlag(
|
||||
|
||||
AllowJavascript();
|
||||
if (flag_name_str == kInternal) {
|
||||
@@ -92,9 +92,9 @@ index a2c6fc542c041d0878dfd62f7641820a9e3bfbc6..6f0cab0eb2dabe23feb1c2ff4850b39c
|
||||
pref->SetBoolean(prefs::kShowInternalAccessibilityTree, enabled);
|
||||
+#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -660,8 +670,12 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
|
||||
} else if (flag_name_str == kLocked) {
|
||||
content::BrowserAccessibilityState::GetInstance()->SetAXModeChangeAllowed(
|
||||
@@ -669,8 +679,12 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
|
||||
AXPropertyFilter::ALLOW_EMPTY);
|
||||
AddPropertyFilters(property_filters, deny, AXPropertyFilter::DENY);
|
||||
|
||||
@@ -107,7 +107,7 @@ index a2c6fc542c041d0878dfd62f7641820a9e3bfbc6..6f0cab0eb2dabe23feb1c2ff4850b39c
|
||||
std::string accessibility_contents =
|
||||
web_contents->DumpAccessibilityTree(internal, property_filters);
|
||||
result.Set(kTreeField, accessibility_contents);
|
||||
@@ -686,6 +700,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
@@ -695,6 +709,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
AXPropertyFilter::ALLOW_EMPTY);
|
||||
AddPropertyFilters(property_filters, deny, AXPropertyFilter::DENY);
|
||||
|
||||
@@ -115,7 +115,7 @@ index a2c6fc542c041d0878dfd62f7641820a9e3bfbc6..6f0cab0eb2dabe23feb1c2ff4850b39c
|
||||
for (Browser* browser : *BrowserList::GetInstance()) {
|
||||
if (browser->session_id().id() == session_id) {
|
||||
base::Value::Dict result = BuildTargetDescriptor(browser);
|
||||
@@ -698,6 +713,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
@@ -707,6 +722,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,7 @@ index a2c6fc542c041d0878dfd62f7641820a9e3bfbc6..6f0cab0eb2dabe23feb1c2ff4850b39c
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
// No browser with the specified |session_id| was found.
|
||||
base::Value::Dict result;
|
||||
@@ -810,5 +826,7 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents(
|
||||
@@ -819,5 +835,7 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents(
|
||||
// static
|
||||
void AccessibilityUIMessageHandler::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
|
||||
@@ -11,7 +11,7 @@ This patch should be upstreamed as a conditional revert of the logic in desktop
|
||||
vs mobile runtimes. i.e. restore the old logic only on desktop platforms
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index e993e7541de716377959aeb71a784a2cab53289b..b226b7ca8a5cdde4581ddbf452e691c0e699829b 100644
|
||||
index 8718ad62ca50b8426814af3a41553263921cf069..be19b35393a23aee40f93baf8bdb4b876649a0e6 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -2140,9 +2140,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() {
|
||||
|
||||
@@ -64,10 +64,10 @@ index cba373664bec3a32abad6fe0396bd67b53b7e67f..7a985067b1371604644d48159f2f5aa7
|
||||
|
||||
#endif // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SCRIPT_EXECUTION_CALLBACK_H_
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
index e84ae764c9d47bfb78d01aa20695e03b07787136..6edb6bd6d8de5fdbd12473673262e05b218cd805 100644
|
||||
index 92cfe0001933cd18ecb7384ead1dda26f563e62b..0e90800b13e3d0fd18e4c8c32f0a90d64bcff4b9 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -2966,6 +2966,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
@@ -2982,6 +2982,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
mojom::blink::EvaluationTiming evaluation_timing,
|
||||
mojom::blink::LoadEventBlockingOption blocking_option,
|
||||
WebScriptExecutionCallback callback,
|
||||
@@ -75,7 +75,7 @@ index e84ae764c9d47bfb78d01aa20695e03b07787136..6edb6bd6d8de5fdbd12473673262e05b
|
||||
BackForwardCacheAware back_forward_cache_aware,
|
||||
mojom::blink::WantResultOption want_result_option,
|
||||
mojom::blink::PromiseResultOption promise_behavior) {
|
||||
@@ -2999,7 +3000,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
@@ -3015,7 +3016,7 @@ void LocalFrame::RequestExecuteScript(
|
||||
PausableScriptExecutor::CreateAndRun(
|
||||
script_state, std::move(script_sources), execute_script_policy,
|
||||
user_gesture, evaluation_timing, blocking_option, want_result_option,
|
||||
@@ -85,10 +85,10 @@ index e84ae764c9d47bfb78d01aa20695e03b07787136..6edb6bd6d8de5fdbd12473673262e05b
|
||||
|
||||
void LocalFrame::SetEvictCachedSessionStorageOnFreezeOrUnload() {
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h
|
||||
index 366f0d69c113b966686572f85c8a482e5b522f5b..e223af5aebd2f62947f5392ca7a622ec4e469417 100644
|
||||
index b05cbf16c6917c646684774829493ad6c908d465..38c9e6c423144fa1f15dc8bc0d76109428b888cb 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.h
|
||||
@@ -821,6 +821,7 @@ class CORE_EXPORT LocalFrame final
|
||||
@@ -825,6 +825,7 @@ class CORE_EXPORT LocalFrame final
|
||||
mojom::blink::EvaluationTiming,
|
||||
mojom::blink::LoadEventBlockingOption,
|
||||
WebScriptExecutionCallback,
|
||||
@@ -97,7 +97,7 @@ index 366f0d69c113b966686572f85c8a482e5b522f5b..e223af5aebd2f62947f5392ca7a622ec
|
||||
mojom::blink::WantResultOption,
|
||||
mojom::blink::PromiseResultOption);
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
|
||||
index 999f3f7ecbb9e4ffda99b7cd930bf324eaf1851f..0c74f1071781cffb34103368380268865a633f45 100644
|
||||
index 1e7c9c5e99d33b1153cdf3af41a5abc58cbcbafb..d07c5b65c70236c5739186b6d3b32882b1bf330e 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
|
||||
@@ -969,6 +969,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld(
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: frame_host_manager.patch
|
||||
Allows embedder to intercept site instances created by chromium.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc
|
||||
index 7ab2528ebaae494ee276929b11b8782b36999189..9a9f49aac1250ad3095311e1528ba77b8d4f3d4c 100644
|
||||
index 91521d844841ba42cc98b98ec646e0a36f2cc393..62a069836bc680bd82559eaa1eb5a7f14d3597c1 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_manager.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_manager.cc
|
||||
@@ -4272,6 +4272,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
@@ -4290,6 +4290,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
request->ResetStateForSiteInstanceChange();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ index 7ab2528ebaae494ee276929b11b8782b36999189..9a9f49aac1250ad3095311e1528ba77b
|
||||
}
|
||||
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index 25641beab08c2f575494f23850b1e22f1958569b..6d6ffe35bb63ecb673d46297780b134ecb1da42b 100644
|
||||
index b777041ec1111444d690d1d188dd622ce4677d4c..7541c01f350b41e5b69a6d91f6ab10409615f2a8 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -308,6 +308,11 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
|
||||
@@ -38,10 +38,10 @@ index c19eb72e8d37fe8145b813d07875addf793e12dc..a5db8841773618814ac90f740201d4d7
|
||||
// Returns whether `Initialize` has already been invoked in the process.
|
||||
// Initialization is a one-way operation (i.e., this method cannot return
|
||||
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
|
||||
index 7da26b994191cba6b8f6bdb7ee36989ba3fc7558..0b8e6108b3ae445ddecc5d9dc1fcb03cf16c6619 100644
|
||||
index 87a32462a37a1226dfc14b47bf73b9f21f9eb898..bf101d76e22d80fe909d0eebe1f5c2c399cb09b9 100644
|
||||
--- a/gin/v8_initializer.cc
|
||||
+++ b/gin/v8_initializer.cc
|
||||
@@ -458,7 +458,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
|
||||
@@ -463,7 +463,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
|
||||
// static
|
||||
void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
|
||||
const std::string js_command_line_flags,
|
||||
@@ -51,7 +51,7 @@ index 7da26b994191cba6b8f6bdb7ee36989ba3fc7558..0b8e6108b3ae445ddecc5d9dc1fcb03c
|
||||
static bool v8_is_initialized = false;
|
||||
if (v8_is_initialized)
|
||||
return;
|
||||
@@ -468,7 +469,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
|
||||
@@ -473,7 +474,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
|
||||
// See https://crbug.com/v8/11043
|
||||
SetFlags(mode, js_command_line_flags);
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch
|
||||
Add electron resources file to the list of resource ids generation.
|
||||
|
||||
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
|
||||
index fb51337be0c37b18e20dbdbc01f5382a02266e1b..0b88ffda8399ec6a6fbdc4e8db97c427362bd746 100644
|
||||
index af3d2926f558788796ba09b3adc0960c24096a2a..2b4b2e54ef1a7424bb675ff6d2f98b976a747fea 100644
|
||||
--- a/tools/gritsettings/resource_ids.spec
|
||||
+++ b/tools/gritsettings/resource_ids.spec
|
||||
@@ -1279,6 +1279,11 @@
|
||||
@@ -1283,6 +1283,11 @@
|
||||
"includes": [8440],
|
||||
},
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ but due to the nature of electron, we need to load the v8 snapshot
|
||||
in the browser process.
|
||||
|
||||
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
|
||||
index f39a56eefbaa70f3abb9b36fe02a25b60ae20c90..1db5e8e422b62d6d92b50d600b1490bc5ac6042e 100644
|
||||
index 824026e6e2bd6a7469c106fad6709282d0f19a94..48d3c60ac1b5691da1b5ae28aed9fd4085f71325 100644
|
||||
--- a/content/app/content_main_runner_impl.cc
|
||||
+++ b/content/app/content_main_runner_impl.cc
|
||||
@@ -274,11 +274,8 @@ void LoadV8SnapshotFile(const base::CommandLine& command_line) {
|
||||
|
||||
@@ -35,10 +35,10 @@ system font by checking if it's kCTFontPriorityAttribute is set to
|
||||
system priority.
|
||||
|
||||
diff --git a/base/BUILD.gn b/base/BUILD.gn
|
||||
index c9f0292cae20a3aa206092a44220d336cb511070..3330a093fb229b823c394440c40405ee628f28e9 100644
|
||||
index 353b3e7c6a519570af5a4842135388a8cc01e130..a836d7380a396813ec0a7a294c91ae0d09cc889f 100644
|
||||
--- a/base/BUILD.gn
|
||||
+++ b/base/BUILD.gn
|
||||
@@ -1048,6 +1048,7 @@ component("base") {
|
||||
@@ -1050,6 +1050,7 @@ component("base") {
|
||||
"//build/config/compiler:prevent_unsafe_narrowing",
|
||||
"//build/config/compiler:wexit_time_destructors",
|
||||
"//build/config/compiler:wglobal_constructors",
|
||||
@@ -459,7 +459,7 @@ index d520acc21839a63f5e1167c5ec3f119d89d43713..8b2f3c6cfa2615452fd43b7accd26ce8
|
||||
return kAttributes;
|
||||
}
|
||||
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
|
||||
index 53801ccd1e8b2eadbe19d3eaf6b03186b2620a1c..c58175e595b98ed5a5e8c369e4c05f229edf5d2d 100644
|
||||
index 7c53d9b2015c6c57f19c23c52c1aab3ffeea15ea..f6b7ba2f3512dcd2528323bb6853452cc9eab1a6 100644
|
||||
--- a/content/browser/BUILD.gn
|
||||
+++ b/content/browser/BUILD.gn
|
||||
@@ -54,6 +54,7 @@ source_set("browser") {
|
||||
@@ -471,7 +471,7 @@ index 53801ccd1e8b2eadbe19d3eaf6b03186b2620a1c..c58175e595b98ed5a5e8c369e4c05f22
|
||||
libs = []
|
||||
frameworks = []
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
index 4655ac4756f8655a5a21ef21a1a7286b2c5f0e46..ec631b1f0925928546e855faa5e968f5aec2b225 100644
|
||||
index abdf8a8d28639dc3735d3dc5bd309c237917f087..c08c84c3b243a6bafd358a34cbb391a6d6a9262a 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
@@ -21,7 +21,9 @@
|
||||
@@ -500,7 +500,7 @@ index 4655ac4756f8655a5a21ef21a1a7286b2c5f0e46..ec631b1f0925928546e855faa5e968f5
|
||||
|
||||
// Use native VoiceOver support for live regions.
|
||||
BrowserAccessibilityCocoa* retained_node = native_node;
|
||||
@@ -620,6 +624,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
@@ -621,6 +625,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
return window == [NSApp accessibilityFocusedWindow];
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ index 4655ac4756f8655a5a21ef21a1a7286b2c5f0e46..ec631b1f0925928546e855faa5e968f5
|
||||
// TODO(accessibility): We need a solution to the problem described below.
|
||||
// If the window is NSAccessibilityRemoteUIElement, there are some challenges:
|
||||
// 1. NSApp is the browser which spawned the PWA, and what it considers the
|
||||
@@ -648,6 +653,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
@@ -649,6 +654,7 @@ void PostAnnouncementNotification(NSString* announcement,
|
||||
if ([window isKindOfClass:[NSAccessibilityRemoteUIElement class]]) {
|
||||
return true;
|
||||
}
|
||||
@@ -700,7 +700,7 @@ index a119b4439bfb9218c7aaf09dca8e78527da7f20d..faa813b003940280c6eeb87e70173019
|
||||
|
||||
} // namespace content
|
||||
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
|
||||
index ec5c896baa6c7ad16f4d43dcb86683dba465f8f4..113aa2da812903a46487092372084b89a710a5c2 100644
|
||||
index f8b1c7ebd90d032411b1885a183403162ec3ff0c..ec30a59330641562d0e3597a4fe12368408dadde 100644
|
||||
--- a/content/test/BUILD.gn
|
||||
+++ b/content/test/BUILD.gn
|
||||
@@ -488,6 +488,7 @@ static_library("test_support") {
|
||||
@@ -719,7 +719,7 @@ index ec5c896baa6c7ad16f4d43dcb86683dba465f8f4..113aa2da812903a46487092372084b89
|
||||
}
|
||||
|
||||
mojom("content_test_mojo_bindings") {
|
||||
@@ -1702,6 +1704,7 @@ test("content_browsertests") {
|
||||
@@ -1703,6 +1705,7 @@ test("content_browsertests") {
|
||||
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
|
||||
|
||||
configs += [ "//build/config:precompiled_headers" ]
|
||||
@@ -727,7 +727,7 @@ index ec5c896baa6c7ad16f4d43dcb86683dba465f8f4..113aa2da812903a46487092372084b89
|
||||
|
||||
public_deps = [
|
||||
":test_interfaces",
|
||||
@@ -2928,6 +2931,7 @@ test("content_unittests") {
|
||||
@@ -2930,6 +2933,7 @@ test("content_unittests") {
|
||||
}
|
||||
|
||||
configs += [ "//build/config:precompiled_headers" ]
|
||||
@@ -817,7 +817,7 @@ index ea3578a727bdccfff74a4112529af9ac052165f2..a0f8573a4401922e4bc9de9b0faf1195
|
||||
if (is_ios) {
|
||||
sources += [ "image_transport_surface_ios.mm" ]
|
||||
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.h b/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
index b994079339dc0aebd86dac807645f81c2974fb96..b05e35c8eabccfd3147030d03453d78e76cdc5d2 100644
|
||||
index 88bac8b417b0618fdb3c14ec4eb3c5006edd58d9..16106d3122cfc18f32285e4f475b01a56095d3d5 100644
|
||||
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
@@ -23,7 +23,9 @@
|
||||
@@ -830,7 +830,7 @@ index b994079339dc0aebd86dac807645f81c2974fb96..b05e35c8eabccfd3147030d03453d78e
|
||||
@class CALayer;
|
||||
|
||||
namespace ui {
|
||||
@@ -76,8 +78,10 @@ class ImageTransportSurfaceOverlayMacEGL : public gl::Presenter {
|
||||
@@ -78,8 +80,10 @@ class ImageTransportSurfaceOverlayMacEGL : public gl::Presenter {
|
||||
const gfx::PresentationFeedback& feedback);
|
||||
void PopulateCALayerParameters();
|
||||
|
||||
@@ -842,7 +842,7 @@ index b994079339dc0aebd86dac807645f81c2974fb96..b05e35c8eabccfd3147030d03453d78e
|
||||
|
||||
gfx::Size pixel_size_;
|
||||
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
index 59413520a9e2d601a80c90072089bed228460730..2ad023d3f9a2eb557a8f65c1727bf032a1aadbfd 100644
|
||||
index 9599d5f3351942d9d71d4c019ecefa35370e8327..268e05efbf68fc556763d18d54934ee711fa1d45 100644
|
||||
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
@@ -75,12 +75,16 @@
|
||||
@@ -942,10 +942,10 @@ index 0c0243c2bb9e72c6eba6f9af554b99e2d5514a5d..f5f0e0ec951ccc8278b773c852134e4e
|
||||
}
|
||||
|
||||
diff --git a/net/dns/BUILD.gn b/net/dns/BUILD.gn
|
||||
index ebee73a859854299c1237b1190f4882bdd1c5121..67a818beb62a76a82a68313f3a27ab4e2ad780b5 100644
|
||||
index 9c10bfed595d0f6ac1a633594da791845cff2196..ff4d40d2e2589a40830cb51cee3d8216744ad87e 100644
|
||||
--- a/net/dns/BUILD.gn
|
||||
+++ b/net/dns/BUILD.gn
|
||||
@@ -183,6 +183,8 @@ source_set("dns") {
|
||||
@@ -185,6 +185,8 @@ source_set("dns") {
|
||||
":host_resolver_manager",
|
||||
":mdns_client",
|
||||
]
|
||||
@@ -1318,7 +1318,7 @@ index eb81a70e4d5d5cd3e6ae9b45f8cd1c795ea76c51..dc30306f2c5d20503399fc3a8860773a
|
||||
|
||||
} // namespace sandbox
|
||||
diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn
|
||||
index c6a38a54eee355342fad2918cb5f7992415df2ce..bdebe67853c8509357889fd4ab977c553307ff89 100644
|
||||
index 45f575dead4a033161fa6f585fa83cd79663899f..627c68574176af4931a5e5e1c6fcaf673d5ffba5 100644
|
||||
--- a/third_party/blink/renderer/core/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/core/BUILD.gn
|
||||
@@ -311,6 +311,7 @@ component("core") {
|
||||
|
||||
@@ -133,10 +133,10 @@ index 38c8cf36fdf9366121c7ada96c167a4c9664952e..03b37fb62655a355e104870a088e4222
|
||||
const GURL& document_url,
|
||||
const WeakDocumentPtr& weak_document_ptr,
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index 823b7e020bc931b64418c0a874539454e491d843..c299ed667915660edb4bdd70eda947f7420e8734 100644
|
||||
index ddeef4098ed4228cbb2d15ea9a05fda4ec3dca28..11662788156dca940a4d90f959fd511bcefbb07b 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -2044,7 +2044,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
@@ -2045,7 +2045,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
case RenderProcessHost::NotificationServiceCreatorType::kSharedWorker:
|
||||
case RenderProcessHost::NotificationServiceCreatorType::kDedicatedWorker: {
|
||||
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
|
||||
@@ -145,7 +145,7 @@ index 823b7e020bc931b64418c0a874539454e491d843..c299ed667915660edb4bdd70eda947f7
|
||||
creator_type, std::move(receiver));
|
||||
break;
|
||||
}
|
||||
@@ -2052,7 +2052,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
@@ -2053,7 +2053,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
CHECK(rfh);
|
||||
|
||||
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
|
||||
|
||||
@@ -640,7 +640,7 @@ index 4ecdb28904fac480cf102fffdff24ae008ac88cf..e8150c95fafd83d7e2fe1f472a35acec
|
||||
PrintingFailed(int32 cookie, PrintFailureReason reason);
|
||||
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
|
||||
index 6ba4d1584f12bb3b064e1cfe17ceaacfde8b4c16..cf263d8e7d3ce07fa57d4259f8d33b36e93d1f9b 100644
|
||||
index a0ec654b13f82d9c5ff4eb838585485a59c45924..e24f2e209e547685daf18570c0a8a95306c72e2d 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -47,6 +47,7 @@
|
||||
@@ -830,10 +830,10 @@ index b0ac94751454bd16b4e9bfdc071e2623813133ec..271bd9949a802a370b3619340f3364df
|
||||
// Calculate number of pages in source document.
|
||||
uint32_t CalculateNumberOfPages(blink::WebLocalFrame* frame,
|
||||
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
|
||||
index c58175e595b98ed5a5e8c369e4c05f229edf5d2d..f2c0fd0aadbc34b400f91e230dc994c7eb9ab8e8 100644
|
||||
index f6b7ba2f3512dcd2528323bb6853452cc9eab1a6..288d9219efa0ea8683fe86c5b339bbf9b829d712 100644
|
||||
--- a/content/browser/BUILD.gn
|
||||
+++ b/content/browser/BUILD.gn
|
||||
@@ -2930,8 +2930,9 @@ source_set("browser") {
|
||||
@@ -2933,8 +2933,9 @@ source_set("browser") {
|
||||
"//ppapi/shared_impl",
|
||||
]
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ index a1dcd0c0eab747f144188b8faea21fb1cf2b1558..20cc65ba206a8b3d988b51f9459de157
|
||||
// RenderWidgetHost on the primary main frame, and false otherwise.
|
||||
virtual bool IsWidgetForPrimaryMainFrame(RenderWidgetHostImpl*);
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index f74ee0d5239ea8d27174e334408a82c42fe78421..e993e7541de716377959aeb71a784a2cab53289b 100644
|
||||
index df4a7d191281af4602517ecc7300235ceb4e6799..8718ad62ca50b8426814af3a41553263921cf069 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -2074,6 +2074,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
|
||||
@@ -44,10 +44,10 @@ index f74ee0d5239ea8d27174e334408a82c42fe78421..e993e7541de716377959aeb71a784a2c
|
||||
|
||||
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index b2866d3d050b57f5b3f6483634dbe3facaee83dd..73df439b9efd501aee94fd7b19e834ad82a5b39c 100644
|
||||
index 6475b9fd000fb83c4562f7d91a30c80e5dddf35e..94cdebc2ae552106bdeb7d3619dc9281c4fb4063 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -5246,6 +5246,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
@@ -5268,6 +5268,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
return text_input_manager_.get();
|
||||
}
|
||||
|
||||
@@ -60,10 +60,10 @@ index b2866d3d050b57f5b3f6483634dbe3facaee83dd..73df439b9efd501aee94fd7b19e834ad
|
||||
RenderWidgetHostImpl* render_widget_host) {
|
||||
return render_widget_host == GetPrimaryMainFrame()->GetRenderWidgetHost();
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
|
||||
index f581af6fa5f0a45c1a93605b56a47f0b36482677..37897c7d0475eb929e7ed826a38094b65a82120f 100644
|
||||
index 4cb27cbd808dafde72c82f3e907c6b45654813e7..6612ecd6d98dc071cf598dffc64d5593911925b8 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.h
|
||||
+++ b/content/browser/web_contents/web_contents_impl.h
|
||||
@@ -1036,6 +1036,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
|
||||
@@ -1044,6 +1044,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
|
||||
void SendScreenRects() override;
|
||||
void SendActiveState(bool active) override;
|
||||
TextInputManager* GetTextInputManager() override;
|
||||
@@ -72,7 +72,7 @@ index f581af6fa5f0a45c1a93605b56a47f0b36482677..37897c7d0475eb929e7ed826a38094b6
|
||||
RenderWidgetHostImpl* render_widget_host) override;
|
||||
bool IsShowingContextMenuOnPage() const override;
|
||||
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
|
||||
index 67a814a07af1e7294134eaa90893318e8c202730..c863f0dd1d90dfe3035b65ce1b00920679b78615 100644
|
||||
index ede7dc05810649698b30efe7b0889420225a0f2b..e9cd2da6c1343aa03ef97a0c42d3393a8c74dc20 100644
|
||||
--- a/content/public/browser/web_contents_observer.h
|
||||
+++ b/content/public/browser/web_contents_observer.h
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: render_widget_host_view_base.patch
|
||||
... something to do with OSR? and maybe <webview> as well? terrifying.
|
||||
|
||||
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 a6f1863cc5c8ad3cfcb32650544e6421675ac996..55da111ec29044c1e0a0b6284039e574718b0c68 100644
|
||||
index 577d2ad516dc748ff067f1bdcae35317bff602d1..252c754aa1f0145879d95a971af486512fc14fa0 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
@@ -717,6 +717,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableForIOv2For(
|
||||
@@ -718,6 +718,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableForIOv2For(
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ index a6f1863cc5c8ad3cfcb32650544e6421675ac996..55da111ec29044c1e0a0b6284039e574
|
||||
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 03d6711927bd78f37c4bc4c168b003e277d4724a..05cffa3fb7bf4f0a6cfdcbdb9c757b1deaa4383a 100644
|
||||
index 6f246e3c59620d2c4f98c73ca1833817938fb86f..547d7108a1e984d71eb8f1e74b875d391bd42725 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
@@ -25,10 +25,13 @@
|
||||
@@ -41,20 +41,12 @@ index 03d6711927bd78f37c4bc4c168b003e277d4724a..05cffa3fb7bf4f0a6cfdcbdb9c757b1d
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
#include "content/public/common/page_visibility_state.h"
|
||||
#include "content/public/common/widget_type.h"
|
||||
@@ -54,7 +57,7 @@
|
||||
namespace blink {
|
||||
class WebMouseEvent;
|
||||
class WebMouseWheelEvent;
|
||||
-}
|
||||
+} // namespace blink
|
||||
|
||||
namespace ui {
|
||||
class Compositor;
|
||||
@@ -72,9 +75,11 @@ class DevicePosturePlatformProvider;
|
||||
@@ -72,10 +75,12 @@ class DevicePosturePlatformProvider;
|
||||
class MouseWheelPhaseHandler;
|
||||
class RenderWidgetHostImpl;
|
||||
class RenderWidgetHostViewBaseObserver;
|
||||
+class RenderWidgetHostViewGuest;
|
||||
class ScopedViewTransitionResources;
|
||||
class SyntheticGestureTarget;
|
||||
class TextInputManager;
|
||||
class TouchSelectionControllerClientManager;
|
||||
@@ -62,7 +54,7 @@ index 03d6711927bd78f37c4bc4c168b003e277d4724a..05cffa3fb7bf4f0a6cfdcbdb9c757b1d
|
||||
class WebContentsAccessibility;
|
||||
class DelegatedFrameHost;
|
||||
|
||||
@@ -159,6 +164,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
|
||||
@@ -160,6 +165,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
|
||||
const gfx::Rect& keyboard_rect) override {}
|
||||
bool IsHTMLFormPopup() const override;
|
||||
|
||||
@@ -72,7 +64,7 @@ index 03d6711927bd78f37c4bc4c168b003e277d4724a..05cffa3fb7bf4f0a6cfdcbdb9c757b1d
|
||||
// This only needs to be overridden by RenderWidgetHostViewBase subclasses
|
||||
// that handle content embedded within other RenderWidgetHostViews.
|
||||
gfx::PointF TransformPointToRootCoordSpaceF(
|
||||
@@ -336,6 +344,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
|
||||
@@ -337,6 +345,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
|
||||
virtual void ProcessGestureEvent(const blink::WebGestureEvent& event,
|
||||
const ui::LatencyInfo& latency);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ 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 f46edeebd1c5e3350dea2f0549ed2a24cfad7a75..77b700e48c976375129eec5f7927fe68efb0e396 100644
|
||||
index 1952b5018f8e5bed87b7dc9d8012c8f2fac00c96..ecef0e83520cbf1015ba1d639be39791ec0cfbb5 100644
|
||||
--- a/content/renderer/render_thread_impl.cc
|
||||
+++ b/content/renderer/render_thread_impl.cc
|
||||
@@ -1263,7 +1263,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
|
||||
|
||||
@@ -22,10 +22,10 @@ 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 c299ed667915660edb4bdd70eda947f7420e8734..d2dd405a2ee5be716588834a1c5d07118070b7e0 100644
|
||||
index 11662788156dca940a4d90f959fd511bcefbb07b..5f2c6c97eda8e543c48784e8bac6795646a9ea24 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -1725,9 +1725,15 @@ bool RenderProcessHostImpl::Init() {
|
||||
@@ -1726,9 +1726,15 @@ bool RenderProcessHostImpl::Init() {
|
||||
std::unique_ptr<SandboxedProcessLauncherDelegate> sandbox_delegate =
|
||||
std::make_unique<RendererSandboxedProcessLauncherDelegateWin>(
|
||||
*cmd_line, IsPdf(), /*is_jit_disabled=*/IsPdf());
|
||||
|
||||
@@ -9,10 +9,10 @@ is needed for OSR.
|
||||
Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 11ed98cbe928b4c1efe1b34feec1a79cbe06a00a..9ec976ec797838e4a4e3e30524f82948c884dc96 100644
|
||||
index 257b9f8ae014f577a9e2de35a3b251efda451fbe..74b8b5bd0d22555f9e11bf326dc212634078f441 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3516,6 +3516,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3521,6 +3521,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
params.main_frame_name, GetOpener(), primary_main_frame_policy,
|
||||
base::UnguessableToken::Create());
|
||||
|
||||
@@ -26,7 +26,7 @@ index 11ed98cbe928b4c1efe1b34feec1a79cbe06a00a..9ec976ec797838e4a4e3e30524f82948
|
||||
std::unique_ptr<WebContentsViewDelegate> delegate =
|
||||
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
||||
|
||||
@@ -3526,6 +3533,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3531,6 +3538,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
view_ = CreateWebContentsView(this, std::move(delegate),
|
||||
&render_view_host_delegate_view_);
|
||||
}
|
||||
@@ -35,10 +35,10 @@ index 11ed98cbe928b4c1efe1b34feec1a79cbe06a00a..9ec976ec797838e4a4e3e30524f82948
|
||||
CHECK(view_.get());
|
||||
|
||||
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
|
||||
index 11504e08e61ecc1fe2747b60818b3e3f520655f7..30362796b3f3a9c3a955fe6f38af63bdb3a4ff80 100644
|
||||
index 663230421212be4a77032357d2143b5990ae3dde..675e23583cb8abb5e1bebdb2a9804dd37b834b30 100644
|
||||
--- a/content/public/browser/web_contents.h
|
||||
+++ b/content/public/browser/web_contents.h
|
||||
@@ -103,10 +103,13 @@ class BrowserContext;
|
||||
@@ -104,10 +104,13 @@ class BrowserContext;
|
||||
class BrowserPluginGuestDelegate;
|
||||
class RenderFrameHost;
|
||||
class RenderViewHost;
|
||||
@@ -52,7 +52,7 @@ index 11504e08e61ecc1fe2747b60818b3e3f520655f7..30362796b3f3a9c3a955fe6f38af63bd
|
||||
class WebUI;
|
||||
struct DropData;
|
||||
struct MHTMLGenerationParams;
|
||||
@@ -253,6 +256,10 @@ class WebContents : public PageNavigator,
|
||||
@@ -254,6 +257,10 @@ class WebContents : public PageNavigator,
|
||||
network::mojom::WebSandboxFlags starting_sandbox_flags =
|
||||
network::mojom::WebSandboxFlags::kNone;
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@ Note that we also need to manually update embedder's
|
||||
`api::WebContents::IsFullscreenForTabOrPending` value.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
index 39b46b4f5bb3adb18d903c0ca4c65f212138590b..bc6a81da3832608b12f67dc241e8711ca09e9215 100644
|
||||
index c36367b28a627f7e6e77bcf3fc10f907b131523b..ed7e48a9b2313eedae4a733e15286a2c28a42a74 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -7542,6 +7542,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
@@ -7548,6 +7548,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ index 39b46b4f5bb3adb18d903c0ca4c65f212138590b..bc6a81da3832608b12f67dc241e8711c
|
||||
if (had_fullscreen_token && !GetView()->HasFocus())
|
||||
GetView()->Focus();
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 9ec976ec797838e4a4e3e30524f82948c884dc96..459d9057d4155f83f6c184d654930f10f2a3241a 100644
|
||||
index 74b8b5bd0d22555f9e11bf326dc212634078f441..d9646348e5b21618e013e04c5ec43868163c1d5b 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3770,21 +3770,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
|
||||
@@ -3775,21 +3775,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
|
||||
const NativeWebKeyboardEvent& event) {
|
||||
OPTIONAL_TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("content.verbose"),
|
||||
"WebContentsImpl::PreHandleKeyboardEvent");
|
||||
@@ -78,7 +78,7 @@ index 9ec976ec797838e4a4e3e30524f82948c884dc96..459d9057d4155f83f6c184d654930f10
|
||||
}
|
||||
|
||||
bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
|
||||
@@ -3920,7 +3924,7 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
@@ -3925,7 +3929,7 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode");
|
||||
DCHECK(CanEnterFullscreenMode(requesting_frame, options));
|
||||
DCHECK(requesting_frame->IsActive());
|
||||
|
||||
@@ -10,10 +10,10 @@ An attempt to upstream this was made, but rejected:
|
||||
https://chromium-review.googlesource.com/c/chromium/src/+/1954347
|
||||
|
||||
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
|
||||
index 05d469f572ba488bdbfbbfb0b4e6b0b298550ab5..c0bd110f078801a62f49a6c5e52db56daba085de 100644
|
||||
index 4399fe2564a03527f5172519d0542967803c8635..1b0e7abf7db8cb2c4df4955f6f5547c63902f14e 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 {
|
||||
@@ -385,6 +385,11 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
virtual void DidInitializeWorkerContextOnWorkerThread(
|
||||
v8::Local<v8::Context> context) {}
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@ that clearly establishes the worker script is ready for evaluation with the scop
|
||||
initialized.
|
||||
|
||||
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
|
||||
index c0bd110f078801a62f49a6c5e52db56daba085de..a8210f00f4c00ad16a21a0c3f0a82c6f198828f2 100644
|
||||
index 1b0e7abf7db8cb2c4df4955f6f5547c63902f14e..ee60a9cbc78858528f3d77e035e0bc11b7e7a57f 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 {
|
||||
@@ -385,6 +385,11 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
virtual void DidInitializeWorkerContextOnWorkerThread(
|
||||
v8::Local<v8::Context> context) {}
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ to handle this without patching, but this is fairly clean for now and no longer
|
||||
patching legacy devtools code.
|
||||
|
||||
diff --git a/front_end/entrypoints/main/MainImpl.ts b/front_end/entrypoints/main/MainImpl.ts
|
||||
index 826885af511a21e31874fed1ff4f056feb0ddb7a..345066348c761ed79ae4463d6bf64688da825a40 100644
|
||||
index be3b1dd1fe8950d7b4fd276e44f5e0552988e8ad..31daf42856d62bfd05a55aab3244605b9d8073f3 100644
|
||||
--- a/front_end/entrypoints/main/MainImpl.ts
|
||||
+++ b/front_end/entrypoints/main/MainImpl.ts
|
||||
@@ -718,6 +718,8 @@ export class MainImpl {
|
||||
@@ -734,6 +734,8 @@ export class MainImpl {
|
||||
globalThis.Main = globalThis.Main || {};
|
||||
// @ts-ignore Exported for Tests.js
|
||||
globalThis.Main.Main = MainImpl;
|
||||
|
||||
@@ -47,3 +47,4 @@ build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch
|
||||
fix_revert_src_lb_reducing_c_calls_of_esm_legacy_main_resolve.patch
|
||||
src_preload_function_for_environment.patch
|
||||
deprecate_vector_v8_local_in_v8.patch
|
||||
fs_fix_wtf-8_decoding_issue.patch
|
||||
|
||||
30
patches/node/fs_fix_wtf-8_decoding_issue.patch
Normal file
30
patches/node/fs_fix_wtf-8_decoding_issue.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Richard Lau <rlau@redhat.com>
|
||||
Date: Fri, 1 Mar 2024 19:15:40 +0000
|
||||
Subject: fs: fix WTF-8 decoding issue
|
||||
|
||||
Cherry-pick of libuv/libuv@d09441c
|
||||
|
||||
Refs: https://github.com/libuv/libuv/pull/2970
|
||||
Fixes: https://github.com/nodejs/node/issues/48673
|
||||
|
||||
We forgot to mask off the high bits from the first byte, so we ended up
|
||||
always failing the subsequent range check.
|
||||
|
||||
diff --git a/deps/uv/src/win/fs.c b/deps/uv/src/win/fs.c
|
||||
index fc209c54f470edaa031009979061cff071cbf66d..4fc13b04bdae5bd9e2627027a10c534c2d9675dc 100644
|
||||
--- a/deps/uv/src/win/fs.c
|
||||
+++ b/deps/uv/src/win/fs.c
|
||||
@@ -176,9 +176,11 @@ static int32_t fs__decode_wtf8_char(const char** input) {
|
||||
if ((b4 & 0xC0) != 0x80)
|
||||
return -1; /* invalid: not a continuation byte */
|
||||
code_point = (code_point << 6) | (b4 & 0x3F);
|
||||
- if (b1 <= 0xF4)
|
||||
+ if (b1 <= 0xF4) {
|
||||
+ code_point &= 0x1FFFFF;
|
||||
if (code_point <= 0x10FFFF)
|
||||
return code_point; /* four-byte character */
|
||||
+ }
|
||||
|
||||
/* code point too large */
|
||||
return -1;
|
||||
@@ -2,3 +2,4 @@ fix_disable_compression_threshold.patch
|
||||
fix_add_python_remote_wrapper.patch
|
||||
build_on_windows_provide_clang_wrapper_as_toolchain_input.patch
|
||||
fix_temporarily_use_toolchain_inputs_exclusively_instead_of_inputs.patch
|
||||
reland_mojo_use_large_worker_for_mojom_parser_action.patch
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: John Kleinschmidt <jkleinsc@electronjs.org>
|
||||
Date: Thu, 14 Mar 2024 11:11:36 -0400
|
||||
Subject: Reland "[mojo] Use large worker for mojom_parser action"
|
||||
|
||||
https://chromium-review.googlesource.com/c/chromium/src/+/5368769
|
||||
requires a "large" worker
|
||||
|
||||
https://chromium-review.googlesource.com/c/chromium/src/+/5364000
|
||||
adds a copy of buildtools/reclient_cfgs/linux_chroot/python/rewrapper_linux_cfg
|
||||
so we will use that approach as we do not have differently sized workers
|
||||
|
||||
diff --git a/configure_reclient.py b/configure_reclient.py
|
||||
index a157ceeb155987f6ab9b11d3cef8c2c9894e0436..34136aab6cbb46c265b9f8298e9411349b1526c2 100755
|
||||
--- a/configure_reclient.py
|
||||
+++ b/configure_reclient.py
|
||||
@@ -297,6 +297,11 @@ class ReclientConfigurator:
|
||||
f'{Paths.reclient_cfgs_dir}/{tool}/rewrapper_{host_os}.cfg',
|
||||
rewrapper_cfg, source_cfg_paths)
|
||||
|
||||
+ # Write "large" configs to the expected location.
|
||||
+ ReclientCfg.write_to_file(
|
||||
+ f'{Paths.reclient_cfgs_dir}/{tool}/rewrapper_{host_os}_large.cfg',
|
||||
+ rewrapper_cfg, source_cfg_paths)
|
||||
+
|
||||
|
||||
class Paths:
|
||||
script_dir = ''
|
||||
@@ -13,7 +13,7 @@ THREEWAY = "ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES" in os.environ
|
||||
def apply_patches(target):
|
||||
repo = target.get('repo')
|
||||
if not os.path.exists(repo):
|
||||
warnings.warn('repo not found: %s' % repo)
|
||||
warnings.warn(f'repo not found: {repo}')
|
||||
return
|
||||
patch_dir = target.get('patch_dir')
|
||||
git.import_patches(
|
||||
|
||||
@@ -13,13 +13,13 @@ def stop():
|
||||
DBusTestCase.stop_dbus(DBusTestCase.session_bus_pid)
|
||||
|
||||
def start():
|
||||
log = sys.stdout if is_verbose_mode() else open(os.devnull, 'w')
|
||||
with sys.stdout if is_verbose_mode() \
|
||||
else open(os.devnull, 'w', encoding='utf-8') as log:
|
||||
DBusTestCase.start_system_bus()
|
||||
DBusTestCase.spawn_server_template('logind', None, log)
|
||||
|
||||
DBusTestCase.start_system_bus()
|
||||
DBusTestCase.spawn_server_template('logind', None, log)
|
||||
|
||||
DBusTestCase.start_session_bus()
|
||||
DBusTestCase.spawn_server_template('notification_daemon', None, log)
|
||||
DBusTestCase.start_session_bus()
|
||||
DBusTestCase.spawn_server_template('notification_daemon', None, log)
|
||||
|
||||
if __name__ == '__main__':
|
||||
start()
|
||||
|
||||
@@ -11,7 +11,7 @@ from lib import git
|
||||
def export_patches(target, dry_run):
|
||||
repo = target.get('repo')
|
||||
if not os.path.exists(repo):
|
||||
warnings.warn('repo not found: %s' % repo)
|
||||
warnings.warn(f'repo not found: {repo}')
|
||||
return
|
||||
git.export_patches(
|
||||
dry_run=dry_run,
|
||||
|
||||
@@ -29,15 +29,15 @@ def run_node_configure(target_cpu):
|
||||
|
||||
def read_node_config_gypi():
|
||||
config_gypi = os.path.join(NODE_DIR, 'config.gypi')
|
||||
with open(config_gypi, 'r') as f:
|
||||
content = f.read()
|
||||
with open(config_gypi, 'r', encoding='utf-8') as file_in:
|
||||
content = file_in.read()
|
||||
return ast.literal_eval(content)
|
||||
|
||||
def read_electron_args():
|
||||
all_gn = os.path.join(ELECTRON_DIR, 'build', 'args', 'all.gn')
|
||||
args = {}
|
||||
with open(all_gn, 'r') as f:
|
||||
for line in f:
|
||||
with open(all_gn, 'r', encoding='utf-8') as file_in:
|
||||
for line in file_in:
|
||||
if line.startswith('#'):
|
||||
continue
|
||||
m = re.match('([\w_]+) = (.+)', line)
|
||||
@@ -62,8 +62,8 @@ def main(target_file, target_cpu):
|
||||
# Used by certain versions of node-gyp.
|
||||
v['build_v8_with_gn'] = 'false'
|
||||
|
||||
with open(target_file, 'w+') as f:
|
||||
f.write(pprint.pformat(config, indent=2))
|
||||
with open(target_file, 'w+', encoding='utf-8') as file_out:
|
||||
file_out.write(pprint.pformat(config, indent=2))
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main(sys.argv[1], sys.argv[2]))
|
||||
|
||||
@@ -4,7 +4,7 @@ import zipfile
|
||||
import sys
|
||||
|
||||
def main(zip_path, manifest_out):
|
||||
with open(manifest_out, 'w') as manifest, \
|
||||
with open(manifest_out, 'w', encoding='utf-8') as manifest, \
|
||||
zipfile.ZipFile(zip_path, 'r', allowZip64=True) as z:
|
||||
for name in sorted(z.namelist()):
|
||||
manifest.write(name + '\n')
|
||||
|
||||
@@ -8,7 +8,8 @@ NMV = None
|
||||
if len(sys.argv) > 3:
|
||||
NMV = sys.argv[3]
|
||||
|
||||
with open(node_version_file, 'r') as in_file, open(out_file, 'w') as out_file:
|
||||
with open(node_version_file, 'r', encoding='utf-8') as in_file, \
|
||||
open(out_file, 'w', encoding='utf-8') as out_file:
|
||||
changed = False
|
||||
contents = in_file.read()
|
||||
new_contents = re.sub(
|
||||
|
||||
@@ -43,7 +43,7 @@ def get_zip_name(name, version, suffix=''):
|
||||
arch = get_target_arch()
|
||||
if arch == 'arm':
|
||||
arch += 'v7l'
|
||||
zip_name = '{0}-{1}-{2}-{3}'.format(name, version, get_platform_key(), arch)
|
||||
zip_name = f'{name}-{version}-{get_platform_key()}-{arch}'
|
||||
if suffix:
|
||||
zip_name += '-' + suffix
|
||||
return zip_name + '.zip'
|
||||
|
||||
@@ -72,13 +72,10 @@ def am(repo, patch_data, threeway=False, directory=None, exclude=None,
|
||||
root_args += ['-c', 'user.email=' + committer_email]
|
||||
root_args += ['-c', 'commit.gpgsign=false']
|
||||
command = ['git'] + root_args + ['am'] + args
|
||||
proc = subprocess.Popen(
|
||||
command,
|
||||
stdin=subprocess.PIPE)
|
||||
proc.communicate(patch_data.encode('utf-8'))
|
||||
if proc.returncode != 0:
|
||||
raise RuntimeError("Command {} returned {}".format(command,
|
||||
proc.returncode))
|
||||
with subprocess.Popen(command, stdin=subprocess.PIPE) as proc:
|
||||
proc.communicate(patch_data.encode('utf-8'))
|
||||
if proc.returncode != 0:
|
||||
raise RuntimeError(f"Command {command} returned {proc.returncode}")
|
||||
|
||||
|
||||
def import_patches(repo, ref=UPSTREAM_HEAD, **kwargs):
|
||||
@@ -229,19 +226,19 @@ def export_patches(repo, out_dir,
|
||||
dry_run=False, grep=None):
|
||||
if not os.path.exists(repo):
|
||||
sys.stderr.write(
|
||||
"Skipping patches in {} because it does not exist.\n".format(repo)
|
||||
f"Skipping patches in {repo} because it does not exist.\n"
|
||||
)
|
||||
return
|
||||
if patch_range is None:
|
||||
patch_range, num_patches = guess_base_commit(repo, ref)
|
||||
sys.stderr.write("Exporting {} patches in {} since {}\n".format(
|
||||
num_patches, repo, patch_range[0:7]))
|
||||
patch_range, n_patches = guess_base_commit(repo, ref)
|
||||
msg = f"Exporting {n_patches} patches in {repo} since {patch_range[0:7]}\n"
|
||||
sys.stderr.write(msg)
|
||||
patch_data = format_patch(repo, patch_range)
|
||||
patches = split_patches(patch_data)
|
||||
if grep:
|
||||
olen = len(patches)
|
||||
patches = filter_patches(patches, grep)
|
||||
sys.stderr.write("Exporting {} of {} patches\n".format(len(patches), olen))
|
||||
sys.stderr.write(f"Exporting {len(patches)} of {olen} patches\n")
|
||||
|
||||
try:
|
||||
os.mkdir(out_dir)
|
||||
@@ -256,7 +253,8 @@ def export_patches(repo, out_dir,
|
||||
for patch in patches:
|
||||
filename = get_file_name(patch)
|
||||
filepath = posixpath.join(out_dir, filename)
|
||||
existing_patch = str(io.open(filepath, 'rb').read(), 'utf-8')
|
||||
with io.open(filepath, 'rb') as inp:
|
||||
existing_patch = str(inp.read(), 'utf-8')
|
||||
formatted_patch = join_patch(patch)
|
||||
if formatted_patch != existing_patch:
|
||||
bad_patches.append(filename)
|
||||
|
||||
@@ -65,7 +65,7 @@ class Platform:
|
||||
return Platform.WINDOWS
|
||||
|
||||
raise AssertionError(
|
||||
"unexpected current platform '{}'".format(platform))
|
||||
f"unexpected current platform '{platform}'")
|
||||
|
||||
@staticmethod
|
||||
def get_all():
|
||||
@@ -101,19 +101,19 @@ class TestsList():
|
||||
# First check that all names are present in the config.
|
||||
for binary_name in binaries:
|
||||
if binary_name not in self.tests:
|
||||
raise Exception("binary {0} not found in config '{1}'".format(
|
||||
binary_name, self.config_path))
|
||||
msg = f"binary {binary_name} not found in config '{self.config_path}'"
|
||||
raise Exception(msg)
|
||||
|
||||
# Respect the "platform" setting.
|
||||
for binary_name in binaries:
|
||||
if not self.__platform_supports(binary_name):
|
||||
raise Exception(
|
||||
"binary {0} cannot be run on {1}, check the config".format(
|
||||
binary_name, Platform.get_current()))
|
||||
host = Platform.get_current()
|
||||
errmsg = f"binary {binary_name} cannot run on {host}. Check the config"
|
||||
raise Exception(errmsg)
|
||||
|
||||
suite_returncode = sum(
|
||||
[self.__run(binary, output_dir, verbosity, disabled_tests_policy)
|
||||
for binary in binaries])
|
||||
self.__run(binary, output_dir, verbosity, disabled_tests_policy)
|
||||
for binary in binaries)
|
||||
return suite_returncode
|
||||
|
||||
def run_all(self, output_dir=None, verbosity=Verbosity.CHATTY,
|
||||
@@ -134,7 +134,7 @@ class TestsList():
|
||||
|
||||
@staticmethod
|
||||
def __get_config_data(config_path):
|
||||
with open(config_path, 'r') as stream:
|
||||
with open(config_path, 'r', encoding='utf-8') as stream:
|
||||
return yaml.load(stream)
|
||||
|
||||
@staticmethod
|
||||
@@ -146,7 +146,7 @@ class TestsList():
|
||||
if isinstance(value, str):
|
||||
return {value: None}
|
||||
|
||||
raise AssertionError("unexpected shorthand type: {}".format(type(value)))
|
||||
raise AssertionError(f"unexpected shorthand type: {type(value)}")
|
||||
|
||||
@staticmethod
|
||||
def __make_a_list(value):
|
||||
@@ -166,7 +166,7 @@ class TestsList():
|
||||
return [list_item for key in value for list_item in value[key]]
|
||||
|
||||
raise AssertionError(
|
||||
"unexpected type for list merging: {}".format(type(value)))
|
||||
f"unexpected type for list merging: {type(value)}")
|
||||
|
||||
def __platform_supports(self, binary_name):
|
||||
return Platform.get_current() in self.tests[binary_name]['platforms']
|
||||
@@ -194,8 +194,7 @@ class TestsList():
|
||||
|
||||
for platform in platforms:
|
||||
assert Platform.is_valid(platform), \
|
||||
"platform '{0}' is not supported, check {1} config" \
|
||||
.format(platform, binary_name)
|
||||
f"Unsupported platform {platform}, check {binary_name} config"
|
||||
|
||||
test_data['platforms'] = platforms
|
||||
|
||||
@@ -231,7 +230,7 @@ class TestsList():
|
||||
if output_dir is None:
|
||||
return None
|
||||
|
||||
return os.path.join(output_dir, "results_{}.xml".format(binary_name))
|
||||
return os.path.join(output_dir, f"results_{binary_name}.xml")
|
||||
|
||||
|
||||
class TestBinary():
|
||||
@@ -248,50 +247,40 @@ class TestBinary():
|
||||
gtest_output = TestBinary.__get_gtest_output(output_file_path)
|
||||
|
||||
args = [self.binary_path, gtest_filter, gtest_output]
|
||||
stdout, stderr = TestBinary.__get_stdout_and_stderr(verbosity)
|
||||
|
||||
returncode = 0
|
||||
try:
|
||||
returncode = subprocess.call(args, stdout=stdout, stderr=stderr)
|
||||
except Exception as exception:
|
||||
if Verbosity.ge(verbosity, Verbosity.ERRORS):
|
||||
print("An error occurred while running '{}':".format(self.binary_path),
|
||||
'\n', exception, file=sys.stderr)
|
||||
returncode = 1
|
||||
|
||||
with open(os.devnull, "w", encoding='utf-8') as devnull:
|
||||
stdout = stderr = None
|
||||
if Verbosity.le(verbosity, Verbosity.ERRORS):
|
||||
stdout = devnull
|
||||
if verbosity == Verbosity.SILENT:
|
||||
stderr = devnull
|
||||
|
||||
try:
|
||||
returncode = subprocess.call(args, stdout=stdout, stderr=stderr)
|
||||
except Exception as exception:
|
||||
if Verbosity.ge(verbosity, Verbosity.ERRORS):
|
||||
print(f"An error occurred while running '{self.binary_path}':",
|
||||
'\n', exception, file=sys.stderr)
|
||||
returncode = 1
|
||||
|
||||
return returncode
|
||||
|
||||
@staticmethod
|
||||
def __get_gtest_filter(included_tests, excluded_tests):
|
||||
included_tests_string = TestBinary.__list_tests(included_tests)
|
||||
excluded_tests_string = TestBinary.__list_tests(excluded_tests)
|
||||
|
||||
gtest_filter = "--gtest_filter={}-{}".format(included_tests_string,
|
||||
excluded_tests_string)
|
||||
return gtest_filter
|
||||
included_str = TestBinary.__list_tests(included_tests)
|
||||
excluded_str = TestBinary.__list_tests(excluded_tests)
|
||||
return f"--gtest_filter={included_str}-{excluded_str}"
|
||||
|
||||
@staticmethod
|
||||
def __get_gtest_output(output_file_path):
|
||||
gtest_output = ""
|
||||
if output_file_path is not None:
|
||||
gtest_output = "--gtest_output={0}:{1}".format(TestBinary.output_format,
|
||||
output_file_path)
|
||||
return gtest_output
|
||||
if output_file_path is None:
|
||||
return ""
|
||||
return f"--gtest_output={TestBinary.output_format}:{output_file_path}"
|
||||
|
||||
@staticmethod
|
||||
def __list_tests(tests):
|
||||
if tests is None:
|
||||
return ''
|
||||
return ':'.join(tests)
|
||||
|
||||
@staticmethod
|
||||
def __get_stdout_and_stderr(verbosity):
|
||||
stdout = stderr = None
|
||||
|
||||
if Verbosity.le(verbosity, Verbosity.ERRORS):
|
||||
devnull = open(os.devnull, 'w')
|
||||
stdout = devnull
|
||||
if verbosity == Verbosity.SILENT:
|
||||
stderr = devnull
|
||||
|
||||
return (stdout, stderr)
|
||||
|
||||
@@ -21,8 +21,8 @@ def read_patch(patch_dir, patch_filename):
|
||||
for l in f.readlines():
|
||||
line_has_correct_start = l.startswith('diff -') or l.startswith('---')
|
||||
if not added_patch_location and line_has_correct_start:
|
||||
ret.append('{}{}\n'.format(PATCH_DIR_PREFIX, patch_dir))
|
||||
ret.append('{}{}\n'.format(PATCH_FILENAME_PREFIX, patch_filename))
|
||||
ret.append(f'{PATCH_DIR_PREFIX}{patch_dir}\n')
|
||||
ret.append(f'{PATCH_FILENAME_PREFIX}{patch_filename}\n')
|
||||
added_patch_location = True
|
||||
ret.append(l)
|
||||
return ''.join(ret)
|
||||
@@ -31,8 +31,8 @@ def read_patch(patch_dir, patch_filename):
|
||||
def patch_from_dir(patch_dir):
|
||||
"""Read a directory of patches into a format suitable for passing to
|
||||
'git am'"""
|
||||
with open(os.path.join(patch_dir, ".patches")) as f:
|
||||
patch_list = [l.rstrip('\n') for l in f.readlines()]
|
||||
with open(os.path.join(patch_dir, ".patches"), encoding='utf-8') as file_in:
|
||||
patch_list = [line.rstrip('\n') for line in file_in.readlines()]
|
||||
|
||||
return ''.join([
|
||||
read_patch(patch_dir, patch_filename)
|
||||
|
||||
@@ -35,9 +35,8 @@ def scoped_cwd(path):
|
||||
|
||||
def download(text, url, path):
|
||||
safe_mkdir(os.path.dirname(path))
|
||||
with open(path, 'wb') as local_file:
|
||||
print("Downloading %s to %s" % (url, path))
|
||||
web_file = urlopen(url)
|
||||
with open(path, 'wb') as local_file, urlopen(url) as web_file:
|
||||
print(f"Downloading {url} to {path}")
|
||||
info = web_file.info()
|
||||
if hasattr(info, 'getheader'):
|
||||
file_size = int(info.getheaders("Content-Length")[0])
|
||||
@@ -58,11 +57,11 @@ def download(text, url, path):
|
||||
|
||||
if not ci:
|
||||
percent = downloaded_size * 100. / file_size
|
||||
status = "\r%s %10d [%3.1f%%]" % (text, downloaded_size, percent)
|
||||
status = f"\r{text} {downloaded_size:10d} [{percent:3.1f}%]"
|
||||
print(status, end=' ')
|
||||
|
||||
if ci:
|
||||
print("%s done." % (text))
|
||||
print(f"{text} done.")
|
||||
else:
|
||||
print()
|
||||
return path
|
||||
@@ -74,15 +73,16 @@ def make_zip(zip_file_path, files, dirs):
|
||||
allfiles = files + dirs
|
||||
execute(['zip', '-r', '-y', zip_file_path] + allfiles)
|
||||
else:
|
||||
zip_file = zipfile.ZipFile(zip_file_path, "w", zipfile.ZIP_DEFLATED,
|
||||
allowZip64=True)
|
||||
for filename in files:
|
||||
zip_file.write(filename, filename)
|
||||
for dirname in dirs:
|
||||
for root, _, filenames in os.walk(dirname):
|
||||
for f in filenames:
|
||||
zip_file.write(os.path.join(root, f))
|
||||
zip_file.close()
|
||||
with zipfile.ZipFile(zip_file_path, "w",
|
||||
zipfile.ZIP_DEFLATED,
|
||||
allowZip64=True) as zip_file:
|
||||
for filename in files:
|
||||
zip_file.write(filename, filename)
|
||||
for dirname in dirs:
|
||||
for root, _, filenames in os.walk(dirname):
|
||||
for f in filenames:
|
||||
zip_file.write(os.path.join(root, f))
|
||||
zip_file.close()
|
||||
|
||||
|
||||
def rm_rf(path):
|
||||
@@ -128,8 +128,8 @@ def get_electron_branding():
|
||||
SOURCE_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', '..'))
|
||||
branding_file_path = os.path.join(
|
||||
SOURCE_ROOT, 'shell', 'app', 'BRANDING.json')
|
||||
with open(branding_file_path) as f:
|
||||
return json.load(f)
|
||||
with open(branding_file_path, encoding='utf-8') as file_in:
|
||||
return json.load(file_in)
|
||||
|
||||
|
||||
cached_electron_version = None
|
||||
@@ -173,14 +173,14 @@ def get_electron_exec():
|
||||
out_dir = get_out_dir()
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
return '{0}/Electron.app/Contents/MacOS/Electron'.format(out_dir)
|
||||
return f'{out_dir}/Electron.app/Contents/MacOS/Electron'
|
||||
if sys.platform == 'win32':
|
||||
return '{0}/electron.exe'.format(out_dir)
|
||||
return f'{out_dir}/electron.exe'
|
||||
if sys.platform == 'linux':
|
||||
return '{0}/electron'.format(out_dir)
|
||||
return f'{out_dir}/electron'
|
||||
|
||||
raise Exception(
|
||||
"get_electron_exec: unexpected platform '{0}'".format(sys.platform))
|
||||
f"get_electron_exec: unexpected platform '{sys.platform}'")
|
||||
|
||||
def get_buildtools_executable(name):
|
||||
buildtools = os.path.realpath(os.path.join(ELECTRON_DIR, '..', 'buildtools'))
|
||||
|
||||
@@ -120,10 +120,10 @@ const LINTERS = [{
|
||||
roots: ['script'],
|
||||
test: filename => filename.endsWith('.py'),
|
||||
run: (opts, filenames) => {
|
||||
const rcfile = path.join(DEPOT_TOOLS, 'pylintrc');
|
||||
const rcfile = path.join(DEPOT_TOOLS, 'pylintrc-2.17');
|
||||
const args = ['--rcfile=' + rcfile, ...filenames];
|
||||
const env = { PYTHONPATH: path.join(ELECTRON_ROOT, 'script'), ...process.env };
|
||||
spawnAndCheckExitCode('pylint-2.7', args, { env });
|
||||
spawnAndCheckExitCode('pylint-2.17', args, { env });
|
||||
}
|
||||
}, {
|
||||
key: 'javascript',
|
||||
|
||||
@@ -65,19 +65,19 @@ def parse_args():
|
||||
# 'config' must exist and be a file.
|
||||
args.config = os.path.abspath(args.config)
|
||||
if not os.path.isfile(args.config):
|
||||
parser.error("file '{}' doesn't exist".format(args.config))
|
||||
parser.error(f"file '{args.config}' doesn't exist")
|
||||
|
||||
# 'tests_dir' must exist and be a directory.
|
||||
if args.tests_dir is not None:
|
||||
args.tests_dir = os.path.abspath(args.tests_dir)
|
||||
if not os.path.isdir(args.tests_dir):
|
||||
parser.error("directory '{}' doesn't exist".format(args.tests_dir))
|
||||
parser.error(f"directory '{args.tests_dir}' doesn't exist")
|
||||
|
||||
# 'output_dir' must exist and be a directory.
|
||||
if args.output_dir is not None:
|
||||
args.output_dir = os.path.abspath(args.output_dir)
|
||||
if not os.path.isdir(args.output_dir):
|
||||
parser.error("directory '{}' doesn't exist".format(args.output_dir))
|
||||
parser.error(f"directory '{args.output_dir}' doesn't exist")
|
||||
|
||||
return args
|
||||
|
||||
@@ -99,7 +99,7 @@ def main():
|
||||
return tests_list.run_all(args.output_dir, args.verbosity,
|
||||
args.disabled_tests_policy)
|
||||
|
||||
raise AssertionError("unexpected command '{}'".format(args.command))
|
||||
raise AssertionError(f"unexpected command '{args.command}'")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -77,8 +77,8 @@ def set_mtimes(patches_config, mtime):
|
||||
|
||||
mtime_cache[file_path] = mtime
|
||||
|
||||
for file_path in mtime_cache:
|
||||
os.utime(file_path, (mtime_cache[file_path], mtime_cache[file_path]))
|
||||
for file_path, file_mtime in mtime_cache.items():
|
||||
os.utime(file_path, (file_mtime, file_mtime))
|
||||
|
||||
|
||||
def main():
|
||||
@@ -131,17 +131,17 @@ def main():
|
||||
if args.operation == "generate":
|
||||
try:
|
||||
# Cache file may exist from a previously aborted sync. Reuse it.
|
||||
with open(args.cache_file, mode="r") as f:
|
||||
json.load(f) # Make sure it's not an empty file
|
||||
with open(args.cache_file, mode='r', encoding='utf-8') as fin:
|
||||
json.load(fin) # Make sure it's not an empty file
|
||||
print("Using existing mtime cache for patches")
|
||||
return 0
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
with open(args.cache_file, mode="w") as f:
|
||||
with open(args.cache_file, mode="w", encoding='utf-8') as fin:
|
||||
mtime_cache = generate_cache(json.load(args.patches_config))
|
||||
json.dump(mtime_cache, f, indent=2)
|
||||
json.dump(mtime_cache, fin, indent=2)
|
||||
except Exception:
|
||||
print(
|
||||
"ERROR: failed to generate mtime cache for patches",
|
||||
@@ -155,8 +155,8 @@ def main():
|
||||
return 0 # Cache file may not exist, fail more gracefully
|
||||
|
||||
try:
|
||||
with open(args.cache_file, mode="r") as f:
|
||||
apply_mtimes(json.load(f))
|
||||
with open(args.cache_file, mode='r', encoding='utf-8') as file_in:
|
||||
apply_mtimes(json.load(file_in))
|
||||
|
||||
if not args.preserve_cache:
|
||||
os.remove(args.cache_file)
|
||||
|
||||
@@ -32,9 +32,8 @@ def get_content(retry_count = 5):
|
||||
headers={"Authorization" : authToken}
|
||||
)
|
||||
|
||||
proposed_content = urlopen(
|
||||
request
|
||||
).read()
|
||||
with urlopen(request) as resp:
|
||||
proposed_content = resp.read()
|
||||
|
||||
if is_json(proposed_content):
|
||||
return proposed_content
|
||||
|
||||
@@ -29,7 +29,7 @@ def main():
|
||||
]
|
||||
|
||||
if args.target_dir is None:
|
||||
store_artifact(directory, 'headers/dist/{0}'.format(args.version),
|
||||
store_artifact(directory, f'headers/dist/{args.version}',
|
||||
checksums)
|
||||
else:
|
||||
copy_files(checksums, args.target_dir)
|
||||
@@ -51,10 +51,10 @@ def parse_args():
|
||||
|
||||
def get_files_list(version):
|
||||
return [
|
||||
{ "filename": 'node-{0}.tar.gz'.format(version), "required": True },
|
||||
{ "filename": 'node-{0}-headers.tar.gz'.format(version), "required": True },
|
||||
{ "filename": 'iojs-{0}.tar.gz'.format(version), "required": True },
|
||||
{ "filename": 'iojs-{0}-headers.tar.gz'.format(version), "required": True },
|
||||
{ "filename": f'node-{version}.tar.gz', "required": True },
|
||||
{ "filename": f'node-{version}-headers.tar.gz', "required": True },
|
||||
{ "filename": f'iojs-{version}.tar.gz', "required": True },
|
||||
{ "filename": f'iojs-{version}-headers.tar.gz', "required": True },
|
||||
{ "filename": 'node.lib', "required": False },
|
||||
{ "filename": 'x64/node.lib', "required": False },
|
||||
{ "filename": 'win-x86/iojs.lib', "required": False },
|
||||
@@ -91,8 +91,8 @@ def create_checksum(algorithm, directory, filename, files):
|
||||
lines.append(h.hexdigest() + ' ' + os.path.relpath(path, directory))
|
||||
|
||||
checksum_file = os.path.join(directory, filename)
|
||||
with open(checksum_file, 'w') as f:
|
||||
f.write('\n'.join(lines) + '\n')
|
||||
with open(checksum_file, 'w', encoding='utf-8') as fout:
|
||||
fout.write('\n'.join(lines) + '\n')
|
||||
return checksum_file
|
||||
|
||||
def copy_files(source_files, output_dir):
|
||||
|
||||
@@ -45,9 +45,9 @@ def upload_node(version):
|
||||
versioned_header_tar = header_tar.format(version)
|
||||
shutil.copy2(generated_tar, os.path.join(GEN_DIR, versioned_header_tar))
|
||||
|
||||
store_artifact(GEN_DIR, 'headers/dist/{0}'.format(version),
|
||||
store_artifact(GEN_DIR, f'headers/dist/{version}',
|
||||
glob.glob('node-*.tar.gz'))
|
||||
store_artifact(GEN_DIR, 'headers/dist/{0}'.format(version),
|
||||
store_artifact(GEN_DIR, f'headers/dist/{version}',
|
||||
glob.glob('iojs-*.tar.gz'))
|
||||
|
||||
if PLATFORM == 'win32':
|
||||
@@ -73,13 +73,13 @@ def upload_node(version):
|
||||
shutil.copy2(electron_lib, v4_node_lib)
|
||||
|
||||
# Upload the node.lib.
|
||||
store_artifact(DIST_DIR, 'headers/dist/{0}'.format(version), [node_lib])
|
||||
store_artifact(DIST_DIR, f'headers/dist/{version}', [node_lib])
|
||||
|
||||
# Upload the iojs.lib.
|
||||
store_artifact(DIST_DIR, 'headers/dist/{0}'.format(version), [iojs_lib])
|
||||
store_artifact(DIST_DIR, f'headers/dist/{version}', [iojs_lib])
|
||||
|
||||
# Upload the v4 node.lib.
|
||||
store_artifact(DIST_DIR, 'headers/dist/{0}'.format(version),
|
||||
store_artifact(DIST_DIR, f'headers/dist/{version}',
|
||||
[v4_node_lib])
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ PRODUCT_NAME = get_electron_branding()['product_name']
|
||||
SYMBOLS_DIR = os.path.join(RELEASE_DIR, 'breakpad_symbols')
|
||||
|
||||
PDB_LIST = [
|
||||
os.path.join(RELEASE_DIR, '{0}.exe.pdb'.format(PROJECT_NAME))
|
||||
os.path.join(RELEASE_DIR, f'{PROJECT_NAME}.exe.pdb')
|
||||
]
|
||||
|
||||
PDB_LIST += glob.glob(os.path.join(RELEASE_DIR, '*.dll.pdb'))
|
||||
|
||||
@@ -53,9 +53,8 @@ def main():
|
||||
|
||||
build_version = get_electron_build_version()
|
||||
if not ELECTRON_VERSION.startswith(build_version):
|
||||
error = 'Tag name ({0}) should match build version ({1})\n'.format(
|
||||
ELECTRON_VERSION, build_version)
|
||||
sys.stderr.write(error)
|
||||
errmsg = f"Tag ({ELECTRON_VERSION}) should match build ({build_version})\n"
|
||||
sys.stderr.write(errmsg)
|
||||
sys.stderr.flush()
|
||||
return 1
|
||||
|
||||
@@ -344,8 +343,7 @@ def upload_electron(release, file_path, args):
|
||||
# if upload_to_storage is set, skip github upload.
|
||||
# todo (vertedinde): migrate this variable to upload_to_storage
|
||||
if args.upload_to_storage:
|
||||
key_prefix = 'release-builds/{0}_{1}'.format(args.version,
|
||||
args.upload_timestamp)
|
||||
key_prefix = f'release-builds/{args.version}_{args.upload_timestamp}'
|
||||
store_artifact(os.path.dirname(file_path), key_prefix, [file_path])
|
||||
upload_sha256_checksum(args.version, file_path, key_prefix)
|
||||
return
|
||||
@@ -358,30 +356,30 @@ def upload_electron(release, file_path, args):
|
||||
|
||||
|
||||
def upload_io_to_github(release, filename, filepath, version):
|
||||
print('Uploading %s to GitHub' % \
|
||||
(filename))
|
||||
print(f'Uploading {filename} to GitHub')
|
||||
script_path = os.path.join(
|
||||
ELECTRON_DIR, 'script', 'release', 'uploaders', 'upload-to-github.ts')
|
||||
upload_process = subprocess.Popen([TS_NODE, script_path, filepath, filename,
|
||||
str(release['id']), version], stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT)
|
||||
if is_verbose_mode():
|
||||
for c in iter(lambda: upload_process.stdout.read(1), b""):
|
||||
sys.stdout.buffer.write(c)
|
||||
sys.stdout.flush()
|
||||
with subprocess.Popen([TS_NODE, script_path, filepath,
|
||||
filename, str(release['id']), version],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT) as upload_process:
|
||||
if is_verbose_mode():
|
||||
for c in iter(lambda: upload_process.stdout.read(1), b""):
|
||||
sys.stdout.buffer.write(c)
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
def upload_sha256_checksum(version, file_path, key_prefix=None):
|
||||
checksum_path = '{}.sha256sum'.format(file_path)
|
||||
checksum_path = f'{file_path}.sha256sum'
|
||||
if key_prefix is None:
|
||||
key_prefix = 'checksums-scratchpad/{0}'.format(version)
|
||||
key_prefix = f'checksums-scratchpad/{version}'
|
||||
sha256 = hashlib.sha256()
|
||||
with open(file_path, 'rb') as f:
|
||||
sha256.update(f.read())
|
||||
|
||||
filename = os.path.basename(file_path)
|
||||
with open(checksum_path, 'w') as checksum:
|
||||
checksum.write('{} *{}'.format(sha256.hexdigest(), filename))
|
||||
with open(checksum_path, 'w', encoding='utf-8') as checksum:
|
||||
checksum.write(f'{sha256.hexdigest()} *{filename}')
|
||||
store_artifact(os.path.dirname(checksum_path), key_prefix, [checksum_path])
|
||||
|
||||
|
||||
@@ -394,7 +392,7 @@ def get_release(version):
|
||||
release_env['NODE_NO_WARNINGS'] = '1'
|
||||
release_info = execute(['node', script_path, version], release_env)
|
||||
if is_verbose_mode():
|
||||
print('Release info for version: {}:\n'.format(version))
|
||||
print(f'Release info for version: {version}:\n')
|
||||
print(release_info)
|
||||
release = json.loads(release_info)
|
||||
return release
|
||||
|
||||
@@ -85,8 +85,8 @@ def make_diff(diff_file, original, reformatted):
|
||||
difflib.unified_diff(
|
||||
original,
|
||||
reformatted,
|
||||
fromfile='a/{}'.format(diff_file),
|
||||
tofile='b/{}'.format(diff_file),
|
||||
fromfile=f'a/{diff_file}',
|
||||
tofile=f'b/{diff_file}',
|
||||
n=3))
|
||||
|
||||
|
||||
@@ -111,8 +111,7 @@ def run_clang_format_diff_wrapper(args, file_name):
|
||||
raise
|
||||
except Exception as e:
|
||||
# pylint: disable=W0707
|
||||
raise UnexpectedError('{}: {}: {}'.format(
|
||||
file_name, e.__class__.__name__, e), e)
|
||||
raise UnexpectedError(f'{file_name}: {e.__class__.__name__}: {e}', e)
|
||||
|
||||
|
||||
def run_clang_format_diff(args, file_name):
|
||||
@@ -131,25 +130,22 @@ def run_clang_format_diff(args, file_name):
|
||||
print(" ".join(invocation))
|
||||
return [], []
|
||||
try:
|
||||
proc = subprocess.Popen(
|
||||
' '.join(invocation),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
universal_newlines=True,
|
||||
shell=True)
|
||||
with subprocess.Popen(' '.join(invocation),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
universal_newlines=True,
|
||||
shell=True) as proc:
|
||||
outs = list(proc.stdout.readlines())
|
||||
errs = list(proc.stderr.readlines())
|
||||
proc.wait()
|
||||
if proc.returncode:
|
||||
code = proc.returncode
|
||||
msg = f"clang-format exited with code {code}: '{file_name}'"
|
||||
raise DiffError(msg, errs)
|
||||
except OSError as exc:
|
||||
# pylint: disable=W0707
|
||||
raise DiffError(
|
||||
"Command '{}' failed to start: {}".format(
|
||||
subprocess.list2cmdline(invocation), exc
|
||||
)
|
||||
)
|
||||
outs = list(proc.stdout.readlines())
|
||||
errs = list(proc.stderr.readlines())
|
||||
proc.wait()
|
||||
if proc.returncode:
|
||||
raise DiffError("clang-format exited with status {}: '{}'".format(
|
||||
proc.returncode, file_name), errs)
|
||||
# pylint: disable=raise-missing-from
|
||||
cmd = subprocess.list2cmdline(invocation)
|
||||
raise DiffError(f"Command '{cmd}' failed to start: {exc}")
|
||||
if args.fix:
|
||||
return None, errs
|
||||
if sys.platform == 'win32':
|
||||
@@ -200,7 +196,7 @@ def print_trouble(prog, message, use_colors):
|
||||
error_text = 'error:'
|
||||
if use_colors:
|
||||
error_text = bold_red(error_text)
|
||||
print("{}: {} {}".format(prog, error_text, message), file=sys.stderr)
|
||||
print(f"{prog}: {error_text} {message}", file=sys.stderr)
|
||||
|
||||
|
||||
def main():
|
||||
@@ -212,8 +208,8 @@ def main():
|
||||
default=get_buildtools_executable('clang-format'))
|
||||
parser.add_argument(
|
||||
'--extensions',
|
||||
help='comma separated list of file extensions (default: {})'.format(
|
||||
DEFAULT_EXTENSIONS),
|
||||
help='comma-separated list of file extensions'
|
||||
f' (default: {DEFAULT_EXTENSIONS})',
|
||||
default=DEFAULT_EXTENSIONS)
|
||||
parser.add_argument(
|
||||
'--fix',
|
||||
@@ -290,18 +286,18 @@ def main():
|
||||
|
||||
parse_files = []
|
||||
if args.changed:
|
||||
stdout = subprocess.Popen(
|
||||
with subprocess.Popen(
|
||||
"git diff --name-only --cached",
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
shell=True,
|
||||
universal_newlines=True
|
||||
).communicate()[0].split("\n")
|
||||
for line in stdout:
|
||||
file_name = line.rstrip()
|
||||
# don't check deleted files
|
||||
if os.path.isfile(file_name):
|
||||
parse_files.append(file_name)
|
||||
) as child:
|
||||
for line in child.communicate()[0].split("\n"):
|
||||
file_name = line.rstrip()
|
||||
# don't check deleted files
|
||||
if os.path.isfile(file_name):
|
||||
parse_files.append(file_name)
|
||||
|
||||
else:
|
||||
parse_files = args.files
|
||||
@@ -324,6 +320,7 @@ def main():
|
||||
njobs = min(len(files), njobs)
|
||||
|
||||
if not args.fix:
|
||||
# pylint: disable=consider-using-with
|
||||
patch_file = tempfile.NamedTemporaryFile(delete=False,
|
||||
prefix='electron-format-')
|
||||
|
||||
@@ -333,6 +330,7 @@ def main():
|
||||
it = (run_clang_format_diff_wrapper(args, file) for file in files)
|
||||
pool = None
|
||||
else:
|
||||
# pylint: disable=consider-using-with
|
||||
pool = multiprocessing.Pool(njobs)
|
||||
it = pool.imap_unordered(
|
||||
partial(run_clang_format_diff_wrapper, args), files)
|
||||
@@ -373,8 +371,11 @@ def main():
|
||||
patch_file.close()
|
||||
os.unlink(patch_file.name)
|
||||
else:
|
||||
print("\nTo patch these files, run:\n$ git apply {}\n"
|
||||
.format(patch_file.name))
|
||||
print(
|
||||
'To patch these files, run:',
|
||||
f"$ git apply {patch_file.name}", sep='\n')
|
||||
filename=patch_file.name
|
||||
print(f"\nTo patch these files, run:\n$ git apply {filename}\n")
|
||||
|
||||
return retcode
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@ target = sys.argv[2]
|
||||
|
||||
os.chdir(os.path.dirname(source))
|
||||
|
||||
tarball = tarfile.open(name=os.path.basename(target), mode='w:gz')
|
||||
tarball.add(os.path.relpath(source))
|
||||
tarball.close()
|
||||
with tarfile.open(name=os.path.basename(target), mode='w:gz') as tarball:
|
||||
tarball.add(os.path.relpath(source))
|
||||
tarball.close()
|
||||
|
||||
@@ -21,14 +21,15 @@ def main():
|
||||
|
||||
chromedriver_path = os.path.join(
|
||||
args.source_root, args.build_dir, chromedriver_name[sys.platform])
|
||||
proc = subprocess.Popen([chromedriver_path],
|
||||
stdout=subprocess.PIPE, universal_newlines=True)
|
||||
try:
|
||||
output = proc.stdout.readline()
|
||||
except KeyboardInterrupt:
|
||||
returncode = 0
|
||||
finally:
|
||||
proc.terminate()
|
||||
with subprocess.Popen([chromedriver_path],
|
||||
stdout=subprocess.PIPE,
|
||||
universal_newlines=True) as proc:
|
||||
try:
|
||||
output = proc.stdout.readline()
|
||||
except KeyboardInterrupt:
|
||||
returncode = 0
|
||||
finally:
|
||||
proc.terminate()
|
||||
|
||||
returncode = 0
|
||||
match = re.search(
|
||||
|
||||
@@ -24,10 +24,10 @@ def main():
|
||||
electron = os.path.join(app_path, 'Contents', 'MacOS', PRODUCT_NAME)
|
||||
ffmpeg_name = 'libffmpeg.dylib'
|
||||
ffmpeg_app_path = os.path.join(app_path, 'Contents', 'Frameworks',
|
||||
'{0} Framework.framework'.format(PRODUCT_NAME),
|
||||
f'{PRODUCT_NAME} Framework.framework',
|
||||
'Libraries')
|
||||
elif sys.platform == 'win32':
|
||||
electron = os.path.join(app_path, '{0}.exe'.format(PROJECT_NAME))
|
||||
electron = os.path.join(app_path, f'{PROJECT_NAME}.exe')
|
||||
ffmpeg_app_path = app_path
|
||||
ffmpeg_name = 'ffmpeg.dll'
|
||||
else:
|
||||
@@ -69,7 +69,7 @@ def create_app_copy(initial_app_path):
|
||||
+ '-no-proprietary-codecs')
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
app_name = '{0}.app'.format(PRODUCT_NAME)
|
||||
app_name = f'{PRODUCT_NAME}.app'
|
||||
initial_app_path = os.path.join(initial_app_path, app_name)
|
||||
app_path = os.path.join(app_path, app_name)
|
||||
|
||||
|
||||
@@ -26,8 +26,9 @@ def main():
|
||||
try:
|
||||
with scoped_cwd(app_path):
|
||||
if args.snapshot_files_dir is None:
|
||||
with open(os.path.join(app_path, 'mksnapshot_args')) as f:
|
||||
mkargs = f.read().splitlines()
|
||||
snapshot_filename = os.path.join(app_path, 'mksnapshot_args')
|
||||
with open(snapshot_filename, encoding='utf-8') as file_in:
|
||||
mkargs = file_in.read().splitlines()
|
||||
print('running: ' + ' '.join(mkargs + [ SNAPSHOT_SOURCE ]))
|
||||
subprocess.check_call(mkargs + [ SNAPSHOT_SOURCE ], cwd=app_path)
|
||||
print('ok mksnapshot successfully created snapshot_blob.bin.')
|
||||
@@ -41,7 +42,7 @@ def main():
|
||||
gen_binary = get_binary_path('v8_context_snapshot_generator', \
|
||||
app_path)
|
||||
genargs = [ gen_binary, \
|
||||
'--output_file={0}'.format(context_snapshot_path) ]
|
||||
f'--output_file={context_snapshot_path}' ]
|
||||
print('running: ' + ' '.join(genargs))
|
||||
subprocess.check_call(genargs)
|
||||
print('ok v8_context_snapshot_generator successfully created ' \
|
||||
@@ -59,15 +60,15 @@ def main():
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
bin_files = glob.glob(os.path.join(app_path, '*.bin'))
|
||||
app_dir = os.path.join(app_path, '{0}.app'.format(PRODUCT_NAME))
|
||||
app_dir = os.path.join(app_path, f'{PRODUCT_NAME}.app')
|
||||
electron = os.path.join(app_dir, 'Contents', 'MacOS', PRODUCT_NAME)
|
||||
bin_out_path = os.path.join(app_dir, 'Contents', 'Frameworks',
|
||||
'{0} Framework.framework'.format(PROJECT_NAME),
|
||||
f'{PROJECT_NAME} Framework.framework',
|
||||
'Resources')
|
||||
for bin_file in bin_files:
|
||||
shutil.copy2(bin_file, bin_out_path)
|
||||
elif sys.platform == 'win32':
|
||||
electron = os.path.join(app_path, '{0}.exe'.format(PROJECT_NAME))
|
||||
electron = os.path.join(app_path, f'{PROJECT_NAME}.exe')
|
||||
else:
|
||||
electron = os.path.join(app_path, PROJECT_NAME)
|
||||
|
||||
@@ -81,7 +82,7 @@ def main():
|
||||
except KeyboardInterrupt:
|
||||
print('Other error')
|
||||
returncode = 0
|
||||
print('Returning with error code: {0}'.format(returncode))
|
||||
print(f'Returning with error code: {returncode}')
|
||||
return returncode
|
||||
|
||||
|
||||
@@ -98,7 +99,7 @@ def create_app_copy(initial_app_path):
|
||||
|
||||
def get_binary_path(binary_name, root_path):
|
||||
if sys.platform == 'win32':
|
||||
binary_path = os.path.join(root_path, '{0}.exe'.format(binary_name))
|
||||
binary_path = os.path.join(root_path, f'{binary_name}.exe')
|
||||
else:
|
||||
binary_path = os.path.join(root_path, binary_name)
|
||||
return binary_path
|
||||
|
||||
@@ -4,7 +4,7 @@ import zipfile
|
||||
import sys
|
||||
|
||||
def main(zip_path, manifest_in):
|
||||
with open(manifest_in, 'r') as manifest, \
|
||||
with open(manifest_in, 'r', encoding='utf-8') as manifest, \
|
||||
zipfile.ZipFile(zip_path, 'r', allowZip64=True) as z:
|
||||
files_in_zip = set(z.namelist())
|
||||
files_in_manifest = {l.strip() for l in manifest.readlines()}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user