mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
Compare commits
25 Commits
v39.6.0
...
v7.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
601c3f97ea | ||
|
|
d01a8eaa39 | ||
|
|
54e1c11b2b | ||
|
|
c1ad66b104 | ||
|
|
a905259646 | ||
|
|
356045ff57 | ||
|
|
a9f69bf732 | ||
|
|
3e181b8efc | ||
|
|
171c76e3cb | ||
|
|
0299f69fd1 | ||
|
|
0bdb7b164c | ||
|
|
ea9cfc127c | ||
|
|
0afb1a8188 | ||
|
|
f154dbda40 | ||
|
|
c3013d2e9f | ||
|
|
3272564eac | ||
|
|
a0f4632461 | ||
|
|
8ddf837d49 | ||
|
|
9822953d31 | ||
|
|
c6061cce41 | ||
|
|
a9602682c5 | ||
|
|
b7e5213afc | ||
|
|
9b70d9aa68 | ||
|
|
d9bfac32e3 | ||
|
|
9e815afc02 |
4
DEPS
4
DEPS
@@ -10,9 +10,9 @@ gclient_gn_args = [
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'9eecb7a9f652bbf84f6437b49c70922b65b38bf3',
|
||||
'78.0.3866.0',
|
||||
'node_version':
|
||||
'v12.6.0',
|
||||
'v12.8.0',
|
||||
'nan_version':
|
||||
'2ee313aaca52e2b478965ac50eb5082520380d1b',
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
7.0.0-nightly.20190731
|
||||
7.0.0-beta.3
|
||||
@@ -32,7 +32,7 @@ In most cases, you should do everything in the `ready` event handler.
|
||||
|
||||
Returns:
|
||||
|
||||
* `launchInfo` Object _macOS_
|
||||
* `launchInfo` unknown _macOS_
|
||||
|
||||
Emitted when Electron has finished initializing. On macOS, `launchInfo` holds
|
||||
the `userInfo` of the `NSUserNotification` that was used to open the application,
|
||||
@@ -146,7 +146,7 @@ Returns:
|
||||
* `event` Event
|
||||
* `type` String - A string identifying the activity. Maps to
|
||||
[`NSUserActivity.activityType`][activity-type].
|
||||
* `userInfo` Object - Contains app-specific state stored by the activity on
|
||||
* `userInfo` unknown - Contains app-specific state stored by the activity on
|
||||
another device.
|
||||
|
||||
Emitted during [Handoff][handoff] when an activity from a different device wants
|
||||
@@ -189,7 +189,7 @@ Returns:
|
||||
* `event` Event
|
||||
* `type` String - A string identifying the activity. Maps to
|
||||
[`NSUserActivity.activityType`][activity-type].
|
||||
* `userInfo` Object - Contains app-specific state stored by the activity.
|
||||
* `userInfo` unknown - Contains app-specific state stored by the activity.
|
||||
|
||||
Emitted during [Handoff][handoff] after an activity from this device was successfully
|
||||
resumed on another one.
|
||||
@@ -201,7 +201,7 @@ Returns:
|
||||
* `event` Event
|
||||
* `type` String - A string identifying the activity. Maps to
|
||||
[`NSUserActivity.activityType`][activity-type].
|
||||
* `userInfo` Object - Contains app-specific state stored by the activity.
|
||||
* `userInfo` unknown - Contains app-specific state stored by the activity.
|
||||
|
||||
Emitted when [Handoff][handoff] is about to be resumed on another device. If you need to update the state to be transferred, you should call `event.preventDefault()` immediately, construct a new `userInfo` dictionary and call `app.updateCurrentActiviy()` in a timely manner. Otherwise, the operation will fail and `continue-activity-error` will be called.
|
||||
|
||||
@@ -949,7 +949,7 @@ allow multiple instances of the application to once again run side by side.
|
||||
|
||||
* `type` String - Uniquely identifies the activity. Maps to
|
||||
[`NSUserActivity.activityType`][activity-type].
|
||||
* `userInfo` Object - App-specific state to store for use by another device.
|
||||
* `userInfo` any - App-specific state to store for use by another device.
|
||||
* `webpageURL` String (optional) - The webpage to load in a browser if no suitable app is
|
||||
installed on the resuming device. The scheme must be `http` or `https`.
|
||||
|
||||
@@ -972,7 +972,7 @@ Marks the current [Handoff][handoff] user activity as inactive without invalidat
|
||||
|
||||
* `type` String - Uniquely identifies the activity. Maps to
|
||||
[`NSUserActivity.activityType`][activity-type].
|
||||
* `userInfo` Object - App-specific state to store for use by another device.
|
||||
* `userInfo` any - App-specific state to store for use by another device.
|
||||
|
||||
Updates the current activity if its type matches `type`, merging the entries from
|
||||
`userInfo` into its current `userInfo` dictionary.
|
||||
|
||||
@@ -103,7 +103,7 @@ The `autoUpdater` object has the following methods:
|
||||
|
||||
* `options` Object
|
||||
* `url` String
|
||||
* `headers` Object (optional) _macOS_ - HTTP request headers.
|
||||
* `headers` Record<String, String> (optional) _macOS_ - HTTP request headers.
|
||||
* `serverType` String (optional) _macOS_ - Either `json` or `default`, see the [Squirrel.Mac][squirrel-mac]
|
||||
README for more information.
|
||||
|
||||
|
||||
@@ -691,7 +691,7 @@ is emitted.
|
||||
|
||||
#### `BrowserWindow.getExtensions()`
|
||||
|
||||
Returns `Object` - The keys are the extension names and each value is
|
||||
Returns `Record<String, ExtensionInfo>` - The keys are the extension names and each value is
|
||||
an Object containing `name` and `version` properties.
|
||||
|
||||
**Note:** This API cannot be called before the `ready` event of the `app` module
|
||||
@@ -724,7 +724,7 @@ is emitted.
|
||||
|
||||
#### `BrowserWindow.getDevToolsExtensions()`
|
||||
|
||||
Returns `Object` - The keys are the extension names and each value is
|
||||
Returns `Record<string, ExtensionInfo>` - The keys are the extension names and each value is
|
||||
an Object containing `name` and `version` properties.
|
||||
|
||||
To check if a DevTools extension is installed you can run the following:
|
||||
@@ -1381,7 +1381,7 @@ win.loadURL('http://localhost:8000/post', {
|
||||
|
||||
* `filePath` String
|
||||
* `options` Object (optional)
|
||||
* `query` Object (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()`.
|
||||
|
||||
@@ -1437,29 +1437,27 @@ screen readers
|
||||
Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
|
||||
convey some sort of application status or to passively notify the user.
|
||||
|
||||
#### `win.setHasShadow(hasShadow)` _macOS_
|
||||
#### `win.setHasShadow(hasShadow)`
|
||||
|
||||
* `hasShadow` Boolean
|
||||
|
||||
Sets whether the window should have a shadow. On Windows and Linux does
|
||||
nothing.
|
||||
Sets whether the window should have a shadow.
|
||||
|
||||
#### `win.hasShadow()` _macOS_
|
||||
#### `win.hasShadow()`
|
||||
|
||||
Returns `Boolean` - Whether the window has a shadow.
|
||||
|
||||
On Windows and Linux always returns
|
||||
`true`.
|
||||
|
||||
#### `win.setOpacity(opacity)` _Windows_ _macOS_
|
||||
|
||||
* `opacity` Number - between 0.0 (fully transparent) and 1.0 (fully opaque)
|
||||
|
||||
Sets the opacity of the window. On Linux does nothing.
|
||||
Sets the opacity of the window. On Linux, does nothing. Out of bound number
|
||||
values are clamped to the [0, 1] range.
|
||||
|
||||
#### `win.getOpacity()` _Windows_ _macOS_
|
||||
#### `win.getOpacity()`
|
||||
|
||||
Returns `Number` - between 0.0 (fully transparent) and 1.0 (fully opaque)
|
||||
Returns `Number` - between 0.0 (fully transparent) and 1.0 (fully opaque). On
|
||||
Linux, always returns 1.
|
||||
|
||||
#### `win.setShape(rects)` _Windows_ _Linux_ _Experimental_
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ following properties:
|
||||
method.
|
||||
* `url` String (optional) - The request URL. Must be provided in the absolute
|
||||
form with the protocol scheme specified as http or https.
|
||||
* `session` Object (optional) - The [`Session`](session.md) instance with
|
||||
* `session` Session (optional) - The [`Session`](session.md) instance with
|
||||
which the request is associated.
|
||||
* `partition` String (optional) - The name of the [`partition`](session.md)
|
||||
with which the request is associated. Defaults to the empty string. The
|
||||
@@ -134,7 +134,7 @@ Returns:
|
||||
* `statusCode` Integer
|
||||
* `method` String
|
||||
* `redirectUrl` String
|
||||
* `responseHeaders` Object
|
||||
* `responseHeaders` Record<String, String[]>
|
||||
|
||||
Emitted when there is redirection and the mode is `manual`. Calling
|
||||
[`request.followRedirect`](#requestfollowredirect) will continue with the redirection.
|
||||
@@ -158,7 +158,7 @@ internally buffered inside Electron process memory.
|
||||
#### `request.setHeader(name, value)`
|
||||
|
||||
* `name` String - An extra HTTP header name.
|
||||
* `value` Object - An extra HTTP header value.
|
||||
* `value` String - An extra HTTP header value.
|
||||
|
||||
Adds an extra HTTP header. The header name will be issued as-is without
|
||||
lowercasing. It can be called only before first write. Calling this method after
|
||||
@@ -169,7 +169,7 @@ the first write will throw an error. If the passed value is not a `String`, its
|
||||
|
||||
* `name` String - Specify an extra header name.
|
||||
|
||||
Returns `Object` - The value of a previously set extra header name.
|
||||
Returns `String` - The value of a previously set extra header name.
|
||||
|
||||
#### `request.removeHeader(name)`
|
||||
|
||||
|
||||
@@ -74,6 +74,9 @@ will be returned in the promise.
|
||||
|
||||
Returns `Promise<Object>` - Resolves with an object containing the `value` and `percentage` of trace buffer maximum usage
|
||||
|
||||
* `value` Number
|
||||
* `percentage` Number
|
||||
|
||||
Get the maximum usage across processes of trace buffer as a percentage of the
|
||||
full state.
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ The `crashReporter` module has the following methods:
|
||||
* `productName` String (optional) - Defaults to `app.name`.
|
||||
* `uploadToServer` Boolean (optional) - Whether crash reports should be sent to the server. Default is `true`.
|
||||
* `ignoreSystemCrashHandler` Boolean (optional) - Default is `false`.
|
||||
* `extra` Object (optional) - An object you can define that will be sent along with the
|
||||
* `extra` Record<String, String> (optional) - An object you can define that will be sent along with the
|
||||
report. Only string properties are sent correctly. Nested objects are not
|
||||
supported. When using Windows, the property names and values must be fewer than 64 characters.
|
||||
* `crashesDirectory` String (optional) - Directory to store the crash reports temporarily (only used when the crash reporter is started via `process.crashReporter.start`).
|
||||
|
||||
@@ -50,7 +50,7 @@ Returns:
|
||||
|
||||
* `event` Event
|
||||
* `method` String - Method name.
|
||||
* `params` Object - Event parameters defined by the 'parameters'
|
||||
* `params` unknown - Event parameters defined by the 'parameters'
|
||||
attribute in the remote debugging protocol.
|
||||
|
||||
Emitted whenever the debugging target issues an instrumentation event.
|
||||
@@ -78,7 +78,7 @@ Detaches the debugger from the `webContents`.
|
||||
|
||||
* `method` String - Method name, should be one of the methods defined by the
|
||||
[remote debugging protocol][rdp].
|
||||
* `commandParams` Object (optional) - JSON object with request parameters.
|
||||
* `commandParams` any (optional) - JSON object with request parameters.
|
||||
|
||||
Returns `Promise<any>` - A promise that resolves with the response defined by
|
||||
the 'returns' attribute of the command description in the remote debugging protocol
|
||||
|
||||
@@ -51,7 +51,7 @@ A `String` representing the HTTP status message.
|
||||
|
||||
#### `response.headers`
|
||||
|
||||
An `Object` representing the response HTTP headers. The `headers` object is
|
||||
An `Record<string, string[]>` representing the response HTTP headers. The `headers` object is
|
||||
formatted as follows:
|
||||
|
||||
* All header names are lowercased.
|
||||
|
||||
@@ -90,7 +90,7 @@ Removes listeners of the specified `channel`.
|
||||
### `ipcMain.handle(channel, listener)`
|
||||
|
||||
* `channel` String
|
||||
* `listener` Function<Promise> | Function<any>
|
||||
* `listener` Function<Promise<void> | any>
|
||||
* `event` IpcMainInvokeEvent
|
||||
* `...args` any[]
|
||||
|
||||
@@ -122,7 +122,7 @@ WebContents is the source of the invoke request.
|
||||
### `ipcMain.handleOnce(channel, listener)`
|
||||
|
||||
* `channel` String
|
||||
* `listener` Function<Promise> | Function<any>
|
||||
* `listener` Function<Promise<void> | any>
|
||||
* `event` IpcMainInvokeEvent
|
||||
* `...args` any[]
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ See [`Menu`](menu.md) for examples.
|
||||
* `menuItem` MenuItem
|
||||
* `browserWindow` [BrowserWindow](browser-window.md)
|
||||
* `event` [KeyboardEvent](structures/keyboard-event.md)
|
||||
* `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteandmatchstyle`, `delete`, `selectall`, `reload`, `forcereload`, `toggledevtools`, `resetzoom`, `zoomin`, `zoomout`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideothers`, `unhide`, `quit`, `startspeaking`, `stopspeaking`, `close`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu` or `windowMenu` - Define the action of the menu item, when specified the
|
||||
* `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `close`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
|
||||
`click` property will be ignored. See [roles](#roles).
|
||||
* `type` String (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or
|
||||
`radio`.
|
||||
@@ -82,7 +82,7 @@ The `role` property can have following values:
|
||||
* `reload` - Reload the current window.
|
||||
* `forceReload` - Reload the current window ignoring the cache.
|
||||
* `toggleDevTools` - Toggle developer tools in the current window.
|
||||
* `toggleFullScreen` - Toggle full screen mode on the current window.
|
||||
* `togglefullscreen` - Toggle full screen mode on the current window.
|
||||
* `resetZoom` - Reset the focused page's zoom level to the original size.
|
||||
* `zoomIn` - Zoom in the focused page by 10%.
|
||||
* `zoomOut` - Zoom out the focused page by 10%.
|
||||
@@ -152,7 +152,7 @@ A `String` indicating the type of the item. Can be `normal`, `separator`, `subme
|
||||
|
||||
#### `menuItem.role`
|
||||
|
||||
A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteandmatchstyle`, `delete`, `selectall`, `reload`, `forcereload`, `toggledevtools`, `resetzoom`, `zoomin`, `zoomout`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideothers`, `unhide`, `quit`, `startspeaking`, `stopspeaking`, `close`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu` or `windowMenu`
|
||||
A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `close`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
|
||||
|
||||
#### `menuItem.accelerator`
|
||||
|
||||
|
||||
35
docs/api/native-theme.md
Normal file
35
docs/api/native-theme.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# nativeTheme
|
||||
|
||||
> Read and respond to changes in Chromium's native color theme.
|
||||
|
||||
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process)
|
||||
|
||||
## Events
|
||||
|
||||
The `nativeTheme` module emits the following events:
|
||||
|
||||
### Event: 'updated'
|
||||
|
||||
Emitted when something in the underlying NativeTheme has changed. This normally
|
||||
means that either the value of `shouldUseDarkColors`,
|
||||
`shouldUseHighContrastColors` or `shouldUseInvertedColorScheme` has changed.
|
||||
You will have to check them to determine which one has changed.
|
||||
|
||||
## Properties
|
||||
|
||||
The `nativeTheme` module has the following properties:
|
||||
|
||||
### `nativeTheme.shouldUseDarkColors` _Readonly_
|
||||
|
||||
A `Boolean` for if the OS / Chromium currently has a dark mode enabled or is
|
||||
being instructed to show a dark-style UI.
|
||||
|
||||
### `nativeTheme.shouldUseHighContrastColors` _macOS_ _Windows_ _Readonly_
|
||||
|
||||
A `Boolean` for if the OS / Chromium currently has high-contrast mode enabled
|
||||
or is being instructed to show a high-constrast UI.
|
||||
|
||||
### `nativeTheme.shouldUseInvertedColorScheme` _macOS_ _Windows_ _Readonly_
|
||||
|
||||
A `Boolean` for if the OS / Chromium currently has an inverted color scheme
|
||||
or is being instructed to use an inverted color scheme.
|
||||
@@ -54,7 +54,7 @@ The `net` module has the following methods:
|
||||
|
||||
### `net.request(options)`
|
||||
|
||||
* `options` (Object | String) - The `ClientRequest` constructor options.
|
||||
* `options` (ClientRequestConstructorOptions | String) - The `ClientRequest` constructor options.
|
||||
|
||||
Returns [`ClientRequest`](./client-request.md)
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ should be called with either a `String` or an object that has the `data`,
|
||||
* `redirectRequest` Object
|
||||
* `url` String
|
||||
* `method` String (optional)
|
||||
* `session` Object (optional)
|
||||
* `session` Session | null (optional)
|
||||
* `uploadData` [ProtocolResponseUploadData](structures/protocol-response-upload-data.md) (optional)
|
||||
* `completion` Function (optional)
|
||||
* `error` Error
|
||||
@@ -388,7 +388,7 @@ which sends a `Buffer` as a response.
|
||||
* `redirectRequest` Object
|
||||
* `url` String
|
||||
* `method` String (optional)
|
||||
* `session` Object | null (optional)
|
||||
* `session` Session | null (optional)
|
||||
* `uploadData` Object (optional)
|
||||
* `contentType` String - MIME type of the content.
|
||||
* `data` String - Content to be sent.
|
||||
|
||||
4
docs/api/structures/extension-info.md
Normal file
4
docs/api/structures/extension-info.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# ExtensionInfo Object
|
||||
|
||||
* `name` String
|
||||
* `version` String
|
||||
@@ -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` Object (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.
|
||||
|
||||
@@ -27,28 +27,34 @@ Returns:
|
||||
|
||||
* `event` Event
|
||||
|
||||
### Event: 'inverted-color-scheme-changed' _Windows_
|
||||
### Event: 'inverted-color-scheme-changed' _Windows_ _Deprecated_
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `invertedColorScheme` Boolean - `true` if an inverted color scheme (a high contrast color scheme with light text and dark backgrounds) is being used, `false` otherwise.
|
||||
|
||||
### Event: 'high-contrast-color-scheme-changed' _Windows_
|
||||
**Deprecated:** Should use the new [`updated`](native-theme.md#event-updated) event on the `nativeTheme` module.
|
||||
|
||||
### Event: 'high-contrast-color-scheme-changed' _Windows_ _Deprecated_
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `highContrastColorScheme` Boolean - `true` if a high contrast theme is being used, `false` otherwise.
|
||||
|
||||
**Deprecated:** Should use the new [`updated`](native-theme.md#event-updated) event on the `nativeTheme` module.
|
||||
|
||||
## Methods
|
||||
|
||||
### `systemPreferences.isDarkMode()` _macOS_ _Windows_
|
||||
### `systemPreferences.isDarkMode()` _macOS_ _Windows_ _Deprecated_
|
||||
|
||||
Returns `Boolean` - Whether the system is in Dark Mode.
|
||||
|
||||
**Note:** On macOS 10.15 Catalina in order for this API to return the correct value when in the "automatic" dark mode setting you must either have `NSRequiresAquaSystemAppearance=false` in your `Info.plist` or be on Electron `>=7.0.0`. See the [dark mode guide](../tutorial/mojave-dark-mode-guide.md) for more information.
|
||||
|
||||
**Deprecated:** Should use the new [`nativeTheme.shouldUseDarkColors`](native-theme.md#nativethemeshouldusedarkcolors-readonly) API.
|
||||
|
||||
### `systemPreferences.isSwipeTrackingFromScrollEventsEnabled()` _macOS_
|
||||
|
||||
Returns `Boolean` - Whether the Swipe between pages setting is on.
|
||||
@@ -56,7 +62,7 @@ Returns `Boolean` - Whether the Swipe between pages setting is on.
|
||||
### `systemPreferences.postNotification(event, userInfo[, deliverImmediately])` _macOS_
|
||||
|
||||
* `event` String
|
||||
* `userInfo` Object
|
||||
* `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
|
||||
@@ -65,7 +71,7 @@ that contains the user information dictionary sent along with the notification.
|
||||
### `systemPreferences.postLocalNotification(event, userInfo)` _macOS_
|
||||
|
||||
* `event` String
|
||||
* `userInfo` Object
|
||||
* `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.
|
||||
@@ -73,7 +79,7 @@ that contains the user information dictionary sent along with the notification.
|
||||
### `systemPreferences.postWorkspaceNotification(event, userInfo)` _macOS_
|
||||
|
||||
* `event` String
|
||||
* `userInfo` Object
|
||||
* `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.
|
||||
@@ -83,7 +89,7 @@ that contains the user information dictionary sent along with the notification.
|
||||
* `event` String
|
||||
* `callback` Function
|
||||
* `event` String
|
||||
* `userInfo` Object
|
||||
* `userInfo` Record<String, unknown>
|
||||
* `object` String
|
||||
|
||||
Returns `Number` - The ID of this subscription
|
||||
@@ -110,7 +116,7 @@ example values of `event` are:
|
||||
* `event` String
|
||||
* `callback` Function
|
||||
* `event` String
|
||||
* `userInfo` Object
|
||||
* `userInfo` Record<String, unknown>
|
||||
* `object` String
|
||||
|
||||
Returns `Number` - The ID of this subscription
|
||||
@@ -123,7 +129,7 @@ This is necessary for events such as `NSUserDefaultsDidChangeNotification`.
|
||||
* `event` String
|
||||
* `callback` Function
|
||||
* `event` String
|
||||
* `userInfo` Object
|
||||
* `userInfo` Record<String, unknown>
|
||||
* `object` String
|
||||
|
||||
Same as `subscribeNotification`, but uses `NSWorkspace.sharedWorkspace.notificationCenter`.
|
||||
@@ -149,7 +155,7 @@ Same as `unsubscribeNotification`, but removes the subscriber from `NSWorkspace.
|
||||
|
||||
### `systemPreferences.registerDefaults(defaults)` _macOS_
|
||||
|
||||
* `defaults` Object - 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`.
|
||||
|
||||
@@ -342,14 +348,18 @@ Returns `String` - The standard system color formatted as `#RRGGBBAA`.
|
||||
|
||||
Returns one of several standard system colors that automatically adapt to vibrancy and changes in accessibility settings like 'Increase contrast' and 'Reduce transparency'. See [Apple Documentation](https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/color#system-colors) for more details.
|
||||
|
||||
### `systemPreferences.isInvertedColorScheme()` _Windows_
|
||||
### `systemPreferences.isInvertedColorScheme()` _Windows_ _Deprecated_
|
||||
|
||||
Returns `Boolean` - `true` if an inverted color scheme (a high contrast color scheme with light text and dark backgrounds) is active, `false` otherwise.
|
||||
|
||||
### `systemPreferences.isHighContrastColorScheme()` _macOS_ _Windows_
|
||||
**Deprecated:** Should use the new [`nativeTheme.shouldUseInvertedColorScheme`](native-theme.md#nativethemeshoulduseinvertedcolorscheme-macos-windows-readonly) API.
|
||||
|
||||
### `systemPreferences.isHighContrastColorScheme()` _macOS_ _Windows_ _Deprecated_
|
||||
|
||||
Returns `Boolean` - `true` if a high contrast theme is active, `false` otherwise.
|
||||
|
||||
**Depreacted:** Should use the new [`nativeTheme.shouldUseHighContrastColors`](native-theme.md#nativethemeshouldusehighcontrastcolors-macos-windows-readonly) API.
|
||||
|
||||
### `systemPreferences.getEffectiveAppearance()` _macOS_
|
||||
|
||||
Returns `String` - Can be `dark`, `light` or `unknown`.
|
||||
@@ -365,7 +375,9 @@ using `electron-packager` or `electron-forge` just set the `enableDarwinDarkMode
|
||||
packager option to `true`. See the [Electron Packager API](https://github.com/electron/electron-packager/blob/master/docs/api.md#darwindarkmodesupport)
|
||||
for more details.
|
||||
|
||||
### `systemPreferences.getAppLevelAppearance()` _macOS_
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
|
||||
### `systemPreferences.getAppLevelAppearance()` _macOS_ _Deprecated_
|
||||
|
||||
Returns `String` | `null` - Can be `dark`, `light` or `unknown`.
|
||||
|
||||
@@ -375,7 +387,7 @@ You can use the `setAppLevelAppearance` API to set this value.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
|
||||
### `systemPreferences.setAppLevelAppearance(appearance)` _macOS_
|
||||
### `systemPreferences.setAppLevelAppearance(appearance)` _macOS_ _Deprecated_
|
||||
|
||||
* `appearance` String | null - Can be `dark` or `light`
|
||||
|
||||
@@ -450,10 +462,25 @@ Returns an object with system animation settings.
|
||||
|
||||
### `systemPreferences.appLevelAppearance` _macOS_
|
||||
|
||||
A `String` property that determines the macOS appearance setting for
|
||||
A `String` property that can be `dark`, `light` or `unknown`. It determines the macOS appearance setting for
|
||||
your application. This maps to values in: [NSApplication.appearance](https://developer.apple.com/documentation/appkit/nsapplication/2967170-appearance?language=objc). Setting this will override the
|
||||
system default as well as the value of `getEffectiveAppearance`.
|
||||
|
||||
Possible values that can be set are `dark` and `light`, and possible return values are `dark`, `light`, and `unknown`.
|
||||
|
||||
This property is only available on macOS 10.14 Mojave or newer.
|
||||
|
||||
### `systemPreferences.effectiveAppearance` _macOS_ _Readonly_
|
||||
|
||||
A `String` property that can be `dark`, `light` or `unknown`.
|
||||
|
||||
Returns the macOS appearance setting that is currently applied to your application,
|
||||
maps to [NSApplication.effectiveAppearance](https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance?language=objc)
|
||||
|
||||
Please note that until Electron is built targeting the 10.14 SDK, your application's
|
||||
`effectiveAppearance` will default to 'light' and won't inherit the OS preference. In
|
||||
the interim in order for your application to inherit the OS preference you must set the
|
||||
`NSRequiresAquaSystemAppearance` key in your apps `Info.plist` to `false`. If you are
|
||||
using `electron-packager` or `electron-forge` just set the `enableDarwinDarkMode`
|
||||
packager option to `true`. See the [Electron Packager API](https://github.com/electron/electron-packager/blob/master/docs/api.md#darwindarkmodesupport)
|
||||
for more details.
|
||||
|
||||
@@ -143,7 +143,7 @@ Returns:
|
||||
* `frameName` String
|
||||
* `disposition` String - Can be `default`, `foreground-tab`, `background-tab`,
|
||||
`new-window`, `save-to-disk` and `other`.
|
||||
* `options` Object - The options which will be used for creating the new
|
||||
* `options` BrowserWindowConstructorOptions - The options which will be used for creating the new
|
||||
[`BrowserWindow`](browser-window.md).
|
||||
* `additionalFeatures` String[] - The non-standard features (features not handled
|
||||
by Chromium or Electron) given to `window.open()`.
|
||||
@@ -481,7 +481,7 @@ Returns:
|
||||
* `requestId` Integer
|
||||
* `activeMatchOrdinal` Integer - Position of the active match.
|
||||
* `matches` Integer - Number of Matches.
|
||||
* `selectionArea` Object - Coordinates of first match region.
|
||||
* `selectionArea` Rectangle - Coordinates of first match region.
|
||||
* `finalUpdate` Boolean
|
||||
|
||||
Emitted when a result is available for
|
||||
@@ -669,10 +669,10 @@ Emitted when the devtools window instructs the webContents to reload
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `webPreferences` Object - The web preferences that will be used by the guest
|
||||
* `webPreferences` WebPreferences - 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` Object - 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
|
||||
@@ -842,7 +842,7 @@ webContents.loadURL('https://github.com', options)
|
||||
|
||||
* `filePath` String
|
||||
* `options` Object (optional)
|
||||
* `query` Object (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()`.
|
||||
|
||||
@@ -1269,11 +1269,7 @@ Returns [`PrinterInfo[]`](structures/printer-info.md).
|
||||
* `failureReason` String - Called back if the print fails; can be `cancelled` or `failed`.
|
||||
|
||||
Prints window's web page. When `silent` is set to `true`, Electron will pick
|
||||
the system's default printer if `deviceName` is empty and the default settings
|
||||
for printing.
|
||||
|
||||
Calling `window.print()` in web page is equivalent to calling
|
||||
`webContents.print({ silent: false, printBackground: false, deviceName: '' })`.
|
||||
the system's default printer if `deviceName` is empty and the default settings for printing.
|
||||
|
||||
Use `page-break-before: always;` CSS style to force to print to a new page.
|
||||
|
||||
@@ -1563,13 +1559,6 @@ Disable device emulation enabled by `webContents.enableDeviceEmulation`.
|
||||
#### `contents.sendInputEvent(inputEvent)`
|
||||
|
||||
* `inputEvent` [MouseInputEvent](structures/mouse-input-event.md) | [MouseWheelInputEvent](structures/mouse-wheel-input-event.md) | [KeyboardInputEvent](structures/keyboard-input-event.md)
|
||||
* `type` String (**required**) - The type of the event, can be `mouseDown`,
|
||||
`mouseUp`, `mouseEnter`, `mouseLeave`, `contextMenu`, `mouseWheel`,
|
||||
`mouseMove`, `keyDown`, `keyUp` or `char`.
|
||||
* `modifiers` String[] - An array of modifiers of the event, can
|
||||
include `shift`, `control`, `alt`, `meta`, `isKeypad`, `isAutoRepeat`,
|
||||
`leftButtonDown`, `middleButtonDown`, `rightButtonDown`, `capsLock`,
|
||||
`numLock`, `left`, `right`.
|
||||
|
||||
Sends an input `event` to the page.
|
||||
**Note:** The [`BrowserWindow`](browser-window.md) containing the contents needs to be focused for
|
||||
|
||||
@@ -593,7 +593,7 @@ examples.
|
||||
|
||||
### `<webview>.sendInputEvent(event)`
|
||||
|
||||
* `event` Object
|
||||
* `event` [MouseInputEvent](structures/mouse-input-event.md) | [MouseWheelInputEvent](structures/mouse-wheel-input-event.md) | [KeyboardInputEvent](structures/keyboard-input-event.md)
|
||||
|
||||
Returns `Promise<void>`
|
||||
|
||||
@@ -767,7 +767,7 @@ Returns:
|
||||
* `requestId` Integer
|
||||
* `activeMatchOrdinal` Integer - Position of the active match.
|
||||
* `matches` Integer - Number of Matches.
|
||||
* `selectionArea` Object - Coordinates of first match region.
|
||||
* `selectionArea` Rectangle - Coordinates of first match region.
|
||||
* `finalUpdate` Boolean
|
||||
|
||||
Fired when a result is available for
|
||||
@@ -791,7 +791,7 @@ Returns:
|
||||
* `frameName` String
|
||||
* `disposition` String - Can be `default`, `foreground-tab`, `background-tab`,
|
||||
`new-window`, `save-to-disk` and `other`.
|
||||
* `options` Object - The options which should be used for creating the new
|
||||
* `options` BrowserWindowConstructorOptions - The options which should be used for creating the new
|
||||
[`BrowserWindow`](browser-window.md).
|
||||
|
||||
Fired when the guest page attempts to open a new browser window.
|
||||
@@ -872,7 +872,7 @@ webview.addEventListener('close', () => {
|
||||
Returns:
|
||||
|
||||
* `channel` String
|
||||
* `args` Array
|
||||
* `args` any[]
|
||||
|
||||
Fired when the guest page has sent an asynchronous message to embedder page.
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ auto_filenames = {
|
||||
"docs/api/menu.md",
|
||||
"docs/api/modernization",
|
||||
"docs/api/native-image.md",
|
||||
"docs/api/native-theme.md",
|
||||
"docs/api/net-log.md",
|
||||
"docs/api/net.md",
|
||||
"docs/api/notification.md",
|
||||
@@ -76,6 +77,7 @@ auto_filenames = {
|
||||
"docs/api/structures/desktop-capturer-source.md",
|
||||
"docs/api/structures/display.md",
|
||||
"docs/api/structures/event.md",
|
||||
"docs/api/structures/extension-info.md",
|
||||
"docs/api/structures/file-filter.md",
|
||||
"docs/api/structures/file-path-with-headers.md",
|
||||
"docs/api/structures/gpu-feature-status.md",
|
||||
@@ -130,6 +132,7 @@ auto_filenames = {
|
||||
"lib/common/api/deprecate.ts",
|
||||
"lib/common/api/module-list.js",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/native-theme.ts",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/buffer-utils.ts",
|
||||
"lib/common/clipboard-utils.ts",
|
||||
@@ -228,7 +231,7 @@ auto_filenames = {
|
||||
"lib/browser/api/protocol.ts",
|
||||
"lib/browser/api/screen.ts",
|
||||
"lib/browser/api/session.js",
|
||||
"lib/browser/api/system-preferences.js",
|
||||
"lib/browser/api/system-preferences.ts",
|
||||
"lib/browser/api/top-level-window.js",
|
||||
"lib/browser/api/touch-bar.js",
|
||||
"lib/browser/api/tray.js",
|
||||
@@ -261,6 +264,7 @@ auto_filenames = {
|
||||
"lib/common/api/exports/electron.js",
|
||||
"lib/common/api/module-list.js",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/native-theme.ts",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/buffer-utils.ts",
|
||||
"lib/common/clipboard-utils.ts",
|
||||
@@ -286,6 +290,7 @@ auto_filenames = {
|
||||
"lib/common/api/exports/electron.js",
|
||||
"lib/common/api/module-list.js",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/native-theme.ts",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/buffer-utils.ts",
|
||||
"lib/common/clipboard-utils.ts",
|
||||
@@ -336,6 +341,7 @@ auto_filenames = {
|
||||
"lib/common/api/exports/electron.js",
|
||||
"lib/common/api/module-list.js",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/native-theme.ts",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/buffer-utils.ts",
|
||||
"lib/common/clipboard-utils.ts",
|
||||
|
||||
@@ -463,6 +463,8 @@ filenames = {
|
||||
"shell/common/api/atom_api_native_image.cc",
|
||||
"shell/common/api/atom_api_native_image.h",
|
||||
"shell/common/api/atom_api_native_image_mac.mm",
|
||||
"shell/common/api/atom_api_native_theme.cc",
|
||||
"shell/common/api/atom_api_native_theme.h",
|
||||
"shell/common/api/atom_api_shell.cc",
|
||||
"shell/common/api/atom_api_v8_util.cc",
|
||||
"shell/common/api/electron_bindings.cc",
|
||||
|
||||
@@ -178,7 +178,7 @@ const roles = {
|
||||
{ role: 'services' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'hide' },
|
||||
{ role: 'hideothers' },
|
||||
{ role: 'hideOthers' },
|
||||
{ role: 'unhide' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'quit' }
|
||||
@@ -209,8 +209,8 @@ const roles = {
|
||||
{
|
||||
label: 'Speech',
|
||||
submenu: [
|
||||
{ role: 'startspeaking' },
|
||||
{ role: 'stopspeaking' }
|
||||
{ role: 'startSpeaking' },
|
||||
{ role: 'stopSpeaking' }
|
||||
]
|
||||
}
|
||||
] : [
|
||||
@@ -225,12 +225,12 @@ const roles = {
|
||||
label: 'View',
|
||||
submenu: [
|
||||
{ role: 'reload' },
|
||||
{ role: 'forcereload' },
|
||||
{ role: 'toggledevtools' },
|
||||
{ role: 'forceReload' },
|
||||
{ role: 'toggleDevTools' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'resetzoom' },
|
||||
{ role: 'zoomin' },
|
||||
{ role: 'zoomout' },
|
||||
{ role: 'resetZoom' },
|
||||
{ role: 'zoomIn' },
|
||||
{ role: 'zoomOut' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'togglefullscreen' }
|
||||
]
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { deprecate } = require('electron')
|
||||
const { systemPreferences, SystemPreferences } = process.electronBinding('system_preferences')
|
||||
|
||||
// SystemPreferences is an EventEmitter.
|
||||
Object.setPrototypeOf(SystemPreferences.prototype, EventEmitter.prototype)
|
||||
EventEmitter.call(systemPreferences)
|
||||
|
||||
if ('appLevelAppearance' in systemPreferences) {
|
||||
deprecate.fnToProperty(SystemPreferences.prototype, 'appLevelAppearance', '_getAppLevelAppearance', '_setAppLevelAppearance')
|
||||
}
|
||||
|
||||
module.exports = systemPreferences
|
||||
42
lib/browser/api/system-preferences.ts
Normal file
42
lib/browser/api/system-preferences.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { EventEmitter } from 'events'
|
||||
import { deprecate } from 'electron'
|
||||
const { systemPreferences, SystemPreferences } = process.electronBinding('system_preferences')
|
||||
|
||||
// SystemPreferences is an EventEmitter.
|
||||
Object.setPrototypeOf(SystemPreferences.prototype, EventEmitter.prototype)
|
||||
EventEmitter.call(systemPreferences)
|
||||
|
||||
if ('appLevelAppearance' in systemPreferences) {
|
||||
deprecate.fnToProperty(
|
||||
SystemPreferences.prototype,
|
||||
'appLevelAppearance',
|
||||
'_getAppLevelAppearance',
|
||||
'_setAppLevelAppearance'
|
||||
)
|
||||
}
|
||||
|
||||
if ('effectiveAppearance' in systemPreferences) {
|
||||
deprecate.fnToProperty(
|
||||
SystemPreferences.prototype,
|
||||
'effectiveAppearance',
|
||||
'_getEffectiveAppearance'
|
||||
)
|
||||
}
|
||||
|
||||
SystemPreferences.prototype.isDarkMode = deprecate.moveAPI(
|
||||
SystemPreferences.prototype.isDarkMode,
|
||||
'systemPreferences.isDarkMode()',
|
||||
'nativeTheme.shouldUseDarkColors'
|
||||
)
|
||||
SystemPreferences.prototype.isInvertedColorScheme = deprecate.moveAPI(
|
||||
SystemPreferences.prototype.isInvertedColorScheme,
|
||||
'systemPreferences.isInvertedColorScheme()',
|
||||
'nativeTheme.shouldUseInvertedColorScheme'
|
||||
)
|
||||
SystemPreferences.prototype.isHighContrastColorScheme = deprecate.moveAPI(
|
||||
SystemPreferences.prototype.isHighContrastColorScheme,
|
||||
'systemPreferences.isHighContrastColorScheme()',
|
||||
'nativeTheme.shouldUseHighContrastColors'
|
||||
)
|
||||
|
||||
module.exports = systemPreferences
|
||||
@@ -40,9 +40,9 @@ const getEditMenuItems = function (): Electron.MenuItemConstructorOptions[] {
|
||||
{ role: 'cut' },
|
||||
{ role: 'copy' },
|
||||
{ role: 'paste' },
|
||||
{ role: 'pasteandmatchstyle' },
|
||||
{ role: 'pasteAndMatchStyle' },
|
||||
{ role: 'delete' },
|
||||
{ role: 'selectall' }
|
||||
{ role: 'selectAll' }
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ const mergeOptions = function (child, parent, visited) {
|
||||
if (key in child && key !== 'webPreferences') continue
|
||||
|
||||
const value = parent[key]
|
||||
if (typeof value === 'object') {
|
||||
if (typeof value === 'object' && !Array.isArray(value)) {
|
||||
child[key] = mergeOptions(child[key] || {}, value, visited)
|
||||
} else {
|
||||
child[key] = value
|
||||
|
||||
@@ -51,7 +51,15 @@ const deprecate: ElectronInternal.DeprecationUtil = {
|
||||
const warn = warnOnce(`${fn.name} function`, `${newName} function`)
|
||||
return function (this: any) {
|
||||
warn()
|
||||
fn.apply(this, arguments)
|
||||
return fn.apply(this, arguments)
|
||||
}
|
||||
},
|
||||
|
||||
moveAPI: (fn: Function, oldUsage: string, newUsage: string) => {
|
||||
const warn = warnOnce(oldUsage, newUsage)
|
||||
return function (this: any) {
|
||||
warn()
|
||||
return fn.apply(this, arguments)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -69,7 +77,7 @@ const deprecate: ElectronInternal.DeprecationUtil = {
|
||||
},
|
||||
|
||||
// deprecate a getter/setter function pair in favor of a property
|
||||
fnToProperty: (prototype: any, prop: string, getter: string, setter: string) => {
|
||||
fnToProperty: (prototype: any, prop: string, getter: string, setter?: string) => {
|
||||
const withWarnOnce = function (obj: any, key: any, oldName: string, newName: string) {
|
||||
const warn = warnOnce(oldName, newName)
|
||||
const method = obj[key]
|
||||
@@ -80,7 +88,9 @@ const deprecate: ElectronInternal.DeprecationUtil = {
|
||||
}
|
||||
|
||||
prototype[getter.substr(1)] = withWarnOnce(prototype, getter, `${getter.substr(1)} function`, `${prop} property`)
|
||||
prototype[setter.substr(1)] = withWarnOnce(prototype, setter, `${setter.substr(1)} function`, `${prop} property`)
|
||||
if (setter) {
|
||||
prototype[setter.substr(1)] = withWarnOnce(prototype, setter, `${setter.substr(1)} function`, `${prop} property`)
|
||||
}
|
||||
},
|
||||
|
||||
// remove a property with no replacement
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
module.exports = [
|
||||
{ name: 'clipboard', loader: () => require('./clipboard') },
|
||||
{ name: 'nativeImage', loader: () => require('./native-image') },
|
||||
{ name: 'nativeTheme', loader: () => require('./native-theme') },
|
||||
{ name: 'shell', loader: () => require('./shell') },
|
||||
// The internal modules, invisible unless you know their names.
|
||||
{ name: 'deprecate', loader: () => require('./deprecate'), private: true }
|
||||
|
||||
8
lib/common/api/native-theme.ts
Normal file
8
lib/common/api/native-theme.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { EventEmitter } from 'events'
|
||||
|
||||
const { NativeTheme, nativeTheme } = process.electronBinding('native_theme')
|
||||
|
||||
Object.setPrototypeOf(NativeTheme.prototype, EventEmitter.prototype)
|
||||
EventEmitter.call(nativeTheme as any)
|
||||
|
||||
module.exports = nativeTheme
|
||||
@@ -48,7 +48,6 @@ v8Util.setHiddenValue(global, 'ipcNative', {
|
||||
onMessage (internal: boolean, channel: string, args: any[], senderId: number) {
|
||||
const sender = internal ? ipcInternalEmitter : ipcEmitter
|
||||
sender.emit(channel, { sender, senderId }, ...args)
|
||||
process.activateUvLoop()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "electron",
|
||||
"version": "7.0.0-nightly.20190731",
|
||||
"version": "7.0.0-beta.3",
|
||||
"repository": "https://github.com/electron/electron",
|
||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||
"devDependencies": {
|
||||
"@electron/docs-parser": "^0.4.1",
|
||||
"@electron/typescript-definitions": "^8.5.0",
|
||||
"@electron/docs-parser": "^0.4.2",
|
||||
"@electron/typescript-definitions": "^8.6.1",
|
||||
"@octokit/rest": "^16.3.2",
|
||||
"@primer/octicons": "^9.1.1",
|
||||
"@types/chai": "^4.1.7",
|
||||
|
||||
@@ -77,3 +77,4 @@ put_back_deleted_colors_for_autofill.patch
|
||||
build_win_disable_zc_twophase.patch
|
||||
disable_color_correct_rendering.patch
|
||||
add_contentgpuclient_precreatemessageloop_callback.patch
|
||||
fix_use_weakptr_to_detect_deletion.patch
|
||||
|
||||
@@ -10,10 +10,10 @@ to fix electron/electron#13787. The backport landed in Chromium 67 but the
|
||||
DidCreateScriptContext re-ordering needs to be upstreamed or kept indefinitely
|
||||
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
index 50c06fddeff3647dc99f8ab9f1538723f91ec2a9..fa4b6c3c8081af03055ddeadc53606fcc9030d5c 100644
|
||||
index b6622fd132cc1b46127a2157b28c2fd2ab63e40d..1a3196aa5737e35237fd467260973fdf260587c4 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
@@ -203,11 +203,10 @@ void LocalWindowProxy::Initialize() {
|
||||
@@ -205,11 +205,10 @@ void LocalWindowProxy::Initialize() {
|
||||
GetFrame()->IsMainFrame());
|
||||
MainThreadDebugger::Instance()->ContextCreated(script_state_, GetFrame(),
|
||||
origin);
|
||||
|
||||
@@ -14,7 +14,7 @@ when there is code doing that.
|
||||
This patch reverts the change to fix the crash in Electron.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
index 60b3fe655dc8c309e3099d15283f8223e9ae2a50..c66465dd1c059e8de6055e44260dd51810c4f202 100644
|
||||
index 76286491111dc1a73ad6e268aa356c8ef668d47b..64824ceabd004c80a610c1ab414e8acbccd20157 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -332,10 +332,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
|
||||
@@ -19,10 +19,10 @@ index ea92c2747104615ac876b8322bd5e7acf039924d..1a5b6c4945de6e26a163fe653fef6583
|
||||
// that the script evaluated to with callback. Script execution can be
|
||||
// suspend.
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
index 3215cba24c414f235c3149ffd45e30dfc7979060..752e04d1510d54ae525e4c7d1b5a149cba2b087a 100644
|
||||
index d0a05520d52a6912ed2454752d8bb7fa78d79ff5..0b8f0f03b965c156858b07d93faff5a960e493b4 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
@@ -868,6 +868,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
|
||||
@@ -866,6 +866,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
|
||||
return MainWorldScriptContext()->Global();
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ index 3215cba24c414f235c3149ffd45e30dfc7979060..752e04d1510d54ae525e4c7d1b5a149c
|
||||
return BindingSecurity::ShouldAllowAccessToFrame(
|
||||
CurrentDOMWindow(V8PerIsolateData::MainThreadIsolate()),
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
|
||||
index c9a5d1d253d7ff16dc88667b07b883842a388c11..ee7079631e3a713f8b001c5d104fc2b1bbe99e8c 100644
|
||||
index df0c843043e29029ccbfa51752866bbaa945e5e3..0ee2e45b7d91028720757672d1adf1636986a991 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h
|
||||
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
|
||||
@@ -149,6 +149,8 @@ class CORE_EXPORT WebLocalFrameImpl final
|
||||
@@ -148,6 +148,8 @@ class CORE_EXPORT WebLocalFrameImpl final
|
||||
int argc,
|
||||
v8::Local<v8::Value> argv[]) override;
|
||||
v8::Local<v8::Context> MainWorldScriptContext() const override;
|
||||
|
||||
@@ -8,7 +8,7 @@ This is to workaround the bug in crbug.com/969698#c10
|
||||
until fixes have landed in upstream.
|
||||
|
||||
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn
|
||||
index a6c0aeaf98f7a860c131dc52161f52f308432a91..7b490d07d0f8383db5cea2703d7451db0108d252 100644
|
||||
index 781aeaaf46b6de0f98f26df4ddcbd13cac527d62..254ede050920993d6b283ffb67f13d2eea633113 100644
|
||||
--- a/build/config/win/BUILD.gn
|
||||
+++ b/build/config/win/BUILD.gn
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: can_create_window.patch
|
||||
|
||||
|
||||
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
|
||||
index a9d30fa2e6b9b2f5fd96be4ecf90dafa9e7ea57a..b352615567a2719828626d9ad4b79ea8c494975f 100644
|
||||
index d731d6d9e2626157520ddcaf231781e723d8d2ce..583065369a21acd86b017d716f6670ff67d2e108 100644
|
||||
--- a/content/browser/frame_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/frame_host/render_frame_host_impl.cc
|
||||
@@ -3831,6 +3831,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -3848,6 +3848,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
last_committed_origin_, params->window_container_type,
|
||||
params->target_url, params->referrer.To<Referrer>(),
|
||||
params->frame_name, params->disposition, *params->features,
|
||||
@@ -17,10 +17,10 @@ index a9d30fa2e6b9b2f5fd96be4ecf90dafa9e7ea57a..b352615567a2719828626d9ad4b79ea8
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
|
||||
index a2fe2dbd0d1c91a0bf5047b5c93f30758a0db277..d9f44fecaae883d861eea94c6cc16727967f0baa 100644
|
||||
index b3eb08bcfd338f0085d7576a78e158a874033f3a..819dd480af5937aaa63b63e38f4d32e4ff7ba8c6 100644
|
||||
--- a/content/common/frame.mojom
|
||||
+++ b/content/common/frame.mojom
|
||||
@@ -305,6 +305,10 @@ struct CreateNewWindowParams {
|
||||
@@ -311,6 +311,10 @@ struct CreateNewWindowParams {
|
||||
|
||||
// The window features to use for the new window.
|
||||
blink.mojom.WindowFeatures features;
|
||||
@@ -32,7 +32,7 @@ index a2fe2dbd0d1c91a0bf5047b5c93f30758a0db277..d9f44fecaae883d861eea94c6cc16727
|
||||
|
||||
// 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 21da9c9c43a94411787d7cab8513b88302383e97..44a574d3c621695d7d1304c7b8db08db8cf753d1 100644
|
||||
index e2b0dcdb14075754a4a1e8a90b3cd9a14a08796b..1f469e9c1001ba63e371456d3cbbbfbddffeabb8 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -494,6 +494,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
@@ -45,7 +45,7 @@ index 21da9c9c43a94411787d7cab8513b88302383e97..44a574d3c621695d7d1304c7b8db08db
|
||||
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 b0709c05aec437c36498587e7a3bd79bf311c525..7d83d9e0d0c57511955921d85f15a27a88c3ac37 100644
|
||||
index a14b357dca0133d25e06b53c19926a7598258382..46399a321845e04f67d8424acddec2636b2d9cc6 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -175,6 +175,7 @@ class RenderFrameHost;
|
||||
@@ -66,7 +66,7 @@ index b0709c05aec437c36498587e7a3bd79bf311c525..7d83d9e0d0c57511955921d85f15a27a
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access);
|
||||
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
||||
index d0ca81590d2b5688022ca6045869dcae0ecd778e..7752c1e49dbee49c64a552ec249cabdb4d073109 100644
|
||||
index 561f409be27c004629455fc3392463fa43313a73..222db08480b15a18d50f0ef8d02ea6afb1681961 100644
|
||||
--- a/content/renderer/render_view_impl.cc
|
||||
+++ b/content/renderer/render_view_impl.cc
|
||||
@@ -75,6 +75,7 @@
|
||||
@@ -77,7 +77,7 @@ index d0ca81590d2b5688022ca6045869dcae0ecd778e..7752c1e49dbee49c64a552ec249cabdb
|
||||
#include "content/renderer/media/audio/audio_device_factory.h"
|
||||
#include "content/renderer/media/stream/media_stream_device_observer.h"
|
||||
#include "content/renderer/media/video_capture/video_capture_impl_manager.h"
|
||||
@@ -1366,6 +1367,8 @@ WebView* RenderViewImpl::CreateView(
|
||||
@@ -1368,6 +1369,8 @@ WebView* RenderViewImpl::CreateView(
|
||||
}
|
||||
params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ index b74bbef56038e29ca35403affd284a7a8868c201..d6887e576ac197f80a7e5261bd251cd7
|
||||
}
|
||||
|
||||
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
||||
index 39d3c28ca33fa1eeab14b67ec31a6ae09f25c354..1fc64dd493536f1aefafd6a683c19289920000b7 100644
|
||||
index 5142cfedf46dafa383f615fe8ca72c1d4c20b36e..691fbc819713beb881402cb8a84886bd0780b106 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -71,6 +71,10 @@ std::unique_ptr<BrowserMainParts> ContentBrowserClient::CreateBrowserMainParts(
|
||||
@@ -37,7 +37,7 @@ index 39d3c28ca33fa1eeab14b67ec31a6ae09f25c354..1fc64dd493536f1aefafd6a683c19289
|
||||
const base::Location& from_here,
|
||||
const scoped_refptr<base::TaskRunner>& task_runner,
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index 3d518759a3bc190970a2d45ec178c97096fa250d..b2c12759d2cd94d7971f20bc289c7fa70f1fe863 100644
|
||||
index 671b2ccfb8f8f21018931c454584d7f0bd2b1418..b5361817676abfdf74cc6cf9a628e18a5aeb3dd8 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -249,6 +249,9 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
|
||||
@@ -234,7 +234,7 @@ index 6f0671a753879d7b327681979090508e610cc129..f1beaf3433d67014cff527a686fd3239
|
||||
network::switches::kExplicitlyAllowedPorts,
|
||||
service_manager::switches::kDisableInProcessStackTraces,
|
||||
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
|
||||
index 734c561001cc625c60851590d69bc7485928538a..1f56e138ae967e8f7c39a4629f6cb7dc590cf42c 100644
|
||||
index 2c96d679729d6ceac7d2b5077b8bbf2b6d951fa5..61ef919b51a1712fb2c0d8eecee8f5b953532b32 100644
|
||||
--- a/content/renderer/render_widget.cc
|
||||
+++ b/content/renderer/render_widget.cc
|
||||
@@ -2854,6 +2854,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: disable_user_gesture_requirement_for_beforeunload_dialogs.patch
|
||||
See https://github.com/electron/electron/issues/10754
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
|
||||
index ac89475a90cdf889c073c6d7749732285455db8c..ed658f7a115087cdec0778ace5ad80b8643d5e92 100644
|
||||
index 14e41abcabba4d881ee8016833662d4cd8ba420b..2499bbcfd67c362166c1ea7e0f4a692784a4bc4c 100644
|
||||
--- a/third_party/blink/renderer/core/dom/document.cc
|
||||
+++ b/third_party/blink/renderer/core/dom/document.cc
|
||||
@@ -4067,7 +4067,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
|
||||
@@ -4065,7 +4065,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
|
||||
"frame that never had a user gesture since its load. "
|
||||
"https://www.chromestatus.com/feature/5082396709879808";
|
||||
Intervention::GenerateReport(frame_, "BeforeUnloadNoGesture", message);
|
||||
|
||||
@@ -7,10 +7,10 @@ Compilation of those files fails with the Chromium 68.
|
||||
Remove the patch during the Chromium 69 upgrade.
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
|
||||
index 0764cc88a8c4753a1c682e4164ec1988f7b824dd..cb1314d44fe2150a049e1e6072f036ffd26a5bfb 100644
|
||||
index 72177b83dec57c6b9497d59304076f60cf96552a..8856846e1a366f224dd8eefdaf3eb75b1e83b76f 100644
|
||||
--- a/third_party/blink/renderer/platform/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/platform/BUILD.gn
|
||||
@@ -1706,7 +1706,7 @@ jumbo_source_set("blink_platform_unittests_sources") {
|
||||
@@ -1717,7 +1717,7 @@ jumbo_source_set("blink_platform_unittests_sources") {
|
||||
"graphics/paint/drawing_display_item_test.cc",
|
||||
"graphics/paint/drawing_recorder_test.cc",
|
||||
"graphics/paint/float_clip_rect_test.cc",
|
||||
|
||||
@@ -98,7 +98,7 @@ index d9a9730a78b9aec833c64282ca868dbba5594d82..d98426e9f78931bd43061ec994559d59
|
||||
private:
|
||||
const HWND hwnd_;
|
||||
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
|
||||
index a43cee43701fc3c139c726d14b128de3ae71c2c2..32ce9f5634ddefd5cd0feaa551f04697b53da68d 100644
|
||||
index fdd358f741e6bfc1eb0cd67c3bb113e64250400c..fe0e53fd43fc762e2d6c096fbccc5676bc14bfde 100644
|
||||
--- a/components/viz/service/BUILD.gn
|
||||
+++ b/components/viz/service/BUILD.gn
|
||||
@@ -113,6 +113,8 @@ viz_component("service") {
|
||||
@@ -477,7 +477,7 @@ index 73ea1986b2140a3ffb87c5e23c7ab2174bac0a10..3ba3657ba12ec47cc3db3fec218496ff
|
||||
return std::make_unique<SoftwareOutputDeviceWinDirect>(hwnd, backing);
|
||||
}
|
||||
diff --git a/services/viz/privileged/interfaces/compositing/display_private.mojom b/services/viz/privileged/interfaces/compositing/display_private.mojom
|
||||
index 8898b9162a65e043e8b95237b8874e48ea71744e..a455df870ece25fc6e5e46688a1c6b5b396b841a 100644
|
||||
index d5d0f0eaab04ccfedf6c01ae565c1ddc3f518cd0..b186708c6a3443806236a565496c5e55019ae9fb 100644
|
||||
--- a/services/viz/privileged/interfaces/compositing/display_private.mojom
|
||||
+++ b/services/viz/privileged/interfaces/compositing/display_private.mojom
|
||||
@@ -79,12 +79,14 @@ interface DisplayPrivate {
|
||||
@@ -497,7 +497,7 @@ index 8898b9162a65e043e8b95237b8874e48ea71744e..a455df870ece25fc6e5e46688a1c6b5b
|
||||
|
||||
// Notifies that a swap has occurred and provides information about the pixel
|
||||
diff --git a/services/viz/privileged/interfaces/compositing/layered_window_updater.mojom b/services/viz/privileged/interfaces/compositing/layered_window_updater.mojom
|
||||
index 58a7e221eaabd9e21196496d220c77babe07c56d..dd141b16eace2999380ed137b4adf1f3538a8a70 100644
|
||||
index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a285498c3f8e72 100644
|
||||
--- a/services/viz/privileged/interfaces/compositing/layered_window_updater.mojom
|
||||
+++ b/services/viz/privileged/interfaces/compositing/layered_window_updater.mojom
|
||||
@@ -26,5 +26,5 @@ interface LayeredWindowUpdater {
|
||||
@@ -595,7 +595,7 @@ index 4014e64a75da88cf66c02e8adb71171c2666cab7..25e57784e1a1ffc546b003daa4cd0059
|
||||
gfx::Size pixel_size;
|
||||
float scale_factor = 1.f;
|
||||
diff --git a/ui/gfx/mojo/ca_layer_params.mojom b/ui/gfx/mojo/ca_layer_params.mojom
|
||||
index 7bf735643541b18bafffe645d3ff37e96caa4dea..f7eaf10ffd665789f10a587142fac0c0c79b9798 100644
|
||||
index a73b2e678ffe0a682d0aa5409724fb441768bec5..6c36626d204c77ef51278b9e8f6fc6ee24a7a9ab 100644
|
||||
--- a/ui/gfx/mojo/ca_layer_params.mojom
|
||||
+++ b/ui/gfx/mojo/ca_layer_params.mojom
|
||||
@@ -18,5 +18,6 @@ struct CALayerParams {
|
||||
@@ -606,7 +606,7 @@ index 7bf735643541b18bafffe645d3ff37e96caa4dea..f7eaf10ffd665789f10a587142fac0c0
|
||||
float scale_factor;
|
||||
};
|
||||
diff --git a/ui/gfx/mojo/ca_layer_params_struct_traits.cc b/ui/gfx/mojo/ca_layer_params_struct_traits.cc
|
||||
index dd553996b5c6ff5ec0c210a020a18a6a843b8aae..26d1e0bda2640052d42ea4e691c3df73074dea08 100644
|
||||
index 5be5a3547f8eb826faaa4a18455b18ee22ec0bf9..beb94400a0d7a30c2aae0b3821f011853c8b6c58 100644
|
||||
--- a/ui/gfx/mojo/ca_layer_params_struct_traits.cc
|
||||
+++ b/ui/gfx/mojo/ca_layer_params_struct_traits.cc
|
||||
@@ -52,6 +52,9 @@ bool StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams>::Read(
|
||||
|
||||
76
patches/chromium/fix_use_weakptr_to_detect_deletion.patch
Normal file
76
patches/chromium/fix_use_weakptr_to_detect_deletion.patch
Normal file
@@ -0,0 +1,76 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: John Kleinschmidt <kleinschmidtorama@gmail.com>
|
||||
Date: Wed, 31 Jul 2019 14:36:27 -0400
|
||||
Subject: fix: use WeakPtr to detect deletion
|
||||
|
||||
|
||||
diff --git a/ui/compositor/callback_layer_animation_observer.cc b/ui/compositor/callback_layer_animation_observer.cc
|
||||
index 639caf4d1411b867a31ce29e6c6ec4ae846359a8..6296afa55e38494cf0232f8bcd05811bfd4ebe38 100644
|
||||
--- a/ui/compositor/callback_layer_animation_observer.cc
|
||||
+++ b/ui/compositor/callback_layer_animation_observer.cc
|
||||
@@ -38,22 +38,18 @@ CallbackLayerAnimationObserver::CallbackLayerAnimationObserver(
|
||||
&CallbackLayerAnimationObserver::DummyAnimationStartedCallback)),
|
||||
animation_ended_callback_(animation_ended_callback) {}
|
||||
|
||||
-CallbackLayerAnimationObserver::~CallbackLayerAnimationObserver() {
|
||||
- if (destroyed_)
|
||||
- *destroyed_ = true;
|
||||
-}
|
||||
+CallbackLayerAnimationObserver::~CallbackLayerAnimationObserver() {}
|
||||
|
||||
void CallbackLayerAnimationObserver::SetActive() {
|
||||
active_ = true;
|
||||
|
||||
- bool destroyed = false;
|
||||
- destroyed_ = &destroyed;
|
||||
+ base::WeakPtr<CallbackLayerAnimationObserver> weak_this =
|
||||
+ weak_factory_.GetWeakPtr();
|
||||
|
||||
CheckAllSequencesStarted();
|
||||
|
||||
- if (destroyed)
|
||||
+ if (!weak_this)
|
||||
return;
|
||||
- destroyed_ = nullptr;
|
||||
|
||||
CheckAllSequencesCompleted();
|
||||
}
|
||||
@@ -110,19 +106,17 @@ void CallbackLayerAnimationObserver::CheckAllSequencesStarted() {
|
||||
void CallbackLayerAnimationObserver::CheckAllSequencesCompleted() {
|
||||
if (active_ && GetNumSequencesCompleted() == attached_sequence_count_) {
|
||||
active_ = false;
|
||||
- bool destroyed = false;
|
||||
- destroyed_ = &destroyed;
|
||||
-
|
||||
+ base::WeakPtr<CallbackLayerAnimationObserver> weak_this =
|
||||
+ weak_factory_.GetWeakPtr();
|
||||
bool should_delete = animation_ended_callback_.Run(*this);
|
||||
|
||||
- if (destroyed) {
|
||||
+ if (!weak_this) {
|
||||
if (should_delete)
|
||||
LOG(WARNING) << "CallbackLayerAnimationObserver was explicitly "
|
||||
"destroyed AND was requested to be destroyed via the "
|
||||
"AnimationEndedCallback's return value.";
|
||||
return;
|
||||
}
|
||||
- destroyed_ = nullptr;
|
||||
|
||||
if (should_delete)
|
||||
delete this;
|
||||
diff --git a/ui/compositor/callback_layer_animation_observer.h b/ui/compositor/callback_layer_animation_observer.h
|
||||
index fc631cc21ccc83a74955cd1af8bf43b879b6bc80..9b3448eecbc6a9bc75719c8df08586fe8870fa96 100644
|
||||
--- a/ui/compositor/callback_layer_animation_observer.h
|
||||
+++ b/ui/compositor/callback_layer_animation_observer.h
|
||||
@@ -167,9 +167,8 @@ class COMPOSITOR_EXPORT CallbackLayerAnimationObserver
|
||||
// The callback to invoke once all the animation sequences have finished.
|
||||
AnimationEndedCallback animation_ended_callback_;
|
||||
|
||||
- // Set to true in the destructor (if non-NULL). Used to detect deletion while
|
||||
- // calling out.
|
||||
- bool* destroyed_ = nullptr;
|
||||
+ // Used to detect deletion while calling out.
|
||||
+ base::WeakPtrFactory<CallbackLayerAnimationObserver> weak_factory_{this};
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CallbackLayerAnimationObserver);
|
||||
};
|
||||
@@ -180,7 +180,7 @@ index 1edb9fd6b0c383f291735dd1a952fcb7b17cc87f..23967f040eb346be265faa2a92562e1f
|
||||
size_t GetRelatedActiveContentsCount() override;
|
||||
bool RequiresDedicatedProcess() override;
|
||||
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
||||
index 44a574d3c621695d7d1304c7b8db08db8cf753d1..39d3c28ca33fa1eeab14b67ec31a6ae09f25c354 100644
|
||||
index 1f469e9c1001ba63e371456d3cbbbfbddffeabb8..5142cfedf46dafa383f615fe8ca72c1d4c20b36e 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -52,6 +52,20 @@ void OverrideOnBindInterface(const service_manager::BindSourceInfo& remote_info,
|
||||
@@ -205,7 +205,7 @@ index 44a574d3c621695d7d1304c7b8db08db8cf753d1..39d3c28ca33fa1eeab14b67ec31a6ae0
|
||||
const MainFunctionParams& parameters) {
|
||||
return nullptr;
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index 7d83d9e0d0c57511955921d85f15a27a88c3ac37..3d518759a3bc190970a2d45ec178c97096fa250d 100644
|
||||
index 46399a321845e04f67d8424acddec2636b2d9cc6..671b2ccfb8f8f21018931c454584d7f0bd2b1418 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -208,8 +208,41 @@ CONTENT_EXPORT void OverrideOnBindInterface(
|
||||
|
||||
@@ -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 b/tools/gritsettings/resource_ids
|
||||
index 7ac3cf37b48153541278b3524d5c1610f6ae62e7..d284647347afca7beb1fea7415ae8f951026a03b 100644
|
||||
index e43847961df964f2de96075a4aed90c233c9babe..bb7f9bf1fc01fa61421baffd344dcae2ac28b0d5 100644
|
||||
--- a/tools/gritsettings/resource_ids
|
||||
+++ b/tools/gritsettings/resource_ids
|
||||
@@ -459,6 +459,11 @@
|
||||
@@ -462,6 +462,11 @@
|
||||
"includes": [28880],
|
||||
},
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ index 94afefcee81b87c05bf9b1199d90d3d4b5ea84a6..2ec7f04c71824b47de1ddbf1f0e8625d
|
||||
|
||||
} // namespace blink
|
||||
diff --git a/third_party/blink/renderer/core/paint/theme_painter_mac.mm b/third_party/blink/renderer/core/paint/theme_painter_mac.mm
|
||||
index e965faf9fd8d5ec3572d769421f149907d66c67f..b2d0bbd80994fdf9607009d9e27bf4c3629fe402 100644
|
||||
index e94235acb17335fbc78c606ff26036871117bd09..7c4bd19215c67f649636ae69b9a21b5c1ba21ecc 100644
|
||||
--- a/third_party/blink/renderer/core/paint/theme_painter_mac.mm
|
||||
+++ b/third_party/blink/renderer/core/paint/theme_painter_mac.mm
|
||||
@@ -41,6 +41,7 @@
|
||||
|
||||
@@ -11,7 +11,7 @@ majority of changes originally come from these PRs:
|
||||
This patch also fixes callback for manual user cancellation and success.
|
||||
|
||||
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
|
||||
index 63f432b58371cfa0f8079fa78a51c8865a00c183..7b39523e0b8b840191ea517d5f5e8eda701995bc 100644
|
||||
index 63f432b58371cfa0f8079fa78a51c8865a00c183..d20d803f55ca67fb6993facc69c3431767786053 100644
|
||||
--- a/chrome/browser/printing/print_job_worker.cc
|
||||
+++ b/chrome/browser/printing/print_job_worker.cc
|
||||
@@ -21,12 +21,12 @@
|
||||
@@ -28,25 +28,40 @@ index 63f432b58371cfa0f8079fa78a51c8865a00c183..7b39523e0b8b840191ea517d5f5e8eda
|
||||
#include "printing/print_job_constants.h"
|
||||
#include "printing/printed_document.h"
|
||||
#include "printing/printing_utils.h"
|
||||
@@ -224,7 +224,15 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
|
||||
@@ -206,9 +206,14 @@ void PrintJobWorker::SetSettingsFromPOD(
|
||||
void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
|
||||
SettingsCallback callback) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
- PrintingContext::Result result =
|
||||
- printing_context_->UpdatePrintSettings(std::move(new_settings));
|
||||
- GetSettingsDone(std::move(callback), result);
|
||||
+ // Reset settings from previous print job
|
||||
+ printing_context_->ResetSettings();
|
||||
+ PrintingContext::Result get_default_result = printing_context_->UseDefaultSettings();
|
||||
+ if (get_default_result == PrintingContext::Result::OK) {
|
||||
+ PrintingContext::Result update_result =
|
||||
+ printing_context_->UpdatePrintSettings(std::move(new_settings));
|
||||
+ GetSettingsDone(std::move(callback), update_result);
|
||||
+ }
|
||||
}
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
@@ -224,6 +229,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
|
||||
|
||||
void PrintJobWorker::GetSettingsDone(SettingsCallback callback,
|
||||
PrintingContext::Result result) {
|
||||
- std::move(callback).Run(printing_context_->settings(), result);
|
||||
+ if (result == PrintingContext::CANCEL) {
|
||||
+ print_job_->PostTask(
|
||||
+ FROM_HERE,
|
||||
+ base::BindOnce(&NotificationCallback, base::RetainedRef(print_job_),
|
||||
+ JobEventDetails::USER_INIT_CANCELED, 0,
|
||||
+ base::RetainedRef(document_)));
|
||||
+ } else {
|
||||
+ std::move(callback).Run(printing_context_->settings(), result);
|
||||
+ }
|
||||
std::move(callback).Run(printing_context_->settings(), result);
|
||||
}
|
||||
|
||||
void PrintJobWorker::GetSettingsWithUI(int document_page_count,
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
|
||||
index c4e0992f6265b34659514ef5f15eb8d78645161c..e95f62c0761d1a5829cc4403434fd643e45a0a69 100644
|
||||
index c4e0992f6265b34659514ef5f15eb8d78645161c..1aca2f88da5d8e96a0f16a667a8a86a7873dfdf9 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.cc
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.cc
|
||||
@@ -27,10 +27,7 @@
|
||||
@@ -188,16 +203,19 @@ index c4e0992f6265b34659514ef5f15eb8d78645161c..e95f62c0761d1a5829cc4403434fd643
|
||||
if (!print_job_)
|
||||
return;
|
||||
|
||||
@@ -607,7 +619,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
@@ -606,8 +618,9 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
rfh->Send(msg.release());
|
||||
}
|
||||
|
||||
registrar_.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
||||
- registrar_.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
||||
- content::Source<PrintJob>(print_job_.get()));
|
||||
+ content::NotificationService::AllSources());
|
||||
+ if (!callback_.is_null())
|
||||
+ registrar_.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
||||
+ content::NotificationService::AllSources());
|
||||
// Don't close the worker thread.
|
||||
print_job_ = nullptr;
|
||||
}
|
||||
@@ -677,6 +689,9 @@ bool PrintViewManagerBase::PrintNowInternal(
|
||||
@@ -677,6 +690,9 @@ bool PrintViewManagerBase::PrintNowInternal(
|
||||
// Don't print / print preview interstitials or crashed tabs.
|
||||
if (web_contents()->ShowingInterstitialPage() || web_contents()->IsCrashed())
|
||||
return false;
|
||||
@@ -248,7 +266,7 @@ index 925736d379c34ac7ddc07032305d24e1ae65e4b3..a8b2b31ec8bcb04d83df368b12d124dc
|
||||
// This means we are _blocking_ until all the necessary pages have been
|
||||
// rendered or the print settings are being loaded.
|
||||
diff --git a/chrome/browser/printing/printing_message_filter.cc b/chrome/browser/printing/printing_message_filter.cc
|
||||
index 706617b7924cfbf25e4f3a04a40d9ee977e6fd69..6e3c3743e5da782e227e1ec3dba83ed7b401f3de 100644
|
||||
index 706617b7924cfbf25e4f3a04a40d9ee977e6fd69..92b46562ef36bbfe874d39d706ab589d98f37cda 100644
|
||||
--- a/chrome/browser/printing/printing_message_filter.cc
|
||||
+++ b/chrome/browser/printing/printing_message_filter.cc
|
||||
@@ -21,6 +21,7 @@
|
||||
@@ -314,7 +332,18 @@ index 706617b7924cfbf25e4f3a04a40d9ee977e6fd69..6e3c3743e5da782e227e1ec3dba83ed7
|
||||
std::unique_ptr<PrinterQuery> printer_query =
|
||||
queue_->PopPrinterQuery(document_cookie);
|
||||
if (!printer_query) {
|
||||
@@ -295,7 +303,7 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
|
||||
@@ -257,7 +265,9 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
|
||||
std::unique_ptr<PrinterQuery> printer_query,
|
||||
IPC::Message* reply_msg) {
|
||||
PrintMsg_PrintPages_Params params;
|
||||
- if (!printer_query || printer_query->last_status() != PrintingContext::OK) {
|
||||
+ // We call update without first printing from defaults,
|
||||
+ // so the last printer status will still be defaulted to PrintingContext::FAILED
|
||||
+ if (!printer_query) {
|
||||
params.Reset();
|
||||
} else {
|
||||
RenderParamsFromPrintSettings(printer_query->settings(), ¶ms.params);
|
||||
@@ -295,7 +305,7 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
void PrintingMessageFilter::OnCheckForCancel(const PrintHostMsg_PreviewIds& ids,
|
||||
bool* cancel) {
|
||||
@@ -349,23 +378,22 @@ index 9fbea6d0a2dbe55b1d600fbc217dee5aa8ae8cd5..de9bd267e408c02fd4da7d903523c0e6
|
||||
// content::BrowserMessageFilter:
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
diff --git a/components/printing/common/print_messages.h b/components/printing/common/print_messages.h
|
||||
index 1802034a6e15a6ad8b0d9591cfb79ba5873dc982..a827091facdb4f6b1d74ce826c3492ced27c008e 100644
|
||||
index 1802034a6e15a6ad8b0d9591cfb79ba5873dc982..331ac71d925c056d3b7577123251514c35f30fde 100644
|
||||
--- a/components/printing/common/print_messages.h
|
||||
+++ b/components/printing/common/print_messages.h
|
||||
@@ -368,7 +368,10 @@ IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu)
|
||||
@@ -368,7 +368,9 @@ IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu)
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
// Tells the RenderFrame to switch the CSS to print media type, renders every
|
||||
// requested pages and switch back the CSS to display media type.
|
||||
-IPC_MESSAGE_ROUTED0(PrintMsg_PrintPages)
|
||||
+IPC_MESSAGE_ROUTED3(PrintMsg_PrintPages,
|
||||
+IPC_MESSAGE_ROUTED2(PrintMsg_PrintPages,
|
||||
+ bool /* silent print */,
|
||||
+ bool /* print page's background */,
|
||||
+ base::DictionaryValue /* settings */)
|
||||
|
||||
// Like PrintMsg_PrintPages, but using the print preview document's frame/node.
|
||||
IPC_MESSAGE_ROUTED0(PrintMsg_PrintForSystemDialog)
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
|
||||
index ef580254bd8feba84ac02924b77b9b4feaf14d96..57a8264a7174b440ed1d6bfe9c2c3e21552d950b 100644
|
||||
index ef580254bd8feba84ac02924b77b9b4feaf14d96..3cdaf40b6e5aeee7193a49a31f824c914d07648e 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -37,6 +37,7 @@
|
||||
@@ -376,49 +404,47 @@ index ef580254bd8feba84ac02924b77b9b4feaf14d96..57a8264a7174b440ed1d6bfe9c2c3e21
|
||||
#include "printing/units.h"
|
||||
#include "third_party/blink/public/common/frame/frame_owner_element_type.h"
|
||||
#include "third_party/blink/public/common/frame/sandbox_flags.h"
|
||||
@@ -1116,7 +1117,9 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
@@ -1116,7 +1117,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
web_frame->DispatchBeforePrintEvent();
|
||||
if (!weak_this)
|
||||
return;
|
||||
- Print(web_frame, blink::WebNode(), PrintRequestType::kScripted);
|
||||
+ Print(web_frame, blink::WebNode(), PrintRequestType::kScripted,
|
||||
+ false /* silent */, false /* print_background */,
|
||||
+ base::DictionaryValue() /* new_settings */);
|
||||
+ false /* silent */, base::DictionaryValue() /* new_settings */);
|
||||
if (weak_this)
|
||||
web_frame->DispatchAfterPrintEvent();
|
||||
}
|
||||
@@ -1164,7 +1167,10 @@ void PrintRenderFrameHelper::OnDestruct() {
|
||||
@@ -1164,7 +1166,9 @@ void PrintRenderFrameHelper::OnDestruct() {
|
||||
delete this;
|
||||
}
|
||||
|
||||
-void PrintRenderFrameHelper::OnPrintPages() {
|
||||
+void PrintRenderFrameHelper::OnPrintPages(
|
||||
+ bool silent,
|
||||
+ bool print_background,
|
||||
+ const base::DictionaryValue& settings) {
|
||||
if (ipc_nesting_level_ > 1)
|
||||
return;
|
||||
|
||||
@@ -1177,7 +1183,8 @@ void PrintRenderFrameHelper::OnPrintPages() {
|
||||
@@ -1177,7 +1181,8 @@ void PrintRenderFrameHelper::OnPrintPages() {
|
||||
// If we are printing a PDF extension frame, find the plugin node and print
|
||||
// that instead.
|
||||
auto plugin = delegate_->GetPdfElement(frame);
|
||||
- Print(frame, plugin, PrintRequestType::kRegular);
|
||||
+ Print(frame, plugin, PrintRequestType::kRegular,
|
||||
+ silent, print_background, settings);
|
||||
+ silent, settings);
|
||||
if (weak_this)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1194,7 +1201,7 @@ void PrintRenderFrameHelper::OnPrintForSystemDialog() {
|
||||
@@ -1194,7 +1199,7 @@ void PrintRenderFrameHelper::OnPrintForSystemDialog() {
|
||||
}
|
||||
auto weak_this = weak_ptr_factory_.GetWeakPtr();
|
||||
Print(frame, print_preview_context_.source_node(),
|
||||
- PrintRequestType::kRegular);
|
||||
+ PrintRequestType::kRegular, false, false, base::DictionaryValue());
|
||||
+ PrintRequestType::kRegular, false, base::DictionaryValue());
|
||||
if (weak_this)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1230,6 +1237,8 @@ void PrintRenderFrameHelper::OnPrintPreview(
|
||||
@@ -1230,6 +1235,8 @@ void PrintRenderFrameHelper::OnPrintPreview(
|
||||
if (ipc_nesting_level_ > 1)
|
||||
return;
|
||||
|
||||
@@ -427,31 +453,29 @@ index ef580254bd8feba84ac02924b77b9b4feaf14d96..57a8264a7174b440ed1d6bfe9c2c3e21
|
||||
print_preview_context_.OnPrintPreview();
|
||||
|
||||
UMA_HISTOGRAM_ENUMERATION("PrintPreview.PreviewEvent",
|
||||
@@ -1622,7 +1631,10 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -1622,7 +1629,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
|
||||
- PrintRequestType::kRegular);
|
||||
+ PrintRequestType::kRegular,
|
||||
+ false /* silent */,
|
||||
+ false /* print_background */,
|
||||
+ base::DictionaryValue() /* new_settings */);
|
||||
// Check if |this| is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -1633,7 +1645,10 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -1633,7 +1642,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
- PrintRequestType print_request_type) {
|
||||
+ PrintRequestType print_request_type,
|
||||
+ bool silent,
|
||||
+ bool print_background,
|
||||
+ const base::DictionaryValue& settings) {
|
||||
// If still not finished with earlier print request simply ignore.
|
||||
if (prep_frame_view_)
|
||||
return;
|
||||
@@ -1641,7 +1656,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -1641,7 +1652,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
FrameReference frame_ref(frame);
|
||||
|
||||
int expected_page_count = 0;
|
||||
@@ -460,7 +484,7 @@ index ef580254bd8feba84ac02924b77b9b4feaf14d96..57a8264a7174b440ed1d6bfe9c2c3e21
|
||||
DidFinishPrinting(FAIL_PRINT_INIT);
|
||||
return; // Failed to init print page settings.
|
||||
}
|
||||
@@ -1661,8 +1676,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -1661,8 +1672,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
|
||||
PrintMsg_PrintPages_Params print_settings;
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
@@ -474,15 +498,7 @@ index ef580254bd8feba84ac02924b77b9b4feaf14d96..57a8264a7174b440ed1d6bfe9c2c3e21
|
||||
// Check if |this| is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -1672,6 +1690,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
? blink::kWebPrintScalingOptionSourceSize
|
||||
: scaling_option;
|
||||
SetPrintPagesParams(print_settings);
|
||||
+ print_settings.params.should_print_backgrounds = print_background;
|
||||
if (print_settings.params.dpi.IsEmpty() ||
|
||||
!print_settings.params.document_cookie) {
|
||||
DidFinishPrinting(OK); // Release resources and fail silently on failure.
|
||||
@@ -1867,10 +1886,24 @@ std::vector<int> PrintRenderFrameHelper::GetPrintedPages(
|
||||
@@ -1867,10 +1881,23 @@ std::vector<int> PrintRenderFrameHelper::GetPrintedPages(
|
||||
return printed_pages;
|
||||
}
|
||||
|
||||
@@ -494,23 +510,22 @@ index ef580254bd8feba84ac02924b77b9b4feaf14d96..57a8264a7174b440ed1d6bfe9c2c3e21
|
||||
- Send(new PrintHostMsg_GetDefaultPrintSettings(routing_id(),
|
||||
- &settings.params));
|
||||
+ if (new_settings.empty()) {
|
||||
+ // Send the default IPC message if caller is window.print()
|
||||
+ Send(new PrintHostMsg_GetDefaultPrintSettings(routing_id(),
|
||||
+ &settings.params));
|
||||
+ } else {
|
||||
+ // Send the cookie so that UpdatePrintSettings can reuse PrinterQuery when
|
||||
+ // possible.
|
||||
+ int cookie =
|
||||
+ print_pages_params_ ? print_pages_params_->params.document_cookie : 0;
|
||||
+ // Send the update IPC message if caller is webContents.print()
|
||||
+ bool canceled = false;
|
||||
+ Send(new PrintHostMsg_UpdatePrintSettings(
|
||||
+ routing_id(), cookie, new_settings, &settings, &canceled));
|
||||
+ routing_id(), 0, new_settings, &settings, &canceled));
|
||||
+ if (canceled)
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
// Check if the printer returned any settings, if the settings is empty, we
|
||||
// can safely assume there are no printer drivers configured. So we safely
|
||||
// terminate.
|
||||
@@ -1890,12 +1923,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
@@ -1890,12 +1917,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -530,33 +545,31 @@ index ef580254bd8feba84ac02924b77b9b4feaf14d96..57a8264a7174b440ed1d6bfe9c2c3e21
|
||||
Send(new PrintHostMsg_ShowInvalidPrinterSettingsError(routing_id()));
|
||||
return false;
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h
|
||||
index 71c0c15217b62cd7a6087c6d9ae50481f9041d5f..e2250a66517dbd909cd3b5407173ad91c11ec32f 100644
|
||||
index 71c0c15217b62cd7a6087c6d9ae50481f9041d5f..18d853d7f808aaf816de86e8c5b8231738d16f55 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.h
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.h
|
||||
@@ -193,7 +193,9 @@ class PrintRenderFrameHelper
|
||||
@@ -193,7 +193,8 @@ class PrintRenderFrameHelper
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
|
||||
// Message handlers ---------------------------------------------------------
|
||||
- void OnPrintPages();
|
||||
+ void OnPrintPages(bool silent,
|
||||
+ bool print_background,
|
||||
+ const base::DictionaryValue& settings);
|
||||
void OnPrintForSystemDialog();
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
void OnInitiatePrintPreview(bool has_selection);
|
||||
@@ -243,7 +245,10 @@ class PrintRenderFrameHelper
|
||||
@@ -243,7 +244,9 @@ class PrintRenderFrameHelper
|
||||
// WARNING: |this| may be gone after this method returns.
|
||||
void Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
- PrintRequestType print_request_type);
|
||||
+ PrintRequestType print_request_type,
|
||||
+ bool silent,
|
||||
+ bool print_background,
|
||||
+ const base::DictionaryValue& settings);
|
||||
|
||||
// Notification when printing is done - signal tear-down/free resources.
|
||||
void DidFinishPrinting(PrintingResult result);
|
||||
@@ -252,12 +257,14 @@ class PrintRenderFrameHelper
|
||||
@@ -252,12 +255,14 @@ class PrintRenderFrameHelper
|
||||
|
||||
// Initialize print page settings with default settings.
|
||||
// Used only for native printing workflow.
|
||||
@@ -573,3 +586,54 @@ index 71c0c15217b62cd7a6087c6d9ae50481f9041d5f..e2250a66517dbd909cd3b5407173ad91
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
// Set options for print preset from source PDF document.
|
||||
diff --git a/printing/print_settings_conversion.cc b/printing/print_settings_conversion.cc
|
||||
index 2563ae6a87b2354ff2f2b45c17f61d2f44910efa..a7c61e5286659c51579c6b50cf5cc52c10433062 100644
|
||||
--- a/printing/print_settings_conversion.cc
|
||||
+++ b/printing/print_settings_conversion.cc
|
||||
@@ -190,11 +190,12 @@ bool PrintSettingsFromJobSettings(const base::Value& job_settings,
|
||||
|
||||
settings->set_dpi_xy(dpi_horizontal.value(), dpi_vertical.value());
|
||||
#endif
|
||||
+ if (!device_name->empty())
|
||||
+ settings->set_device_name(base::UTF8ToUTF16(*device_name));
|
||||
|
||||
settings->set_collate(collate.value());
|
||||
settings->set_copies(copies.value());
|
||||
settings->SetOrientation(landscape.value());
|
||||
- settings->set_device_name(base::UTF8ToUTF16(*device_name));
|
||||
settings->set_duplex_mode(static_cast<DuplexMode>(duplex_mode.value()));
|
||||
settings->set_color(static_cast<ColorModel>(color.value()));
|
||||
settings->set_scale_factor(static_cast<double>(scale_factor.value()) / 100.0);
|
||||
diff --git a/printing/printing_context.cc b/printing/printing_context.cc
|
||||
index 78e3c3b2e1bea0f3626838eab14267847a556470..b1c16e6eb1d0d9c0a8b700d9faf408d602f962ea 100644
|
||||
--- a/printing/printing_context.cc
|
||||
+++ b/printing/printing_context.cc
|
||||
@@ -77,8 +77,6 @@ PrintingContext::Result PrintingContext::UsePdfSettings() {
|
||||
|
||||
PrintingContext::Result PrintingContext::UpdatePrintSettings(
|
||||
base::Value job_settings) {
|
||||
- ResetSettings();
|
||||
-
|
||||
if (!PrintSettingsFromJobSettings(job_settings, &settings_)) {
|
||||
NOTREACHED();
|
||||
return OnError();
|
||||
diff --git a/printing/printing_context.h b/printing/printing_context.h
|
||||
index 9ccc1a6680bcedd452cade7f7531924ace7876cf..4e1c330c01a1d6d1ba702337f16d8f8a70cd76f5 100644
|
||||
--- a/printing/printing_context.h
|
||||
+++ b/printing/printing_context.h
|
||||
@@ -129,12 +129,12 @@ class PRINTING_EXPORT PrintingContext {
|
||||
|
||||
int job_id() const { return job_id_; }
|
||||
|
||||
- protected:
|
||||
- explicit PrintingContext(Delegate* delegate);
|
||||
-
|
||||
// Reinitializes the settings for object reuse.
|
||||
void ResetSettings();
|
||||
|
||||
+ protected:
|
||||
+ explicit PrintingContext(Delegate* delegate);
|
||||
+
|
||||
// Does bookkeeping when an error occurs.
|
||||
PrintingContext::Result OnError();
|
||||
|
||||
|
||||
@@ -52,10 +52,10 @@ Some alternatives to this patch:
|
||||
None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
|
||||
|
||||
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
|
||||
index e107dd9f5d264b17601a67edafe9bd61c4d767c3..85e6af67276684202fadd7a4ca4e58252f222c70 100644
|
||||
index 1b355b2404bca740edc422693c482ceae5d13b9d..93b5810ec10466625b11e7e1d19abfd78589786a 100644
|
||||
--- a/chrome/BUILD.gn
|
||||
+++ b/chrome/BUILD.gn
|
||||
@@ -1716,7 +1716,7 @@ if (is_chrome_branded && !is_android) {
|
||||
@@ -1717,7 +1717,7 @@ if (is_chrome_branded && !is_android) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ index e107dd9f5d264b17601a67edafe9bd61c4d767c3..85e6af67276684202fadd7a4ca4e5825
|
||||
chrome_paks("packed_resources") {
|
||||
if (is_mac) {
|
||||
output_dir = "$root_gen_dir/repack"
|
||||
@@ -1740,6 +1740,12 @@ if (!is_android) {
|
||||
@@ -1741,6 +1741,12 @@ if (!is_android) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 76de46a31174c27f11a097575c6dec7b5f675fa8..3f119362e22c14e63d2afafa79df46836c59ae81 100644
|
||||
index 02fb86dce91aab3385c9ee2acacf6a9a40cc1642..0a2cf06d6aa03dafc922912a2c4788bc43e00fae 100644
|
||||
--- a/content/renderer/render_thread_impl.cc
|
||||
+++ b/content/renderer/render_thread_impl.cc
|
||||
@@ -1506,7 +1506,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: ssl_security_state_tab_helper.patch
|
||||
Allows populating security tab info for devtools in Electron.
|
||||
|
||||
diff --git a/chrome/browser/ssl/security_state_tab_helper.cc b/chrome/browser/ssl/security_state_tab_helper.cc
|
||||
index 45e0f485363a282e2e0caf227c2a7fbc8309acee..a05e16eba687d34e0cbad8cdc6159156cea59abd 100644
|
||||
index f271b01fad91c169afb06795d9b8aa7207744139..6c3fcf193d5f47670c6642a5643b639dd7ed99a7 100644
|
||||
--- a/chrome/browser/ssl/security_state_tab_helper.cc
|
||||
+++ b/chrome/browser/ssl/security_state_tab_helper.cc
|
||||
@@ -13,14 +13,18 @@
|
||||
@@ -25,13 +25,13 @@ index 45e0f485363a282e2e0caf227c2a7fbc8309acee..a05e16eba687d34e0cbad8cdc6159156
|
||||
#include "components/omnibox/common/omnibox_features.h"
|
||||
#include "components/password_manager/core/browser/password_manager_metrics_util.h"
|
||||
+#endif
|
||||
#include "components/safe_browsing/buildflags.h"
|
||||
#include "components/security_state/content/content_utils.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/navigation_entry.h"
|
||||
@@ -43,8 +47,10 @@
|
||||
@@ -44,8 +48,10 @@
|
||||
#endif // defined(OS_CHROMEOS)
|
||||
|
||||
#if defined(FULL_SAFE_BROWSING)
|
||||
#if BUILDFLAG(FULL_SAFE_BROWSING)
|
||||
+#if 0
|
||||
#include "chrome/browser/safe_browsing/chrome_password_protection_service.h"
|
||||
#endif
|
||||
@@ -39,7 +39,7 @@ index 45e0f485363a282e2e0caf227c2a7fbc8309acee..a05e16eba687d34e0cbad8cdc6159156
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -64,8 +70,9 @@ void RecordSecurityLevel(
|
||||
@@ -65,8 +71,9 @@ void RecordSecurityLevel(
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -50,7 +50,7 @@ index 45e0f485363a282e2e0caf227c2a7fbc8309acee..a05e16eba687d34e0cbad8cdc6159156
|
||||
|
||||
SecurityStateTabHelper::SecurityStateTabHelper(
|
||||
content::WebContents* web_contents)
|
||||
@@ -153,6 +160,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
|
||||
@@ -154,6 +161,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
|
||||
web_contents()->GetController().GetVisibleEntry();
|
||||
if (!entry)
|
||||
return security_state::MALICIOUS_CONTENT_STATUS_NONE;
|
||||
@@ -58,7 +58,7 @@ index 45e0f485363a282e2e0caf227c2a7fbc8309acee..a05e16eba687d34e0cbad8cdc6159156
|
||||
safe_browsing::SafeBrowsingService* sb_service =
|
||||
g_browser_process->safe_browsing_service();
|
||||
if (!sb_service)
|
||||
@@ -219,6 +227,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
|
||||
@@ -220,6 +228,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@ index bfc62d1766686981ded5e62ad7da466d3afb9bab..5fa60ba975561626ae3ccecd9968278c
|
||||
// An empty URL is returned if the URL is not overriden.
|
||||
virtual GURL OverrideFlashEmbedWithHTML(const GURL& url);
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
|
||||
index a89a61d35a4b9cdde896f8a1d8acfa5c17baec02..4547b0146ae3d03844a5c73a3b4eed97fdbc89c1 100644
|
||||
index 379ca75ac50388ddb8338f2dabc78faaa68a8088..fe6d379868953918892712da387da1a134cdbd50 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.cc
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.cc
|
||||
@@ -914,6 +914,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
|
||||
@@ -947,6 +947,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
|
||||
WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread();
|
||||
}
|
||||
|
||||
@@ -38,10 +38,10 @@ index a89a61d35a4b9cdde896f8a1d8acfa5c17baec02..4547b0146ae3d03844a5c73a3b4eed97
|
||||
const v8::Local<v8::Context>& worker) {
|
||||
GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread(
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h
|
||||
index f1bc21b53606d4133440c72c9dea6de1a3a9544f..2c58ea10e04bb1ee337f12a2fcc4db77a071510d 100644
|
||||
index a58c51ee026ead91af050541a8663dc070388e45..01f170553ac95dfeb34f91290c39845ce349b1c8 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.h
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.h
|
||||
@@ -186,6 +186,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
@@ -191,6 +191,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
void DidStartWorkerThread() override;
|
||||
void WillStopWorkerThread() override;
|
||||
void WorkerContextCreated(const v8::Local<v8::Context>& worker) override;
|
||||
@@ -50,10 +50,10 @@ index f1bc21b53606d4133440c72c9dea6de1a3a9544f..2c58ea10e04bb1ee337f12a2fcc4db77
|
||||
const blink::WebString& header_name) override;
|
||||
|
||||
diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h
|
||||
index 9ae02783be95b1748b931c2f75eb79b038947b7f..eb99295295613fe044b27c401a4b4a77b084255d 100644
|
||||
index 049aac2befd99a746fbe667a69fd1873333fcdba..f089b63da4b1150151877edb257d959401b1319c 100644
|
||||
--- a/third_party/blink/public/platform/platform.h
|
||||
+++ b/third_party/blink/public/platform/platform.h
|
||||
@@ -636,6 +636,7 @@ class BLINK_PLATFORM_EXPORT Platform {
|
||||
@@ -656,6 +656,7 @@ class BLINK_PLATFORM_EXPORT Platform {
|
||||
virtual void DidStartWorkerThread() {}
|
||||
virtual void WillStopWorkerThread() {}
|
||||
virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}
|
||||
|
||||
@@ -4,7 +4,6 @@ refactor_alter_child_process_fork_to_use_execute_script_with.patch
|
||||
feat_add_uv_loop_watcher_queue_code.patch
|
||||
feat_initialize_asar_support.patch
|
||||
expose_get_builtin_module_function.patch
|
||||
fix_expose_traceeventhelper.patch
|
||||
fix_build_and_expose_inspector_agent.patch
|
||||
fix_expose_internalcallbackscope.patch
|
||||
build_add_gn_build_files.patch
|
||||
@@ -29,15 +28,13 @@ build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.pa
|
||||
refactor_allow_embedder_overriding_of_internal_fs_calls.patch
|
||||
chore_add_ability_to_prevent_warn_non_context-aware_native_modules.patch
|
||||
fsevents_fix_file_event_reporting.patch
|
||||
src_read_break_node_first_line_from_the_inspect_options.patch
|
||||
chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch
|
||||
inherit_electron_crashpad_pipe_name_in_child_process.patch
|
||||
fixme_revert_crypto_add_support_for_rsa-pss_keys.patch
|
||||
chore_re-add_compileandcall_this_should_be_added_as_a_helper_in.patch
|
||||
src_add_missing_option_parser_template_for_the_debugoptionsparser.patch
|
||||
src_expose_maybeinitializecontext_to_allow_existing_contexts.patch
|
||||
fix_extern_the_nativemoduleenv_and_options_parser_for_debug_builds.patch
|
||||
chore_read_nobrowserglobals_from_global_not_process.patch
|
||||
chore_split_createenvironment_into_createenvironment_and.patch
|
||||
chore_handle_default_configuration_not_being_set_in_the_electron_env.patch
|
||||
fix_set_uptime_offset_in_correct_init_method.patch
|
||||
revert_crypto_add_outputlength_option_to_crypto_createhash.patch
|
||||
|
||||
@@ -882,10 +882,10 @@ index 0000000000000000000000000000000000000000..f13b471d17128468bed06e66bd03a2ea
|
||||
+}
|
||||
diff --git a/filenames.json b/filenames.json
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..edb0b215088118f567c5ad5e5969d1eb5ef661a3
|
||||
index 0000000000000000000000000000000000000000..be8613d11f9f5b1c6604257edf707792f2119fcb
|
||||
--- /dev/null
|
||||
+++ b/filenames.json
|
||||
@@ -0,0 +1,443 @@
|
||||
@@ -0,0 +1,442 @@
|
||||
+// This file is automatically generated by generate_gn_filenames_json.py
|
||||
+// DO NOT EDIT
|
||||
+{
|
||||
@@ -1099,7 +1099,7 @@ index 0000000000000000000000000000000000000000..edb0b215088118f567c5ad5e5969d1eb
|
||||
+ "lib/internal/process/report.js",
|
||||
+ "lib/internal/process/task_queues.js",
|
||||
+ "lib/internal/querystring.js",
|
||||
+ "lib/internal/readline.js",
|
||||
+ "lib/internal/readline/utils.js",
|
||||
+ "lib/internal/repl.js",
|
||||
+ "lib/internal/repl/await.js",
|
||||
+ "lib/internal/repl/history.js",
|
||||
@@ -1152,7 +1152,6 @@ index 0000000000000000000000000000000000000000..edb0b215088118f567c5ad5e5969d1eb
|
||||
+ "deps/node-inspect/lib/internal/inspect_repl.js",
|
||||
+ "deps/acorn/acorn/dist/acorn.js",
|
||||
+ "deps/acorn/acorn-walk/dist/walk.js",
|
||||
+ "deps/acorn-plugins/acorn-bigint/index.js",
|
||||
+ "deps/acorn-plugins/acorn-class-fields/index.js",
|
||||
+ "deps/acorn-plugins/acorn-numeric-separator/index.js",
|
||||
+ "deps/acorn-plugins/acorn-private-class-elements/index.js",
|
||||
@@ -1535,7 +1534,7 @@ index 0000000000000000000000000000000000000000..f3c5c798c0aefcb8cf9b1570a7b4817c
|
||||
+ args = rebase_path(inputs + outputs, root_build_dir)
|
||||
+}
|
||||
diff --git a/src/node_version.h b/src/node_version.h
|
||||
index 46f92e1b83847f6078c46c8ddd0efaae859cc06d..e484042b7b68e7bb5b2e6431bc76bdeea31decaf 100644
|
||||
index 2d105483ba10533d992de3265121e6ab9edce2ed..8a8fd5f7fad4a69b65e06d67225a398385d3bbbf 100644
|
||||
--- a/src/node_version.h
|
||||
+++ b/src/node_version.h
|
||||
@@ -89,7 +89,10 @@
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: chore: add ability to prevent / warn non context-aware native modules
|
||||
being loaded
|
||||
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index e60f76372a324b83cd054c830fc2d6f9ab2dcae8..63e71fc1fc2b0e95a85f38b58b34eeb290d8f09d 100644
|
||||
index 2dd6bdb75f02e2ccb07129996d16df99c0c4ccf2..ecb845803776f5ff6e7eec712ec7a5ebea2e8d0a 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -849,6 +849,15 @@ class Environment : public MemoryRetainer {
|
||||
@@ -884,6 +884,15 @@ class Environment : public MemoryRetainer {
|
||||
uint64_t thread_id = kNoThreadId);
|
||||
~Environment();
|
||||
|
||||
@@ -24,7 +24,7 @@ index e60f76372a324b83cd054c830fc2d6f9ab2dcae8..63e71fc1fc2b0e95a85f38b58b34eeb2
|
||||
void InitializeLibuv(bool start_profiler_idle_notifier);
|
||||
inline const std::vector<std::string>& exec_argv();
|
||||
inline const std::vector<std::string>& argv();
|
||||
@@ -1197,6 +1206,9 @@ class Environment : public MemoryRetainer {
|
||||
@@ -1234,6 +1243,9 @@ class Environment : public MemoryRetainer {
|
||||
inline void ThrowError(v8::Local<v8::Value> (*fun)(v8::Local<v8::String>),
|
||||
const char* errmsg);
|
||||
|
||||
@@ -35,7 +35,7 @@ index e60f76372a324b83cd054c830fc2d6f9ab2dcae8..63e71fc1fc2b0e95a85f38b58b34eeb2
|
||||
v8::Isolate* const isolate_;
|
||||
IsolateData* const isolate_data_;
|
||||
diff --git a/src/node_binding.cc b/src/node_binding.cc
|
||||
index 99c2406036e1874af253c61239e7736867813af8..117bc2891118e67ca7b10a33ba7e1fbebc973dbb 100644
|
||||
index c51a892e1bcd3df6ea8af952c8200975c7f4ac7e..9a4a7780f4ac1bcc0855cc9e3eed904d5a0b4254 100644
|
||||
--- a/src/node_binding.cc
|
||||
+++ b/src/node_binding.cc
|
||||
@@ -2,6 +2,7 @@
|
||||
@@ -46,7 +46,7 @@ index 99c2406036e1874af253c61239e7736867813af8..117bc2891118e67ca7b10a33ba7e1fbe
|
||||
#include "util.h"
|
||||
|
||||
#if HAVE_OPENSSL
|
||||
@@ -470,6 +471,13 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -463,6 +464,13 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
|
||||
}
|
||||
|
||||
if (mp != nullptr) {
|
||||
|
||||
@@ -10,10 +10,10 @@ The default behavior of node is to `path.resolve(firstArg)` to figure out what J
|
||||
Similar to the above, the loader uses `process.argv[1]` to figure out when to break for `--inspect-brk` this updates the logic to use an Electron provided `process._firstFileName`
|
||||
|
||||
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
|
||||
index a998b095fb067ab6ca35cc276ac6a9a7c38dcf30..68ca0cefa4cf663cded9155bc4f2f226d807b577 100644
|
||||
index 072e614fca05197fb2b259914711033981f6e2f2..dd7b6496e23efe0b73c6c9919c3780abeecdcec3 100644
|
||||
--- a/lib/internal/bootstrap/pre_execution.js
|
||||
+++ b/lib/internal/bootstrap/pre_execution.js
|
||||
@@ -70,8 +70,10 @@ function patchProcessObject(expandArgv1) {
|
||||
@@ -71,8 +71,10 @@ function patchProcessObject(expandArgv1) {
|
||||
|
||||
if (expandArgv1 && process.argv[1] && !process.argv[1].startsWith('-')) {
|
||||
// Expand process.argv[1] into a full path.
|
||||
@@ -25,10 +25,10 @@ index a998b095fb067ab6ca35cc276ac6a9a7c38dcf30..68ca0cefa4cf663cded9155bc4f2f226
|
||||
|
||||
// TODO(joyeecheung): most of these should be deprecated and removed,
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index c975804d847eea5a8d759f79121aa4da61e88dc4..506ce67d553f4e755d56d386666c19f27d1ab694 100644
|
||||
index 2a7ffbff213f23536b94664c3ecffa18eb812849..6e73d0b57a11620b1fcec8b9b716b66673438864 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -753,6 +753,13 @@ Module.prototype._compile = function(content, filename) {
|
||||
@@ -845,6 +845,13 @@ Module.prototype._compile = function(content, filename) {
|
||||
if (getOptionValue('--inspect-brk') && process._eval == null) {
|
||||
if (!resolvedArgv) {
|
||||
// We enter the repl if we're not given a filename argument.
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: chore: handle default_configuration not being set in the electron env
|
||||
|
||||
|
||||
diff --git a/test/common/index.js b/test/common/index.js
|
||||
index bbb74e2b988517bddc610084a9ee959eda6912e5..c8487ad94c9f4a9603cee0f2c368a4e119f92bcd 100644
|
||||
index 13604d06e14a3612e4d161ebbdda10912a46d3b0..0f1398ed665b66d4fe7778a33ceab5176c086ff4 100644
|
||||
--- a/test/common/index.js
|
||||
+++ b/test/common/index.js
|
||||
@@ -118,7 +118,7 @@ const enoughTestCpu = Array.isArray(cpus) &&
|
||||
|
||||
@@ -8,10 +8,10 @@ This allows us to run operations on a created but not yet bootstrapped
|
||||
environment such as setting up an InspectorAgent
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index 5011774be2c5fee910079790feae747fa1785b87..d5cb74025959ad32a6d2e6a914bf99a2b3d7946f 100644
|
||||
index 443f49320b2e6720f932fcfcefdbe6e539594964..4d79af9ec2a7b476c5f86f3882f4fb63afafc53e 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -269,7 +269,8 @@ Environment* CreateEnvironment(IsolateData* isolate_data,
|
||||
@@ -263,7 +263,8 @@ Environment* CreateEnvironment(IsolateData* isolate_data,
|
||||
int argc,
|
||||
const char* const* argv,
|
||||
int exec_argc,
|
||||
@@ -21,7 +21,7 @@ index 5011774be2c5fee910079790feae747fa1785b87..d5cb74025959ad32a6d2e6a914bf99a2
|
||||
Isolate* isolate = context->GetIsolate();
|
||||
HandleScope handle_scope(isolate);
|
||||
Context::Scope context_scope(context);
|
||||
@@ -287,9 +288,16 @@ Environment* CreateEnvironment(IsolateData* isolate_data,
|
||||
@@ -281,9 +282,16 @@ Environment* CreateEnvironment(IsolateData* isolate_data,
|
||||
Environment::kOwnsProcessState |
|
||||
Environment::kOwnsInspector));
|
||||
env->InitializeLibuv(per_process::v8_is_profiling);
|
||||
@@ -39,7 +39,7 @@ index 5011774be2c5fee910079790feae747fa1785b87..d5cb74025959ad32a6d2e6a914bf99a2
|
||||
|
||||
std::vector<Local<String>> parameters = {
|
||||
env->require_string(),
|
||||
@@ -302,9 +310,10 @@ Environment* CreateEnvironment(IsolateData* isolate_data,
|
||||
@@ -296,9 +304,10 @@ Environment* CreateEnvironment(IsolateData* isolate_data,
|
||||
if (ExecuteBootstrapper(
|
||||
env, "internal/bootstrap/environment", ¶meters, &arguments)
|
||||
.IsEmpty()) {
|
||||
@@ -53,7 +53,7 @@ index 5011774be2c5fee910079790feae747fa1785b87..d5cb74025959ad32a6d2e6a914bf99a2
|
||||
|
||||
void FreeEnvironment(Environment* env) {
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index de007ed97a52c17cff8b8917d25f2383d5bbae6a..cdf96c283dbfb4c763d0b0e21497fc289e28741a 100644
|
||||
index c51fb1a6a6e497a091e2ba0b147e3d7b6a4d685c..211f00cca65eeba317a03af36411a19a6befae18 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -330,7 +330,9 @@ NODE_EXTERN Environment* CreateEnvironment(IsolateData* isolate_data,
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: export Environment::kNodeContextTagPtr
|
||||
|
||||
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index 3d955297920a98fc4f567cf8a12a6cc2267ed402..e60f76372a324b83cd054c830fc2d6f9ab2dcae8 100644
|
||||
index 82ed066f9cde4851fa3375d0faffe4bfcf2bf411..2dd6bdb75f02e2ccb07129996d16df99c0c4ccf2 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -1266,7 +1266,7 @@ class Environment : public MemoryRetainer {
|
||||
@@ -1304,7 +1304,7 @@ class Environment : public MemoryRetainer {
|
||||
uint64_t thread_id_;
|
||||
std::unordered_set<worker::Worker*> sub_worker_contexts_;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ Environment on the V8 context of blink, so no new V8 context is created.
|
||||
As a result, a renderer process may have multiple Node Environments in it.
|
||||
|
||||
diff --git a/src/env.cc b/src/env.cc
|
||||
index df59eaaa94928fc26d8636bcbabe70c12c83fa04..a10b3db67872ebb24f10ac3bc6e43356a59c2644 100644
|
||||
index 257bf78519f32d690ea9cd5b9e21d3d863801c33..89e940cdc478df8a3be7738106a1c739542a7430 100644
|
||||
--- a/src/env.cc
|
||||
+++ b/src/env.cc
|
||||
@@ -383,6 +383,12 @@ Environment::Environment(IsolateData* isolate_data,
|
||||
@@ -39,9 +39,9 @@ index df59eaaa94928fc26d8636bcbabe70c12c83fa04..a10b3db67872ebb24f10ac3bc6e43356
|
||||
+ }
|
||||
}
|
||||
|
||||
CompileFnEntry::CompileFnEntry(Environment* env, uint32_t id)
|
||||
Environment::~Environment() {
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index c074ed0dfe1b47611fdcf40537e5e70a2d95f58b..00fb0ed1c9cfbc86a7ec7d1d0ce7789b68d6a1e3 100644
|
||||
index 572490730da5854ad1a79670564ad9705c86747b..9b43d7676e5e106318b58bfe443651cc49780068 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -27,6 +27,7 @@
|
||||
@@ -52,7 +52,7 @@ index c074ed0dfe1b47611fdcf40537e5e70a2d95f58b..00fb0ed1c9cfbc86a7ec7d1d0ce7789b
|
||||
#include "node_internals.h"
|
||||
#include "node_main_instance.h"
|
||||
#include "node_metadata.h"
|
||||
@@ -134,6 +135,9 @@ using v8::Undefined;
|
||||
@@ -130,6 +131,9 @@ using v8::Undefined;
|
||||
using v8::V8;
|
||||
using v8::Value;
|
||||
|
||||
@@ -62,7 +62,7 @@ index c074ed0dfe1b47611fdcf40537e5e70a2d95f58b..00fb0ed1c9cfbc86a7ec7d1d0ce7789b
|
||||
namespace per_process {
|
||||
|
||||
// node_revert.h
|
||||
@@ -356,6 +360,13 @@ MaybeLocal<Value> Environment::RunBootstrapping() {
|
||||
@@ -352,6 +356,13 @@ MaybeLocal<Value> Environment::RunBootstrapping() {
|
||||
|
||||
CHECK(!has_run_bootstrapping_code());
|
||||
|
||||
@@ -76,7 +76,7 @@ index c074ed0dfe1b47611fdcf40537e5e70a2d95f58b..00fb0ed1c9cfbc86a7ec7d1d0ce7789b
|
||||
if (BootstrapInternalLoaders().IsEmpty()) {
|
||||
return MaybeLocal<Value>();
|
||||
}
|
||||
@@ -736,7 +747,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
@@ -741,7 +752,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
binding::RegisterBuiltinModules();
|
||||
|
||||
// Make inherited handles noninheritable.
|
||||
@@ -87,7 +87,7 @@ index c074ed0dfe1b47611fdcf40537e5e70a2d95f58b..00fb0ed1c9cfbc86a7ec7d1d0ce7789b
|
||||
|
||||
#ifdef NODE_REPORT
|
||||
// Cache the original command line to be
|
||||
@@ -838,6 +851,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
@@ -843,6 +856,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -97,7 +97,7 @@ index c074ed0dfe1b47611fdcf40537e5e70a2d95f58b..00fb0ed1c9cfbc86a7ec7d1d0ce7789b
|
||||
const int exit_code = ProcessGlobalArgs(argv, exec_argv, errors, false);
|
||||
if (exit_code != 0) return exit_code;
|
||||
|
||||
@@ -860,6 +876,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
@@ -865,6 +881,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
per_process::metadata.versions.InitializeIntlVersions();
|
||||
#endif
|
||||
|
||||
@@ -107,7 +107,7 @@ index c074ed0dfe1b47611fdcf40537e5e70a2d95f58b..00fb0ed1c9cfbc86a7ec7d1d0ce7789b
|
||||
|
||||
// We should set node_is_initialized here instead of in node::Start,
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 5098dc9c7e77df62b90e4332c6695dfb48b430a0..9df33dfb47e591728c9502fea8152e4344b2b275 100644
|
||||
index f78c76023bb667031b46e5fac80028bc5fd5374c..42ad1a5aba3fb57e27a07689768fd0dc8dd37d6d 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -203,6 +203,9 @@ namespace node {
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: feat: initialize asar support
|
||||
|
||||
|
||||
diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js
|
||||
index 7a98e4c96c87d4738829aadf1969ee90eda3876a..bf63de07613b4d19d95607f404139e587319f11d 100644
|
||||
index 2889df4812bb031f1a0debe1eb0b75bd6c846407..0b3b92b33490fe754788a94dedce7533de528acf 100644
|
||||
--- a/lib/internal/bootstrap/loaders.js
|
||||
+++ b/lib/internal/bootstrap/loaders.js
|
||||
@@ -189,6 +189,8 @@ function nativeModuleRequire(id) {
|
||||
@@ -18,10 +18,10 @@ index 7a98e4c96c87d4738829aadf1969ee90eda3876a..bf63de07613b4d19d95607f404139e58
|
||||
return NativeModule.map.has(id);
|
||||
};
|
||||
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
|
||||
index bbb0786dcd20ec741892b02f96b3c37fec8f1de0..a998b095fb067ab6ca35cc276ac6a9a7c38dcf30 100644
|
||||
index 104ebaff320573f3f517d0839eef66a186080da9..072e614fca05197fb2b259914711033981f6e2f2 100644
|
||||
--- a/lib/internal/bootstrap/pre_execution.js
|
||||
+++ b/lib/internal/bootstrap/pre_execution.js
|
||||
@@ -51,6 +51,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
|
||||
@@ -52,6 +52,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
|
||||
initializeCJSLoader();
|
||||
initializeESMLoader();
|
||||
loadPreloadModules();
|
||||
@@ -29,7 +29,7 @@ index bbb0786dcd20ec741892b02f96b3c37fec8f1de0..a998b095fb067ab6ca35cc276ac6a9a7
|
||||
}
|
||||
|
||||
function patchProcessObject(expandArgv1) {
|
||||
@@ -393,6 +394,10 @@ function loadPreloadModules() {
|
||||
@@ -420,6 +421,10 @@ function loadPreloadModules() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ common.gypi is a file that's included in the node header bundle, despite
|
||||
the fact that we do not build node with gyp.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index c106549f67c264b27144faa9c13b1a4cf31db9cb..c0538bad7a0323d609365521ee2feb5a1f22e967 100644
|
||||
index b86e5e05d7df9ad472f16735448a53f433620eef..f07e65f719a1a5939997dfcae7bc787ee6391f4d 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -77,6 +77,22 @@
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: fix: build and expose inspector agent
|
||||
Node inspector initialization happens in a different start-up function in node.cc, which we don't call in Electron. This allows for us to use the inspector agent in electron/atom/browser/node_debugger.cc
|
||||
|
||||
diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc
|
||||
index ceba6a59a83e4d9ec6cc42305cd0715ffbe61489..a2a714e39db999f4293adf8064f7f53b546850e6 100644
|
||||
index 2965483dea6244e7123c08c104f399fc023a84e0..b6624300e96daf6041a296fdc1ceeaf579e215cd 100644
|
||||
--- a/src/inspector_agent.cc
|
||||
+++ b/src/inspector_agent.cc
|
||||
@@ -217,7 +217,7 @@ const int CONTEXT_GROUP_ID = 1;
|
||||
@@ -18,7 +18,7 @@ index ceba6a59a83e4d9ec6cc42305cd0715ffbe61489..a2a714e39db999f4293adf8064f7f53b
|
||||
return result.str();
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ class NodeInspectorClient : public V8InspectorClient {
|
||||
@@ -465,7 +465,7 @@ class NodeInspectorClient : public V8InspectorClient {
|
||||
client_ = V8Inspector::create(env->isolate(), this);
|
||||
// TODO(bnoordhuis) Make name configurable from src/node.cc.
|
||||
std::string name =
|
||||
@@ -28,7 +28,7 @@ index ceba6a59a83e4d9ec6cc42305cd0715ffbe61489..a2a714e39db999f4293adf8064f7f53b
|
||||
info.is_default = true;
|
||||
contextCreated(env->context(), info);
|
||||
diff --git a/src/inspector_agent.h b/src/inspector_agent.h
|
||||
index 5447a68485c2282f0a38821bd5858824275311dd..0722a0fde38ade1d621b020bba0e2680d132fa71 100644
|
||||
index 4fb544f85bd1453d0705088dfb5511ae32bacad2..ac9352e3fa953e2f4ac0a032c2aacd7353c2cf71 100644
|
||||
--- a/src/inspector_agent.h
|
||||
+++ b/src/inspector_agent.h
|
||||
@@ -6,7 +6,9 @@
|
||||
@@ -51,7 +51,7 @@ index 5447a68485c2282f0a38821bd5858824275311dd..0722a0fde38ade1d621b020bba0e2680
|
||||
explicit Agent(node::Environment* env);
|
||||
~Agent();
|
||||
diff --git a/src/inspector_io.cc b/src/inspector_io.cc
|
||||
index 91384ca949c2f13e0264811cd76e44743e695bd4..9edefd91be0effbad162ced398558785ad655cf1 100644
|
||||
index 76e481c9530d955a841a19d91b34f03bebaaecfb..8b61d73b8d7cc5d84a61b4a683a28ab1865ad71b 100644
|
||||
--- a/src/inspector_io.cc
|
||||
+++ b/src/inspector_io.cc
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
@@ -15,7 +15,7 @@ By putting the definitions of constructors into the implementation file,
|
||||
we can avoid this problem.
|
||||
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index 11c910bbd17c8b8e345862e11a24aba7822c31b6..9b9b9324d681d8a55418c7a43a071a6f978750e7 100644
|
||||
index f4dc3d7df5a33ce92ca52e901283db5aa9f143b4..b9d6108c5db800465e6c7156ad1c28002c33261b 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -26,6 +26,12 @@ Mutex cli_options_mutex;
|
||||
@@ -32,7 +32,7 @@ index 11c910bbd17c8b8e345862e11a24aba7822c31b6..9b9b9324d681d8a55418c7a43a071a6f
|
||||
#if !NODE_USE_V8_PLATFORM
|
||||
if (inspector_enabled) {
|
||||
diff --git a/src/node_options.h b/src/node_options.h
|
||||
index 35daba3291c8358a44f9fca53df34b35c5423d15..b8959745f5bd66bb19f3f1d9b1bf45e8a6ebd4f7 100644
|
||||
index 5fb23cfda7aebca507174555b78c9a73e837dda0..ce86827024126c6b0d8462c811360057c298ec5b 100644
|
||||
--- a/src/node_options.h
|
||||
+++ b/src/node_options.h
|
||||
@@ -61,11 +61,11 @@ struct InspectPublishUid {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: fix: export DebugOptions
|
||||
|
||||
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index 021fc5d70b250b39ac76028b5d384608d51f7248..11c910bbd17c8b8e345862e11a24aba7822c31b6 100644
|
||||
index e2a39626b69fd3380febc258fb25efc0cea2a08e..f4dc3d7df5a33ce92ca52e901283db5aa9f143b4 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -202,11 +202,6 @@ void EnvironmentOptions::CheckOptions(std::vector<std::string>* errors) {
|
||||
@@ -204,11 +204,6 @@ void EnvironmentOptions::CheckOptions(std::vector<std::string>* errors) {
|
||||
|
||||
namespace options_parser {
|
||||
|
||||
@@ -21,7 +21,7 @@ index 021fc5d70b250b39ac76028b5d384608d51f7248..11c910bbd17c8b8e345862e11a24aba7
|
||||
public:
|
||||
EnvironmentOptionsParser();
|
||||
diff --git a/src/node_options.h b/src/node_options.h
|
||||
index 34c54511e1bb8bba201994802f7fd53c4217cece..35daba3291c8358a44f9fca53df34b35c5423d15 100644
|
||||
index dbd85b2d584be57619fc5c8d019140f67514f427..5fb23cfda7aebca507174555b78c9a73e837dda0 100644
|
||||
--- a/src/node_options.h
|
||||
+++ b/src/node_options.h
|
||||
@@ -59,7 +59,7 @@ struct InspectPublishUid {
|
||||
@@ -33,7 +33,7 @@ index 34c54511e1bb8bba201994802f7fd53c4217cece..35daba3291c8358a44f9fca53df34b35
|
||||
public:
|
||||
DebugOptions() = default;
|
||||
DebugOptions(const DebugOptions&) = default;
|
||||
@@ -236,7 +236,7 @@ class PerProcessOptions : public Options {
|
||||
@@ -240,7 +240,7 @@ class PerProcessOptions : public Options {
|
||||
|
||||
namespace options_parser {
|
||||
|
||||
@@ -42,7 +42,7 @@ index 34c54511e1bb8bba201994802f7fd53c4217cece..35daba3291c8358a44f9fca53df34b35
|
||||
std::vector<std::string>* errors);
|
||||
void GetOptions(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
|
||||
@@ -429,6 +429,11 @@ class OptionsParser {
|
||||
@@ -433,6 +433,11 @@ class OptionsParser {
|
||||
friend void GetOptions(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: fix: Export node::Abort and Assert
|
||||
|
||||
|
||||
diff --git a/src/node_errors.cc b/src/node_errors.cc
|
||||
index 298d84b4f362b3b9e9a0e604c7635ac77eaf8925..e0c5eaacffbd1ac7aaa104dd15f5e5de4ed5240b 100644
|
||||
index 0214521144c607c084cabc941f006780bcd3cfa2..ea4113aa3b2b431c6d9bbfbf4b20f8ff59cd9182 100644
|
||||
--- a/src/node_errors.cc
|
||||
+++ b/src/node_errors.cc
|
||||
@@ -242,13 +242,13 @@ void AppendExceptionLine(Environment* env,
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Mon, 30 Jul 2018 13:08:34 -0700
|
||||
Subject: fix: expose TraceEventHelper
|
||||
|
||||
Node required tracing controller to be initialized, otherwise a crash would occur. Changed in concert with https://github.com/electron/electron/commit/0e5b6f93000e4718c9e35332ddbd0f6b76cdd585\#diff-0cdfa12fff513e022fac830c6af9c19a
|
||||
|
||||
diff --git a/src/tracing/trace_event.h b/src/tracing/trace_event.h
|
||||
index 590cb592fc054f90ffc85052985087db6c3c3463..4a398106d77e5e0f7c16448fa952c637833cfede 100644
|
||||
--- a/src/tracing/trace_event.h
|
||||
+++ b/src/tracing/trace_event.h
|
||||
@@ -310,7 +310,7 @@ const int kZeroNumArgs = 0;
|
||||
const decltype(nullptr) kGlobalScope = nullptr;
|
||||
const uint64_t kNoId = 0;
|
||||
|
||||
-class TraceEventHelper {
|
||||
+class NODE_EXTERN TraceEventHelper {
|
||||
public:
|
||||
static TracingController* GetTracingController();
|
||||
static Agent* GetAgent();
|
||||
@@ -5,10 +5,10 @@ Subject: fix: expose tracing::Agent and use tracing::TracingController instead
|
||||
of v8::TracingController
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index 8c1f5aaff2a5e4bbe7b534e0b130b1b50cad1c15..bfd279aa7e7cd4d50b6cffe75d6f8e41c0213acb 100644
|
||||
index ac1e513967310aefa50100843c643c788ab5157c..35e8666ef771c56a1bcd441c99d4483a0d3e90bf 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -320,6 +320,10 @@ MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() {
|
||||
@@ -314,6 +314,10 @@ MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() {
|
||||
return per_process::v8_platform.Platform();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ index 8c1f5aaff2a5e4bbe7b534e0b130b1b50cad1c15..bfd279aa7e7cd4d50b6cffe75d6f8e41
|
||||
int thread_pool_size,
|
||||
node::tracing::TracingController* tracing_controller) {
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 9df33dfb47e591728c9502fea8152e4344b2b275..dca89e212c89df19d0b97d748e3649392fec000c 100644
|
||||
index 42ad1a5aba3fb57e27a07689768fd0dc8dd37d6d..a2b47d1cf984ec36994b477b371cdf262191ab9c 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -108,6 +108,7 @@ namespace node {
|
||||
|
||||
@@ -18,7 +18,7 @@ index b91a5059cd1f19d87e5876c372f3ded60681a5df..f81cf8dfb892a8ddd9084c5d9477b178
|
||||
static void Initialize(v8::Local<v8::Object> target,
|
||||
v8::Local<v8::Value> unused,
|
||||
diff --git a/src/node_options.h b/src/node_options.h
|
||||
index b8959745f5bd66bb19f3f1d9b1bf45e8a6ebd4f7..5ef8476387e71d92ec7936959f8cc8a211490f1b 100644
|
||||
index ce86827024126c6b0d8462c811360057c298ec5b..d53307f9589d4487c220526b8e49b6c7fbd29daf 100644
|
||||
--- a/src/node_options.h
|
||||
+++ b/src/node_options.h
|
||||
@@ -44,7 +44,7 @@ class HostPort {
|
||||
@@ -30,7 +30,7 @@ index b8959745f5bd66bb19f3f1d9b1bf45e8a6ebd4f7..5ef8476387e71d92ec7936959f8cc8a2
|
||||
public:
|
||||
virtual void CheckOptions(std::vector<std::string>* errors) {}
|
||||
virtual ~Options() = default;
|
||||
@@ -436,7 +436,7 @@ class NODE_EXTERN DebugOptionsParser : public OptionsParser<DebugOptions> {
|
||||
@@ -440,7 +440,7 @@ class NODE_EXTERN DebugOptionsParser : public OptionsParser<DebugOptions> {
|
||||
|
||||
using StringVector = std::vector<std::string>;
|
||||
template <class OptionsType, class = Options>
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: fix: key gen APIs are not available in BoringSSL
|
||||
This will make Node's key pair generation APIs fail.
|
||||
|
||||
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
|
||||
index 300d2b92d7040c831b3178202a725df15191407d..5622ae8a367b017aa4d8a7e6e5892b5caa9bbec3 100644
|
||||
index bca482cc9724fef680196a192a6bbd7b4d2e4fde..1cc2372fe2e385e9a9db27e38f0da61d62de2e81 100644
|
||||
--- a/src/node_crypto.cc
|
||||
+++ b/src/node_crypto.cc
|
||||
@@ -290,24 +290,14 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj,
|
||||
@@ -62,7 +62,7 @@ index 300d2b92d7040c831b3178202a725df15191407d..5622ae8a367b017aa4d8a7e6e5892b5c
|
||||
default:
|
||||
return Undefined(env()->isolate());
|
||||
}
|
||||
@@ -6194,6 +6190,8 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
@@ -6240,6 +6236,8 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0)
|
||||
return nullptr;
|
||||
|
||||
@@ -71,7 +71,7 @@ index 300d2b92d7040c831b3178202a725df15191407d..5622ae8a367b017aa4d8a7e6e5892b5c
|
||||
if (EVP_PKEY_CTX_set_dsa_paramgen_bits(param_ctx.get(), modulus_bits_) <= 0)
|
||||
return nullptr;
|
||||
|
||||
@@ -6213,6 +6211,8 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
@@ -6259,6 +6257,8 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
|
||||
EVPKeyCtxPointer key_ctx(EVP_PKEY_CTX_new(params.get(), nullptr));
|
||||
return key_ctx;
|
||||
@@ -80,7 +80,7 @@ index 300d2b92d7040c831b3178202a725df15191407d..5622ae8a367b017aa4d8a7e6e5892b5c
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -6904,9 +6904,12 @@ void Initialize(Local<Object> target,
|
||||
@@ -6950,9 +6950,12 @@ void Initialize(Local<Object> target,
|
||||
env->SetMethod(target, "generateKeyPairEC", GenerateKeyPairEC);
|
||||
env->SetMethod(target, "generateKeyPairNid", GenerateKeyPairNid);
|
||||
NODE_DEFINE_CONSTANT(target, EVP_PKEY_ED25519);
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Micha Hanselmann <deermichel@github.com>
|
||||
Date: Wed, 24 Jul 2019 11:44:25 -0700
|
||||
Subject: fix: set uptime offset in correct init method
|
||||
|
||||
This patch can be removed after 'https://github.com/nodejs/node/pull/28849' landed here.
|
||||
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index 707579c8254903f5c587fa42711eb5d0184b4112..64f46faa36a7b52d86b257adad6c54b93b894262 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -743,6 +743,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
// Make sure InitializeNodeWithArgs() is called only once.
|
||||
CHECK(!init_called.exchange(true));
|
||||
|
||||
+ // Initialize node_start_time to get relative uptime.
|
||||
+ per_process::node_start_time = uv_hrtime();
|
||||
+
|
||||
// Register built-in modules
|
||||
binding::RegisterBuiltinModules();
|
||||
|
||||
@@ -929,7 +932,6 @@ void Init(int* argc,
|
||||
InitializationResult InitializeOncePerProcess(int argc, char** argv) {
|
||||
atexit(ResetStdio);
|
||||
PlatformInit();
|
||||
- per_process::node_start_time = uv_hrtime();
|
||||
|
||||
CHECK_GT(argc, 0);
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: fix: use bssl BN_bn2bin_padded for ossl's BN_bn2binpad
|
||||
Also note that BN_bn2bin_padded returns 1 on success instead of size
|
||||
|
||||
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
|
||||
index 590c6d1c374c086e128580d6160ccbd71a7ef227..4933bf7f1bd2cd5e4293e52a241fcfd5fda6b779 100644
|
||||
index 91e62f41b3db02bac516e6e91ffb77d5476fb9ad..dd78a59742fc05e938ba2397d3701b2ac8ccfc23 100644
|
||||
--- a/src/node_crypto.cc
|
||||
+++ b/src/node_crypto.cc
|
||||
@@ -5408,9 +5408,9 @@ void DiffieHellman::GenerateKeys(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -5453,9 +5453,9 @@ void DiffieHellman::GenerateKeys(const FunctionCallbackInfo<Value>& args) {
|
||||
const int size = BN_num_bytes(pub_key);
|
||||
CHECK_GE(size, 0);
|
||||
AllocatedBuffer data = env->AllocateManaged(size);
|
||||
@@ -22,7 +22,7 @@ index 590c6d1c374c086e128580d6160ccbd71a7ef227..4933bf7f1bd2cd5e4293e52a241fcfd5
|
||||
args.GetReturnValue().Set(data.ToBuffer().ToLocalChecked());
|
||||
}
|
||||
|
||||
@@ -5430,8 +5430,8 @@ void DiffieHellman::GetField(const FunctionCallbackInfo<Value>& args,
|
||||
@@ -5475,8 +5475,8 @@ void DiffieHellman::GetField(const FunctionCallbackInfo<Value>& args,
|
||||
CHECK_GE(size, 0);
|
||||
AllocatedBuffer data = env->AllocateManaged(size);
|
||||
CHECK_EQ(
|
||||
@@ -33,7 +33,7 @@ index 590c6d1c374c086e128580d6160ccbd71a7ef227..4933bf7f1bd2cd5e4293e52a241fcfd5
|
||||
args.GetReturnValue().Set(data.ToBuffer().ToLocalChecked());
|
||||
}
|
||||
|
||||
@@ -5748,9 +5748,9 @@ void ECDH::GetPrivateKey(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -5793,9 +5793,9 @@ void ECDH::GetPrivateKey(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
const int size = BN_num_bytes(b);
|
||||
AllocatedBuffer out = env->AllocateManaged(size);
|
||||
|
||||
@@ -110,10 +110,10 @@ index b6a3376e735094f970ef61a52ef9bb6d6101647a..bb70c2305fd44cfea46a8df5e65d1af5
|
||||
|
||||
Sign.prototype.sign = function sign(options, encoding) {
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index 63e71fc1fc2b0e95a85f38b58b34eeb290d8f09d..1415e32c02c4ffc6e3205ff15bef2006021bb1c2 100644
|
||||
index ecb845803776f5ff6e7eec712ec7a5ebea2e8d0a..1516d77be8514ce55d8d21b78a7cd85ead2cb95f 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -170,7 +170,6 @@ constexpr size_t kFsStatsBufferLength = kFsStatsFieldsNumber * 2;
|
||||
@@ -173,7 +173,6 @@ constexpr size_t kFsStatsBufferLength = kFsStatsFieldsNumber * 2;
|
||||
V(crypto_x25519_string, "x25519") \
|
||||
V(crypto_x448_string, "x448") \
|
||||
V(crypto_rsa_string, "rsa") \
|
||||
@@ -122,7 +122,7 @@ index 63e71fc1fc2b0e95a85f38b58b34eeb290d8f09d..1415e32c02c4ffc6e3205ff15bef2006
|
||||
V(data_string, "data") \
|
||||
V(dest_string, "dest") \
|
||||
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
|
||||
index 5622ae8a367b017aa4d8a7e6e5892b5caa9bbec3..87b54447574c9aef094776f9bd9397aa63c7085b 100644
|
||||
index 1cc2372fe2e385e9a9db27e38f0da61d62de2e81..cd09cdb3f2244825f6631891b94e61eeb6bc60bf 100644
|
||||
--- a/src/node_crypto.cc
|
||||
+++ b/src/node_crypto.cc
|
||||
@@ -3727,8 +3727,6 @@ Local<Value> KeyObject::GetAsymmetricKeyType() const {
|
||||
@@ -134,7 +134,7 @@ index 5622ae8a367b017aa4d8a7e6e5892b5caa9bbec3..87b54447574c9aef094776f9bd9397aa
|
||||
case EVP_PKEY_DSA:
|
||||
return env()->crypto_dsa_string();
|
||||
case EVP_PKEY_EC:
|
||||
@@ -4730,14 +4728,13 @@ void SignBase::CheckThrow(SignBase::Error error) {
|
||||
@@ -4775,14 +4773,13 @@ void SignBase::CheckThrow(SignBase::Error error) {
|
||||
static bool ApplyRSAOptions(const ManagedEVPPKey& pkey,
|
||||
EVP_PKEY_CTX* pkctx,
|
||||
int padding,
|
||||
@@ -153,7 +153,7 @@ index 5622ae8a367b017aa4d8a7e6e5892b5caa9bbec3..87b54447574c9aef094776f9bd9397aa
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -4788,16 +4785,11 @@ void Sign::SignUpdate(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -4833,16 +4830,11 @@ void Sign::SignUpdate(const FunctionCallbackInfo<Value>& args) {
|
||||
sign->CheckThrow(err);
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ index 5622ae8a367b017aa4d8a7e6e5892b5caa9bbec3..87b54447574c9aef094776f9bd9397aa
|
||||
unsigned char m[EVP_MAX_MD_SIZE];
|
||||
unsigned int m_len;
|
||||
|
||||
@@ -4830,7 +4822,7 @@ static AllocatedBuffer Node_SignFinal(Environment* env,
|
||||
@@ -4875,7 +4867,7 @@ static AllocatedBuffer Node_SignFinal(Environment* env,
|
||||
Sign::SignResult Sign::SignFinal(
|
||||
const ManagedEVPPKey& pkey,
|
||||
int padding,
|
||||
@@ -180,7 +180,7 @@ index 5622ae8a367b017aa4d8a7e6e5892b5caa9bbec3..87b54447574c9aef094776f9bd9397aa
|
||||
if (!mdctx_)
|
||||
return SignResult(kSignNotInitialised);
|
||||
|
||||
@@ -4881,17 +4873,11 @@ void Sign::SignFinal(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -4926,17 +4918,11 @@ void Sign::SignFinal(const FunctionCallbackInfo<Value>& args) {
|
||||
if (!key)
|
||||
return;
|
||||
|
||||
@@ -202,7 +202,7 @@ index 5622ae8a367b017aa4d8a7e6e5892b5caa9bbec3..87b54447574c9aef094776f9bd9397aa
|
||||
|
||||
SignResult ret = sign->SignFinal(
|
||||
key,
|
||||
@@ -4952,17 +4938,11 @@ void SignOneShot(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -4997,17 +4983,11 @@ void SignOneShot(const FunctionCallbackInfo<Value>& args) {
|
||||
return CheckThrow(env, SignBase::Error::kSignUnknownDigest);
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ index 5622ae8a367b017aa4d8a7e6e5892b5caa9bbec3..87b54447574c9aef094776f9bd9397aa
|
||||
|
||||
EVP_PKEY_CTX* pkctx = nullptr;
|
||||
EVPMDPointer mdctx(EVP_MD_CTX_new());
|
||||
@@ -5040,7 +5020,7 @@ SignBase::Error Verify::VerifyFinal(const ManagedEVPPKey& pkey,
|
||||
@@ -5085,7 +5065,7 @@ SignBase::Error Verify::VerifyFinal(const ManagedEVPPKey& pkey,
|
||||
const char* sig,
|
||||
int siglen,
|
||||
int padding,
|
||||
@@ -233,7 +233,7 @@ index 5622ae8a367b017aa4d8a7e6e5892b5caa9bbec3..87b54447574c9aef094776f9bd9397aa
|
||||
bool* verify_result) {
|
||||
if (!mdctx_)
|
||||
return kSignNotInitialised;
|
||||
@@ -5084,17 +5064,11 @@ void Verify::VerifyFinal(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -5129,17 +5109,11 @@ void Verify::VerifyFinal(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
ArrayBufferViewContents<char> hbuf(args[offset]);
|
||||
|
||||
@@ -255,7 +255,7 @@ index 5622ae8a367b017aa4d8a7e6e5892b5caa9bbec3..87b54447574c9aef094776f9bd9397aa
|
||||
|
||||
bool verify_result;
|
||||
Error err = verify->VerifyFinal(pkey, hbuf.data(), hbuf.length(), padding,
|
||||
@@ -5127,17 +5101,11 @@ void VerifyOneShot(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -5172,17 +5146,11 @@ void VerifyOneShot(const FunctionCallbackInfo<Value>& args) {
|
||||
return CheckThrow(env, SignBase::Error::kSignUnknownDigest);
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ index 5622ae8a367b017aa4d8a7e6e5892b5caa9bbec3..87b54447574c9aef094776f9bd9397aa
|
||||
|
||||
EVP_PKEY_CTX* pkctx = nullptr;
|
||||
EVPMDPointer mdctx(EVP_MD_CTX_new());
|
||||
@@ -6135,48 +6103,6 @@ class RSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
@@ -6181,48 +6149,6 @@ class RSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
const unsigned int exponent_;
|
||||
};
|
||||
|
||||
@@ -326,7 +326,7 @@ index 5622ae8a367b017aa4d8a7e6e5892b5caa9bbec3..87b54447574c9aef094776f9bd9397aa
|
||||
class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
|
||||
public:
|
||||
DSAKeyPairGenerationConfig(unsigned int modulus_bits, int divisor_bits)
|
||||
@@ -6410,44 +6336,6 @@ void GenerateKeyPairRSA(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -6456,44 +6382,6 @@ void GenerateKeyPairRSA(const FunctionCallbackInfo<Value>& args) {
|
||||
GenerateKeyPair(args, 2, std::move(config));
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ index 5622ae8a367b017aa4d8a7e6e5892b5caa9bbec3..87b54447574c9aef094776f9bd9397aa
|
||||
void GenerateKeyPairDSA(const FunctionCallbackInfo<Value>& args) {
|
||||
CHECK(args[0]->IsUint32());
|
||||
const uint32_t modulus_bits = args[0].As<Uint32>()->Value();
|
||||
@@ -6899,7 +6787,6 @@ void Initialize(Local<Object> target,
|
||||
@@ -6945,7 +6833,6 @@ void Initialize(Local<Object> target,
|
||||
|
||||
env->SetMethod(target, "pbkdf2", PBKDF2);
|
||||
env->SetMethod(target, "generateKeyPairRSA", GenerateKeyPairRSA);
|
||||
@@ -380,10 +380,10 @@ index 5622ae8a367b017aa4d8a7e6e5892b5caa9bbec3..87b54447574c9aef094776f9bd9397aa
|
||||
env->SetMethod(target, "generateKeyPairEC", GenerateKeyPairEC);
|
||||
env->SetMethod(target, "generateKeyPairNid", GenerateKeyPairNid);
|
||||
diff --git a/src/node_crypto.h b/src/node_crypto.h
|
||||
index 3e337eaddbe490b98aa2f9da2e310c94e4a96bf8..e526325a60feaa345f02e021f7ba1c9e3d8ca602 100644
|
||||
index 07ca412e8f7fc6281553ca90a4c3c8c18726c526..04a06affce1de8c567034d084c43b1a016076353 100644
|
||||
--- a/src/node_crypto.h
|
||||
+++ b/src/node_crypto.h
|
||||
@@ -657,7 +657,7 @@ class Sign : public SignBase {
|
||||
@@ -660,7 +660,7 @@ class Sign : public SignBase {
|
||||
SignResult SignFinal(
|
||||
const ManagedEVPPKey& pkey,
|
||||
int padding,
|
||||
@@ -392,7 +392,7 @@ index 3e337eaddbe490b98aa2f9da2e310c94e4a96bf8..e526325a60feaa345f02e021f7ba1c9e
|
||||
|
||||
protected:
|
||||
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
@@ -678,7 +678,7 @@ class Verify : public SignBase {
|
||||
@@ -681,7 +681,7 @@ class Verify : public SignBase {
|
||||
const char* sig,
|
||||
int siglen,
|
||||
int padding,
|
||||
@@ -402,7 +402,7 @@ index 3e337eaddbe490b98aa2f9da2e310c94e4a96bf8..e526325a60feaa345f02e021f7ba1c9e
|
||||
|
||||
protected:
|
||||
diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile
|
||||
index 226dc67346ef740ae9d622c03271d2761e51e713..492a30f6e43fc8068b8b89da86cdfe6250fe1fe6 100644
|
||||
index 824704c7241b0ae58f5b4f2768b429f465aafb9b..28afa6685955b1ad57901c776c268cd3aef7d508 100644
|
||||
--- a/test/fixtures/keys/Makefile
|
||||
+++ b/test/fixtures/keys/Makefile
|
||||
@@ -61,12 +61,6 @@ all: \
|
||||
|
||||
@@ -10,10 +10,10 @@ internalModuleStat` in the very beginning of the file holds a reference
|
||||
to a native Node.js implementation of the function.
|
||||
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index b6bef5f0fdb6f60e4baf5fbd647f191a0e290355..2f5385cea51d3456dffb43a852bd2b3cdce9998b 100644
|
||||
index 70da676a40feeaa82d3a0ccd1c17882ab5d6edf3..ffc7fb6fd5857b807198d4d26b7b899e63cde4a1 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -85,6 +85,8 @@ const relativeResolveCache = Object.create(null);
|
||||
@@ -93,6 +93,8 @@ const relativeResolveCache = Object.create(null);
|
||||
let requireDepth = 0;
|
||||
let statCache = null;
|
||||
function stat(filename) {
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: Inherit ELECTRON_CRASHPAD_PIPE_NAME in child process
|
||||
This is required for crashReporter to work correctly in node process.
|
||||
|
||||
diff --git a/lib/child_process.js b/lib/child_process.js
|
||||
index 2a2e68aaf23116203d756431cafd81c106ed9044..724ac30c5cfc79a01d4fc8c0e5b0a044a7143cd5 100644
|
||||
index ec429a082b081f0289507c15aa9ecc5305345ca2..7c231993e60278d3946745cba15c458962556581 100644
|
||||
--- a/lib/child_process.js
|
||||
+++ b/lib/child_process.js
|
||||
@@ -108,6 +108,10 @@ function fork(modulePath /* , args, options */) {
|
||||
|
||||
@@ -10,10 +10,10 @@ node's module code.
|
||||
(cherry picked from commit 76ba048c37588ee32636817fa7b8dffc64330cbf)
|
||||
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index 00bc575b1f7d4b271ccbb342ddbe3c53b7915c30..865e9d13e840351bcf61bec771462fc88ee0a602 100644
|
||||
index 95724d4c27f12e4f9c90f70b20d3d7fad3e9f035..2a1a412fe7c55b8046b19860005e89a52ee3b816 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -916,8 +916,8 @@ Module._initPaths = function() {
|
||||
@@ -1008,8 +1008,8 @@ Module._initPaths = function() {
|
||||
|
||||
modulePaths = paths;
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: Pass all globals through "require"
|
||||
(cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62)
|
||||
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index 865e9d13e840351bcf61bec771462fc88ee0a602..b6bef5f0fdb6f60e4baf5fbd647f191a0e290355 100644
|
||||
index 2a1a412fe7c55b8046b19860005e89a52ee3b816..70da676a40feeaa82d3a0ccd1c17882ab5d6edf3 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -71,6 +71,13 @@ const {
|
||||
@@ -79,6 +79,13 @@ const {
|
||||
CHAR_COLON
|
||||
} = require('internal/constants');
|
||||
|
||||
@@ -23,7 +23,7 @@ index 865e9d13e840351bcf61bec771462fc88ee0a602..b6bef5f0fdb6f60e4baf5fbd647f191a
|
||||
const isWindows = process.platform === 'win32';
|
||||
|
||||
const relativeResolveCache = Object.create(null);
|
||||
@@ -771,10 +778,12 @@ Module.prototype._compile = function(content, filename) {
|
||||
@@ -863,10 +870,12 @@ Module.prototype._compile = function(content, filename) {
|
||||
if (requireDepth === 0) statCache = new Map();
|
||||
if (inspectorWrapper) {
|
||||
result = inspectorWrapper(compiledWrapper, thisValue, exports,
|
||||
|
||||
@@ -20,10 +20,10 @@ index 86b2164bb0d74a531acd0f01da5269642ea574cf..48a38a6b5054c6bf14df82a8cb3c41d4
|
||||
process.config = JSON.parse(internalBinding('native_module').config);
|
||||
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index 2f5385cea51d3456dffb43a852bd2b3cdce9998b..c975804d847eea5a8d759f79121aa4da61e88dc4 100644
|
||||
index ffc7fb6fd5857b807198d4d26b7b899e63cde4a1..2a7ffbff213f23536b94664c3ecffa18eb812849 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -31,10 +31,7 @@ const assert = require('internal/assert');
|
||||
@@ -37,10 +37,7 @@ const assert = require('internal/assert');
|
||||
const fs = require('fs');
|
||||
const internalFS = require('internal/fs/utils');
|
||||
const path = require('path');
|
||||
@@ -35,7 +35,7 @@ index 2f5385cea51d3456dffb43a852bd2b3cdce9998b..c975804d847eea5a8d759f79121aa4da
|
||||
const { safeGetenv } = internalBinding('credentials');
|
||||
const {
|
||||
makeRequireFunction,
|
||||
@@ -85,14 +82,12 @@ const relativeResolveCache = Object.create(null);
|
||||
@@ -93,14 +90,12 @@ const relativeResolveCache = Object.create(null);
|
||||
let requireDepth = 0;
|
||||
let statCache = null;
|
||||
function stat(filename) {
|
||||
@@ -51,9 +51,9 @@ index 2f5385cea51d3456dffb43a852bd2b3cdce9998b..c975804d847eea5a8d759f79121aa4da
|
||||
if (statCache !== null) statCache.set(filename, result);
|
||||
return result;
|
||||
}
|
||||
@@ -199,7 +194,7 @@ function readPackage(requestPath) {
|
||||
return entry;
|
||||
@@ -205,7 +200,7 @@ const packageExportsCache = new SafeMap();
|
||||
|
||||
function readPackageRaw(requestPath) {
|
||||
const jsonPath = path.resolve(requestPath, 'package.json');
|
||||
- const json = internalModuleReadJSON(path.toNamespacedPath(jsonPath));
|
||||
+ const json = internalFsBinding.internalModuleReadJSON(path.toNamespacedPath(jsonPath));
|
||||
|
||||
@@ -7,7 +7,7 @@ Subject: refactor: alter child_process.fork to use execute script with
|
||||
When forking a child script, we setup a special environment to make the Electron binary run like the upstream node. On Mac, we use the helper app as node binary.
|
||||
|
||||
diff --git a/lib/child_process.js b/lib/child_process.js
|
||||
index 0d3785f0d5b9b8a2959e9487500d010796709d7f..2a2e68aaf23116203d756431cafd81c106ed9044 100644
|
||||
index 43257e53dfe0319d6c110e94529cbc991c2bcfb3..ec429a082b081f0289507c15aa9ecc5305345ca2 100644
|
||||
--- a/lib/child_process.js
|
||||
+++ b/lib/child_process.js
|
||||
@@ -102,6 +102,16 @@ function fork(modulePath /* , args, options */) {
|
||||
|
||||
@@ -0,0 +1,262 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nitish Sakhawalkar <nitsakh@icloud.com>
|
||||
Date: Mon, 12 Aug 2019 12:54:47 -0700
|
||||
Subject: Revert "crypto: add outputLength option to crypto.createHash"
|
||||
|
||||
This reverts commit b7c6ad595b80442e433c6308dc5b80ed641866e0.
|
||||
|
||||
diff --git a/doc/api/crypto.md b/doc/api/crypto.md
|
||||
index 8132e2975483b8fda95fe4466910dd42f74866cd..9b7aab3009770bb7816493581d82b63b7e19f2f3 100644
|
||||
--- a/doc/api/crypto.md
|
||||
+++ b/doc/api/crypto.md
|
||||
@@ -1785,10 +1785,6 @@ and description of each available elliptic curve.
|
||||
### crypto.createHash(algorithm[, options])
|
||||
<!-- YAML
|
||||
added: v0.1.92
|
||||
-changes:
|
||||
- - version: v12.8.0
|
||||
- pr-url: https://github.com/nodejs/node/pull/28805
|
||||
- description: The `outputLength` option was added for XOF hash functions.
|
||||
-->
|
||||
* `algorithm` {string}
|
||||
* `options` {Object} [`stream.transform` options][]
|
||||
@@ -1796,8 +1792,7 @@ changes:
|
||||
|
||||
Creates and returns a `Hash` object that can be used to generate hash digests
|
||||
using the given `algorithm`. Optional `options` argument controls stream
|
||||
-behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option
|
||||
-can be used to specify the desired output length in bytes.
|
||||
+behavior.
|
||||
|
||||
The `algorithm` is dependent on the available algorithms supported by the
|
||||
version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
|
||||
diff --git a/lib/internal/crypto/hash.js b/lib/internal/crypto/hash.js
|
||||
index 38b125e5f22c2dd5220a983d8126bef1feb5462b..a58164802124d30ac0fa2c5b472857fa018d2bfa 100644
|
||||
--- a/lib/internal/crypto/hash.js
|
||||
+++ b/lib/internal/crypto/hash.js
|
||||
@@ -25,7 +25,7 @@ const {
|
||||
ERR_CRYPTO_HASH_UPDATE_FAILED,
|
||||
ERR_INVALID_ARG_TYPE
|
||||
} = require('internal/errors').codes;
|
||||
-const { validateString, validateUint32 } = require('internal/validators');
|
||||
+const { validateString } = require('internal/validators');
|
||||
const { normalizeEncoding } = require('internal/util');
|
||||
const { isArrayBufferView } = require('internal/util/types');
|
||||
const LazyTransform = require('internal/streams/lazy_transform');
|
||||
@@ -36,11 +36,7 @@ function Hash(algorithm, options) {
|
||||
if (!(this instanceof Hash))
|
||||
return new Hash(algorithm, options);
|
||||
validateString(algorithm, 'algorithm');
|
||||
- const xofLen = typeof options === 'object' && options !== null ?
|
||||
- options.outputLength : undefined;
|
||||
- if (xofLen !== undefined)
|
||||
- validateUint32(xofLen, 'options.outputLength');
|
||||
- this[kHandle] = new _Hash(algorithm, xofLen);
|
||||
+ this[kHandle] = new _Hash(algorithm);
|
||||
this[kState] = {
|
||||
[kFinalized]: false
|
||||
};
|
||||
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
|
||||
index cd09cdb3f2244825f6631891b94e61eeb6bc60bf..177de527c634671c571ebe4c2cfdeedc1c423ecc 100644
|
||||
--- a/src/node_crypto.cc
|
||||
+++ b/src/node_crypto.cc
|
||||
@@ -4563,21 +4563,15 @@ void Hash::New(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
const node::Utf8Value hash_type(env->isolate(), args[0]);
|
||||
|
||||
- Maybe<unsigned int> xof_md_len = Nothing<unsigned int>();
|
||||
- if (!args[1]->IsUndefined()) {
|
||||
- CHECK(args[1]->IsUint32());
|
||||
- xof_md_len = Just<unsigned int>(args[1].As<Uint32>()->Value());
|
||||
- }
|
||||
-
|
||||
Hash* hash = new Hash(env, args.This());
|
||||
- if (!hash->HashInit(*hash_type, xof_md_len)) {
|
||||
+ if (!hash->HashInit(*hash_type)) {
|
||||
return ThrowCryptoError(env, ERR_get_error(),
|
||||
"Digest method not supported");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-bool Hash::HashInit(const char* hash_type, Maybe<unsigned int> xof_md_len) {
|
||||
+bool Hash::HashInit(const char* hash_type) {
|
||||
const EVP_MD* md = EVP_get_digestbyname(hash_type);
|
||||
if (md == nullptr)
|
||||
return false;
|
||||
@@ -4586,18 +4580,6 @@ bool Hash::HashInit(const char* hash_type, Maybe<unsigned int> xof_md_len) {
|
||||
mdctx_.reset();
|
||||
return false;
|
||||
}
|
||||
-
|
||||
- md_len_ = EVP_MD_size(md);
|
||||
- if (xof_md_len.IsJust() && xof_md_len.FromJust() != md_len_) {
|
||||
- // This is a little hack to cause createHash to fail when an incorrect
|
||||
- // hashSize option was passed for a non-XOF hash function.
|
||||
- if ((EVP_MD_meth_get_flags(md) & EVP_MD_FLAG_XOF) == 0) {
|
||||
- EVPerr(EVP_F_EVP_DIGESTFINALXOF, EVP_R_NOT_XOF_OR_INVALID_LENGTH);
|
||||
- return false;
|
||||
- }
|
||||
- md_len_ = xof_md_len.FromJust();
|
||||
- }
|
||||
-
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4646,40 +4628,13 @@ void Hash::HashDigest(const FunctionCallbackInfo<Value>& args) {
|
||||
encoding = ParseEncoding(env->isolate(), args[0], BUFFER);
|
||||
}
|
||||
|
||||
- // TODO(tniessen): SHA3_squeeze does not work for zero-length outputs on all
|
||||
- // platforms and will cause a segmentation fault if called. This workaround
|
||||
- // causes hash.digest() to correctly return an empty buffer / string.
|
||||
- // See https://github.com/openssl/openssl/issues/9431.
|
||||
- if (!hash->has_md_ && hash->md_len_ == 0) {
|
||||
- hash->has_md_ = true;
|
||||
- }
|
||||
-
|
||||
- if (!hash->has_md_) {
|
||||
+ if (hash->md_len_ == 0) {
|
||||
// Some hash algorithms such as SHA3 do not support calling
|
||||
// EVP_DigestFinal_ex more than once, however, Hash._flush
|
||||
// and Hash.digest can both be used to retrieve the digest,
|
||||
// so we need to cache it.
|
||||
// See https://github.com/nodejs/node/issues/28245.
|
||||
-
|
||||
- hash->md_value_ = MallocOpenSSL<unsigned char>(hash->md_len_);
|
||||
-
|
||||
- size_t default_len = EVP_MD_CTX_size(hash->mdctx_.get());
|
||||
- int ret;
|
||||
- if (hash->md_len_ == default_len) {
|
||||
- ret = EVP_DigestFinal_ex(hash->mdctx_.get(), hash->md_value_,
|
||||
- &hash->md_len_);
|
||||
- } else {
|
||||
- ret = EVP_DigestFinalXOF(hash->mdctx_.get(), hash->md_value_,
|
||||
- hash->md_len_);
|
||||
- }
|
||||
-
|
||||
- if (ret != 1) {
|
||||
- OPENSSL_free(hash->md_value_);
|
||||
- hash->md_value_ = nullptr;
|
||||
- return ThrowCryptoError(env, ERR_get_error());
|
||||
- }
|
||||
-
|
||||
- hash->has_md_ = true;
|
||||
+ EVP_DigestFinal_ex(hash->mdctx_.get(), hash->md_value_, &hash->md_len_);
|
||||
}
|
||||
|
||||
Local<Value> error;
|
||||
diff --git a/src/node_crypto.h b/src/node_crypto.h
|
||||
index 04a06affce1de8c567034d084c43b1a016076353..e526325a60feaa345f02e021f7ba1c9e3d8ca602 100644
|
||||
--- a/src/node_crypto.h
|
||||
+++ b/src/node_crypto.h
|
||||
@@ -585,7 +585,7 @@ class Hash : public BaseObject {
|
||||
SET_MEMORY_INFO_NAME(Hash)
|
||||
SET_SELF_SIZE(Hash)
|
||||
|
||||
- bool HashInit(const char* hash_type, v8::Maybe<unsigned int> xof_md_len);
|
||||
+ bool HashInit(const char* hash_type);
|
||||
bool HashUpdate(const char* data, int len);
|
||||
|
||||
protected:
|
||||
@@ -596,21 +596,18 @@ class Hash : public BaseObject {
|
||||
Hash(Environment* env, v8::Local<v8::Object> wrap)
|
||||
: BaseObject(env, wrap),
|
||||
mdctx_(nullptr),
|
||||
- has_md_(false),
|
||||
- md_value_(nullptr) {
|
||||
+ md_len_(0) {
|
||||
MakeWeak();
|
||||
}
|
||||
|
||||
~Hash() override {
|
||||
- if (md_value_ != nullptr)
|
||||
- OPENSSL_clear_free(md_value_, md_len_);
|
||||
+ OPENSSL_cleanse(md_value_, md_len_);
|
||||
}
|
||||
|
||||
private:
|
||||
EVPMDPointer mdctx_;
|
||||
- bool has_md_;
|
||||
+ unsigned char md_value_[EVP_MAX_MD_SIZE];
|
||||
unsigned int md_len_;
|
||||
- unsigned char* md_value_;
|
||||
};
|
||||
|
||||
class SignBase : public BaseObject {
|
||||
diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js
|
||||
index 4d3214adb2db0b31e9172f3f20b056b5f1af3c7d..de15f00bc918aa4a80b02ae0c51957be264eb3c5 100644
|
||||
--- a/test/parallel/test-crypto-hash.js
|
||||
+++ b/test/parallel/test-crypto-hash.js
|
||||
@@ -185,71 +185,3 @@ common.expectsError(
|
||||
assert(instance instanceof Hash, 'Hash is expected to return a new instance' +
|
||||
' when called without `new`');
|
||||
}
|
||||
-
|
||||
-// Test XOF hash functions and the outputLength option.
|
||||
-{
|
||||
- // Default outputLengths.
|
||||
- assert.strictEqual(crypto.createHash('shake128').digest('hex'),
|
||||
- '7f9c2ba4e88f827d616045507605853e');
|
||||
- assert.strictEqual(crypto.createHash('shake128', null).digest('hex'),
|
||||
- '7f9c2ba4e88f827d616045507605853e');
|
||||
- assert.strictEqual(crypto.createHash('shake256').digest('hex'),
|
||||
- '46b9dd2b0ba88d13233b3feb743eeb24' +
|
||||
- '3fcd52ea62b81b82b50c27646ed5762f');
|
||||
-
|
||||
- // Short outputLengths.
|
||||
- assert.strictEqual(crypto.createHash('shake128', { outputLength: 0 })
|
||||
- .digest('hex'),
|
||||
- '');
|
||||
- assert.strictEqual(crypto.createHash('shake128', { outputLength: 5 })
|
||||
- .digest('hex'),
|
||||
- '7f9c2ba4e8');
|
||||
- assert.strictEqual(crypto.createHash('shake128', { outputLength: 15 })
|
||||
- .digest('hex'),
|
||||
- '7f9c2ba4e88f827d61604550760585');
|
||||
- assert.strictEqual(crypto.createHash('shake256', { outputLength: 16 })
|
||||
- .digest('hex'),
|
||||
- '46b9dd2b0ba88d13233b3feb743eeb24');
|
||||
-
|
||||
- // Large outputLengths.
|
||||
- assert.strictEqual(crypto.createHash('shake128', { outputLength: 128 })
|
||||
- .digest('hex'),
|
||||
- '7f9c2ba4e88f827d616045507605853e' +
|
||||
- 'd73b8093f6efbc88eb1a6eacfa66ef26' +
|
||||
- '3cb1eea988004b93103cfb0aeefd2a68' +
|
||||
- '6e01fa4a58e8a3639ca8a1e3f9ae57e2' +
|
||||
- '35b8cc873c23dc62b8d260169afa2f75' +
|
||||
- 'ab916a58d974918835d25e6a435085b2' +
|
||||
- 'badfd6dfaac359a5efbb7bcc4b59d538' +
|
||||
- 'df9a04302e10c8bc1cbf1a0b3a5120ea');
|
||||
- const superLongHash = crypto.createHash('shake256', {
|
||||
- outputLength: 1024 * 1024
|
||||
- }).update('The message is shorter than the hash!')
|
||||
- .digest('hex');
|
||||
- assert.strictEqual(superLongHash.length, 2 * 1024 * 1024);
|
||||
- assert.ok(superLongHash.endsWith('193414035ddba77bf7bba97981e656ec'));
|
||||
- assert.ok(superLongHash.startsWith('a2a28dbc49cfd6e5d6ceea3d03e77748'));
|
||||
-
|
||||
- // Non-XOF hash functions should accept valid outputLength options as well.
|
||||
- assert.strictEqual(crypto.createHash('sha224', { outputLength: 28 })
|
||||
- .digest('hex'),
|
||||
- 'd14a028c2a3a2bc9476102bb288234c4' +
|
||||
- '15a2b01f828ea62ac5b3e42f');
|
||||
-
|
||||
- // Passing invalid sizes should throw during creation.
|
||||
- common.expectsError(() => {
|
||||
- crypto.createHash('sha256', { outputLength: 28 });
|
||||
- }, {
|
||||
- code: 'ERR_OSSL_EVP_NOT_XOF_OR_INVALID_LENGTH'
|
||||
- });
|
||||
-
|
||||
- for (const outputLength of [null, {}, 'foo', false]) {
|
||||
- common.expectsError(() => crypto.createHash('sha256', { outputLength }),
|
||||
- { code: 'ERR_INVALID_ARG_TYPE' });
|
||||
- }
|
||||
-
|
||||
- for (const outputLength of [-1, .5, Infinity, 2 ** 90]) {
|
||||
- common.expectsError(() => crypto.createHash('sha256', { outputLength }),
|
||||
- { code: 'ERR_OUT_OF_RANGE' });
|
||||
- }
|
||||
-}
|
||||
@@ -1,32 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sattard@slack-corp.com>
|
||||
Date: Thu, 4 Jul 2019 15:28:22 -0700
|
||||
Subject: src: add missing option parser template for the DebugOptionsParser
|
||||
|
||||
This allows embedders to run `node::options_parser::Parse` for a
|
||||
`node::DebugOptions`.
|
||||
|
||||
This can be removed once https://github.com/nodejs/node/pull/28543 is
|
||||
merged and available in our node fork.
|
||||
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index e2f20d1b7b5ad4407b5630b163ee1c29a18027ce..01ecbd2c7318f90ec79af7450119d6368ed30d6a 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -232,6 +232,16 @@ class PerProcessOptionsParser : public OptionsParser<PerProcessOptions> {
|
||||
#if HAVE_INSPECTOR
|
||||
const DebugOptionsParser _dop_instance{};
|
||||
const EnvironmentOptionsParser _eop_instance{_dop_instance};
|
||||
+
|
||||
+template <>
|
||||
+void Parse(
|
||||
+ StringVector* const args, StringVector* const exec_args,
|
||||
+ StringVector* const v8_args,
|
||||
+ DebugOptions* const options,
|
||||
+ OptionEnvvarSettings required_env_settings, StringVector* const errors) {
|
||||
+ _dop_instance.Parse(
|
||||
+ args, exec_args, v8_args, options, required_env_settings, errors);
|
||||
+}
|
||||
#else
|
||||
const EnvironmentOptionsParser _eop_instance{};
|
||||
#endif // HAVE_INSPECTOR
|
||||
@@ -6,7 +6,7 @@ Subject: src: Disable NODE_USE_V8_PLATFORM in node_options
|
||||
Electron does not set NODE_USE_V8_PLATFORM. If inspector is enabled when NODE_USE_V8_PLATFORM is false, then there's an error. We want to ignore that, use our own v8 platform but still use the node inspector
|
||||
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index 9b9b9324d681d8a55418c7a43a071a6f978750e7..e2f20d1b7b5ad4407b5630b163ee1c29a18027ce 100644
|
||||
index b9d6108c5db800465e6c7156ad1c28002c33261b..01dddb979042c098326a8b1ff37397642733f49b 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -33,7 +33,7 @@ DebugOptions& DebugOptions::operator=(const DebugOptions&) = default;
|
||||
|
||||
@@ -9,10 +9,10 @@ can still use them in a node Environment now that primordials are
|
||||
initialized and required so early.
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index bfd279aa7e7cd4d50b6cffe75d6f8e41c0213acb..5011774be2c5fee910079790feae747fa1785b87 100644
|
||||
index 35e8666ef771c56a1bcd441c99d4483a0d3e90bf..443f49320b2e6720f932fcfcefdbe6e539594964 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -363,6 +363,13 @@ Local<Context> NewContext(Isolate* isolate,
|
||||
@@ -357,6 +357,13 @@ Local<Context> NewContext(Isolate* isolate,
|
||||
Local<ObjectTemplate> object_template) {
|
||||
auto context = Context::New(isolate, nullptr, object_template);
|
||||
if (context.IsEmpty()) return context;
|
||||
@@ -27,7 +27,7 @@ index bfd279aa7e7cd4d50b6cffe75d6f8e41c0213acb..5011774be2c5fee910079790feae747f
|
||||
|
||||
context->SetEmbedderData(ContextEmbedderIndex::kAllowWasmCodeGeneration,
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index dca89e212c89df19d0b97d748e3649392fec000c..de007ed97a52c17cff8b8917d25f2383d5bbae6a 100644
|
||||
index a2b47d1cf984ec36994b477b371cdf262191ab9c..c51fb1a6a6e497a091e2ba0b147e3d7b6a4d685c 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -303,6 +303,14 @@ NODE_EXTERN v8::Local<v8::Context> NewContext(
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <samuel.r.attard@gmail.com>
|
||||
Date: Sun, 2 Jun 2019 12:43:59 -0700
|
||||
Subject: src: read break_node_first_line from the inspect options
|
||||
|
||||
There are cases where the debug_options() on the env are
|
||||
different to the options that were passed into inspector::Agent.
|
||||
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index 00fb0ed1c9cfbc86a7ec7d1d0ce7789b68d6a1e3..707579c8254903f5c587fa42711eb5d0184b4112 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -256,7 +256,7 @@ int Environment::InitializeInspector(
|
||||
|
||||
profiler::StartProfilers(this);
|
||||
|
||||
- if (options_->debug_options().break_node_first_line) {
|
||||
+ if (inspector_agent_->options().break_node_first_line) {
|
||||
inspector_agent_->PauseOnNextJavascriptStatement("Break at bootstrap");
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: src: use CHECK(false) in switch default case
|
||||
Porting https://github.com/nodejs/node/pull/26502
|
||||
|
||||
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
|
||||
index 4933bf7f1bd2cd5e4293e52a241fcfd5fda6b779..300d2b92d7040c831b3178202a725df15191407d 100644
|
||||
index dd78a59742fc05e938ba2397d3701b2ac8ccfc23..bca482cc9724fef680196a192a6bbd7b4d2e4fde 100644
|
||||
--- a/src/node_crypto.cc
|
||||
+++ b/src/node_crypto.cc
|
||||
@@ -3476,7 +3476,7 @@ static ManagedEVPPKey GetPublicOrPrivateKeyFromJs(
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
"parallel/test-async-hooks-promise",
|
||||
"parallel/test-async-hooks-promise-triggerid",
|
||||
"parallel/test-async-hooks-top-level-clearimmediate",
|
||||
"parallel/test-inspector-async-hook-after-done",
|
||||
"parallel/test-inspector-workers-flat-list",
|
||||
"parallel/test-sync-io-option",
|
||||
"parallel/test-heapdump-async-hooks-init-promise",
|
||||
"parallel/test-bootstrap-modules",
|
||||
"parallel/test-buffer-backing-arraybuffer",
|
||||
"parallel/test-buffer-constructor-node-modules-paths",
|
||||
|
||||
@@ -47,7 +47,7 @@ async function nextBeta (v) {
|
||||
tags.sort((t1, t2) => semver.gt(t1, t2))
|
||||
|
||||
// increment the latest existing beta tag or start at beta.1 if it's a new beta line
|
||||
return tags.length === 0 ? semver.inc(next, 'beta', 'prerelease') : semver.inc(tags.pop(), 'prerelease')
|
||||
return tags.length === 0 ? `${next}-beta.1` : semver.inc(tags.pop(), 'prerelease')
|
||||
}
|
||||
|
||||
async function getElectronVersion () {
|
||||
|
||||
@@ -563,7 +563,7 @@ v8::Local<v8::Promise> Session::ClearAuthCache() {
|
||||
|
||||
void Session::AllowNTLMCredentialsForDomains(const std::string& domains) {
|
||||
auto auth_params = CreateHttpAuthDynamicParams();
|
||||
auth_params->server_whitelist = domains;
|
||||
auth_params->server_allowlist = domains;
|
||||
content::GetNetworkService()->ConfigureHttpAuthPrefs(std::move(auth_params));
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ void SystemPreferences::BuildPrototype(
|
||||
.SetMethod("removeUserDefault", &SystemPreferences::RemoveUserDefault)
|
||||
.SetMethod("isSwipeTrackingFromScrollEventsEnabled",
|
||||
&SystemPreferences::IsSwipeTrackingFromScrollEventsEnabled)
|
||||
.SetMethod("getEffectiveAppearance",
|
||||
.SetMethod("_getEffectiveAppearance",
|
||||
&SystemPreferences::GetEffectiveAppearance)
|
||||
.SetMethod("_getAppLevelAppearance",
|
||||
&SystemPreferences::GetAppLevelAppearance)
|
||||
@@ -108,6 +108,8 @@ void SystemPreferences::BuildPrototype(
|
||||
.SetProperty("appLevelAppearance",
|
||||
&SystemPreferences::GetAppLevelAppearance,
|
||||
&SystemPreferences::SetAppLevelAppearance)
|
||||
.SetProperty("effectiveAppearance",
|
||||
&SystemPreferences::GetEffectiveAppearance)
|
||||
.SetMethod("getSystemColor", &SystemPreferences::GetSystemColor)
|
||||
.SetMethod("canPromptTouchID", &SystemPreferences::CanPromptTouchID)
|
||||
.SetMethod("promptTouchID", &SystemPreferences::PromptTouchID)
|
||||
|
||||
@@ -1168,6 +1168,7 @@ void TopLevelWindow::BuildPrototype(v8::Isolate* isolate,
|
||||
.SetMethod("_isMenuBarAutoHide", &TopLevelWindow::IsMenuBarAutoHide)
|
||||
.SetProperty("autoHideMenuBar", &TopLevelWindow::IsMenuBarAutoHide,
|
||||
&TopLevelWindow::SetAutoHideMenuBar)
|
||||
.SetMethod("setMenuBarVisibility", &TopLevelWindow::SetMenuBarVisibility)
|
||||
.SetMethod("isMenuBarVisible", &TopLevelWindow::IsMenuBarVisible)
|
||||
.SetMethod("setAspectRatio", &TopLevelWindow::SetAspectRatio)
|
||||
.SetMethod("previewFile", &TopLevelWindow::PreviewFile)
|
||||
|
||||
@@ -1591,13 +1591,16 @@ bool WebContents::IsCurrentlyAudible() {
|
||||
void WebContents::Print(mate::Arguments* args) {
|
||||
mate::Dictionary options = mate::Dictionary::CreateEmpty(args->isolate());
|
||||
base::DictionaryValue settings;
|
||||
|
||||
if (args->Length() >= 1 && !args->GetNext(&options)) {
|
||||
args->ThrowError("Invalid print settings specified");
|
||||
args->ThrowError("webContents.print(): Invalid print settings specified.");
|
||||
return;
|
||||
}
|
||||
|
||||
printing::CompletionCallback callback;
|
||||
if (args->Length() == 2 && !args->GetNext(&callback)) {
|
||||
args->ThrowError("Invalid optional callback provided");
|
||||
args->ThrowError(
|
||||
"webContents.print(): Invalid optional callback provided.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1605,8 +1608,13 @@ void WebContents::Print(mate::Arguments* args) {
|
||||
bool silent = false;
|
||||
options.Get("silent", &silent);
|
||||
|
||||
bool print_background = false;
|
||||
options.Get("printBackground", &print_background);
|
||||
settings.SetBoolean(printing::kSettingShouldPrintBackgrounds,
|
||||
print_background);
|
||||
|
||||
// Set custom margin settings
|
||||
mate::Dictionary margins;
|
||||
mate::Dictionary margins = mate::Dictionary::CreateEmpty(args->isolate());
|
||||
if (options.Get("margins", &margins)) {
|
||||
printing::MarginType margin_type = printing::DEFAULT_MARGINS;
|
||||
margins.Get("marginType", &margin_type);
|
||||
@@ -1643,6 +1651,8 @@ void WebContents::Print(mate::Arguments* args) {
|
||||
options.Get("landscape", &landscape);
|
||||
settings.SetBoolean(printing::kSettingLandscape, landscape);
|
||||
|
||||
// We set the default to empty string here and only update
|
||||
// if at the Chromium level if it's non-empty
|
||||
base::string16 device_name;
|
||||
options.Get("deviceName", &device_name);
|
||||
settings.SetString(printing::kSettingDeviceName, device_name);
|
||||
@@ -1663,11 +1673,6 @@ void WebContents::Print(mate::Arguments* args) {
|
||||
options.Get("copies", &copies);
|
||||
settings.SetInteger(printing::kSettingCopies, copies);
|
||||
|
||||
bool print_background = false;
|
||||
options.Get("printBackground", &print_background);
|
||||
settings.SetBoolean(printing::kSettingShouldPrintBackgrounds,
|
||||
print_background);
|
||||
|
||||
// For now we don't want to allow the user to enable these settings
|
||||
// but we need to set them or a CHECK is hit.
|
||||
settings.SetBoolean(printing::kSettingPrintToPDF, false);
|
||||
@@ -1723,11 +1728,10 @@ void WebContents::Print(mate::Arguments* args) {
|
||||
auto* rfh = focused_frame && focused_frame->HasSelection()
|
||||
? focused_frame
|
||||
: web_contents()->GetMainFrame();
|
||||
print_view_manager->PrintNow(
|
||||
rfh,
|
||||
std::make_unique<PrintMsg_PrintPages>(rfh->GetRoutingID(), silent,
|
||||
print_background, settings),
|
||||
std::move(callback));
|
||||
print_view_manager->PrintNow(rfh,
|
||||
std::make_unique<PrintMsg_PrintPages>(
|
||||
rfh->GetRoutingID(), silent, settings),
|
||||
std::move(callback));
|
||||
}
|
||||
|
||||
std::vector<printing::PrinterBasicInfo> WebContents::GetPrinterList() {
|
||||
|
||||
@@ -147,9 +147,17 @@ bool Browser::IsEmojiPanelSupported() {
|
||||
}
|
||||
|
||||
void Browser::ShowAboutPanel() {
|
||||
GtkAboutDialog* dialog = GTK_ABOUT_DIALOG(gtk_about_dialog_new());
|
||||
|
||||
const auto& opts = about_panel_options_;
|
||||
|
||||
if (!opts.is_dict()) {
|
||||
LOG(WARNING) << "Called showAboutPanel(), but didn't use "
|
||||
"setAboutPanelSettings() first";
|
||||
return;
|
||||
}
|
||||
|
||||
GtkWidget* dialogWidget = gtk_about_dialog_new();
|
||||
GtkAboutDialog* dialog = GTK_ABOUT_DIALOG(dialogWidget);
|
||||
|
||||
const std::string* str;
|
||||
const base::Value* val;
|
||||
|
||||
@@ -198,7 +206,7 @@ void Browser::ShowAboutPanel() {
|
||||
}
|
||||
|
||||
gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
g_clear_object(&dialog);
|
||||
gtk_widget_destroy(dialogWidget);
|
||||
}
|
||||
|
||||
void Browser::SetAboutPanelOptions(const base::DictionaryValue& options) {
|
||||
|
||||
@@ -96,9 +96,6 @@ void Browser::Focus() {
|
||||
}
|
||||
|
||||
void Browser::AddRecentDocument(const base::FilePath& path) {
|
||||
if (base::win::GetVersion() < base::win::Version::WIN7)
|
||||
return;
|
||||
|
||||
CComPtr<IShellItem> item;
|
||||
HRESULT hr = SHCreateItemFromParsingName(path.value().c_str(), NULL,
|
||||
IID_PPV_ARGS(&item));
|
||||
@@ -111,13 +108,7 @@ void Browser::AddRecentDocument(const base::FilePath& path) {
|
||||
}
|
||||
|
||||
void Browser::ClearRecentDocuments() {
|
||||
CComPtr<IApplicationDestinations> destinations;
|
||||
if (FAILED(destinations.CoCreateInstance(CLSID_ApplicationDestinations, NULL,
|
||||
CLSCTX_INPROC_SERVER)))
|
||||
return;
|
||||
if (FAILED(destinations->SetAppID(GetAppUserModelID())))
|
||||
return;
|
||||
destinations->RemoveAllDestinations();
|
||||
SHAddToRecentDocs(SHARD_APPIDINFO, nullptr);
|
||||
}
|
||||
|
||||
void Browser::SetAppUserModelID(const base::string16& name) {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "base/mac/mac_util.h"
|
||||
#include "base/mac/scoped_cftyperef.h"
|
||||
#include "base/numerics/ranges.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#include "components/remote_cocoa/app_shim/native_widget_ns_window_bridge.h"
|
||||
#include "content/public/browser/browser_accessibility_state.h"
|
||||
@@ -1032,7 +1033,8 @@ bool NativeWindowMac::HasShadow() {
|
||||
}
|
||||
|
||||
void NativeWindowMac::SetOpacity(const double opacity) {
|
||||
[window_ setAlphaValue:opacity];
|
||||
const double boundedOpacity = base::ClampToRange(opacity, 0.0, 1.0);
|
||||
[window_ setAlphaValue:boundedOpacity];
|
||||
}
|
||||
|
||||
double NativeWindowMac::GetOpacity() {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/numerics/ranges.h"
|
||||
#include "base/stl_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
@@ -880,6 +881,7 @@ bool NativeWindowViews::HasShadow() {
|
||||
|
||||
void NativeWindowViews::SetOpacity(const double opacity) {
|
||||
#if defined(OS_WIN)
|
||||
const double boundedOpacity = base::ClampToRange(opacity, 0.0, 1.0);
|
||||
HWND hwnd = GetAcceleratedWidget();
|
||||
if (!layered_) {
|
||||
LONG ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||
@@ -887,9 +889,11 @@ void NativeWindowViews::SetOpacity(const double opacity) {
|
||||
::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
|
||||
layered_ = true;
|
||||
}
|
||||
::SetLayeredWindowAttributes(hwnd, 0, opacity * 255, LWA_ALPHA);
|
||||
::SetLayeredWindowAttributes(hwnd, 0, boundedOpacity * 255, LWA_ALPHA);
|
||||
opacity_ = boundedOpacity;
|
||||
#else
|
||||
opacity_ = 1.0; // setOpacity unsupported on Linux
|
||||
#endif
|
||||
opacity_ = opacity;
|
||||
}
|
||||
|
||||
double NativeWindowViews::GetOpacity() {
|
||||
|
||||
@@ -50,9 +50,9 @@ network::mojom::HttpAuthDynamicParamsPtr CreateHttpAuthDynamicParams() {
|
||||
network::mojom::HttpAuthDynamicParamsPtr auth_dynamic_params =
|
||||
network::mojom::HttpAuthDynamicParams::New();
|
||||
|
||||
auth_dynamic_params->server_whitelist = command_line->GetSwitchValueASCII(
|
||||
auth_dynamic_params->server_allowlist = command_line->GetSwitchValueASCII(
|
||||
electron::switches::kAuthServerWhitelist);
|
||||
auth_dynamic_params->delegate_whitelist = command_line->GetSwitchValueASCII(
|
||||
auth_dynamic_params->delegate_allowlist = command_line->GetSwitchValueASCII(
|
||||
electron::switches::kAuthNegotiateDelegateWhitelist);
|
||||
auth_dynamic_params->enable_negotiate_port =
|
||||
command_line->HasSwitch(electron::switches::kEnableAuthNegotiatePort);
|
||||
|
||||
@@ -50,8 +50,8 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 7,0,0,20190731
|
||||
PRODUCTVERSION 7,0,0,20190731
|
||||
FILEVERSION 7,0,0,3
|
||||
PRODUCTVERSION 7,0,0,3
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "shell/browser/native_window_mac.h"
|
||||
#include "shell/browser/ui/cocoa/atom_preview_item.h"
|
||||
#include "shell/browser/ui/cocoa/atom_touch_bar.h"
|
||||
#include "ui/gfx/mac/coordinate_conversion.h"
|
||||
#include "ui/views/cocoa/native_widget_mac_ns_window_host.h"
|
||||
#include "ui/views/widget/native_widget_mac.h"
|
||||
|
||||
@@ -120,8 +121,10 @@ using TitleBarStyle = electron::NativeWindowMac::TitleBarStyle;
|
||||
|
||||
{
|
||||
bool prevent_default = false;
|
||||
gfx::Rect new_bounds(gfx::Point(sender.frame.origin), gfx::Size(newSize));
|
||||
shell_->NotifyWindowWillResize(new_bounds, &prevent_default);
|
||||
NSRect new_bounds = NSMakeRect(sender.frame.origin.x, sender.frame.origin.y,
|
||||
newSize.width, newSize.height);
|
||||
shell_->NotifyWindowWillResize(gfx::ScreenRectFromNSRect(new_bounds),
|
||||
&prevent_default);
|
||||
if (prevent_default) {
|
||||
return sender.frame.size;
|
||||
}
|
||||
|
||||
@@ -275,9 +275,6 @@ void MenuBar::OnMenuButtonClicked(views::Button* source,
|
||||
return;
|
||||
}
|
||||
|
||||
GetFocusManager()->SetFocusedViewWithReason(
|
||||
source, views::FocusManager::kReasonFocusTraversal);
|
||||
|
||||
// Deleted in MenuDelegate::OnMenuClosed
|
||||
MenuDelegate* menu_delegate = new MenuDelegate(this);
|
||||
menu_delegate->RunMenu(menu_model_->GetSubmenuModelAt(id), source,
|
||||
|
||||
@@ -7,6 +7,6 @@ mojom("mojo") {
|
||||
|
||||
public_deps = [
|
||||
"//mojo/public/mojom/base",
|
||||
"//ui/gfx/geometry/mojo",
|
||||
"//ui/gfx/geometry/mojom",
|
||||
]
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user