Compare commits

...

202 Commits

Author SHA1 Message Date
Electron Bot
1af3a71fdb Bump v8.0.0 2020-02-03 13:17:36 -08:00
trop[bot]
9f2371fc4e fix: bind spellchecker receivers correctly in the renderer (#22015)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-02-03 11:48:01 -08:00
trop[bot]
f658c1aeb4 fix: use the new MediaPlayPause key listener for internal chrome logic (#21998)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-02-03 10:28:32 -08:00
Samuel Attard
c196121467 Revert "Bump v8.0.0-beta.10"
This reverts commit a326408bce.
2020-02-03 10:24:51 -08:00
Electron Bot
133ac9a323 chore: bump chromium to 80.0.3987.86 (8-x-y) (#22000)
* chore: bump chromium in DEPS to 80.0.3987.84

* chore: bump chromium in DEPS to 80.0.3987.85

* chore: bump chromium in DEPS to 80.0.3987.86
2020-02-03 11:20:30 -05:00
Electron Bot
a326408bce Bump v8.0.0-beta.10 2020-01-31 15:19:09 -08:00
Samuel Attard
2085111c43 Revert "Bump v8.0.0-beta.10"
This reverts commit 7ae8d54265.
2020-01-31 15:17:13 -08:00
Electron Bot
7ae8d54265 Bump v8.0.0-beta.10 2020-01-31 13:39:41 -08:00
Samuel Attard
c5574c8667 feat: custom positioning for traffic light buttons (#21990)
* feat: custom positioning for traffic light buttons (#21781)

* feat: custom positioning for traffic light buttons

* remove NSLog and unnecessary call-site in IsVisible()

* no longer need to check if entering fullscreen

* change API to take a point object

Co-authored-by: tonyfwoo <55114329+tonyfwoo@users.noreply.github.com>

* chore: add safety checks to RepositionTrafficLights

Co-authored-by: Tony <TonyWuu@users.noreply.github.com>
Co-authored-by: tonyfwoo <55114329+tonyfwoo@users.noreply.github.com>
2020-01-31 13:35:47 -08:00
trop[bot]
6cf8abc3b3 fix: return path from netLog.stopLogging (#21989)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-01-31 11:22:14 -08:00
LuoJinghua
46a4864b08 feat: Exposing methods required by capturing a hidden webContents (#21895) 2020-01-31 11:21:42 -08:00
Electron Bot
7956b45323 chore: bump chromium in DEPS to 80.0.3987.82 (#21984) 2020-01-31 11:50:10 -05:00
trop[bot]
63bcbd4ff5 fix: prevent print crash on bad deviceName (#21982) 2020-01-31 16:26:19 +00:00
Electron Bot
3b5ca91a40 chore: bump chromium to 80.0.3987.79 (8-x-y) (#21953)
* chore: bump chromium in DEPS to 80.0.3987.78

* Update patches

* chore: bump chromium in DEPS to 80.0.3987.79

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-01-30 15:55:47 -05:00
Electron Bot
80282ba972 Bump v8.0.0-beta.9 2020-01-29 18:23:35 -08:00
Erick Zhao
7ddb3dd184 fix: add executable to ChromeDriver's rpath for electron 8+ (#21966) 2020-01-29 18:14:12 -08:00
trop[bot]
0cee5cc1c1 fix: ensure web_contents is not nullptr in UpdateDraggableRegions (#21965)
* fix: ensure web_contents is not nullptr in UpdateDraggableRegions

This is a speculative fix for a crash in `UpdateDraggableRegions` that we've noticed

* Update atom_api_browser_window_mac.mm

* Update atom_api_browser_window_mac.mm

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-01-29 17:43:55 -08:00
Jeremy Apthorp
048d770a0e fix: show module name in deprecation warning for context-aware modules (#21958) 2020-01-29 17:29:06 -08:00
Robo
b3fdb242f0 fix: compilation of native modules on windows with older msvc versions (#21950) (#21960) 2020-01-29 17:13:07 -08:00
Electron Bot
38d908ee6a Bump v8.0.0-beta.8 2020-01-29 11:22:54 -08:00
Alexey Kuzmin
416b850dd2 chore: fix linter errors in .mm files (#21933) 2020-01-29 17:04:14 +00:00
Erick Zhao
714e068cba refactor: try just using regular [Sync] for MessageSync (#20797) (#21948)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-01-29 07:11:32 -05:00
trop[bot]
0a0689587a chore: update build_bring_back_node_with_ltcg_configuration.patch (#21947)
* chore: update build_bring_back_node_with_ltcg_configuration.patch

set default value for node_with_ltcg=true

* fix: move ltcg definition to Release configuration

Co-authored-by: Robo <hop2deep@gmail.com>
2020-01-28 22:42:53 -08:00
trop[bot]
83c4633b21 fix: use powerMonitor.on() only after app is ready (#21942) 2020-01-28 22:13:19 +00:00
Electron Bot
a33063c8a7 chore: bump chromium in DEPS to 80.0.3987.75 (#21932) 2020-01-28 15:15:07 -05:00
trop[bot]
c478d45713 fix: ensure tray icon is the proper size on linux (#21936) 2020-01-28 18:15:22 +00:00
trop[bot]
74686a9cb3 fix: About Panel credits should be dark mode aware (#21926)
* fix: about panel credits should be dark mode aware

* use textColor for automatic adaptability

Co-authored-by: Shelley Vohr <codebytere@github.com>
2020-01-28 17:05:04 +09:00
Shelley Vohr
473a90f99f fix: window.print() only working once (#21908) 2020-01-28 02:11:05 +00:00
trop[bot]
15e9f22fda docs: clean up context bridge API docs (#21917) 2020-01-28 02:01:44 +00:00
Electron Bot
ee44155f7a chore: bump chromium to 80.0.3987.74 (8-x-y) (#21886) 2020-01-27 23:08:46 +00:00
Shelley Vohr
bf64b34475 fix: recursive printing crash (#21905) 2020-01-27 21:18:02 +00:00
trop[bot]
26dbd2218e fix: menu not updating with Tray.setContextMenu (#21902)
Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-01-27 15:48:02 +09:00
trop[bot]
38e46abf0b Update browser-window.md (#21901)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-01-27 14:56:03 +09:00
Electron Bot
67f7bf4a23 chore: bump chromium to 80.0.3987.69 (8-x-y) (#21863)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-01-23 10:38:06 -08:00
trop[bot]
02f040c765 docs: added info on bookmark return values for securityScopedBookmarks (#21874) 2020-01-22 18:37:32 -08:00
trop[bot]
9b841e4594 fix: Windows checkboxChecked edge case (#21861) 2020-01-22 18:36:03 -08:00
trop[bot]
a40957f2bc fix: some websites using WebComponents V0 not loading (#21866)
Co-authored-by: Shelley Vohr <codebytere@github.com>
2020-01-23 09:38:21 +09:00
trop[bot]
a6121f527c fix: call SetCanActivate in setFocusable (#21854)
Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-01-22 14:45:27 +09:00
Cheng Zhao
71a31d553f fix: crash when doing redirect navigation with webRequest listener (8-x-y) (#21841)
* fix: pass navigation_ui_data to proxying factory

* fix: clone response instead of move in redirect
2020-01-22 10:31:19 +09:00
Electron Bot
1a309fd55f chore: bump chromium in DEPS to 80.0.3987.64 (#21848) 2020-01-21 11:41:13 -08:00
Electron Bot
73527e54c5 chore: bump chromium to 80.0.3987.63 (8-x-y) (#21832) 2020-01-20 19:09:53 +00:00
trop[bot]
2ef0827767 fix: crash when restoring minimized hidden window (#21821)
Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-01-20 15:43:32 +09:00
Electron Bot
76bcab07e6 chore: bump chromium in DEPS to 80.0.3987.61 (#21826) 2020-01-18 17:45:23 +00:00
Electron Bot
5a5b6abd2c chore: bump chromium in DEPS to 80.0.3987.60 (#21817) 2020-01-17 10:27:43 -08:00
Electron Bot
4ce5a48076 Bump v8.0.0-beta.7 2020-01-16 09:55:43 -08:00
Electron Bot
7b61e6044a chore: bump chromium in DEPS to 80.0.3987.59 (#21800) 2020-01-16 12:08:28 -05:00
trop[bot]
048f06c7f5 feat: add session.addWordToSpellCheckerDictionary to allow custom words in the dictionary (#21297)
* feat: add session.addWordToSpellCheckerDictionary to allow custom words in the dictionary

* Update session.md

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-01-16 09:47:58 -05:00
trop[bot]
06868c938f fix: printToPDF failing to generate PDF (#21797)
Co-authored-by: Shelley Vohr <codebytere@github.com>
2020-01-16 09:39:26 -05:00
Electron Bot
22e8fc6379 chore: bump chromium in DEPS to 80.0.3987.58 (#21789) 2020-01-15 19:04:45 -05:00
trop[bot]
427c139eff fix: pass full response headers in net module (#21769)
* fix: pass full response headers in net module

* chore: put helper classes in annoymouse namespace

* fix: use hasOwnProperty to test key

* chore: shorter class name

Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-01-15 13:38:09 +09:00
Electron Bot
6a881520ee chore: bump chromium in DEPS to 80.0.3987.55 (#21765) 2020-01-14 06:56:22 -08:00
trop[bot]
5a2c451c0b fix: stream protocols not completing (#21759)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-01-14 16:09:46 +09:00
Robo
f47fbccf1a Fix memory leak in generator functions (#21760)
Backports https://chromium-review.googlesource.com/c/v8/v8/+/1967317
2020-01-14 16:08:41 +09:00
Electron Bot
eb419946ad Bump v8.0.0-beta.6 2020-01-13 10:25:18 -08:00
Electron Bot
1b204a4369 chore: bump chromium to 80.0.3987.51 (8-x-y) (#21738)
* chore: bump chromium in DEPS to 80.0.3987.49

* chore: bump chromium in DEPS to 80.0.3987.50

* chore: bump chromium in DEPS to 80.0.3987.51
2020-01-13 13:13:02 -05:00
Cheng Zhao
ee2de310f5 fix: disable private macOS APIs in MAS build except for CAContext/CALayerHost (8-x-y) (#21574)
* fix: add patch to disable remote accessibility APIs

* fix: add patch to disable private window frame APIs
2020-01-13 09:06:13 -05:00
trop[bot]
e81aa83a14 fix: don't fallback to OpenFolderViaShell (#21748)
Co-authored-by: Shelley Vohr <codebytere@github.com>
2020-01-13 14:56:19 +09:00
trop[bot]
96cae44f32 fix: prefer occluded rather than unloading layout info (#21751)
Co-authored-by: loc <andy@slack-corp.com>
2020-01-13 14:55:05 +09:00
Milan Burda
757e7a91a9 fix: load window-setup in sandboxed renderer (#21416) (#21431) 2020-01-13 11:04:10 +09:00
trop[bot]
6faef05095 docs: responseHeaders should be Record<string, string[]> (#21743)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-01-13 09:51:59 +09:00
Shelley Vohr
ee65a190fa chore: deprecate visibleOnFullScreen option (#21732) 2020-01-13 09:48:16 +09:00
trop[bot]
da45f0341a fix: avoid contextBridge double free on garbage collection (#21735)
* fix: reset next/prev pointers for life-monitored nodes

* fix: don't double-delete nodes in a linked list

Co-authored-by: loc <andy@slack-corp.com>
2020-01-10 16:56:40 -08:00
Electron Bot
c6517c0b7f chore: bump chromium in DEPS to 80.0.3987.48 (#21728) 2020-01-10 11:47:38 -08:00
trop[bot]
2c92573978 fix: don't unnecessarily copy draggable regions (#21722) 2020-01-10 09:09:26 -08:00
trop[bot]
fa7326af64 fix: Notification crash in before-quit (#21720) 2020-01-10 09:08:24 -08:00
Electron Bot
aca96553fc chore: bump chromium to 80.0.3987.47 (8-x-y) (#21651)
* chore: bump chromium in DEPS to 80.0.3987.32

* chore: bump chromium in DEPS to 80.0.3987.33

* chore: bump chromium in DEPS to 80.0.3987.34

* chore: bump chromium in DEPS to 80.0.3987.36

* chore: bump chromium in DEPS to 80.0.3987.37

* chore: bump chromium in DEPS to 80.0.3987.38

* chore: bump chromium in DEPS to 80.0.3987.39

* chore: bump chromium in DEPS to 80.0.3987.40

* chore: bump chromium in DEPS to 80.0.3987.43

* chore: bump chromium in DEPS to 80.0.3987.47
2020-01-09 08:22:19 -08:00
trop[bot]
37592cdaee refactor: throw error for getLastCrashReport if crashReporter not started (#21685) 2020-01-07 09:15:50 -05:00
trop[bot]
64e48ad0e6 fix: SimpleURLLoaderWrapper redirects (#21566) (#21644) 2020-01-01 09:31:38 +09:00
trop[bot]
68566583f0 fix: highlight defaulted button correctly (#21653) 2019-12-31 08:42:07 -08:00
Electron Bot
6a56aa2240 chore: bump chromium to 80.0.3987.31 (8-x-y) (#21557)
* chore: bump chromium in DEPS to 80.0.3987.16

* chore: bump chromium in DEPS to 80.0.3987.18

* chore: bump chromium in DEPS to 80.0.3987.20

* chore: bump chromium in DEPS to 80.0.3987.21

* chore: bump chromium in DEPS to 80.0.3987.22

* chore: bump chromium in DEPS to 80.0.3987.23

* chore: bump chromium in DEPS to 80.0.3987.24

* chore: bump chromium in DEPS to 80.0.3987.25

* chore: bump chromium in DEPS to 80.0.3987.26

* chore: bump chromium in DEPS to 80.0.3987.27

* chore: bump chromium in DEPS to 80.0.3987.28

* chore: bump chromium in DEPS to 80.0.3987.29

* chore: bump chromium in DEPS to 80.0.3987.30

* chore: bump chromium in DEPS to 80.0.3987.31
2019-12-30 08:53:24 -08:00
trop[bot]
7e8c1108e0 fix: set enable_negotiate_port to false in allowNTLMCredentialsForDomains (#21580)
* fix: set enable_negotiate_port to false in allowNTLMCredentialsForDomains

* read commandline switch

Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2019-12-19 19:26:46 -08:00
trop[bot]
f5ce5f8218 build: free up macos disk space on Mac publish (#21570) 2019-12-18 16:40:09 -08:00
Electron Bot
28e44b31ca Bump very far --> this is electron bot fixing the release 2019-12-18 14:04:34 -08:00
Samuel Attard
606ca98df0 build: handle origin/X branch formats 2019-12-18 14:02:38 -08:00
Electron Bot
acd2eabdfd Bump v8.0.0-beta.5 2019-12-17 16:05:21 -08:00
Shelley Vohr
07972c2892 Revert "Bump v8.0.0-beta.6"
This reverts commit 70079d1c8a.
2019-12-17 15:47:28 -08:00
Electron Bot
70079d1c8a Bump v8.0.0-beta.6 2019-12-17 15:16:32 -08:00
trop[bot]
4def69876f fix: enforce parent-child relationship in custom postMessage() handler (#21512) 2019-12-17 15:08:36 -08:00
John Kleinschmidt
61a2c7bd16 Revert "Bump v8.0.0-beta.5"
This reverts commit 6c1eb46f68.
2019-12-17 13:52:56 -08:00
Shelley Vohr
f53262d58f fix: MediaKey globalShortcuts not working on macOS (#21547) 2019-12-17 13:36:47 -08:00
trop[bot]
8c15619905 docs: update webContents.printToPDF() example for promisified API (#21549) 2019-12-16 21:29:03 -08:00
trop[bot]
4a66bed930 refactor: export internalWindowOpen from guest-window-manager (#21530) 2019-12-16 13:55:17 -08:00
trop[bot]
8dabb3fe33 docs: update installation docs to reflect latest @electron/get changes (#21540) 2019-12-16 13:53:43 -08:00
Electron Bot
3f88934025 chore: bump chromium to 80.0.3987.14 (8-x-y) (#21520)
* chore: bump chromium in DEPS to 80.0.3987.12

* chore: bump chromium in DEPS to 80.0.3987.13

* chore: bump chromium in DEPS to 80.0.3987.14
2019-12-16 12:43:29 -05:00
trop[bot]
296dcc3405 fix: avoid contextBridge crash when RenderFrame address is reused (#21513)
* fix: avoid contextBridge crash when RenderFrame address is reused

Co-Authored-By: Jeremy Apthorp <nornagon@nornagon.net>

* make routing_id_ const
2019-12-16 11:01:20 +09:00
trop[bot]
5f6de7053a fix: quit after Chromium is fully started (#21507)
* fix: quit when chromium is fully started

* test: remove hacks on app.quit

* chore: RunUntilIdle is unnecessary
2019-12-16 09:45:45 +09:00
Electron Bot
6c1eb46f68 Bump v8.0.0-beta.5 2019-12-14 08:10:53 -08:00
Electron Bot
05cde0d945 chore: bump chromium to 80.0.3987.6 (8-x-y) (#21061) 2019-12-13 12:13:29 -08:00
trop[bot]
696c94c08a fix: sourcemaps not loading with network service (#21493)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/1525270
Backports https://chromium-review.googlesource.com/c/chromium/src/+/1852212
2019-12-12 18:55:44 -08:00
trop[bot]
4284691cb3 fix: avoid Electron.dsym files in the main app bundle (#21484)
* ci: CHECK_DIST_MANIFEST in release builds

* fix: skip Electron.dSYM on macOS app zip
2019-12-11 13:16:56 -08:00
trop[bot]
2ab56802cb fix: restore POST forms that open a new window with target=_blank (#21474)
* fix: restore parts of original ResourceRequestBody V8 conversion

Restore some of the original conversion logic in order to fix target=_blank post form submissions.

* test: add test for POST form submission
2019-12-11 19:36:01 +09:00
Cheng Zhao
353d12b231 fix: name and expirationDate should be optional when setting cookie (#21454) (#21477)
* fix: correctly set cookie date

* fix: name is not required for setting cookie

* test: clear cookie after each cookie test

* test: should test session property

* chore: style fixes
2019-12-11 19:34:23 +09:00
trop[bot]
cbd734faf9 fix: restore accessibility window title on macOS (#21467)
Electron's `AtomNSWindow` implements `accessibilityAttributeValue` to
provide various accessibility info to the OS, including window titles.

Chromium 75 changed to Apple's newer accessibility API for window titles
in the super class that `AtomNSWindow` inherits from. macOS still
supports both the old and new style APIs, but it will prefer the new
style if it is implemented.  This means the Electron window title is
being ignored because the newer API at the Chromium level has taken
precedence.

By implementing the newer accessibility API in `AtomNSWindow`, this
restores correct accessibility window titles in macOS Electron apps.

This is a regression has been present since Electron 6.0.0 (the first
release including the Chromium change above).
2019-12-10 18:45:18 -08:00
trop[bot]
cf282c177f fix: window menu should handle keys correctly (#21452) 2019-12-10 10:08:15 -08:00
trop[bot]
e8c8afb1b4 fix: Fix compositor recycling when creating new BrowserView (#21399)
In #20829, we fixed compositor recycling when switching between
BrowserViews, but it turns out that there is one additional case that we
need to handle. When we create a completely new BrowserView instance, it
starts of as visible (even when it hasn't been added to the window),
which means that it will need its own compositor instead of using the
recycled compositor.

To fix this, lets make BrowserViews hidden by default until they're
added to the window. See also #19988. This is a potentially breaking
change given that the initial value of `document.visibilityState` will
now be `hidden`, but given the experimental status of BrowserViews, I
think this is a fine change to make. The old behavior can be restored
with `webPreferences: { show: true }`.

Notes: Fix compositor recycling when creating new BrowserView
2019-12-10 10:05:10 +09:00
trop[bot]
dd0d06448c fix: hiding window menu should work on startup (#21443)
* fix: menu visibility should not be overwritten on startup

* fix: removing menu for window without global menubar

* test: setMenu tests are not for mac
2019-12-10 09:29:00 +09:00
trop[bot]
3527fdc291 chore: workflows and pipeline state were split in the circle API (#21444) 2019-12-09 11:32:55 -08:00
trop[bot]
a6b9d68897 fix: fix ClientRequest.getUploadProgress (#21424) 2019-12-09 11:18:39 -08:00
trop[bot]
e1e7ec737f fix: pass noLink correctly on Windows (#21405) 2019-12-08 10:39:35 -08:00
trop[bot]
4fd03f59f4 docs: fix return type of getPrinters (#21421) 2019-12-08 10:38:17 -08:00
trop[bot]
e64e0f00ca fix: do not use messages after move (#21420) 2019-12-06 14:41:29 -08:00
trop[bot]
1bfead2f6b fix: ensure persistence store still exists when GC runs (#21418)
Fix a bad access crash that happens when a render frame is deleted (window closed) and garbage collection runs afterward.
2019-12-06 12:35:32 -08:00
Jacob
c79f1ee720 fix: prevent silent failure when DOM storage quota exceeded (#20899) (#21380)
* test: update DOM storage quota limits test

* fix: update dom_storage_limits.patch (fixes #13465)

The previous version of this patch did not include
changes required to circumvent the quota enforcement
performed by StorageAreaImpl. Consequently when
the quota was exceeded, things still "appeared to
work" at first but then would later fail silently.
That is, the cache would be updated but the backing
store would not.

This could be fixed by disabling the code below
(from `content/browser/dom_storage/storage_area_impl.cc`)
```
  // Only check quota if the size is increasing, this allows
  // shrinking changes to pre-existing maps that are over budget.
  if (new_item_size > old_item_size && new_storage_used > max_size_) {
    if (map_state_ == MapState::LOADED_KEYS_ONLY) {
      receivers_.ReportBadMessage(
          "The quota in browser cannot exceed when there is only one "
          "renderer.");
    } else {
      std::move(callback).Run(false);
    }
    return;
  }
```

However, since this seems to have some unintended side-effects
(see updated notes in dom_storage_limits.patch) it seems
more prudent to simply increase the quota to a larger
yet still reasonable size rather than attempt to circumvent
the storage quota altogether.
2019-12-04 12:27:43 -08:00
trop[bot]
e18c369e4a fix: deprecate setLayoutZoomLevelLimits (#21360) 2019-12-04 08:46:15 -08:00
trop[bot]
1953ab3bf2 chore: remove unused shell/common/crash_reporter/win/crash_service.cc (#21376) 2019-12-04 16:40:40 +09:00
Electron Bot
d998bf9fed Bump v8.0.0-beta.4 2019-12-03 16:37:39 -08:00
Electron Bot
40eff3a778 Revert "Bump v8.0.0-beta.4"
This reverts commit 9dd089fc56.
2019-12-03 16:17:17 -08:00
Electron Bot
9dd089fc56 Bump v8.0.0-beta.4 2019-12-03 16:11:22 -08:00
Electron Bot
5e2bd0e55f Revert "Bump v8.0.0-beta.4"
This reverts commit 95b8be4cc4.
2019-12-03 13:31:30 -08:00
Electron Bot
95b8be4cc4 Bump v8.0.0-beta.4 2019-12-03 13:28:04 -08:00
Jeremy Apthorp
d48f99fd6e ci: generate debug symbols on Linux (#21278)
* ci: generate debug symbols on Linux (#18676)

* kick ci
2019-12-03 11:03:51 -05:00
trop[bot]
3a9b934cc5 fix: backgroundThrottling rwh assignment (#21358)
* fix: backgroundThrottling rwh assignment

* fix: disable DOM timer throttling

* chore: fix typo
2019-12-02 15:42:44 -08:00
Electron Bot
768f372675 Revert "Bump v8.0.0-beta.4"
This reverts commit 9e3f0d5190.
2019-12-02 13:55:49 -08:00
Electron Bot
9e3f0d5190 Bump v8.0.0-beta.4 2019-12-02 13:53:37 -08:00
Electron Bot
5a297f409f Revert "Bump v8.0.0-beta.4"
This reverts commit 57335cea69.
2019-12-02 12:32:55 -08:00
Electron Bot
57335cea69 Bump v8.0.0-beta.4 2019-12-02 12:30:44 -08:00
trop[bot]
3331f51571 fix: ensure no node globals passively leak when nodeIntegration is disabled (#21355) 2019-12-02 12:27:51 -08:00
Robo
f122268ca8 fix: focus with OOPIF embedded inside <webview> (#21343)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/1922650
2019-12-02 10:26:35 -08:00
Robo
bfc817fd28 build: fix building with enable_builtin_spellchecker = false (#21334) (#21341) 2019-11-30 16:22:50 -08:00
trop[bot]
2bd83d0e89 fix: correctly plumb checkboxChecked on win (#21312)
* fix: correctly plumb checkboxChecked on win

* address final style comment
2019-11-29 17:23:43 +09:00
Jeremy Apthorp
f29f3418ed refactor: rewrite the net module to simplify state tracking (#21303)
* refactor: rewrite the net module to simplify state tracking (#21244)

* fix build

* Update atom_api_net.cc
2019-11-29 17:22:45 +09:00
trop[bot]
c87a0077dd build: disable strip_absolute_paths_from_debug_symbols on debug.gn (#21316) 2019-11-29 17:22:17 +09:00
Jeremy Apthorp
23c1dcea46 fix: restore --ignore-connections-limit functionality (#21286) (#21298) 2019-11-27 16:41:44 +09:00
Samuel Attard
41e64d2469 chore: add deprecation warning for the default of allowRendererProcessReuse (#21287)
* chore: add deprecation warning for the default of allowRendererProcessReuse

* Update web-contents.js
2019-11-26 15:48:35 -08:00
Jeremy Apthorp
5fdc24d3bf fix: record cpu_profiler data for main process (#21187) (#21276)
* fix: record cpu_profiler data for main process

* kick ci
2019-11-26 13:20:15 -08:00
Samuel Attard
64dc86c8c2 fix: allow reading body from non-2xx responses in net.request (#21055) (#21285)
* fix(urlrequest): allow non-2xx repsponse results

- closes #21046

* test(net): add test cases to verify non-2xx body

* test(session): update spec to match clientrequest behavior

* test(net): update test cases to match clientrequest behavior

* spec: clean up async net spec
2019-11-26 13:10:07 -08:00
Jeremy Apthorp
9d1ec6b0eb fix: implement 'login' event for net.ClientRequest (#21133)
* fix: implement 'login' event for net.ClientRequest (#21096)

* lint

* more lint

* whoops forgot patch

* fix compile

* fix ts

* i swear to god i already fixed this

* ugh

* asfdsafd

* disambiguate callback converter (i hope)

* Update atom_api_url_request_ns.cc

* use gin, not mate
2019-11-26 11:32:28 -08:00
trop[bot]
8919480ebc fix: reloadIgnoringCache() should ignore the cache (#21283) 2019-11-25 12:51:02 -08:00
trop[bot]
bb9e68beee fix: add missing early return (#21282) 2019-11-25 12:50:52 -08:00
trop[bot]
88c1f2caf7 feat: expose executeJavaScriptInIsolatedWorld on webContents (#21267)
* feat: expose executeJavaScriptInIsolatedWorld on webContents

* Apply suggestions from code review

Co-Authored-By: loc <andy@slack-corp.com>
2019-11-22 20:44:39 -08:00
Shelley Vohr
88375be2b2 fix: conversion of NativeImage from path (#21241) 2019-11-22 10:26:13 -08:00
trop[bot]
2aa69505f9 docs: remove string literal type from window events (#21245) 2019-11-21 14:50:02 -08:00
Electron Bot
e78fe7c8da Bump v8.0.0-beta.3 2019-11-20 11:24:28 -08:00
trop[bot]
7a7b944c74 build: update release build endpoint from /jobs to /job (#21233) 2019-11-20 14:23:13 -05:00
Electron Bot
09f5a2b741 Revert "Bump v8.0.0-beta.3"
This reverts commit cbf50eabd9.
2019-11-20 11:16:26 -08:00
Electron Bot
cbf50eabd9 Bump v8.0.0-beta.3 2019-11-20 11:14:52 -08:00
trop[bot]
90a74139c1 build: delete unneeded files when running a release (#21230)
* build: delete unneeded files when running a release

Needed to free up disk space on MacOS.

* Delete all the .git directories

* Update comment

* Run gn gen after deleting .git dirs
2019-11-20 14:04:25 -05:00
Cheng Zhao
3a6cc1b786 fix: menu should not be garbage-collected when popuping (8-x-y) (#21224)
* fix: retain menu when popuping

* test: menu should not be garbage-collected when popuping
2019-11-20 11:19:21 -05:00
trop[bot]
f5fde13b14 spec: skip flaky <webview>.capturePage() test on Windows (#21212) 2019-11-20 11:00:52 -05:00
John Kleinschmidt
c6d429d533 Revert "Bump v8.0.0-beta.3"
This reverts commit 269f4ba2bb.
2019-11-19 16:53:29 -05:00
Charles Kerr
73df925241 docs: document webkitdirectory breaking change (#21209) 2019-11-19 15:31:06 -05:00
Electron Bot
269f4ba2bb Bump v8.0.0-beta.3 2019-11-19 11:41:06 -08:00
Electron Bot
9b304beb54 Revert "Bump v8.0.0-beta.3"
This reverts commit 5ffad09e91.
2019-11-19 11:34:24 -08:00
Electron Bot
5ffad09e91 Bump v8.0.0-beta.3 2019-11-19 11:32:01 -08:00
John Kleinschmidt
b694315cd3 Revert "Bump v8.0.0-beta.3" (#21207)
This reverts commit 7fe2f25341.
2019-11-19 14:21:25 -05:00
trop[bot]
8566315902 fix: allow chromium to handle WM_NCCALCSIZE for frameless windows (#21201) 2019-11-19 14:18:50 -05:00
trop[bot]
cd94ab9de3 build: use python3 to download external binaries (#21202)
* build: use python3 to download external binaries

* Update config.py
2019-11-19 08:40:51 -08:00
trop[bot]
09ebadaf5b build: use symbol_level 1 for 32bit linux releases (#21204)
* build: use symbol_level 1 for 32bit linux releases

* Add comment
2019-11-19 08:14:34 -08:00
trop[bot]
990189ab35 fix: stream protocols sometimes flake out (#21180) 2019-11-19 06:31:07 -08:00
trop[bot]
049e536c5f docs: fix isMactemplateImage type definition (#21182) 2019-11-18 21:04:01 -08:00
Electron Bot
7fe2f25341 Bump v8.0.0-beta.3 2019-11-18 10:41:07 -08:00
Charles Kerr
c79809ddb9 build: missing include in windows release builds (#21132)
* fix: add missing `#include <algorithm>` as needed

Manual backport of #21045

* fix: add missing `#include <algorithm>` as needed

Manual backport of #21045

* chore: add patch to include missing `#include <memory>`

* chore: add another `#include <memory>` needed

* chore: regenerate patches w/correct breakpad root

* chore: regenerate breakpad include failure patches

* refactor: use --keep-cr in the git am patch script

We need something like this to patch files that have crlf endings. See
https://stackoverflow.com/questions/6289001/git-am-format-patch-control-format-of-line-endings

* chore: regenerate node patches

The udpated crlf support in git-{import,export}-patches caused a new
warning when applying patches from `electron/patches/nodes`, so refresh
the patches.

* chore: no need to regenerate node patches

* chore: silence whitespace warnings

* chore: fix FTBFS from stl features used but not included

* fixup! refactor: use --keep-cr in the git am patch script
2019-11-18 10:39:59 -08:00
Robo
b3edf86914 fix: incorrect size of windows on differently scaled monitors (#21139)
* Revert "fix: handle WM_GETMINMAXINFO instead of letting chromium do it (#19928)"

This reverts commit 27ce6a9cd3.

* fix: don't reset the width and height when correcting window placement
2019-11-15 09:28:47 -08:00
John Kleinschmidt
7044122f5d chore: Reset version for 8-x-y (#21134)
* Revert "Bump v8.0.0-beta.4"

This reverts commit 2560776888.

* Revert "Bump v8.0.0-beta.3"

This reverts commit d5d5fef931.
2019-11-14 16:34:57 -08:00
Jeremy Apthorp
b7bcce9576 fix: implement login event for WebContents (#21098)
* fix: implement login event for WebContents

* fix gin header path

* use mate

* correct path to native_mate/dictionary.h

* use BindRepeating bc apparently no BindOnce converter...?
2019-11-14 16:18:28 -08:00
Electron Bot
2560776888 Bump v8.0.0-beta.4 2019-11-14 10:20:46 -08:00
Electron Bot
d5d5fef931 Bump v8.0.0-beta.3 2019-11-14 09:50:16 -08:00
Cheng Zhao
6b158872fc fix: webRequest should be able to modify CORS headers (#21099) (#21122) 2019-11-14 12:45:25 -05:00
Andrew MacDonald
a4ef2d4356 feat: add app.getApplicationNameForProtocol API (#20399) (#21117)
* Add GetApplicationNameForProtocol.

* Fix Windows implementation.

* Fix up test.

* Add documentation.

* Implement for real on Linux using xdg-mime.

Also ensure we allow blocking calls here to avoid errant DCHECKing.

* Improve docs for Linux.

* Clean up tests.

* Add a note about not relying on the precise format.

* Update docs/api/app.md

Co-Authored-By: Shelley Vohr <codebytere@github.com>

* Remove needless `done()`s from tests.

* Use vector list initialization.

* Add a simple test for isDefaultProtocolClient.

* Remove unneeded include and skip a test on Linux CI.

* We no longer differentiate between CI and non-CI test runs.
2019-11-14 12:38:54 -05:00
Milan Burda
14cc902ad8 feat: add 'screen' to systemPreferences.getMediaAccessStatus() (#21116) 2019-11-14 15:15:24 +00:00
Milan Burda
a62a367b9f fix: NativeImage serialization of <webview>.capturePage() result (#21103)
* refactor: add Error to isSerializableObject() (#20886)

* fix: NativeImage serialization of <webview>.capturePage() result (#20825)
2019-11-14 10:36:22 +00:00
Shelley Vohr
8d67f16512 fix: refactor printing for mojo (#21059) 2019-11-13 17:43:38 +00:00
loc
59cb78e9aa fix: allow iframe-initiated HTML fullscreen to exit while in macOS fullscreen (8-x-y) (#21042)
* fix: explicitly resize the contents when exiting html fullscreen while in OS fullscreen

* test: ensure HTML fullscreen toggles while in OS fullscreen
2019-11-13 14:33:31 +09:00
Samuel Attard
032552df57 build: depend on chromium version not SHA (#20839) 2019-11-08 16:35:10 -08:00
trop[bot]
1913926ebc feat: deprecate <webview>.getWebContents() (#21039) 2019-11-07 15:31:54 -05:00
trop[bot]
dc979388ba fix: check for validity of guest webcontents (#21035) 2019-11-07 13:37:14 -05:00
trop[bot]
bcabc25b93 fix: Fix broken globalShortcuts.registerAll() on non-macOS platforms (#20984)
This was a regression in #16125, which unintentionally put
`GlobalShortcutListener::RegisterAccelerator` into a
`#if defined(OS_MACOSX)` block.

Notes: Fix broken `globalShortcut.registerAll()` on Windows and Linux
2019-11-06 23:01:51 -08:00
trop[bot]
ab6d22c958 docs: fix win.setIcon ts type (#20981)
* docs: fix win.setIcon ts type

* test: update smoke tests
2019-11-06 16:25:26 -08:00
trop[bot]
806925ee79 fix: proper i18n of recentDocuments item (#20956) 2019-11-06 13:57:42 -08:00
Samuel Attard
a46b50fc7b fix: correctly emplace optional values in the value converter (#20985)
* fix: correctly emplace optional values in the value converter

* chore: replace optional with nullopt when the conversion failed
2019-11-06 10:34:29 -08:00
trop[bot]
517a5915d7 chore: emit the document-start and document-end events in a sandboxed renderer (#20992) 2019-11-05 19:25:10 -08:00
trop[bot]
1de38af8cc chore: upgrade ts generator for better type safety (#20976)
* chore: upgrade ts generator for better type safety

* spec: fix tests
2019-11-05 15:20:08 -08:00
trop[bot]
66a95db3df docs: update installation instructions for proxies (#20979) 2019-11-05 13:45:14 -08:00
trop[bot]
7b779c6e6a fix: cannot access nativeTheme via electron.remote (#20953) 2019-11-04 16:00:28 -08:00
trop[bot]
429dfd7054 fix: don't export __esModule = true by electron.ts (#20952) 2019-11-04 16:00:03 -08:00
Samuel Attard
03f7a85cfb fix: capture the promise global to avoid userland mutation (#20925) (#20946) 2019-11-04 15:58:28 -08:00
trop[bot]
2d2a753dd9 fix: don't copy tray image when it's set (#20936) 2019-11-04 14:17:18 -08:00
trop[bot]
028e3889f0 fix: use Unicode version of ShellExecute() in OpenExternalOnWorkerThread() (#20906) 2019-11-01 18:25:29 -07:00
trop[bot]
47eb123649 build: lengthen wait times and retries for CircleCI releases (#20894)
* build: lengthen wait times and retries for CircleCI releases

* Review suggestions

* build: allow CircleCI timeout and retry to be set via env variables (#20896)

* build: allow circleci timeout and retry to be set via env variables

* check for more statuses and run indefinitely

(cherry picked from commit 4240017cb6)
2019-11-01 14:17:24 -04:00
trop[bot]
45ab098079 build: enable sccache on windows (#20898)
* build: enable sccache on windows

* chore: temporarily disable the docs only check

* build: fix escaping in sccache path on windows

* Update appveyor.yml

* Update appveyor.yml

* Use sccache settings from CI

* Use Azure enabled sccache for Windows
2019-11-01 11:46:10 -04:00
Electron Bot
6cfc05ded2 Bump v8.0.0-beta.2 2019-10-31 14:37:20 -07:00
Samuel Attard
40e0e8e499 feat: enable builtin spellchecker (#20897)
* feat: enable builtin spellchecker (#20692)

* chore: add code required to use chromes spellchecker

* chore: fix linting

* chore: manifests needs buildflags now

* chore: add dictionarySuggestions to the context menu event when the spellchecker is active

* chore: enable by default for windows builds

* chore: add patch to remove incognito usage in the spellchecker

* chore: add dependencies on spellcheck common and flags

* chore: conditionally include spell check panel impl

* chore: fix deps for spellcheck feature flags

* chore: add patch for electron resources

* chore: add dependency on //components/language/core/browser

* chore: patches to make hunspell work on windows

* build: collect hunspell dictionaries into a zip file and publish

* chore: clean up patches

* chore: add docs and set spell checker url method

* chore: fix error handling

* chore: fix hash logic

* build: update hunspell filename generator

* fix: default spellchecker list to the current system locale if we can

* docs: document the language getter

* chore: patch IDS_ resources for linux builds

* feat: add spellcheck webpref flag to disable the builtin spellchecker

* chore: fix docs typo

* chore: clean up spellchecker impl as per feedback

* remove unneeded deps

* chore: disable spellcheck by default in web prefs
2019-10-31 14:35:38 -07:00
trop[bot]
beff8b8b51 docs: clean up performance checklist formatting (#20888)
* docs: fix list formatting in performance checklist

* docs: remove unused link ref
2019-10-31 09:52:36 -07:00
trop[bot]
311723396a fix: swapped labels on open/save gtkdialog (#20883) 2019-10-31 08:42:37 -07:00
trop[bot]
d39d75321a build: do not try to run non existent VSTS release builds (#20878) 2019-10-31 10:53:44 -04:00
Birunthan Mohanathas
55201d7db6 fix: Disable compositor recycling only for attached views (8-x-y) (#20847)
Backport of #20829

Notes: Fix flicker when switching between `BrowserView`s
2019-10-30 16:52:33 -04:00
trop[bot]
ac46d5b16e fix: devtools extensions not loading (#20842) 2019-10-30 09:16:32 -07:00
Milan Burda
a1fb069624 fix: pass frameId to v8Util.setRemoteCallbackFreer() (#20732) (#20813) 2019-10-30 14:35:18 +09:00
trop[bot]
3aa33dd220 fix: do not DCHECK production-necessary methods (#20836) 2019-10-29 14:49:12 -07:00
trop[bot]
9b74d0d54a fix: properly generate requestID in webContents.printToPDF() (#20802) 2019-10-29 15:39:41 +09:00
trop[bot]
018fc2ca46 fix: deprecation warnings in Electron code (#20805) 2019-10-29 15:38:25 +09:00
trop[bot]
e286b78df7 docs: the ipc main listener being removed can have args (#20807) 2019-10-29 15:34:44 +09:00
Shelley Vohr
f77bd19a70 fix: prevent menu gc during popup (#20785) 2019-10-29 13:21:08 +09:00
trop[bot]
cff63d32a0 chore: fix formatting of a few Python files (#20778) 2019-10-28 15:36:53 -04:00
trop[bot]
a8e7696674 ci: skip build on doc only changes (#20717)
* ci: skip build on doc only changes

* Try using exit codes on doc-only-change

* Fixup

* Fixup circleci doc-only check

* Update appveyor.yml

Co-Authored-By: Samuel Attard <sattard@slack-corp.com>

* Properly detect doc only change on Windows

* Flip exit code per review

* build: fix doc only change when there isn't a PR (#20749)

* build: fix doc only change when there isn't a PR

Fixes issue where CI was mistakenly marking a PR as a doc only change because the CI was kicked off before the PR was created.

(cherry picked from commit 73da4b7215)
2019-10-28 11:14:50 -04:00
trop[bot]
5fc689dc4e docs: fix process.getSystemVersion() type (#20767) 2019-10-27 11:21:00 -07:00
Electron Bot
895bdc0ee0 Bump v8.0.0-beta.1 2019-10-24 12:05:38 -07:00
Electron Bot
c99f1d317e Revert "Bump v8.0.0-beta.1"
This reverts commit 315e3e325d.
2019-10-23 16:07:43 -07:00
Electron Bot
315e3e325d Bump v8.0.0-beta.1 2019-10-23 16:04:33 -07:00
Samuel Attard
8acce4279b Revert "Bump v8.0.0-beta.1"
This reverts commit c8943cdc3c.
2019-10-23 16:03:04 -07:00
Electron Bot
c8943cdc3c Bump v8.0.0-beta.1 2019-10-23 13:15:01 -07:00
trop[bot]
f74f009648 build: handle -x-y format for getCurrentBranch (#20711) 2019-10-23 13:03:50 -07:00
456 changed files with 9312 additions and 6228 deletions

View File

@@ -65,18 +65,22 @@ machine-linux-2xlarge: &machine-linux-2xlarge
machine-mac: &machine-mac
macos:
xcode: "9.4.1"
xcode: "10.3.0"
machine-mac-large: &machine-mac-large
resource_class: large
macos:
xcode: "9.4.1"
xcode: "10.3.0"
# Build configurations options.
env-debug-build: &env-debug-build
GN_CONFIG: //electron/build/args/debug.gn
SKIP_DIST_ZIP: '1'
env-mac-debug-build: &env-mac-debug-build
# Set symbol level to 1 so that debug builds do not run out of disk space
GN_BUILDFLAG_ARGS: 'symbol_level = 1'
env-testing-build: &env-testing-build
GN_CONFIG: //electron/build/args/testing.gn
CHECK_DIST_MANIFEST: '1'
@@ -85,6 +89,7 @@ env-release-build: &env-release-build
GN_CONFIG: //electron/build/args/release.gn
STRIP_BINARIES: true
GENERATE_SYMBOLS: true
CHECK_DIST_MANIFEST: '1'
env-headless-testing: &env-headless-testing
DISPLAY: ':99.0'
@@ -155,6 +160,10 @@ env-ninja-status: &env-ninja-status
env-disable-run-as-node: &env-disable-run-as-node
GN_BUILDFLAG_ARGS: 'enable_run_as_node = false'
env-32bit-release: &env-32bit-release
# Set symbol level to 1 for 32 bit releases because of https://crbug.com/648948
GN_BUILDFLAG_ARGS: 'symbol_level = 1'
# Individual (shared) steps.
step-maybe-notify-slack-failure: &step-maybe-notify-slack-failure
run:
@@ -246,14 +255,21 @@ step-get-more-space-on-mac: &step-get-more-space-on-mac
command: |
if [ "`uname`" == "Darwin" ]; then
sudo rm -rf /Library/Developer/CoreSimulator
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
fi
step-delete-git-directories: &step-delete-git-directories
run:
name: Delete src/.git directory on MacOS to free space
name: Delete all .git directories under src on MacOS to free space
command: |
if [ "`uname`" == "Darwin" ]; then
sudo rm -rf src/.git
cd src
( find . -type d -name ".git" ) | xargs rm -rf
fi
# On macOS the yarn install command during gclient sync was run on a linux
@@ -319,6 +335,8 @@ step-gn-check: &step-gn-check
gn check out/Default //electron:electron_app
gn check out/Default //electron:manifests
gn check out/Default //electron/shell/common/api:mojo
# Check the hunspell filenames
node electron/script/gen-hunspell-filenames.js --check
step-electron-build: &step-electron-build
run:
@@ -340,9 +358,18 @@ step-maybe-electron-dist-strip: &step-maybe-electron-dist-strip
run:
name: Strip electron binaries
command: |
if [ "$STRIP_BINARIES" == "true" ] && [ "`uname`" != "Darwin" ]; then
if [ "$STRIP_BINARIES" == "true" ] && [ "`uname`" == "Linux" ]; then
if [ x"$TARGET_ARCH" == x ]; then
target_cpu=x64
elif [ "$TARGET_ARCH" == "ia32" ]; then
target_cpu=x86
else
target_cpu="$TARGET_ARCH"
fi
cd src
electron/script/strip-binaries.py --target-cpu="$TARGET_ARCH"
electron/script/copy-debug-symbols.py --target-cpu="$target_cpu" --out-dir=out/Default/debug --compress
electron/script/strip-binaries.py --target-cpu="$target_cpu"
electron/script/add-debug-link.py --target-cpu="$target_cpu" --debug-dir=out/Default/debug
fi
step-electron-dist-build: &step-electron-dist-build
@@ -416,6 +443,9 @@ step-electron-publish: &step-electron-publish
run:
name: Publish Electron Dist
command: |
if [ "`uname`" == "Darwin" ]; then
rm -rf src/out/Default/obj
fi
cd src/electron
if [ "$UPLOAD_TO_S3" == "1" ]; then
echo 'Uploading Electron release distribution to S3'
@@ -534,6 +564,20 @@ step-mksnapshot-store: &step-mksnapshot-store
path: src/out/Default/mksnapshot.zip
destination: mksnapshot.zip
step-hunspell-build: &step-hunspell-build
run:
name: hunspell build
command: |
cd src
if [ "$SKIP_DIST_ZIP" != "1" ]; then
ninja -C out/Default electron:hunspell_dictionaries_zip -j $NUMBER_OF_NINJA_PROCESSES
fi
step-hunspell-store: &step-hunspell-store
store_artifacts:
path: src/out/Default/hunspell_dictionaries.zip
destination: hunspell_dictionaries.zip
step-maybe-generate-breakpad-symbols: &step-maybe-generate-breakpad-symbols
run:
name: Generate breakpad symbols
@@ -693,7 +737,6 @@ step-minimize-workspace-size-from-checkout: &step-minimize-workspace-size-from-c
rm -rf src/ios
rm -rf src/third_party/blink/web_tests
rm -rf src/third_party/blink/perf_tests
rm -rf src/third_party/hunspell_dictionaries
rm -rf src/third_party/WebKit/LayoutTests
# Save the src cache based on the deps hash
@@ -704,6 +747,51 @@ step-save-src-cache: &step-save-src-cache
key: v5-src-cache-{{ arch }}-{{ checksum "src/electron/.depshash" }}
name: Persisting src cache
# Check for doc only change
step-check-for-doc-only-change: &step-check-for-doc-only-change
run:
name: Check if commit is doc only change
command: |
cd src/electron
node script/yarn install --frozen-lockfile
if node script/doc-only-change.js --prNumber=$CIRCLE_PR_NUMBER --prURL=$CIRCLE_PULL_REQUEST; then
#PR is doc only change; save file with value true to indicate doc only change
echo "true" > .skip-ci-build
else
#PR is not a doc only change; create empty file to indicate check has been done
touch .skip-ci-build
fi
step-persist-doc-only-change: &step-persist-doc-only-change
persist_to_workspace:
root: .
paths:
- src/electron/.skip-ci-build
step-maybe-early-exit-doc-only-change: &step-maybe-early-exit-doc-only-change
run:
name: Shortcircuit build if doc only change
command: |
if [ -s src/electron/.skip-ci-build ]; then
circleci-agent step halt
fi
step-maybe-early-exit-no-doc-change: &step-maybe-early-exit-no-doc-change
run:
name: Shortcircuit job if change is not doc only
command: |
if [ ! -s src/electron/.skip-ci-build ]; then
circleci-agent step halt
fi
step-ts-compile: &step-ts-compile
run:
name: Run TS/JS compile on doc only change
command: |
cd src
ninja -C out/Default electron:default_app_js -j $NUMBER_OF_NINJA_PROCESSES
ninja -C out/Default electron:atom_js2c -j $NUMBER_OF_NINJA_PROCESSES
# Lists of steps.
steps-lint: &steps-lint
steps:
@@ -752,6 +840,9 @@ steps-lint: &steps-lint
steps-checkout-fast: &steps-checkout-fast
steps:
- *step-checkout-electron
- *step-check-for-doc-only-change
- *step-persist-doc-only-change
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-get
- *step-depot-tools-add-to-path
- *step-restore-brew-cache
@@ -783,6 +874,9 @@ steps-checkout-fast: &steps-checkout-fast
steps-checkout-and-save-cache: &steps-checkout-and-save-cache
steps:
- *step-checkout-electron
- *step-check-for-doc-only-change
- *step-persist-doc-only-change
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-get
- *step-depot-tools-add-to-path
- *step-restore-brew-cache
@@ -813,6 +907,7 @@ steps-electron-gn-check: &steps-electron-gn-check
steps:
- attach_workspace:
at: .
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-add-to-path
- *step-setup-env-for-build
- *step-gn-gen-default
@@ -822,14 +917,15 @@ steps-electron-build: &steps-electron-build
steps:
- attach_workspace:
at: .
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-add-to-path
- *step-setup-env-for-build
- *step-restore-brew-cache
- *step-get-more-space-on-mac
- *step-install-npm-deps-on-mac
- *step-fix-sync-on-mac
- *step-gn-gen-default
- *step-delete-git-directories
- *step-gn-gen-default
# Electron app
- *step-electron-build
@@ -859,6 +955,10 @@ steps-electron-build: &steps-electron-build
- *step-ffmpeg-build
- *step-ffmpeg-store
# hunspell
- *step-hunspell-build
- *step-hunspell-store
# Save all data needed for a further tests run.
- *step-persist-data-for-tests
@@ -875,6 +975,90 @@ steps-electron-build-with-inline-checkout-for-tests: &steps-electron-build-with-
steps:
# Checkout - Copied ffrom steps-checkout
- *step-checkout-electron
- *step-check-for-doc-only-change
- *step-persist-doc-only-change
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-get
- *step-depot-tools-add-to-path
- *step-restore-brew-cache
- *step-get-more-space-on-mac
- *step-install-gnutar-on-mac
- *step-generate-deps-hash
- *step-touch-sync-done
- *step-maybe-restore-src-cache
- *step-maybe-restore-git-cache
- *step-set-git-cache-path
# This sync call only runs if .circle-sync-done is an EMPTY file
- *step-gclient-sync
# These next few steps reset Electron to the correct commit regardless of which cache was restored
- run:
name: Wipe Electron
command: rm -rf src/electron
- *step-checkout-electron
- *step-run-electron-only-hooks
- *step-generate-deps-hash-cleanly
- *step-mark-sync-done
- *step-minimize-workspace-size-from-checkout
- *step-depot-tools-add-to-path
- *step-setup-env-for-build
- *step-restore-brew-cache
- *step-get-more-space-on-mac
- *step-install-npm-deps-on-mac
- *step-fix-sync-on-mac
- *step-delete-git-directories
- *step-gn-gen-default
# Electron app
- *step-electron-build
- *step-maybe-electron-dist-strip
- *step-electron-dist-build
- *step-electron-dist-store
- *step-ninja-summary
# Native test targets
- *step-native-unittests-build
- *step-native-unittests-store
# Node.js headers
- *step-nodejs-headers-build
- *step-nodejs-headers-store
- *step-show-sccache-stats
# mksnapshot
- *step-mksnapshot-build
- *step-mksnapshot-store
- *step-maybe-cross-arch-snapshot
- *step-maybe-cross-arch-snapshot-store
# ffmpeg
- *step-ffmpeg-gn-gen
- *step-ffmpeg-build
- *step-ffmpeg-store
# hunspell
- *step-hunspell-build
- *step-hunspell-store
# Save all data needed for a further tests run.
- *step-persist-data-for-tests
- *step-maybe-generate-breakpad-symbols
- *step-maybe-zip-symbols
- *step-symbols-store
# Trigger tests on arm hardware if needed
- *step-maybe-trigger-arm-test
- *step-maybe-notify-slack-failure
steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-change
steps:
# Checkout - Copied ffrom steps-checkout
- *step-checkout-electron
- *step-check-for-doc-only-change
- *step-maybe-early-exit-no-doc-change
- *step-depot-tools-get
- *step-depot-tools-add-to-path
- *step-restore-brew-cache
@@ -904,47 +1088,9 @@ steps-electron-build-with-inline-checkout-for-tests: &steps-electron-build-with-
- *step-install-npm-deps-on-mac
- *step-fix-sync-on-mac
- *step-gn-gen-default
- *step-delete-git-directories
# Electron app
- *step-electron-build
- *step-maybe-electron-dist-strip
- *step-electron-dist-build
- *step-electron-dist-store
- *step-ninja-summary
# Native test targets
- *step-native-unittests-build
- *step-native-unittests-store
# Node.js headers
- *step-nodejs-headers-build
- *step-nodejs-headers-store
- *step-show-sccache-stats
# mksnapshot
- *step-mksnapshot-build
- *step-mksnapshot-store
- *step-maybe-cross-arch-snapshot
- *step-maybe-cross-arch-snapshot-store
# ffmpeg
- *step-ffmpeg-gn-gen
- *step-ffmpeg-build
- *step-ffmpeg-store
# Save all data needed for a further tests run.
- *step-persist-data-for-tests
- *step-maybe-generate-breakpad-symbols
- *step-maybe-zip-symbols
- *step-symbols-store
# Trigger tests on arm hardware if needed
- *step-maybe-trigger-arm-test
- *step-maybe-notify-slack-failure
#Compile ts/js to verify doc change didn't break anything
- *step-ts-compile
steps-electron-build-for-publish: &steps-electron-build-for-publish
steps:
@@ -955,8 +1101,9 @@ steps-electron-build-for-publish: &steps-electron-build-for-publish
- *step-get-more-space-on-mac
- *step-gclient-sync
- *step-setup-env-for-build
- *step-gn-gen-default
- *step-delete-git-directories
- *step-minimize-workspace-size-from-checkout
- *step-gn-gen-default
# Electron app
- *step-electron-build
@@ -984,6 +1131,10 @@ steps-electron-build-for-publish: &steps-electron-build-for-publish
- *step-ffmpeg-build
- *step-ffmpeg-store
# hunspell
- *step-hunspell-build
- *step-hunspell-store
# typescript defs
- *step-maybe-generate-typescript-defs
@@ -1064,6 +1215,7 @@ steps-tests: &steps-tests
steps:
- attach_workspace:
at: .
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-add-to-path
- *step-electron-dist-unzip
- *step-mksnapshot-unzip
@@ -1106,6 +1258,7 @@ steps-test-nan: &steps-test-nan
steps:
- attach_workspace:
at: .
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-add-to-path
- *step-electron-dist-unzip
- *step-setup-linux-for-headless-testing
@@ -1121,6 +1274,7 @@ steps-test-node: &steps-test-node
steps:
- attach_workspace:
at: .
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-add-to-path
- *step-electron-dist-unzip
- *step-setup-linux-for-headless-testing
@@ -1146,6 +1300,13 @@ jobs:
<<: *env-linux-medium
<<: *steps-lint
ts-compile-doc-change:
<<: *machine-linux-medium
environment:
<<: *env-linux-medium
<<: *env-testing-build
<<: *steps-electron-ts-compile-for-doc-change
# Layer 1: Checkout.
linux-checkout-fast:
<<: *machine-linux-2xlarge
@@ -1315,6 +1476,7 @@ jobs:
<<: *env-ia32
<<: *env-release-build
<<: *env-enable-sccache
<<: *env-32bit-release
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *steps-electron-build-for-publish
@@ -1369,6 +1531,7 @@ jobs:
<<: *env-arm
<<: *env-release-build
<<: *env-enable-sccache
<<: *env-32bit-release
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *steps-electron-build-for-publish
@@ -1458,6 +1621,7 @@ jobs:
environment:
<<: *env-mac-large
<<: *env-debug-build
<<: *env-mac-debug-build
<<: *env-enable-sccache
<<: *env-ninja-status
<<: *steps-electron-build
@@ -1520,6 +1684,7 @@ jobs:
<<: *env-mac-large
<<: *env-mas
<<: *env-debug-build
<<: *env-mac-debug-build
<<: *env-enable-sccache
<<: *env-ninja-status
<<: *steps-electron-build
@@ -1917,6 +2082,7 @@ workflows:
- linux-arm64-testing-gn-check:
requires:
- linux-checkout-fast
- ts-compile-doc-change
build-mac:
when: << pipeline.parameters.run-build-mac >>
@@ -1928,14 +2094,6 @@ workflows:
requires:
- mac-checkout-fast
- osx-debug:
requires:
- mac-checkout-fast
- osx-debug-gn-check:
requires:
- mac-checkout-fast
- osx-testing-gn-check:
requires:
- mac-checkout-fast
@@ -1948,14 +2106,6 @@ workflows:
requires:
- mac-checkout-fast
- mas-debug:
requires:
- mac-checkout-fast
- mas-debug-gn-check:
requires:
- mac-checkout-fast
- mas-testing-gn-check:
requires:
- mac-checkout-fast

View File

@@ -1,6 +1,7 @@
import("//build/config/locales.gni")
import("//build/config/ui.gni")
import("//build/config/win/manifest.gni")
import("//components/spellcheck/spellcheck_build_features.gni")
import("//content/public/app/mac_helpers.gni")
import("//pdf/features.gni")
import("//printing/buildflags/buildflags.gni")
@@ -21,6 +22,7 @@ import("buildflags/buildflags.gni")
import("electron_paks.gni")
import("filenames.auto.gni")
import("filenames.gni")
import("filenames.hunspell.gni")
if (is_mac) {
import("//build/config/mac/rules.gni")
@@ -351,6 +353,7 @@ source_set("electron_lib") {
":resources",
"buildflags",
"chromium_src:chrome",
"chromium_src:chrome_spellchecker",
"native_mate",
"shell/common/api:mojo",
"//base:base_static",
@@ -358,12 +361,13 @@ source_set("electron_lib") {
"//chrome/app/resources:platform_locale_settings",
"//chrome/services/printing/public/mojom",
"//components/certificate_transparency",
"//components/language/core/browser",
"//components/net_log",
"//components/network_hints/common",
"//components/network_hints/browser",
"//components/network_hints/common:mojo_bindings",
"//components/network_hints/renderer",
"//components/network_session_configurator/common",
"//components/prefs",
"//components/spellcheck/renderer",
"//components/viz/host",
"//components/viz/service",
"//content/public/browser",
@@ -379,12 +383,10 @@ source_set("electron_lib") {
"//media/mojo/mojom",
"//net:extras",
"//net:net_resources",
"//net:net_with_v8",
"//ppapi/host",
"//ppapi/proxy",
"//ppapi/shared_impl",
"//printing/buildflags",
"//services/audio/public/mojom:constants",
"//services/device/public/cpp/geolocation",
"//services/device/public/mojom",
"//services/proxy_resolver:lib",
@@ -396,7 +398,7 @@ source_set("electron_lib") {
"//third_party/electron_node:node_lib",
"//third_party/leveldatabase",
"//third_party/libyuv",
"//third_party/webrtc_overrides:init_webrtc",
"//third_party/webrtc_overrides:webrtc_component",
"//third_party/widevine/cdm:headers",
"//ui/base/idle",
"//ui/events:dom_keycode_converter",
@@ -546,6 +548,10 @@ source_set("electron_lib") {
]
sources += filenames.lib_sources_nss
sources += [
"shell/browser/ui/gtk_util.cc",
"shell/browser/ui/gtk_util.h",
]
}
if (is_win) {
libs += [ "dwmapi.lib" ]
@@ -705,7 +711,6 @@ if (is_mac) {
public_deps += [ "//third_party/icu:icudata" ]
}
if (v8_use_external_startup_data) {
sources += [ "$root_out_dir/natives_blob.bin" ]
public_deps += [ "//v8" ]
if (use_v8_context_snapshot) {
sources += [ "$root_out_dir/v8_context_snapshot.bin" ]
@@ -1265,9 +1270,14 @@ template("dist_zip") {
"outputs",
"testonly",
])
flatten = false
if (defined(invoker.flatten)) {
flatten = invoker.flatten
}
args = rebase_path(outputs + [ _runtime_deps_file ], root_build_dir) + [
target_cpu,
target_os,
"$flatten",
]
}
}
@@ -1353,6 +1363,24 @@ dist_zip("electron_mksnapshot_zip") {
]
}
copy("hunspell_dictionaries") {
sources = hunspell_dictionaries + hunspell_licenses
outputs = [
"$target_gen_dir/electron_hunspell/{{source_file_part}}",
]
}
dist_zip("hunspell_dictionaries_zip") {
data_deps = [
":hunspell_dictionaries",
]
flatten = true
outputs = [
"$root_build_dir/hunspell_dictionaries.zip",
]
}
group("electron") {
public_deps = [
":electron_app",

4
DEPS
View File

@@ -11,7 +11,7 @@ gclient_gn_args = [
vars = {
'chromium_version':
'c3a0220e7bde049d599a8332b9b2785b0178be74',
'80.0.3987.86',
'node_version':
'v12.13.0',
'nan_version':
@@ -114,7 +114,7 @@ hooks = [
'pattern': 'src/electron/script/update-external-binaries.py',
'condition': 'download_external_binaries',
'action': [
'python',
'python3',
'src/electron/script/update-external-binaries.py',
],
},

View File

@@ -1 +1 @@
8.0.0-nightly.20191023
8.0.0

View File

@@ -29,7 +29,7 @@
version: 1.0.{build}
build_cloud: libcc-20
image: vs2017-15.9-10.0.18362
image: vs2019-16.3-10.0.18362
environment:
GIT_CACHE_PATH: C:\Users\electron\libcc_cache
ELECTRON_OUT_DIR: Default
@@ -50,6 +50,12 @@ build_script:
- ps: >-
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
} else {
node script/yarn.js install --frozen-lockfile
if ($(node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH;$LASTEXITCODE -eq 0)) {
Write-warning "Skipping build for doc only change"; Exit-AppveyorBuild
}
}
- echo "Building $env:GN_CONFIG build"
- git config --global core.longpaths true
@@ -70,10 +76,10 @@ build_script:
--unmanaged
%GCLIENT_EXTRA_ARGS%
"https://github.com/electron/electron"
- gclient sync --with_branch_heads --with_tags --reset
- gclient sync --with_branch_heads --with_tags --ignore_locks --break_repo_locks
- cd src
- ps: $env:BUILD_CONFIG_PATH="//electron/build/args/%GN_CONFIG%.gn"
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS%"
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS% cc_wrapper=\"%SCCACHE_PATH%\""
- gn check out/Default //electron:electron_lib
- gn check out/Default //electron:electron_app
- gn check out/Default //electron:manifests
@@ -85,8 +91,10 @@ build_script:
- ninja -C out/Default electron:electron_dist_zip
- ninja -C out/Default shell_browser_ui_unittests
- ninja -C out/Default electron:electron_mksnapshot_zip
- ninja -C out/Default electron:hunspell_dictionaries_zip
- ninja -C out/Default electron:electron_chromedriver_zip
- ninja -C out/Default third_party/electron_node:headers
- cmd /C %SCCACHE_PATH% --show-stats
- appveyor PushArtifact out/Default/dist.zip
- appveyor PushArtifact out/Default/shell_browser_ui_unittests.exe
- appveyor PushArtifact out/Default/chromedriver.zip
@@ -94,6 +102,7 @@ build_script:
- 7z a node_headers.zip out\Default\gen\node_headers
- appveyor PushArtifact node_headers.zip
- appveyor PushArtifact out/Default/mksnapshot.zip
- appveyor PushArtifact out/Default/hunspell_dictionaries.zip
- appveyor PushArtifact out/Default/electron.lib
- ps: >-
if ($env:GN_CONFIG -eq 'release') {

View File

@@ -1,5 +1,4 @@
is_electron_build = true
use_jumbo_build = true
root_extra_deps = [ "//electron" ]
# Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
@@ -9,6 +8,12 @@ v8_promise_internal_field_count = 1
v8_typed_array_max_size_in_heap = 0
v8_embedder_string = "-electron.0"
# TODO: this breaks native modules. See e.g. https://www.github.com/nodejs/node/pull/30463
# We can probably enable this as long as we make sure node native modules
# also build with the relevant #defines (V8_COMPRESS_POINTERS etc.)
v8_enable_pointer_compression = false
v8_enable_31bit_smis_on_64bit_arch = false
# TODO: this breaks mksnapshot
v8_enable_snapshot_native_code_counters = false
@@ -18,12 +23,9 @@ ffmpeg_branding = "Chrome"
enable_basic_printing = true
angle_enable_vulkan_validation_layers = false
dawn_enable_vulkan_validation_layers = false
is_cfi = false
# TODO: Remove this and update CI to contain 10.14 SDK once
# crbug.com/986701 is fixed.
mac_sdk_min = "10.13"
# TODO: disabled due to crashes. re-enable.
enable_osr = false

View File

@@ -5,4 +5,3 @@ is_debug = false
is_component_build = false
is_component_ffmpeg = false
symbol_level = 1
use_jumbo_build = true

View File

@@ -1,9 +1,50 @@
import("//build/config/mac/mac_sdk.gni")
# This is imported from /ios becuase this functionality was moved
# after Chromium stopped using xib files for macOS menu functionality
# See https://chromium-review.googlesource.com/c/chromium/src/+/1648695
import("//build/config/ios/rules.gni")
# Template to compile .xib and .storyboard files.
# (copied from src/build/config/ios/rules.gni)
#
# Arguments
#
# sources:
# list of string, sources to compile
#
# ibtool_flags:
# (optional) list of string, additional flags to pass to the ibtool
template("compile_ib_files") {
action_foreach(target_name) {
forward_variables_from(invoker,
[
"testonly",
"visibility",
])
assert(defined(invoker.sources),
"sources must be specified for $target_name")
assert(defined(invoker.output_extension),
"output_extension must be specified for $target_name")
ibtool_flags = []
if (defined(invoker.ibtool_flags)) {
ibtool_flags = invoker.ibtool_flags
}
_output_extension = invoker.output_extension
script = "//build/config/ios/compile_ib_files.py"
sources = invoker.sources
outputs = [
"$target_gen_dir/$target_name/{{source_name_part}}.$_output_extension",
]
args = [
"--input",
"{{source}}",
"--output",
rebase_path(
"$target_gen_dir/$target_name/{{source_name_part}}.$_output_extension",
root_build_dir),
]
args += ibtool_flags
}
}
# Template is copied here from Chromium but was removed in
# https://chromium-review.googlesource.com/c/chromium/src/+/1637981

View File

@@ -74,7 +74,10 @@ module.exports = ({
global: ['@electron/internal/renderer/webpack-provider', '_global'],
Buffer: ['@electron/internal/renderer/webpack-provider', 'Buffer'],
})
] : [])
] : []),
new webpack.ProvidePlugin({
Promise: ['@electron/internal/common/webpack-globals-provider', 'Promise'],
}),
]
})
}
}

View File

@@ -16,6 +16,10 @@ PATHS_TO_SKIP = [
'./libVkICD_mock_', #Skipping because these are outputs that we don't need
'./VkICD_mock_', #Skipping because these are outputs that we don't need
# Skipping because its an output of create_bundle from //build/config/mac/rules.gni
# that we don't need
'Electron.dSYM',
# //chrome/browser:resources depends on this via
# //chrome/browser/resources/ssl/ssl_error_assistant, but we don't need to
# ship it.
@@ -46,19 +50,19 @@ def execute(argv):
raise e
def main(argv):
dist_zip, runtime_deps, target_cpu, target_os = argv
dist_zip, runtime_deps, target_cpu, target_os, flatten_val = argv
should_flatten = flatten_val == "true"
dist_files = set()
with open(runtime_deps) as f:
for dep in f.readlines():
dep = dep.strip()
dist_files.add(dep)
if sys.platform == 'darwin':
if not skip_path(dep, dist_zip, target_cpu):
dist_files.add(dep)
if sys.platform == 'darwin' and not should_flatten:
execute(['zip', '-r', '-y', dist_zip] + list(dist_files))
else:
with zipfile.ZipFile(dist_zip, 'w', zipfile.ZIP_DEFLATED, allowZip64=True) as z:
for dep in dist_files:
if skip_path(dep, dist_zip, target_cpu):
continue
if os.path.isdir(dep):
for root, dirs, files in os.walk(dep):
for file in files:
@@ -67,7 +71,7 @@ def main(argv):
basename = os.path.basename(dep)
dirname = os.path.dirname(dep)
arcname = os.path.join(dirname, 'chrome-sandbox') if basename == 'chrome_sandbox' else dep
z.write(dep, arcname)
z.write(dep, os.path.basename(arcname) if should_flatten else arcname)
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))

View File

@@ -19,6 +19,7 @@ buildflag_header("buildflags") {
"ENABLE_TTS=$enable_tts",
"ENABLE_COLOR_CHOOSER=$enable_color_chooser",
"ENABLE_ELECTRON_EXTENSIONS=$enable_electron_extensions",
"ENABLE_BUILTIN_SPELLCHECKER=$enable_builtin_spellchecker",
"ENABLE_PICTURE_IN_PICTURE=$enable_picture_in_picture",
"OVERRIDE_LOCATION_PROVIDER=$enable_fake_location_provider",
]

View File

@@ -33,4 +33,7 @@ declare_args() {
# Enable Chrome extensions support.
enable_electron_extensions = false
# Enable Spellchecker support
enable_builtin_spellchecker = true
}

View File

@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
import("//components/spellcheck/spellcheck_build_features.gni")
import("//electron/buildflags/buildflags.gni")
import("//printing/buildflags/buildflags.gni")
import("//third_party/widevine/cdm/widevine.gni")
@@ -31,6 +32,8 @@ static_library("chrome") {
"//chrome/browser/icon_loader_win.cc",
"//chrome/browser/icon_manager.cc",
"//chrome/browser/icon_manager.h",
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.h",
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm",
"//chrome/browser/net/chrome_mojo_proxy_resolver_factory.cc",
"//chrome/browser/net/chrome_mojo_proxy_resolver_factory.h",
"//chrome/browser/net/proxy_config_monitor.cc",
@@ -39,6 +42,8 @@ static_library("chrome") {
"//chrome/browser/net/proxy_service_factory.h",
"//chrome/browser/predictors/preconnect_manager.cc",
"//chrome/browser/predictors/preconnect_manager.h",
"//chrome/browser/predictors/predictors_features.cc",
"//chrome/browser/predictors/predictors_features.h",
"//chrome/browser/predictors/proxy_lookup_client_impl.cc",
"//chrome/browser/predictors/proxy_lookup_client_impl.h",
"//chrome/browser/predictors/resolve_host_client_impl.cc",
@@ -225,3 +230,58 @@ static_library("chrome") {
]
}
}
# This source set is just so we don't have to depend on all of //chrome/browser
# You may have to add new files here during the upgrade if //chrome/browser/spellchecker
# gets more files
source_set("chrome_spellchecker") {
sources = []
deps = []
libs = []
if (enable_builtin_spellchecker) {
sources += [
"//chrome/browser/spellchecker/spell_check_host_chrome_impl.cc",
"//chrome/browser/spellchecker/spell_check_host_chrome_impl.h",
"//chrome/browser/spellchecker/spellcheck_custom_dictionary.cc",
"//chrome/browser/spellchecker/spellcheck_custom_dictionary.h",
"//chrome/browser/spellchecker/spellcheck_factory.cc",
"//chrome/browser/spellchecker/spellcheck_factory.h",
"//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc",
"//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h",
"//chrome/browser/spellchecker/spellcheck_language_blacklist_policy_handler.cc",
"//chrome/browser/spellchecker/spellcheck_language_blacklist_policy_handler.h",
"//chrome/browser/spellchecker/spellcheck_language_policy_handler.cc",
"//chrome/browser/spellchecker/spellcheck_language_policy_handler.h",
"//chrome/browser/spellchecker/spellcheck_service.cc",
"//chrome/browser/spellchecker/spellcheck_service.h",
]
if (has_spellcheck_panel) {
sources += [
"//chrome/browser/spellchecker/spell_check_panel_host_impl.cc",
"//chrome/browser/spellchecker/spell_check_panel_host_impl.h",
]
}
if (use_browser_spellchecker) {
sources += [
"//chrome/browser/spellchecker/spelling_request.cc",
"//chrome/browser/spellchecker/spelling_request.h",
]
}
deps += [
"//base:base_static",
"//components/language/core/browser",
"//components/spellcheck:buildflags",
"//components/sync",
]
}
public_deps = [
"//components/spellcheck/browser",
"//components/spellcheck/common",
"//components/spellcheck/renderer",
]
}

View File

@@ -37,10 +37,8 @@ net::NSSCertDatabase* GetNSSCertDatabaseForResourceContext(
// public and private slot.
// Redirect any slot usage to this persistent slot on Linux.
g_nss_cert_database = new net::NSSCertDatabase(
crypto::ScopedPK11Slot(
crypto::GetPersistentNSSKeySlot()) /* public slot */,
crypto::ScopedPK11Slot(
crypto::GetPersistentNSSKeySlot()) /* private slot */);
crypto::ScopedPK11Slot(PK11_GetInternalKeySlot()) /* public slot */,
crypto::ScopedPK11Slot(PK11_GetInternalKeySlot()) /* private slot */);
}
return g_nss_cert_database;
}

View File

@@ -3,6 +3,8 @@ import * as path from 'path'
let mainWindow: BrowserWindow | null = null
app.allowRendererProcessReuse = true
// Quit when all windows are closed.
app.on('window-all-closed', () => {
app.quit()

View File

@@ -314,10 +314,8 @@ Returns:
* `event` Event
* `webContents` [WebContents](web-contents.md)
* `request` Object
* `method` String
* `authenticationResponseDetails` Object
* `url` URL
* `referrer` URL
* `authInfo` Object
* `isProxy` Boolean
* `scheme` String
@@ -325,8 +323,8 @@ Returns:
* `port` Integer
* `realm` String
* `callback` Function
* `username` String
* `password` String
* `username` String (optional)
* `password` String (optional)
Emitted when `webContents` wants to do basic auth.
@@ -337,12 +335,16 @@ should prevent the default behavior with `event.preventDefault()` and call
```javascript
const { app } = require('electron')
app.on('login', (event, webContents, request, authInfo, callback) => {
app.on('login', (event, webContents, details, authInfo, callback) => {
event.preventDefault()
callback('username', 'secret')
})
```
If `callback` is called without a username or password, the authentication
request will be cancelled and the authentication error will be returned to the
page.
### Event: 'gpu-info-update'
Emitted whenever there is a GPU info update.
@@ -770,6 +772,21 @@ macOS machine. Please refer to
The API uses the Windows Registry and LSCopyDefaultHandlerForURLScheme internally.
### `app.getApplicationNameForProtocol(url)`
* `url` String - a URL with the protocol name to check. Unlike the other
methods in this family, this accepts an entire URL, including `://` at a
minimum (e.g. `https://`).
Returns `String` - Name of the application handling the protocol, or an empty
string if there is no handler. For instance, if Electron is the default
handler of the URL, this could be `Electron` on Windows and Mac. However,
don't rely on the precise format which is not guaranteed to remain unchanged.
Expect a different format on Linux, possibly with a `.desktop` suffix.
This method returns the application name of the default handler for the protocol
(aka URI scheme) of a URL.
### `app.setUserTasks(tasks)` _Windows_
* `tasks` [Task[]](structures/task.md) - Array of `Task` objects
@@ -1186,8 +1203,9 @@ Show the app's about panel options. These options can be overridden with `app.se
* `website` String (optional) _Linux_ - The app's website.
* `iconPath` String (optional) _Linux_ _Windows_ - Path to the app's icon. On Linux, will be shown as 64x64 pixels while retaining aspect ratio.
Set the about panel options. This will override the values defined in the app's
`.plist` file on MacOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults.
Set the about panel options. This will override the values defined in the app's `.plist` file on MacOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults.
If you do not set `credits` but still wish to surface them in your app, AppKit will look for a file named "Credits.html", "Credits.rtf", and "Credits.rtfd", in that order, in the bundle returned by the NSBundle class method main. The first file found is used, and if none is found, the info area is left blank. See Apple [documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptioncredits?language=objc) for more information.
### `app.isEmojiPanelSupported()`

View File

@@ -59,6 +59,55 @@ these kinds of objects will throw a 'could not be cloned' error.
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
### `<webview>.getWebContents()`
This API is implemented using the `remote` module, which has both performance
and security implications. Therefore its usage should be explicit.
```js
// Deprecated
webview.getWebContents()
// Replace with
const { remote } = require('electron')
remote.webContents.fromId(webview.getWebContentsId())
```
However, it is recommended to avoid using the `remote` module altogether.
```js
// main
const { ipcMain, webContents } = require('electron')
const getGuestForWebContents = function (webContentsId, contents) {
const guest = webContents.fromId(webContentsId)
if (!guest) {
throw new Error(`Invalid webContentsId: ${webContentsId}`)
}
if (guest.hostWebContents !== contents) {
throw new Error(`Access denied to webContents`)
}
return guest
}
ipcMain.handle('openDevTools', (event, webContentsId) => {
const guest = getGuestForWebContents(webContentsId, event.sender)
guest.openDevTools()
})
// renderer
const { ipcRenderer } = require('electron')
ipcRenderer.invoke('openDevTools', webview.getWebContentsId())
```
### `webFrame.setLayoutZoomLevelLimits()`
Chromium has removed support for changing the layout zoom level limits, and it
is beyond Electron's capacity to maintain it. The function will emit a warning
in Electron 8.x, and cease to exist in Electron 9.x. The layout zoom level
limits are now fixed at a minimum of 0.25 and a maximum of 5.0, as defined
[here](https://chromium.googlesource.com/chromium/src/+/938b37a6d2886bf8335fc7db792f1eb46c65b2ae/third_party/blink/common/page/page_zoom.cc#11).
## Planned Breaking API Changes (7.0)
### Node Headers URL
@@ -103,7 +152,7 @@ const idleTime = getSystemIdleTime()
### webFrame Isolated World APIs
```js
// Removed in Elecron 7.0
// Removed in Electron 7.0
webFrame.setIsolatedWorldContentSecurityPolicy(worldId, csp)
webFrame.setIsolatedWorldHumanReadableName(worldId, name)
webFrame.setIsolatedWorldSecurityOrigin(worldId, securityOrigin)
@@ -121,6 +170,40 @@ webFrame.setIsolatedWorldInfo(
This property was removed in Chromium 77, and as such is no longer available.
### `webkitdirectory` attribute for `<input type="file"/>`
The `webkitdirectory` property on HTML file inputs allows them to select folders.
Previous versions of Electron had an incorrect implementation where the `event.target.files`
of the input returned a `FileList` that returned one `File` corresponding to the selected folder.
As of Electron 7, that `FileList` is now list of all files contained within
the folder, similarly to Chrome, Firefox, and Edge
([link to MDN docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory)).
As an illustration, take a folder with this structure:
```console
folder
├── file1
├── file2
└── file3
```
In Electron <=6, this would return a `FileList` with a `File` object for:
```console
path/to/folder
```
In Electron 7, this now returns a `FileList` with a `File` object for:
```console
/path/to/folder/file3
/path/to/folder/file2
/path/to/folder/file1
```
Note that `webkitdirectory` no longer exposes the path to the selected folder.
If you require the path to the selected folder rather than the folder contents,
see the `dialog.showOpenDialog` API ([link](https://github.com/electron/electron/blob/master/docs/api/dialog.md#dialogshowopendialogbrowserwindow-options)).
## Planned Breaking API Changes (6.0)
### `win.setMenu(null)`

View File

@@ -229,6 +229,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
unless hovered over in the top left of the window. These custom buttons prevent
issues with mouse events that occur with the standard window toolbar buttons.
**Note:** This option is currently experimental.
* `trafficLightPosition` [Point](structures/point.md) (optional) - Set a custom position for the traffic light buttons. Can only be used with `titleBarStyle` set to `hidden`
* `fullscreenWindowTitle` Boolean (optional) - Shows the title in the
title bar in full screen mode on macOS for all `titleBarStyle` options.
Default is `false`.
@@ -272,8 +273,6 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
OS-level sandbox and disabling the Node.js engine. This is not the same as
the `nodeIntegration` option and the APIs available to the preload script
are more limited. Read more about the option [here](sandbox-option.md).
**Note:** This option is currently experimental and may change or be
removed in future Electron releases.
* `enableRemoteModule` Boolean (optional) - Whether to enable the [`remote`](remote.md) module.
Default is `true`.
* `session` [Session](session.md#class-session) (optional) - Sets the session used by the
@@ -385,6 +384,8 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `accessibleTitle` String (optional) - An alternative title string provided only
to accessibility tools such as screen readers. This string is not directly
visible to users.
* `spellcheck` Boolean (optional) - Whether to enable the builtin spellchecker.
Default is `false`.
When setting minimum or maximum window size with `minWidth`/`maxWidth`/
`minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from
@@ -515,7 +516,7 @@ Emitted when the window is restored from a minimized state.
Returns:
* `event` Event
* `newBounds` [`Rectangle`](structures/rectangle.md) - Size the window is being resized to.
* `newBounds` [Rectangle](structures/rectangle.md) - Size the window is being resized to.
Emitted before the window is resized. Calling `event.preventDefault()` will prevent the window from being resized.
@@ -530,7 +531,7 @@ Emitted after the window has been resized.
Returns:
* `event` Event
* `newBounds` [`Rectangle`](structures/rectangle.md) - Location the window is being moved to.
* `newBounds` [Rectangle](structures/rectangle.md) - Location the window is being moved to.
Emitted before the window is moved. On Windows, calling `event.preventDefault()` will prevent the window from being moved.
@@ -1579,7 +1580,7 @@ Same as `webContents.showDefinitionForSelection()`.
#### `win.setIcon(icon)` _Windows_ _Linux_
* `icon` [NativeImage](native-image.md)
* `icon` [NativeImage](native-image.md) | String
Changes window icon.
@@ -1625,7 +1626,7 @@ Returns `Boolean` - Whether the menu bar is visible.
* `visible` Boolean
* `options` Object (optional)
* `visibleOnFullScreen` Boolean (optional) _macOS_ - Sets whether
the window should be visible above fullscreen windows
the window should be visible above fullscreen windows _deprecated_
Sets whether the window should be visible on all workspaces.

View File

@@ -32,8 +32,8 @@ the hostname and the port number 'hostname:port'.
* `redirect` String (optional) - The redirect mode for this request. Should be
one of `follow`, `error` or `manual`. Defaults to `follow`. When mode is `error`,
any redirection will be aborted. When mode is `manual` the redirection will be
deferred until [`request.followRedirect`](#requestfollowredirect) is invoked. Listen for the [`redirect`](#event-redirect) event in
this mode to get more details about the redirect request.
cancelled unless [`request.followRedirect`](#requestfollowredirect) is invoked
synchronously during the [`redirect`](#event-redirect) event.
`options` properties such as `protocol`, `host`, `hostname`, `port` and `path`
strictly follow the Node.js model as described in the
@@ -70,8 +70,8 @@ Returns:
* `port` Integer
* `realm` String
* `callback` Function
* `username` String
* `password` String
* `username` String (optional)
* `password` String (optional)
Emitted when an authenticating proxy is asking for user credentials.
@@ -136,8 +136,11 @@ Returns:
* `redirectUrl` String
* `responseHeaders` Record<String, String[]>
Emitted when there is redirection and the mode is `manual`. Calling
[`request.followRedirect`](#requestfollowredirect) will continue with the redirection.
Emitted when the server returns a redirect response (e.g. 301 Moved
Permanently). Calling [`request.followRedirect`](#requestfollowredirect) will
continue with the redirection. If this event is handled,
[`request.followRedirect`](#requestfollowredirect) must be called
**synchronously**, otherwise the request will be cancelled.
### Instance Properties
@@ -214,7 +217,8 @@ response object,it will emit the `aborted` event.
#### `request.followRedirect()`
Continues any deferred redirection request when the redirection mode is `manual`.
Continues any pending redirection. Can only be called during a `'redirect'`
event.
#### `request.getUploadProgress()`

View File

@@ -28,13 +28,14 @@ window.electron.doThing()
### Main World
The "Main World" is the javascript context that your main renderer code runs in. By default the page you load in your renderer
executes code in this world.
The "Main World" is the JavaScript context that your main renderer code runs in. By default, the
page you load in your renderer executes code in this world.
### Isolated World
When `contextIsolation` is enabled in your `webPreferences` your `preload` scripts run in an "Isolated World". You can read more about
context isolation and what it affects in the [BrowserWindow](browser-window.md) docs.
When `contextIsolation` is enabled in your `webPreferences`, your `preload` scripts run in an
"Isolated World". You can read more about context isolation and what it affects in the
[security](../tutorial/security.md#3-enable-context-isolation-for-remote-content) docs.
## Methods
@@ -50,12 +51,12 @@ The `contextBridge` module has the following methods:
### API Objects
The `api` object provided to [`exposeInMainWorld`](#contextbridgeexposeinmainworldapikey-api-experimental) must be an object
whose keys are strings and values are a `Function`, `String`, `Number`, `Array`, `Boolean` or another nested object that meets the same conditions.
whose keys are strings and values are a `Function`, `String`, `Number`, `Array`, `Boolean`, or another nested object that meets the same conditions.
`Function` values are proxied to the other context and all other values are **copied** and **frozen**. I.e. Any data / primitives sent in
`Function` values are proxied to the other context and all other values are **copied** and **frozen**. Any data / primitives sent in
the API object become immutable and updates on either side of the bridge do not result in an update on the other side.
An example of a complex API object is shown below.
An example of a complex API object is shown below:
```javascript
const { contextBridge } = require('electron')
@@ -90,22 +91,22 @@ results in some key limitations that we've outlined below.
#### Parameter / Error / Return Type support
Because parameters, errors and return values are **copied** when they are sent over the bridge there are only certain types that can be used.
At a high level if the type you want to use can be serialized and un-serialized into the same object it will work. A table of type support
has been included below for completeness.
Because parameters, errors and return values are **copied** when they are sent over the bridge, there are only certain types that can be used.
At a high level, if the type you want to use can be serialized and deserialized into the same object it will work. A table of type support
has been included below for completeness:
| Type | Complexity | Parameter Support | Return Value Support | Limitations |
| ---- | ---------- | ----------------- | -------------------- | ----------- |
| `String` | Simple | ✅ | ✅ | N/A |
| `Number` | Simple | ✅ | ✅ | N/A |
| `Boolean` | Simple | ✅ | ✅ | N/A |
| `Object` | Complex | ✅ | ✅ | Keys must be supported "Simple" types in this table. Values must be supported in this table. Prototype modifications are dropped. Sending custom classes will copy values but not the prototype. |
| `Object` | Complex | ✅ | ✅ | Keys must be supported using only "Simple" types in this table. Values must be supported in this table. Prototype modifications are dropped. Sending custom classes will copy values but not the prototype. |
| `Array` | Complex | ✅ | ✅ | Same limitations as the `Object` type |
| `Error` | Complex | ✅ | ✅ | Errors that are thrown are also copied, this can result in the message and stack trace of the error changing slightly due to being thrown in a different context |
| `Promise` | Complex | ✅ | ✅ | Promises are only proxied if they are a the return value or exact parameter. Promises nested in arrays or obejcts will be dropped. |
| `Promise` | Complex | ✅ | ✅ | Promises are only proxied if they are the return value or exact parameter. Promises nested in arrays or objects will be dropped. |
| `Function` | Complex | ✅ | ✅ | Prototype modifications are dropped. Sending classes or constructors will not work. |
| [Cloneable Types](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm) | Simple | ✅ | ✅ | See the linked document on cloneable types |
| `Symbol` | N/A | ❌ | ❌ | Symbols cannot be copied across contexts so they are dropped |
If the type you care about is not in the above table it is probably not supported.
If the type you care about is not in the above table, it is probably not supported.

View File

@@ -91,7 +91,11 @@ The `desktopCapturer` module has the following methods:
Returns `Promise<DesktopCapturerSource[]>` - Resolves with an array of [`DesktopCapturerSource`](structures/desktop-capturer-source.md) objects, each `DesktopCapturerSource` represents a screen or an individual window that can be captured.
**Note** Capturing the screen contents requires user consent on macOS 10.15 Catalina or higher,
which can detected by [`systemPreferences.getMediaAccessStatus`].
[`navigator.mediaDevices.getUserMedia`]: https://developer.mozilla.org/en/docs/Web/API/MediaDevices/getUserMedia
[`systemPreferences.getMediaAccessStatus`]: system-preferences.md#systempreferencesgetmediaaccessstatusmediatype-macos
## Caveats

View File

@@ -120,7 +120,7 @@ Returns `Promise<Object>` - Resolve with an object containing the following:
* `canceled` Boolean - whether or not the dialog was canceled.
* `filePaths` String[] - An array of file paths chosen by the user. If the dialog is cancelled this will be an empty array.
* `bookmarks` String[] (optional) _macOS_ _mas_ - An array matching the `filePaths` array of base64 encoded strings which contains security scoped bookmark data. `securityScopedBookmarks` must be enabled for this to be populated.
* `bookmarks` String[] (optional) _macOS_ _mas_ - An array matching the `filePaths` array of base64 encoded strings which contains security scoped bookmark data. `securityScopedBookmarks` must be enabled for this to be populated. (For return values, see [table here](#bookmarks-array).)
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
@@ -215,7 +215,7 @@ The `filters` specifies an array of file types that can be displayed, see
Returns `Promise<Object>` - Resolve with an object containing the following:
* `canceled` Boolean - whether or not the dialog was canceled.
* `filePath` String (optional) - If the dialog is canceled, this will be `undefined`.
* `bookmark` String (optional) _macOS_ _mas_ - Base64 encoded string which contains the security scoped bookmark data for the saved file. `securityScopedBookmarks` must be enabled for this to be present.
* `bookmark` String (optional) _macOS_ _mas_ - Base64 encoded string which contains the security scoped bookmark data for the saved file. `securityScopedBookmarks` must be enabled for this to be present. (For return values, see [table here](#bookmarks-array).)
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
@@ -350,6 +350,17 @@ On Windows the options are more limited, due to the Win32 APIs used:
* The `browserWindow` argument is ignored since it is not possible to make
this confirmation dialog modal.
## Bookmarks array
`showOpenDialog`, `showOpenDialogSync`, `showSaveDialog`, and `showSaveDialogSync` will return a `bookmarks` array.
| Build Type | securityScopedBookmarks boolean | Return Type | Return Value |
|------------|---------------------------------|:-----------:|--------------------------------|
| macOS mas | True | Success | `['LONGBOOKMARKSTRING']` |
| macOS mas | True | Error | `['']` (array of empty string) |
| macOS mas | False | NA | `[]` (empty array) |
| non mas | any | NA | `[]` (empty array) |
## Sheets
On macOS, dialogs are presented as sheets attached to a window if you provide

View File

@@ -77,6 +77,7 @@ only the next time a message is sent to `channel`, after which it is removed.
* `channel` String
* `listener` Function
* `...args` any[]
Removes the specified `listener` from the listener array for the specified
`channel`.

View File

@@ -329,9 +329,9 @@ can be called on empty images.
[buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer
## Properties
### Instance Properties
### `nativeImage.isMacTemplateImage` _macOS_
#### `nativeImage.isMacTemplateImage` _macOS_
A `Boolean` property that determines whether the image is considered a [template image](https://developer.apple.com/documentation/appkit/nsimage/1520017-template).

View File

@@ -217,11 +217,15 @@ that all statistics are reported in Kilobytes.
Returns `String` - The version of the host operating system.
Examples:
Example:
* `macOS` -> `10.13.6`
* `Windows` -> `10.0.17763`
* `Linux` -> `4.15.0-45-generic`
```js
const version = process.getSystemVersion()
console.log(version)
// On macOS -> '10.13.6'
// On Windows -> '10.0.17763'
// On Linux -> '4.15.0-45-generic'
```
**Note:** It returns the actual operating system version instead of kernel version on macOS unlike `os.release()`.

View File

@@ -389,9 +389,7 @@ which sends a `Buffer` as a response.
* `url` String
* `method` String (optional)
* `session` Session | null (optional)
* `uploadData` Object (optional)
* `contentType` String - MIME type of the content.
* `data` String - Content to be sent.
* `uploadData` [ProtocolResponseUploadData](structures/protocol-response-upload-data.md) (optional)
* `completion` Function (optional)
* `error` Error

View File

@@ -456,10 +456,52 @@ this session just before normal `preload` scripts run.
Returns `String[]` an array of paths to preload scripts that have been
registered.
#### `ses.setSpellCheckerLanguages(languages)`
* `languages` String[] - An array of language codes to enable the spellchecker for.
The built in spellchecker does not automatically detect what language a user is typing in. In order for the
spell checker to correctly check their words you must call this API with an array of language codes. You can
get the list of supported language codes with the `ses.availableSpellCheckerLanguages` property.
**Note:** On macOS the OS spellchecker is used and will detect your language automatically. This API is a no-op on macOS.
#### `ses.getSpellCheckerLanguages()`
Returns `String[]` - An array of language codes the spellchecker is enabled for. If this list is empty the spellchecker
will fallback to using `en-US`. By default on launch if this setting is an empty list Electron will try to populate this
setting with the current OS locale. This setting is persisted across restarts.
**Note:** On macOS the OS spellchecker is used and has it's own list of languages. This API is a no-op on macOS.
#### `ses.setSpellCheckerDictionaryDownloadURL(url)`
* `url` String - A base URL for Electron to download hunspell dictionaries from.
By default Electron will download hunspell dictionaries from the Chromium CDN. If you want to override this
behavior you can use this API to point the dictionary downloader at your own hosted version of the hunspell
dictionaries. We publish a `hunspell_dictionaries.zip` file with each release which contains the files you need
to host here.
**Note:** On macOS the OS spellchecker is used and therefore we do not download any dictionary files. This API is a no-op on macOS.
#### `ses.addWordToSpellCheckerDictionary(word)`
* `word` String - The word you want to add to the dictionary
Returns `Boolean` - Whether the word was successfully written to the custom dictionary.
**Note:** On macOS and Windows 10 this word will be written to the OS custom dictionary as well
### Instance Properties
The following properties are available on instances of `Session`:
#### `ses.availableSpellCheckerLanguages` _Readonly_
A `String[]` array which consists of all the known available spell checker languages. Providing a language
code to the `setSpellCheckerLanaguages` API that isn't in this array will result in an error.
#### `ses.cookies` _Readonly_
A [`Cookies`](cookies.md) object for this session.

View File

@@ -1,4 +1,4 @@
# ProtocolResponseUploadData Object
* `contentType` String - MIME type of the content.
* `data` String - Content to be sent.
* `data` String | Buffer - Content to be sent.

View File

@@ -434,11 +434,13 @@ Returns `Boolean` - `true` if the current process is a trusted accessibility cli
### `systemPreferences.getMediaAccessStatus(mediaType)` _macOS_
* `mediaType` String - `microphone` or `camera`.
* `mediaType` String - Can be `microphone`, `camera` or `screen`.
Returns `String` - Can be `not-determined`, `granted`, `denied`, `restricted` or `unknown`.
This user consent was not required until macOS 10.14 Mojave, so this method will always return `granted` if your system is running 10.13 High Sierra or lower.
This user consent was not required on macOS 10.13 High Sierra or lower so this method will always return `granted`.
macOS 10.14 Mojave or higher requires consent for `microphone` and `camera` access.
macOS 10.15 Catalina or higher requires consent for `screen` access.
### `systemPreferences.askForMediaAccess(mediaType)` _macOS_

View File

@@ -454,10 +454,8 @@ The usage is the same with [the `select-client-certificate` event of
Returns:
* `event` Event
* `request` Object
* `method` String
* `authenticationResponseDetails` Object
* `url` URL
* `referrer` URL
* `authInfo` Object
* `isProxy` Boolean
* `scheme` String
@@ -465,8 +463,8 @@ Returns:
* `port` Integer
* `realm` String
* `callback` Function
* `username` String
* `password` String
* `username` String (optional)
* `password` String (optional)
Emitted when `webContents` wants to do basic auth.
@@ -570,6 +568,9 @@ Returns:
* `titleText` String - Title or alt text of the selection that the context
was invoked on.
* `misspelledWord` String - The misspelled word under the cursor, if any.
* `dictionarySuggestions` String[] - An array of suggested words to show the
user to replace the `misspelledWord`. Only available if there is a misspelled
word and spellchecker is enabled.
* `frameCharset` String - The character encoding of the frame on which the
menu was invoked.
* `inputFieldType` String - If the context menu was invoked on an input
@@ -1041,6 +1042,17 @@ contents.executeJavaScript('fetch("https://jsonplaceholder.typicode.com/users/1"
})
```
#### `contents.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture])`
* `worldId` Integer - The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electron's `contextIsolation` feature. You can provide any integer here.
* `scripts` [WebSource[]](structures/web-source.md)
* `userGesture` Boolean (optional) - Default is `false`.
Returns `Promise<any>` - A promise that resolves with the result of the executed code
or is rejected if the result of the code is a rejected promise.
Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
#### `contents.setIgnoreMenuShortcuts(ignore)` _Experimental_
* `ignore` Boolean
@@ -1112,7 +1124,7 @@ Sets the maximum and minimum pinch-to-zoom level.
> contents.setVisualZoomLevelLimits(1, 3)
> ```
#### `contents.setLayoutZoomLevelLimits(minimumLevel, maximumLevel)`
#### `contents.setLayoutZoomLevelLimits(minimumLevel, maximumLevel)` _Deprecated_
* `minimumLevel` Number
* `maximumLevel` Number
@@ -1121,6 +1133,8 @@ Returns `Promise<void>`
Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
**Deprecated:** This API is no longer supported by Chromium.
#### `contents.undo()`
Executes the editing command `undo` in web page.
@@ -1233,11 +1247,34 @@ Returns `Promise<NativeImage>` - Resolves with a [NativeImage](native-image.md)
Captures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page.
#### `contents.isBeingCaptured()`
Returns `Boolean` - Whether this page is being captured. It returns true when the capturer count
is large then 0.
#### `contents.incrementCapturerCount([size, stayHidden])`
* `size` [Size](structures/size.md) (optional) - The perferred size for the capturer.
* `stayHidden` Boolean (optional) - Keep the page hidden instead of visible.
Increase the capturer count by one. The page is considered visible when its browser window is
hidden and the capturer count is non-zero. If you would like the page to stay hidden, you should ensure that `stayHidden` is set to true.
This also affects the Page Visibility API.
#### `contents.decrementCapturerCount([stayHidden])`
* `stayHidden` Boolean (optional) - Keep the page in hidden state instead of visible.
Decrease the capturer count by one. The page will be set to hidden or occluded state when its
browser window is hidden or occluded and the capturer count reaches zero. If you want to
decrease the hidden capturer count instead you should set `stayHidden` to true.
#### `contents.getPrinters()`
Get the system printer list.
Returns [`PrinterInfo[]`](structures/printer-info.md).
Returns [`PrinterInfo[]`](structures/printer-info.md)
#### `contents.print([options], [callback])`
@@ -1245,7 +1282,7 @@ Returns [`PrinterInfo[]`](structures/printer-info.md).
* `silent` Boolean (optional) - Don't ask user for print settings. Default is `false`.
* `printBackground` Boolean (optional) - Prints the background color and image of
the web page. Default is `false`.
* `deviceName` String (optional) - Set the printer device name to use. Default is `''`.
* `deviceName` String (optional) - Set the printer device name to use. Must be the system-defined name and not the 'friendly' name, e.g 'Brother_QL_820NWB' and not 'Brother QL-820NWB'.
* `color` Boolean (optional) - Set whether the printed web page will be in color or grayscale. Default is `true`.
* `margins` Object (optional)
* `marginType` String (optional) - Can be `default`, `none`, `printableArea`, or `custom`. If `custom` is chosen, you will also need to specify `top`, `bottom`, `left`, and `right`.
@@ -1326,12 +1363,13 @@ win.loadURL('http://github.com')
win.webContents.on('did-finish-load', () => {
// Use default printing options
win.webContents.printToPDF({}, (error, data) => {
if (error) throw error
win.webContents.printToPDF({}).then(data => {
fs.writeFile('/tmp/print.pdf', data, (error) => {
if (error) throw error
console.log('Write PDF successfully.')
})
}).catch(error => {
console.log(error)
})
})
```

View File

@@ -56,13 +56,15 @@ Sets the maximum and minimum pinch-to-zoom level.
> webFrame.setVisualZoomLevelLimits(1, 3)
> ```
### `webFrame.setLayoutZoomLevelLimits(minimumLevel, maximumLevel)`
### `webFrame.setLayoutZoomLevelLimits(minimumLevel, maximumLevel)` _Deprecated_
* `minimumLevel` Number
* `maximumLevel` Number
Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
**Deprecated:** This API is no longer supported by Chromium.
### `webFrame.setSpellCheckProvider(language, provider)`
* `language` String
@@ -74,6 +76,17 @@ Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
Sets a provider for spell checking in input fields and text areas.
If you want to use this method you must disable the builtin spellchecker when you
construct the window.
```js
const mainWindow = new BrowserWindow({
webPreferences: {
spellcheck: false
}
})
```
The `provider` must be an object that has a `spellCheck` method that accepts
an array of individual words for spellchecking.
The `spellCheck` function runs asynchronously and calls the `callback` function

View File

@@ -146,7 +146,7 @@ response are visible by the time this listener is fired.
* `timestamp` Double
* `statusLine` String
* `statusCode` Integer
* `responseHeaders` Record<string, string> (optional)
* `responseHeaders` Record<string, string[]> (optional)
* `callback` Function
* `headersReceivedResponse` Object
* `cancel` Boolean (optional)
@@ -175,7 +175,7 @@ The `callback` has to be called with a `response` object.
* `resourceType` String
* `referrer` String
* `timestamp` Double
* `responseHeaders` Record<string, string> (optional)
* `responseHeaders` Record<string, string[]> (optional)
* `fromCache` Boolean - Indicates whether the response was fetched from disk
cache.
* `statusCode` Integer
@@ -205,7 +205,7 @@ and response headers are available.
* `ip` String (optional) - The server IP address that the request was
actually sent to.
* `fromCache` Boolean
* `responseHeaders` Record<string, string> (optional)
* `responseHeaders` Record<string, string[]> (optional)
The `listener` will be called with `listener(details)` when a server initiated
redirect is about to occur.
@@ -224,7 +224,7 @@ redirect is about to occur.
* `resourceType` String
* `referrer` String
* `timestamp` Double
* `responseHeaders` Record<string, string> (optional)
* `responseHeaders` Record<string, string[]> (optional)
* `fromCache` Boolean
* `statusCode` Integer
* `statusLine` String

View File

@@ -635,7 +635,7 @@ Returns `Promise<void>`
Sets the maximum and minimum pinch-to-zoom level.
### `<webview>.setLayoutZoomLevelLimits(minimumLevel, maximumLevel)`
### `<webview>.setLayoutZoomLevelLimits(minimumLevel, maximumLevel)` _Deprecated_
* `minimumLevel` Number
* `maximumLevel` Number
@@ -644,11 +644,13 @@ Returns `Promise<void>`
Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
**Deprecated:** This API is no longer supported by Chromium.
### `<webview>.showDefinitionForSelection()` _macOS_
Shows pop-up dictionary that searches the selected word on the page.
### `<webview>.getWebContents()`
### `<webview>.getWebContents()` _Deprecated_
Returns [`WebContents`](web-contents.md) - The web contents associated with
this `webview`.

View File

@@ -38,11 +38,15 @@ npm install --platform=win32 electron
## Proxies
If you need to use an HTTP proxy you can [set these environment variables][proxy-env].
If you need to use an HTTP proxy, you need to set the `ELECTRON_GET_USE_PROXY` variable to any
value, plus additional environment variables depending on your host system's Node version:
* [Node 10 and above][proxy-env-10]
* [Before Node 10][proxy-env]
## Custom Mirrors and Caches
During installation, the `electron` module will call out to
[`electron-download`][electron-download] to download prebuilt binaries of
[`@electron/get`][electron-get] to download prebuilt binaries of
Electron for your platform. It will do so by contacting GitHub's
release download page (`https://github.com/electron/electron/releases/tag/v$VERSION`,
where `$VERSION` is the exact version of Electron).
@@ -52,7 +56,7 @@ can do so by either providing a mirror or an existing cache directory.
#### Mirror
You can use environment variables to override the base URL, the path at which to
look for Electron binaries, and the binary filename. The url used by `electron-download`
look for Electron binaries, and the binary filename. The url used by `@electron/get`
is composed as follows:
```plaintext
@@ -62,11 +66,11 @@ url = ELECTRON_MIRROR + ELECTRON_CUSTOM_DIR + '/' + ELECTRON_CUSTOM_FILENAME
For instance, to use the China mirror:
```plaintext
ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/"
ELECTRON_MIRROR="https://cdn.npm.taobao.org/dist/electron/"
```
#### Cache
Alternatively, you can override the local cache. `electron-download` will cache
Alternatively, you can override the local cache. `@electron/get` will cache
downloaded binaries in a local directory to not stress your network. You can use
that cache folder to provide custom builds of Electron or to avoid making contact
with the network at all.
@@ -85,16 +89,26 @@ The cache contains the version's official zip file as well as a checksum, stored
a text file. A typical cache might look like this:
```sh
├── electron-v1.7.9-darwin-x64.zip
── electron-v1.8.1-darwin-x64.zip
├── electron-v1.8.2-beta.1-darwin-x64.zip
├── electron-v1.8.2-beta.2-darwin-x64.zip
├── electron-v1.8.2-beta.3-darwin-x64.zip
├── SHASUMS256.txt-1.7.9
├── SHASUMS256.txt-1.8.1
── SHASUMS256.txt-1.8.2-beta.1
├── SHASUMS256.txt-1.8.2-beta.2
├── SHASUMS256.txt-1.8.2-beta.3
├── httpsgithub.comelectronelectronreleasesdownloadv1.7.9electron-v1.7.9-darwin-x64.zip
│ └── electron-v1.7.9-darwin-x64.zip
├── httpsgithub.comelectronelectronreleasesdownloadv1.7.9SHASUMS256.txt
│ └── SHASUMS256.txt
├── httpsgithub.comelectronelectronreleasesdownloadv1.8.1electron-v1.8.1-darwin-x64.zip
│ └── electron-v1.8.1-darwin-x64.zip
├── httpsgithub.comelectronelectronreleasesdownloadv1.8.1SHASUMS256.txt
│ └── SHASUMS256.txt
├── httpsgithub.comelectronelectronreleasesdownloadv1.8.2-beta.1electron-v1.8.2-beta.1-darwin-x64.zip
│ └── electron-v1.8.2-beta.1-darwin-x64.zip
├── httpsgithub.comelectronelectronreleasesdownloadv1.8.2-beta.1SHASUMS256.txt
│ └── SHASUMS256.txt
├── httpsgithub.comelectronelectronreleasesdownloadv1.8.2-beta.2electron-v1.8.2-beta.2-darwin-x64.zip
│ └── electron-v1.8.2-beta.2-darwin-x64.zip
├── httpsgithub.comelectronelectronreleasesdownloadv1.8.2-beta.2SHASUMS256.txt
│ └── SHASUMS256.txt
├── httpsgithub.comelectronelectronreleasesdownloadv1.8.2-beta.3electron-v1.8.2-beta.3-darwin-x64.zip
│ └── electron-v1.8.2-beta.3-darwin-x64.zip
└── httpsgithub.comelectronelectronreleasesdownloadv1.8.2-beta.3SHASUMS256.txt
└── SHASUMS256.txt
```
## Skip binary download
@@ -146,7 +160,8 @@ If you need to force a re-download of the asset and the SHASUM file set the
[npm]: https://docs.npmjs.com
[versioning]: ./electron-versioning.md
[releases]: https://github.com/electron/electron/releases
[proxy-env]: https://github.com/request/request/tree/f0c4ec061141051988d1216c24936ad2e7d5c45d#controlling-proxy-behaviour-using-environment-variables
[electron-download]: https://github.com/electron-userland/electron-download
[proxy-env-10]: https://github.com/gajus/global-agent/blob/v2.1.5/README.md#environment-variables
[proxy-env]: https://github.com/np-maintain/global-tunnel/blob/v2.7.1/README.md#auto-config
[electron-get]: https://github.com/electron/get
[npm-permissions]: https://docs.npmjs.com/getting-started/fixing-npm-permissions
[unsafe-perm]: https://docs.npmjs.com/misc/config#unsafe-perm

View File

@@ -54,13 +54,13 @@ at once, consider the [Chrome Tracing] tool.
Chances are that your app could be a little leaner, faster, and generally less
resource-hungry if you attempt these steps.
1) [Carelessly including modules](#1-carelessly-including-modules)
2) [Loading and running code too soon](#2-loading-and-running-code-too-soon)
3) [Blocking the main process](#3-blocking-the-main-process)
4) [Blocking the renderer process](#4-blocking-the-renderer-process)
5) [Unnecessary polyfills](#5-unnecessary-polyfills)
6) [Unnecessary or blocking network requests](#6-unnecessary-or-blocking-network-requests)
7) [Bundle your code](#7-bundle-your-code)
1. [Carelessly including modules](#1-carelessly-including-modules)
2. [Loading and running code too soon](#2-loading-and-running-code-too-soon)
3. [Blocking the main process](#3-blocking-the-main-process)
4. [Blocking the renderer process](#4-blocking-the-renderer-process)
5. [Unnecessary polyfills](#5-unnecessary-polyfills)
6. [Unnecessary or blocking network requests](#6-unnecessary-or-blocking-network-requests)
7. [Bundle your code](#7-bundle-your-code)
## 1) Carelessly including modules
@@ -418,7 +418,6 @@ As of writing this article, the popular choices include [Webpack][webpack],
[performance-cpu-prof]: ../images/performance-cpu-prof.png
[performance-heap-prof]: ../images/performance-heap-prof.png
[chrome-devtools-tutorial]: https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/
[chrome-tracing-tutorial]:
[worker-threads]: https://nodejs.org/api/worker_threads.html
[web-workers]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
[request-idle-callback]: https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback

View File

@@ -61,7 +61,6 @@ The output should look roughly like this:
├── libgcrypt.so.11
├── libnode.so
├── locales
├── natives_blob.bin
├── resources
├── v8_context_snapshot.bin
└── version

View File

@@ -62,7 +62,6 @@ The output should look roughly like this:
│   ├── am.pak
│   ├── ar.pak
│   ├── [...]
├── natives_blob.bin
├── node.dll
├── resources
│   ├── app

View File

@@ -69,4 +69,10 @@
<message name="IDS_PICTURE_IN_PICTURE_PREVIOUS_TRACK_CONTROL_ACCESSIBLE_TEXT" desc="Accessible text label used for the controls button in the Picture-in-Picture window. The button invokes previous track action.">
Previous track
</message>
<message name="IDS_SPELLCHECK_DICTIONARY" use_name_for_id="true">
en-US
</message>
<message name="IDS_ACCEPT_LANGUAGES" use_name_for_id="true">
en-US,en
</message>
</grit-part>

View File

@@ -135,12 +135,12 @@ auto_filenames = {
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/clipboard-utils.ts",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/remote/type-utils.ts",
"lib/common/type-utils.ts",
"lib/common/web-view-methods.ts",
"lib/common/webpack-globals-provider.ts",
"lib/renderer/api/context-bridge.ts",
"lib/renderer/api/crash-reporter.js",
"lib/renderer/api/desktop-capturer.ts",
@@ -165,6 +165,7 @@ auto_filenames = {
"lib/renderer/web-view/web-view-element.ts",
"lib/renderer/web-view/web-view-impl.ts",
"lib/renderer/web-view/web-view-init.ts",
"lib/renderer/window-setup.ts",
"lib/sandboxed_renderer/api/exports/electron.ts",
"lib/sandboxed_renderer/api/module-list.ts",
"lib/sandboxed_renderer/init.js",
@@ -188,6 +189,7 @@ auto_filenames = {
content_script_bundle_deps = [
"lib/common/electron-binding-setup.ts",
"lib/common/webpack-globals-provider.ts",
"lib/content_script/init.js",
"lib/renderer/chrome-api.ts",
"lib/renderer/extensions/event.ts",
@@ -266,15 +268,15 @@ auto_filenames = {
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/clipboard-utils.ts",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/init.ts",
"lib/common/parse-features-string.js",
"lib/common/remote/type-utils.ts",
"lib/common/reset-search-paths.ts",
"lib/common/type-utils.ts",
"lib/common/web-view-methods.ts",
"lib/common/webpack-globals-provider.ts",
"lib/renderer/ipc-renderer-internal-utils.ts",
"lib/renderer/ipc-renderer-internal.ts",
"package.json",
@@ -289,14 +291,14 @@ auto_filenames = {
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/clipboard-utils.ts",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/init.ts",
"lib/common/remote/type-utils.ts",
"lib/common/reset-search-paths.ts",
"lib/common/type-utils.ts",
"lib/common/web-view-methods.ts",
"lib/common/webpack-globals-provider.ts",
"lib/renderer/api/context-bridge.ts",
"lib/renderer/api/crash-reporter.js",
"lib/renderer/api/desktop-capturer.ts",
@@ -338,13 +340,13 @@ auto_filenames = {
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/clipboard-utils.ts",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/init.ts",
"lib/common/remote/type-utils.ts",
"lib/common/reset-search-paths.ts",
"lib/common/type-utils.ts",
"lib/common/webpack-globals-provider.ts",
"lib/renderer/api/context-bridge.ts",
"lib/renderer/api/crash-reporter.js",
"lib/renderer/api/desktop-capturer.ts",

View File

@@ -22,6 +22,11 @@ filenames = {
]
lib_sources = [
"chromium_src/chrome/browser/process_singleton.h",
"chromium_src/chrome/browser/process_singleton_posix.cc",
"chromium_src/chrome/browser/process_singleton_win.cc",
"chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.cc",
"chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h",
"shell/app/atom_content_client.cc",
"shell/app/atom_content_client.h",
"shell/app/atom_main_delegate.cc",
@@ -32,17 +37,17 @@ filenames = {
"shell/app/command_line_args.h",
"shell/app/uv_task_runner.cc",
"shell/app/uv_task_runner.h",
"shell/browser/api/atom_api_app_mac.mm",
"shell/browser/api/atom_api_app.cc",
"shell/browser/font_defaults.cc",
"shell/browser/font_defaults.h",
"shell/browser/feature_list.cc",
"shell/browser/feature_list.h",
"shell/browser/api/atom_api_app.h",
"shell/browser/api/atom_api_app_mac.mm",
"shell/browser/api/atom_api_auto_updater.cc",
"shell/browser/api/atom_api_auto_updater.h",
"shell/browser/api/atom_api_browser_view.cc",
"shell/browser/api/atom_api_browser_view.h",
"shell/browser/api/atom_api_browser_window.cc",
"shell/browser/api/atom_api_browser_window.h",
"shell/browser/api/atom_api_browser_window_mac.mm",
"shell/browser/api/atom_api_browser_window_views.cc",
"shell/browser/api/atom_api_content_tracing.cc",
"shell/browser/api/atom_api_cookies.cc",
"shell/browser/api/atom_api_cookies.h",
@@ -73,10 +78,10 @@ filenames = {
"shell/browser/api/atom_api_net_log.h",
"shell/browser/api/atom_api_notification.cc",
"shell/browser/api/atom_api_notification.h",
"shell/browser/api/atom_api_power_monitor_mac.mm",
"shell/browser/api/atom_api_power_monitor_win.cc",
"shell/browser/api/atom_api_power_monitor.cc",
"shell/browser/api/atom_api_power_monitor.h",
"shell/browser/api/atom_api_power_monitor_mac.mm",
"shell/browser/api/atom_api_power_monitor_win.cc",
"shell/browser/api/atom_api_power_save_blocker.cc",
"shell/browser/api/atom_api_power_save_blocker.h",
"shell/browser/api/atom_api_protocol_ns.cc",
@@ -93,8 +98,8 @@ filenames = {
"shell/browser/api/atom_api_top_level_window.h",
"shell/browser/api/atom_api_tray.cc",
"shell/browser/api/atom_api_tray.h",
"shell/browser/api/atom_api_url_request_ns.cc",
"shell/browser/api/atom_api_url_request_ns.h",
"shell/browser/api/atom_api_url_loader.cc",
"shell/browser/api/atom_api_url_loader.h",
"shell/browser/api/atom_api_view.cc",
"shell/browser/api/atom_api_view.h",
"shell/browser/api/atom_api_web_contents.cc",
@@ -106,16 +111,10 @@ filenames = {
"shell/browser/api/atom_api_web_request_ns.cc",
"shell/browser/api/atom_api_web_request_ns.h",
"shell/browser/api/atom_api_web_view_manager.cc",
"shell/browser/api/atom_api_browser_window.cc",
"shell/browser/api/atom_api_browser_window.h",
"shell/browser/api/atom_api_browser_window_mac.mm",
"shell/browser/api/atom_api_browser_window_views.cc",
"shell/browser/api/event.cc",
"shell/browser/api/event.h",
"shell/browser/api/event_emitter_deprecated.cc",
"shell/browser/api/event_emitter_deprecated.h",
"shell/browser/api/trackable_object.cc",
"shell/browser/api/trackable_object.h",
"shell/browser/api/frame_subscriber.cc",
"shell/browser/api/frame_subscriber.h",
"shell/browser/api/gpu_info_enumerator.cc",
@@ -126,29 +125,28 @@ filenames = {
"shell/browser/api/process_metric.h",
"shell/browser/api/save_page_handler.cc",
"shell/browser/api/save_page_handler.h",
"shell/browser/auto_updater.cc",
"shell/browser/auto_updater.h",
"shell/browser/auto_updater_mac.mm",
"shell/browser/atom_autofill_driver_factory.cc",
"shell/browser/atom_autofill_driver_factory.h",
"shell/browser/api/trackable_object.cc",
"shell/browser/api/trackable_object.h",
"shell/browser/atom_autofill_driver.cc",
"shell/browser/atom_autofill_driver.h",
"shell/browser/atom_autofill_driver_factory.cc",
"shell/browser/atom_autofill_driver_factory.h",
"shell/browser/atom_browser_client.cc",
"shell/browser/atom_browser_client.h",
"shell/browser/atom_browser_context.cc",
"shell/browser/atom_browser_context.h",
"shell/browser/atom_download_manager_delegate.cc",
"shell/browser/atom_download_manager_delegate.h",
"shell/browser/atom_gpu_client.cc",
"shell/browser/atom_gpu_client.h",
"shell/browser/atom_browser_main_parts.cc",
"shell/browser/atom_browser_main_parts.h",
"shell/browser/atom_browser_main_parts_mac.mm",
"shell/browser/atom_browser_main_parts_posix.cc",
"shell/browser/atom_download_manager_delegate.cc",
"shell/browser/atom_download_manager_delegate.h",
"shell/browser/atom_gpu_client.cc",
"shell/browser/atom_gpu_client.h",
"shell/browser/atom_javascript_dialog_manager.cc",
"shell/browser/atom_javascript_dialog_manager.h",
"shell/browser/atom_navigation_throttle.h",
"shell/browser/atom_navigation_throttle.cc",
"shell/browser/atom_navigation_throttle.h",
"shell/browser/atom_paths.h",
"shell/browser/atom_permission_manager.cc",
"shell/browser/atom_permission_manager.h",
@@ -158,29 +156,38 @@ filenames = {
"shell/browser/atom_speech_recognition_manager_delegate.h",
"shell/browser/atom_web_ui_controller_factory.cc",
"shell/browser/atom_web_ui_controller_factory.h",
"shell/browser/auto_updater.cc",
"shell/browser/auto_updater.h",
"shell/browser/auto_updater_mac.mm",
"shell/browser/browser.cc",
"shell/browser/browser.h",
"shell/browser/browser_linux.cc",
"shell/browser/browser_mac.mm",
"shell/browser/browser_win.cc",
"shell/browser/browser_observer.h",
"shell/browser/browser_process_impl.cc",
"shell/browser/browser_process_impl.h",
"shell/browser/browser_win.cc",
"shell/browser/child_web_contents_tracker.cc",
"shell/browser/child_web_contents_tracker.h",
"shell/browser/common_web_contents_delegate_mac.mm",
"shell/browser/common_web_contents_delegate_views.cc",
"shell/browser/common_web_contents_delegate.cc",
"shell/browser/common_web_contents_delegate.h",
"shell/browser/common_web_contents_delegate_mac.mm",
"shell/browser/common_web_contents_delegate_views.cc",
"shell/browser/cookie_change_notifier.cc",
"shell/browser/cookie_change_notifier.h",
"shell/browser/feature_list.cc",
"shell/browser/feature_list.h",
"shell/browser/font_defaults.cc",
"shell/browser/font_defaults.h",
"shell/browser/javascript_environment.cc",
"shell/browser/javascript_environment.h",
"shell/browser/lib/bluetooth_chooser.cc",
"shell/browser/lib/bluetooth_chooser.h",
"shell/browser/lib/power_observer.h",
"shell/browser/lib/power_observer_linux.h",
"shell/browser/lib/power_observer_linux.cc",
"shell/browser/lib/power_observer_linux.h",
"shell/browser/linux/unity_service.cc",
"shell/browser/linux/unity_service.h",
"shell/browser/login_handler.cc",
"shell/browser/login_handler.h",
"shell/browser/mac/atom_application.h",
@@ -195,48 +202,52 @@ filenames = {
"shell/browser/mac/in_app_purchase_observer.mm",
"shell/browser/mac/in_app_purchase_product.h",
"shell/browser/mac/in_app_purchase_product.mm",
"shell/browser/microtasks_runner.cc",
"shell/browser/microtasks_runner.h",
"shell/browser/native_browser_view.cc",
"shell/browser/native_browser_view.h",
"shell/browser/native_browser_view_mac.h",
"shell/browser/native_browser_view_mac.mm",
"shell/browser/native_browser_view_views.h",
"shell/browser/native_browser_view_views.cc",
"shell/browser/native_window.cc",
"shell/browser/native_window.h",
"shell/browser/native_window_views_win.cc",
"shell/browser/native_window_views.cc",
"shell/browser/native_window_views.h",
"shell/browser/native_window_mac.h",
"shell/browser/native_window_mac.mm",
"shell/browser/native_window_observer.h",
"shell/browser/media/media_capture_devices_dispatcher.cc",
"shell/browser/media/media_capture_devices_dispatcher.h",
"shell/browser/media/media_device_id_salt.cc",
"shell/browser/media/media_device_id_salt.h",
"shell/browser/media/media_stream_devices_controller.cc",
"shell/browser/media/media_stream_devices_controller.h",
"shell/browser/microtasks_runner.cc",
"shell/browser/microtasks_runner.h",
"shell/browser/native_browser_view.cc",
"shell/browser/native_browser_view.h",
"shell/browser/native_browser_view_mac.h",
"shell/browser/native_browser_view_mac.mm",
"shell/browser/native_browser_view_views.cc",
"shell/browser/native_browser_view_views.h",
"shell/browser/native_window.cc",
"shell/browser/native_window.h",
"shell/browser/native_window_mac.h",
"shell/browser/native_window_mac.mm",
"shell/browser/native_window_observer.h",
"shell/browser/native_window_views.cc",
"shell/browser/native_window_views.h",
"shell/browser/native_window_views_win.cc",
"shell/browser/net/asar/asar_url_loader.cc",
"shell/browser/net/asar/asar_url_loader.h",
"shell/browser/net/atom_url_loader_factory.cc",
"shell/browser/net/atom_url_loader_factory.h",
"shell/browser/net/cert_verifier_client.cc",
"shell/browser/net/cert_verifier_client.h",
"shell/browser/net/proxying_url_loader_factory.cc",
"shell/browser/net/proxying_url_loader_factory.h",
"shell/browser/net/network_context_service_factory.cc",
"shell/browser/net/network_context_service_factory.h",
"shell/browser/net/network_context_service.cc",
"shell/browser/net/network_context_service.h",
"shell/browser/net/network_context_service_factory.cc",
"shell/browser/net/network_context_service_factory.h",
"shell/browser/net/node_stream_loader.cc",
"shell/browser/net/node_stream_loader.h",
"shell/browser/net/proxying_url_loader_factory.cc",
"shell/browser/net/proxying_url_loader_factory.h",
"shell/browser/net/resolve_proxy_helper.cc",
"shell/browser/net/resolve_proxy_helper.h",
"shell/browser/net/system_network_context_manager.cc",
"shell/browser/net/system_network_context_manager.h",
"shell/browser/net/url_pipe_loader.cc",
"shell/browser/net/url_pipe_loader.h",
"shell/browser/network_hints_handler_impl.cc",
"shell/browser/network_hints_handler_impl.h",
"shell/browser/node_debugger.cc",
"shell/browser/node_debugger.h",
"shell/browser/notifications/linux/libnotify_notification.cc",
"shell/browser/notifications/linux/libnotify_notification.h",
"shell/browser/notifications/linux/notification_presenter_linux.cc",
@@ -269,17 +280,13 @@ filenames = {
"shell/browser/notifications/win/win32_notification.h",
"shell/browser/notifications/win/windows_toast_notification.cc",
"shell/browser/notifications/win/windows_toast_notification.h",
"shell/browser/node_debugger.cc",
"shell/browser/node_debugger.h",
"shell/browser/pref_store_delegate.cc",
"shell/browser/pref_store_delegate.h",
"shell/browser/relauncher.cc",
"shell/browser/relauncher.h",
"shell/browser/relauncher_linux.cc",
"shell/browser/relauncher_mac.cc",
"shell/browser/relauncher_win.cc",
"shell/browser/relauncher.cc",
"shell/browser/relauncher.h",
"shell/browser/renderer_host/electron_render_message_filter.cc",
"shell/browser/renderer_host/electron_render_message_filter.h",
"shell/browser/session_preferences.cc",
"shell/browser/session_preferences.h",
"shell/browser/special_storage_policy.cc",
@@ -293,8 +300,14 @@ filenames = {
"shell/browser/ui/certificate_trust.h",
"shell/browser/ui/certificate_trust_mac.mm",
"shell/browser/ui/certificate_trust_win.cc",
"shell/browser/ui/cocoa/NSColor+Hex.h",
"shell/browser/ui/cocoa/NSColor+Hex.mm",
"shell/browser/ui/cocoa/NSString+ANSI.h",
"shell/browser/ui/cocoa/NSString+ANSI.mm",
"shell/browser/ui/cocoa/atom_bundle_mover.h",
"shell/browser/ui/cocoa/atom_bundle_mover.mm",
"shell/browser/ui/cocoa/atom_inspectable_web_contents_view.h",
"shell/browser/ui/cocoa/atom_inspectable_web_contents_view.mm",
"shell/browser/ui/cocoa/atom_menu_controller.h",
"shell/browser/ui/cocoa/atom_menu_controller.mm",
"shell/browser/ui/cocoa/atom_native_widget_mac.h",
@@ -309,27 +322,23 @@ filenames = {
"shell/browser/ui/cocoa/atom_touch_bar.mm",
"shell/browser/ui/cocoa/delayed_native_view_host.cc",
"shell/browser/ui/cocoa/delayed_native_view_host.h",
"shell/browser/ui/cocoa/views_delegate_mac.h",
"shell/browser/ui/cocoa/views_delegate_mac.mm",
"shell/browser/ui/cocoa/root_view_mac.mm",
"shell/browser/ui/cocoa/root_view_mac.h",
"shell/browser/ui/cocoa/atom_inspectable_web_contents_view.h",
"shell/browser/ui/cocoa/atom_inspectable_web_contents_view.mm",
"shell/browser/ui/cocoa/event_dispatching_window.h",
"shell/browser/ui/cocoa/event_dispatching_window.mm",
"shell/browser/ui/cocoa/root_view_mac.h",
"shell/browser/ui/cocoa/root_view_mac.mm",
"shell/browser/ui/cocoa/views_delegate_mac.h",
"shell/browser/ui/cocoa/views_delegate_mac.mm",
"shell/browser/ui/devtools_manager_delegate.cc",
"shell/browser/ui/devtools_manager_delegate.h",
"shell/browser/ui/devtools_ui.cc",
"shell/browser/ui/devtools_ui.h",
"shell/browser/ui/drag_util.h",
"shell/browser/ui/drag_util_mac.mm",
"shell/browser/ui/drag_util_views.cc",
"shell/browser/ui/drag_util.h",
"shell/browser/ui/file_dialog.h",
"shell/browser/ui/file_dialog_gtk.cc",
"shell/browser/ui/file_dialog_mac.mm",
"shell/browser/ui/file_dialog_win.cc",
"shell/browser/ui/util_gtk.cc",
"shell/browser/ui/util_gtk.h",
"shell/browser/ui/inspectable_web_contents.cc",
"shell/browser/ui/inspectable_web_contents.h",
"shell/browser/ui/inspectable_web_contents_delegate.h",
@@ -344,19 +353,16 @@ filenames = {
"shell/browser/ui/message_box_gtk.cc",
"shell/browser/ui/message_box_mac.mm",
"shell/browser/ui/message_box_win.cc",
"shell/browser/ui/cocoa/NSColor+Hex.mm",
"shell/browser/ui/cocoa/NSColor+Hex.h",
"shell/browser/ui/cocoa/NSString+ANSI.mm",
"shell/browser/ui/cocoa/NSString+ANSI.h",
"shell/browser/ui/tray_icon.cc",
"shell/browser/ui/tray_icon.h",
"shell/browser/ui/tray_icon_gtk.cc",
"shell/browser/ui/tray_icon_gtk.h",
"shell/browser/ui/tray_icon_cocoa.h",
"shell/browser/ui/tray_icon_cocoa.mm",
"shell/browser/ui/tray_icon_gtk.cc",
"shell/browser/ui/tray_icon_gtk.h",
"shell/browser/ui/tray_icon_observer.h",
"shell/browser/ui/tray_icon_win.cc",
"shell/browser/ui/views/atom_views_delegate.cc",
"shell/browser/ui/views/atom_views_delegate_win.cc",
"shell/browser/ui/views/atom_views_delegate.h",
"shell/browser/ui/views/autofill_popup_view.cc",
"shell/browser/ui/views/autofill_popup_view.h",
@@ -386,10 +392,10 @@ filenames = {
"shell/browser/ui/win/atom_desktop_window_tree_host_win.h",
"shell/browser/ui/win/jump_list.cc",
"shell/browser/ui/win/jump_list.h",
"shell/browser/ui/win/notify_icon_host.cc",
"shell/browser/ui/win/notify_icon_host.h",
"shell/browser/ui/win/notify_icon.cc",
"shell/browser/ui/win/notify_icon.h",
"shell/browser/ui/win/notify_icon_host.cc",
"shell/browser/ui/win/notify_icon_host.h",
"shell/browser/ui/win/taskbar_host.cc",
"shell/browser/ui/win/taskbar_host.h",
"shell/browser/ui/x/event_disabler.cc",
@@ -400,8 +406,6 @@ filenames = {
"shell/browser/ui/x/x_window_utils.h",
"shell/browser/unresponsive_suppressor.cc",
"shell/browser/unresponsive_suppressor.h",
"shell/browser/win/scoped_hstring.cc",
"shell/browser/win/scoped_hstring.h",
"shell/browser/web_contents_permission_helper.cc",
"shell/browser/web_contents_permission_helper.h",
"shell/browser/web_contents_preferences.cc",
@@ -414,6 +418,8 @@ filenames = {
"shell/browser/web_view_guest_delegate.h",
"shell/browser/web_view_manager.cc",
"shell/browser/web_view_manager.h",
"shell/browser/win/scoped_hstring.cc",
"shell/browser/win/scoped_hstring.h",
"shell/browser/window_list.cc",
"shell/browser/window_list.h",
"shell/browser/window_list_observer.h",
@@ -431,25 +437,25 @@ filenames = {
"shell/common/api/atom_api_native_image_mac.mm",
"shell/common/api/atom_api_shell.cc",
"shell/common/api/atom_api_v8_util.cc",
"shell/common/api/constructor.h",
"shell/common/api/electron_bindings.cc",
"shell/common/api/electron_bindings.h",
"shell/common/api/constructor.h",
"shell/common/api/event_emitter_caller_deprecated.cc",
"shell/common/api/event_emitter_caller_deprecated.h",
"shell/common/api/features.cc",
"shell/common/api/locker.cc",
"shell/common/api/locker.h",
"shell/common/application_info.cc",
"shell/common/application_info.h",
"shell/common/application_info_linux.cc",
"shell/common/application_info_mac.mm",
"shell/common/application_info_win.cc",
"shell/common/asar/archive.cc",
"shell/common/asar/archive.h",
"shell/common/asar/asar_util.cc",
"shell/common/asar/asar_util.h",
"shell/common/asar/scoped_temporary_file.cc",
"shell/common/asar/scoped_temporary_file.h",
"shell/common/application_info_linux.cc",
"shell/common/application_info_mac.mm",
"shell/common/application_info_win.cc",
"shell/common/application_info.cc",
"shell/common/application_info.h",
"shell/common/atom_command_line.cc",
"shell/common/atom_command_line.h",
"shell/common/atom_constants.cc",
@@ -462,12 +468,15 @@ filenames = {
"shell/common/crash_reporter/crash_reporter_linux.h",
"shell/common/crash_reporter/crash_reporter_mac.h",
"shell/common/crash_reporter/crash_reporter_mac.mm",
"shell/common/crash_reporter/crash_reporter_win.h",
"shell/common/crash_reporter/crash_reporter_win.cc",
"shell/common/crash_reporter/crash_reporter_win.h",
"shell/common/crash_reporter/linux/crash_dump_handler.cc",
"shell/common/crash_reporter/linux/crash_dump_handler.h",
"shell/common/crash_reporter/win/crash_service_main.cc",
"shell/common/crash_reporter/win/crash_service_main.h",
"shell/common/deprecate_util.cc",
"shell/common/deprecate_util.h",
"shell/common/gin_converters/blink_converter_gin_adapter.h",
"shell/common/gin_converters/callback_converter.h",
"shell/common/gin_converters/file_dialog_converter.cc",
"shell/common/gin_converters/file_dialog_converter.h",
@@ -483,7 +492,6 @@ filenames = {
"shell/common/gin_converters/net_converter.cc",
"shell/common/gin_converters/net_converter.h",
"shell/common/gin_converters/std_converter.h",
"shell/common/gin_converters/blink_converter_gin_adapter.h",
"shell/common/gin_converters/value_converter_gin_adapter.h",
"shell/common/gin_helper/arguments.cc",
"shell/common/gin_helper/arguments.h",
@@ -494,10 +502,10 @@ filenames = {
"shell/common/gin_helper/dictionary.h",
"shell/common/gin_helper/error_thrower.cc",
"shell/common/gin_helper/error_thrower.h",
"shell/common/gin_helper/event_emitter_caller.cc",
"shell/common/gin_helper/event_emitter_caller.h",
"shell/common/gin_helper/event_emitter.cc",
"shell/common/gin_helper/event_emitter.h",
"shell/common/gin_helper/event_emitter_caller.cc",
"shell/common/gin_helper/event_emitter_caller.h",
"shell/common/gin_helper/function_template.cc",
"shell/common/gin_helper/function_template.h",
"shell/common/gin_helper/object_template_builder.cc",
@@ -507,12 +515,10 @@ filenames = {
"shell/common/key_weak_map.h",
"shell/common/keyboard_util.cc",
"shell/common/keyboard_util.h",
"shell/common/deprecate_util.cc",
"shell/common/deprecate_util.h",
"shell/common/mouse_util.cc",
"shell/common/mouse_util.h",
"shell/common/mac/main_application_bundle.h",
"shell/common/mac/main_application_bundle.mm",
"shell/common/mouse_util.cc",
"shell/common/mouse_util.h",
"shell/common/native_mate_converters/accelerator_converter.cc",
"shell/common/native_mate_converters/accelerator_converter.h",
"shell/common/native_mate_converters/blink_converter.cc",
@@ -545,38 +551,40 @@ filenames = {
"shell/common/node_bindings_win.cc",
"shell/common/node_bindings_win.h",
"shell/common/node_includes.h",
"shell/common/node_util.h",
"shell/common/node_util.cc",
"shell/common/node_util.h",
"shell/common/options_switches.cc",
"shell/common/options_switches.h",
"shell/common/platform_util.h",
"shell/common/platform_util_linux.cc",
"shell/common/platform_util_mac.mm",
"shell/common/platform_util_win.cc",
"shell/common/promise_util.h",
"shell/common/promise_util.cc",
"shell/common/skia_util.h",
"shell/common/promise_util.h",
"shell/common/skia_util.cc",
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.cc",
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.h",
"shell/common/skia_util.h",
"shell/renderer/api/atom_api_context_bridge.cc",
"shell/renderer/api/atom_api_context_bridge.h",
"shell/renderer/api/atom_api_renderer_ipc.cc",
"shell/renderer/api/atom_api_spell_check_client.cc",
"shell/renderer/api/atom_api_spell_check_client.h",
"shell/renderer/api/atom_api_web_frame.cc",
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.cc",
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.h",
"shell/renderer/atom_autofill_agent.cc",
"shell/renderer/atom_autofill_agent.h",
"shell/renderer/atom_render_frame_observer.cc",
"shell/renderer/atom_render_frame_observer.h",
"shell/renderer/atom_renderer_client.cc",
"shell/renderer/atom_renderer_client.h",
"shell/renderer/atom_sandboxed_renderer_client.cc",
"shell/renderer/atom_sandboxed_renderer_client.h",
"shell/renderer/browser_exposed_renderer_interfaces.cc",
"shell/renderer/browser_exposed_renderer_interfaces.h",
"shell/renderer/content_settings_observer.cc",
"shell/renderer/content_settings_observer.h",
"shell/renderer/electron_api_service_impl.cc",
"shell/renderer/electron_api_service_impl.h",
"shell/renderer/atom_sandboxed_renderer_client.cc",
"shell/renderer/atom_sandboxed_renderer_client.h",
"shell/renderer/guest_view_container.cc",
"shell/renderer/guest_view_container.h",
"shell/renderer/renderer_client_base.cc",
@@ -585,11 +593,6 @@ filenames = {
"shell/renderer/web_worker_observer.h",
"shell/utility/atom_content_utility_client.cc",
"shell/utility/atom_content_utility_client.h",
"chromium_src/chrome/browser/process_singleton_posix.cc",
"chromium_src/chrome/browser/process_singleton_win.cc",
"chromium_src/chrome/browser/process_singleton.h",
"chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.cc",
"chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h",
]
lib_sources_nss = [

60
filenames.hunspell.gni Normal file
View File

@@ -0,0 +1,60 @@
hunspell_dictionaries = [
"//third_party/hunspell_dictionaries/af-ZA-3-0.bdic",
"//third_party/hunspell_dictionaries/bg-BG-3-0.bdic",
"//third_party/hunspell_dictionaries/ca-ES-3-0.bdic",
"//third_party/hunspell_dictionaries/cs-CZ-3-0.bdic",
"//third_party/hunspell_dictionaries/cy-GB-1-0.bdic",
"//third_party/hunspell_dictionaries/da-DK-3-0.bdic",
"//third_party/hunspell_dictionaries/de-DE-3-0.bdic",
"//third_party/hunspell_dictionaries/el-GR-3-0.bdic",
"//third_party/hunspell_dictionaries/en-AU-8-0.bdic",
"//third_party/hunspell_dictionaries/en-CA-8-0.bdic",
"//third_party/hunspell_dictionaries/en-GB-8-0.bdic",
"//third_party/hunspell_dictionaries/en-US-8-0.bdic",
"//third_party/hunspell_dictionaries/es-ES-3-0.bdic",
"//third_party/hunspell_dictionaries/et-EE-3-0.bdic",
"//third_party/hunspell_dictionaries/fa-IR-8-0.bdic",
"//third_party/hunspell_dictionaries/fo-FO-3-0.bdic",
"//third_party/hunspell_dictionaries/fr-FR-3-0.bdic",
"//third_party/hunspell_dictionaries/he-IL-3-0.bdic",
"//third_party/hunspell_dictionaries/hi-IN-3-0.bdic",
"//third_party/hunspell_dictionaries/hr-HR-3-0.bdic",
"//third_party/hunspell_dictionaries/hu-HU-3-0.bdic",
"//third_party/hunspell_dictionaries/hy-1-0.bdic",
"//third_party/hunspell_dictionaries/id-ID-3-0.bdic",
"//third_party/hunspell_dictionaries/it-IT-3-0.bdic",
"//third_party/hunspell_dictionaries/ko-3-0.bdic",
"//third_party/hunspell_dictionaries/lt-LT-3-0.bdic",
"//third_party/hunspell_dictionaries/lv-LV-3-0.bdic",
"//third_party/hunspell_dictionaries/nb-NO-3-0.bdic",
"//third_party/hunspell_dictionaries/nl-NL-3-0.bdic",
"//third_party/hunspell_dictionaries/pl-PL-3-0.bdic",
"//third_party/hunspell_dictionaries/pt-BR-3-0.bdic",
"//third_party/hunspell_dictionaries/pt-PT-3-0.bdic",
"//third_party/hunspell_dictionaries/ro-RO-3-0.bdic",
"//third_party/hunspell_dictionaries/ru-RU-3-0.bdic",
"//third_party/hunspell_dictionaries/sh-3-0.bdic",
"//third_party/hunspell_dictionaries/sh-4-0.bdic",
"//third_party/hunspell_dictionaries/sk-SK-3-0.bdic",
"//third_party/hunspell_dictionaries/sl-SI-3-0.bdic",
"//third_party/hunspell_dictionaries/sq-3-0.bdic",
"//third_party/hunspell_dictionaries/sr-3-0.bdic",
"//third_party/hunspell_dictionaries/sr-4-0.bdic",
"//third_party/hunspell_dictionaries/sv-SE-3-0.bdic",
"//third_party/hunspell_dictionaries/ta-IN-3-0.bdic",
"//third_party/hunspell_dictionaries/tg-TG-5-0.bdic",
"//third_party/hunspell_dictionaries/tr-TR-4-0.bdic",
"//third_party/hunspell_dictionaries/uk-UA-3-0.bdic",
"//third_party/hunspell_dictionaries/vi-VN-3-0.bdic",
"//third_party/hunspell_dictionaries/xx-XX-3-0.bdic",
]
hunspell_licenses = [
"//third_party/hunspell_dictionaries/COPYING",
"//third_party/hunspell_dictionaries/COPYING.Apache",
"//third_party/hunspell_dictionaries/COPYING.LESSER",
"//third_party/hunspell_dictionaries/COPYING.LGPL",
"//third_party/hunspell_dictionaries/COPYING.MIT",
"//third_party/hunspell_dictionaries/COPYING.MPL",
"//third_party/hunspell_dictionaries/LICENSE",
]

View File

@@ -105,9 +105,9 @@ if (process.platform === 'linux') {
}
// Routes the events to webContents.
const events = ['login', 'certificate-error', 'select-client-certificate']
const events = ['certificate-error', 'select-client-certificate']
for (const name of events) {
app.on(name as 'login', (event, webContents, ...args: any[]) => {
app.on(name as 'certificate-error', (event, webContents, ...args: any[]) => {
webContents.emit(name, event, ...args)
})
}

View File

@@ -33,7 +33,7 @@ BrowserWindow.prototype._init = function () {
// Hide the auto-hide menu when webContents is focused.
this.webContents.on('activate', () => {
if (process.platform !== 'darwin' && this.isMenuBarAutoHide() && this.isMenuBarVisible()) {
if (process.platform !== 'darwin' && this.autoHideMenuBar && this.isMenuBarVisible()) {
this.setMenuBarVisibility(false)
}
})
@@ -116,7 +116,7 @@ BrowserWindow.getFocusedWindow = () => {
BrowserWindow.fromWebContents = (webContents) => {
for (const window of BrowserWindow.getAllWindows()) {
if (window.webContents.equal(webContents)) return window
if (window.webContents && window.webContents.equal(webContents)) return window
}
return null

View File

@@ -163,6 +163,7 @@ const messageBox = (sync, window, options) => {
defaultId = -1,
detail = '',
icon = null,
noLink = false,
message = '',
title = '',
type = 'none'
@@ -173,11 +174,15 @@ const messageBox = (sync, window, options) => {
if (!Array.isArray(buttons)) throw new TypeError('Buttons must be an array')
if (options.normalizeAccessKeys) buttons = buttons.map(normalizeAccessKey)
if (typeof title !== 'string') throw new TypeError('Title must be a string')
if (typeof noLink !== 'boolean') throw new TypeError('noLink must be a boolean')
if (typeof message !== 'string') throw new TypeError('Message must be a string')
if (typeof detail !== 'string') throw new TypeError('Detail must be a string')
if (typeof checkboxLabel !== 'string') throw new TypeError('checkboxLabel must be a string')
checkboxChecked = !!checkboxChecked
if (checkboxChecked && !checkboxLabel) {
throw new Error('checkboxChecked requires that checkboxLabel also be passed')
}
// Choose a default button to get selected when dialog is cancelled.
if (cancelId == null) {
@@ -192,15 +197,13 @@ const messageBox = (sync, window, options) => {
}
}
const flags = options.noLink ? messageBoxOptions.noLink : 0
const settings = {
window,
messageBoxType,
buttons,
defaultId,
cancelId,
flags,
noLink,
title,
message,
detail,

View File

@@ -2,5 +2,7 @@ import { defineProperties } from '@electron/internal/common/define-properties'
import { commonModuleList } from '@electron/internal/common/api/module-list'
import { browserModuleList } from '@electron/internal/browser/api/module-list'
defineProperties(exports, commonModuleList)
defineProperties(exports, browserModuleList)
module.exports = {}
defineProperties(module.exports, commonModuleList)
defineProperties(module.exports, browserModuleList)

View File

@@ -21,6 +21,7 @@ module.exports = [
{ name: 'inAppPurchase' },
{ name: 'Menu' },
{ name: 'MenuItem' },
{ name: 'nativeTheme' },
{ name: 'net' },
{ name: 'netLog' },
{ name: 'Notification' },

View File

@@ -2,17 +2,13 @@
const url = require('url')
const { EventEmitter } = require('events')
const { Readable } = require('stream')
const { Readable, Writable } = require('stream')
const { app } = require('electron')
const { Session } = process.electronBinding('session')
const { net, Net } = process.electronBinding('net')
const { URLRequest } = net
const { net, Net, _isValidHeaderName, _isValidHeaderValue } = process.electronBinding('net')
const { URLLoader } = net
// Net is an EventEmitter.
Object.setPrototypeOf(Net.prototype, EventEmitter.prototype)
EventEmitter.call(net)
Object.setPrototypeOf(URLRequest.prototype, EventEmitter.prototype)
Object.setPrototypeOf(URLLoader.prototype, EventEmitter.prototype)
const kSupportedProtocols = new Set(['http:', 'https:'])
@@ -40,43 +36,44 @@ const discardableDuplicateHeaders = new Set([
])
class IncomingMessage extends Readable {
constructor (urlRequest) {
constructor (responseHead) {
super()
this.urlRequest = urlRequest
this.shouldPush = false
this.data = []
this.urlRequest.on('data', (event, chunk) => {
this._storeInternalData(chunk)
this._pushInternalData()
})
this.urlRequest.on('end', () => {
this._storeInternalData(null)
this._pushInternalData()
})
this._shouldPush = false
this._data = []
this._responseHead = responseHead
}
get statusCode () {
return this.urlRequest.statusCode
return this._responseHead.statusCode
}
get statusMessage () {
return this.urlRequest.statusMessage
return this._responseHead.statusMessage
}
get headers () {
const filteredHeaders = {}
const rawHeaders = this.urlRequest.rawResponseHeaders
Object.keys(rawHeaders).forEach(header => {
if (header in filteredHeaders && discardableDuplicateHeaders.has(header)) {
const { rawHeaders } = this._responseHead
rawHeaders.forEach(header => {
if (Object.prototype.hasOwnProperty.call(filteredHeaders, header.key) &&
discardableDuplicateHeaders.has(header.key)) {
// do nothing with discardable duplicate headers
} else {
if (header === 'set-cookie') {
if (header.key === 'set-cookie') {
// keep set-cookie as an array per Node.js rules
// see https://nodejs.org/api/http.html#http_message_headers
filteredHeaders[header] = rawHeaders[header]
if (Object.prototype.hasOwnProperty.call(filteredHeaders, header.key)) {
filteredHeaders[header.key].push(header.value)
} else {
filteredHeaders[header.key] = [header.value]
}
} else {
// for non-cookie headers, the values are joined together with ', '
filteredHeaders[header] = rawHeaders[header].join(', ')
if (Object.prototype.hasOwnProperty.call(filteredHeaders, header.key)) {
filteredHeaders[header.key] += `, ${header.value}`
} else {
filteredHeaders[header.key] = header.value
}
}
}
})
@@ -88,11 +85,11 @@ class IncomingMessage extends Readable {
}
get httpVersionMajor () {
return this.urlRequest.httpVersionMajor
return this._responseHead.httpVersion.major
}
get httpVersionMinor () {
return this.urlRequest.httpVersionMinor
return this._responseHead.httpVersion.minor
}
get rawTrailers () {
@@ -104,181 +101,197 @@ class IncomingMessage extends Readable {
}
_storeInternalData (chunk) {
this.data.push(chunk)
this._data.push(chunk)
this._pushInternalData()
}
_pushInternalData () {
while (this.shouldPush && this.data.length > 0) {
const chunk = this.data.shift()
this.shouldPush = this.push(chunk)
while (this._shouldPush && this._data.length > 0) {
const chunk = this._data.shift()
this._shouldPush = this.push(chunk)
}
}
_read () {
this.shouldPush = true
this._shouldPush = true
this._pushInternalData()
}
}
URLRequest.prototype._emitRequestEvent = function (isAsync, ...rest) {
if (isAsync) {
process.nextTick(() => {
this.clientRequest.emit(...rest)
})
} else {
this.clientRequest.emit(...rest)
}
}
URLRequest.prototype._emitResponseEvent = function (isAsync, ...rest) {
if (isAsync) {
process.nextTick(() => {
this._response.emit(...rest)
})
} else {
this._response.emit(...rest)
}
}
class ClientRequest extends EventEmitter {
constructor (options, callback) {
/** Writable stream that buffers up everything written to it. */
class SlurpStream extends Writable {
constructor () {
super()
this._data = Buffer.alloc(0)
}
_write (chunk, encoding, callback) {
this._data = Buffer.concat([this._data, chunk])
callback()
}
data () { return this._data }
}
class ChunkedBodyStream extends Writable {
constructor (clientRequest) {
super()
this._clientRequest = clientRequest
}
_write (chunk, encoding, callback) {
if (this._downstream) {
this._downstream.write(chunk).then(callback, callback)
} else {
// the contract of _write is that we won't be called again until we call
// the callback, so we're good to just save a single chunk.
this._pendingChunk = chunk
this._pendingCallback = callback
// The first write to a chunked body stream begins the request.
this._clientRequest._startRequest()
}
}
_final (callback) {
this._downstream.done()
callback()
}
startReading (pipe) {
if (this._downstream) {
throw new Error('two startReading calls???')
}
this._downstream = pipe
if (this._pendingChunk) {
const doneWriting = (maybeError) => {
const cb = this._pendingCallback
delete this._pendingCallback
delete this._pendingChunk
cb(maybeError)
}
this._downstream.write(this._pendingChunk).then(doneWriting, doneWriting)
}
}
}
function parseOptions (options) {
if (typeof options === 'string') {
options = url.parse(options)
} else {
options = { ...options }
}
const method = (options.method || 'GET').toUpperCase()
let urlStr = options.url
if (!urlStr) {
const urlObj = {}
const protocol = options.protocol || 'http:'
if (!kSupportedProtocols.has(protocol)) {
throw new Error('Protocol "' + protocol + '" not supported')
}
urlObj.protocol = protocol
if (options.host) {
urlObj.host = options.host
} else {
if (options.hostname) {
urlObj.hostname = options.hostname
} else {
urlObj.hostname = 'localhost'
}
if (options.port) {
urlObj.port = options.port
}
}
if (options.path && / /.test(options.path)) {
// The actual regex is more like /[^A-Za-z0-9\-._~!$&'()*+,;=/:@]/
// with an additional rule for ignoring percentage-escaped characters
// but that's a) hard to capture in a regular expression that performs
// well, and b) possibly too restrictive for real-world usage. That's
// why it only scans for spaces because those are guaranteed to create
// an invalid request.
throw new TypeError('Request path contains unescaped characters')
}
const pathObj = url.parse(options.path || '/')
urlObj.pathname = pathObj.pathname
urlObj.search = pathObj.search
urlObj.hash = pathObj.hash
urlStr = url.format(urlObj)
}
const redirectPolicy = options.redirect || 'follow'
if (!['follow', 'error', 'manual'].includes(redirectPolicy)) {
throw new Error('redirect mode should be one of follow, error or manual')
}
if (options.headers != null && typeof options.headers !== 'object') {
throw new TypeError('headers must be an object')
}
const urlLoaderOptions = {
method: method,
url: urlStr,
redirectPolicy,
extraHeaders: options.headers || {}
}
for (const [name, value] of Object.entries(urlLoaderOptions.extraHeaders)) {
if (!_isValidHeaderName(name)) {
throw new Error(`Invalid header name: '${name}'`)
}
if (!_isValidHeaderValue(value.toString())) {
throw new Error(`Invalid value for header '${name}': '${value}'`)
}
}
if (options.session) {
if (options.session instanceof Session) {
urlLoaderOptions.session = options.session
} else {
throw new TypeError('`session` should be an instance of the Session class')
}
} else if (options.partition) {
if (typeof options.partition === 'string') {
urlLoaderOptions.partition = options.partition
} else {
throw new TypeError('`partition` should be a string')
}
}
return urlLoaderOptions
}
class ClientRequest extends Writable {
constructor (options, callback) {
super({ autoDestroy: true })
if (!app.isReady()) {
throw new Error('net module can only be used after app is ready')
}
if (typeof options === 'string') {
options = url.parse(options)
} else {
options = Object.assign({}, options)
}
const method = (options.method || 'GET').toUpperCase()
let urlStr = options.url
if (!urlStr) {
const urlObj = {}
const protocol = options.protocol || 'http:'
if (!kSupportedProtocols.has(protocol)) {
throw new Error('Protocol "' + protocol + '" not supported')
}
urlObj.protocol = protocol
if (options.host) {
urlObj.host = options.host
} else {
if (options.hostname) {
urlObj.hostname = options.hostname
} else {
urlObj.hostname = 'localhost'
}
if (options.port) {
urlObj.port = options.port
}
}
if (options.path && / /.test(options.path)) {
// The actual regex is more like /[^A-Za-z0-9\-._~!$&'()*+,;=/:@]/
// with an additional rule for ignoring percentage-escaped characters
// but that's a) hard to capture in a regular expression that performs
// well, and b) possibly too restrictive for real-world usage. That's
// why it only scans for spaces because those are guaranteed to create
// an invalid request.
throw new TypeError('Request path contains unescaped characters')
}
const pathObj = url.parse(options.path || '/')
urlObj.pathname = pathObj.pathname
urlObj.search = pathObj.search
urlObj.hash = pathObj.hash
urlStr = url.format(urlObj)
}
const redirectPolicy = options.redirect || 'follow'
if (!['follow', 'error', 'manual'].includes(redirectPolicy)) {
throw new Error('redirect mode should be one of follow, error or manual')
}
const urlRequestOptions = {
method: method,
url: urlStr,
redirect: redirectPolicy
}
if (options.session) {
if (options.session instanceof Session) {
urlRequestOptions.session = options.session
} else {
throw new TypeError('`session` should be an instance of the Session class')
}
} else if (options.partition) {
if (typeof options.partition === 'string') {
urlRequestOptions.partition = options.partition
} else {
throw new TypeError('`partition` should be a string')
}
}
const urlRequest = new URLRequest(urlRequestOptions)
// Set back and forward links.
this.urlRequest = urlRequest
urlRequest.clientRequest = this
// This is a copy of the extra headers structure held by the native
// net::URLRequest. The main reason is to keep the getHeader API synchronous
// after the request starts.
this.extraHeaders = {}
if (options.headers) {
for (const key in options.headers) {
this.setHeader(key, options.headers[key])
}
}
// Set when the request uses chunked encoding. Can be switched
// to true only once and never set back to false.
this.chunkedEncodingEnabled = false
urlRequest.on('response', () => {
const response = new IncomingMessage(urlRequest)
urlRequest._response = response
this.emit('response', response)
})
urlRequest.on('login', (event, authInfo, callback) => {
this.emit('login', authInfo, (username, password) => {
// If null or undefined username/password, force to empty string.
if (username === null || username === undefined) {
username = ''
}
if (typeof username !== 'string') {
throw new Error('username must be a string')
}
if (password === null || password === undefined) {
password = ''
}
if (typeof password !== 'string') {
throw new Error('password must be a string')
}
callback(username, password)
})
})
if (callback) {
this.once('response', callback)
}
}
get chunkedEncoding () {
return this.chunkedEncodingEnabled
const { redirectPolicy, ...urlLoaderOptions } = parseOptions(options)
this._urlLoaderOptions = urlLoaderOptions
this._redirectPolicy = redirectPolicy
this._started = false
}
set chunkedEncoding (value) {
if (!this.urlRequest.notStarted) {
throw new Error('Can\'t set the transfer encoding, headers have been sent')
if (this._started) {
throw new Error('chunkedEncoding can only be set before the request is started')
}
if (typeof this._chunkedEncoding !== 'undefined') {
throw new Error('chunkedEncoding can only be set once')
}
this._chunkedEncoding = !!value
if (this._chunkedEncoding) {
this._body = new ChunkedBodyStream(this)
this._urlLoaderOptions.body = (pipe) => {
this._body.startReading(pipe)
}
}
this.chunkedEncodingEnabled = value
}
setHeader (name, value) {
@@ -288,13 +301,18 @@ class ClientRequest extends EventEmitter {
if (value == null) {
throw new Error('`value` required in setHeader("' + name + '", value)')
}
if (!this.urlRequest.notStarted) {
if (this._started || this._firstWrite) {
throw new Error('Can\'t set headers after they are sent')
}
if (!_isValidHeaderName(name)) {
throw new Error(`Invalid header name: '${name}'`)
}
if (!_isValidHeaderValue(value.toString())) {
throw new Error(`Invalid value for header '${name}': '${value}'`)
}
const key = name.toLowerCase()
this.extraHeaders[key] = value
this.urlRequest.setExtraHeader(name, value.toString())
this._urlLoaderOptions.extraHeaders[key] = value
}
getHeader (name) {
@@ -302,12 +320,8 @@ class ClientRequest extends EventEmitter {
throw new Error('`name` is required for getHeader(name)')
}
if (!this.extraHeaders) {
return
}
const key = name.toLowerCase()
return this.extraHeaders[key]
return this._urlLoaderOptions.extraHeaders[key]
}
removeHeader (name) {
@@ -315,93 +329,144 @@ class ClientRequest extends EventEmitter {
throw new Error('`name` is required for removeHeader(name)')
}
if (!this.urlRequest.notStarted) {
if (this._started || this._firstWrite) {
throw new Error('Can\'t remove headers after they are sent')
}
const key = name.toLowerCase()
delete this.extraHeaders[key]
this.urlRequest.removeExtraHeader(name)
delete this._urlLoaderOptions.extraHeaders[key]
}
_write (chunk, encoding, callback, isLast) {
const chunkIsString = typeof chunk === 'string'
const chunkIsBuffer = chunk instanceof Buffer
if (!chunkIsString && !chunkIsBuffer) {
throw new TypeError('First argument must be a string or Buffer')
_write (chunk, encoding, callback) {
this._firstWrite = true
if (!this._body) {
this._body = new SlurpStream()
this._body.on('finish', () => {
this._urlLoaderOptions.body = this._body.data()
this._startRequest()
})
}
if (chunkIsString) {
// We convert all strings into binary buffers.
chunk = Buffer.from(chunk, encoding)
}
// Since writing to the network is asynchronous, we conservatively
// assume that request headers are written after delivering the first
// buffer to the network IO thread.
if (this.urlRequest.notStarted) {
this.urlRequest.setChunkedUpload(this.chunkedEncoding)
}
// Headers are assumed to be sent on first call to _writeBuffer,
// i.e. after the first call to write or end.
const result = this.urlRequest.write(chunk, isLast)
// The write callback is fired asynchronously to mimic Node.js.
if (callback) {
process.nextTick(callback)
}
return result
// TODO: is this the right way to forward to another stream?
this._body.write(chunk, encoding, callback)
}
write (data, encoding, callback) {
if (this.urlRequest.finished) {
const error = new Error('Write after end')
process.nextTick(writeAfterEndNT, this, error, callback)
return true
_final (callback) {
if (this._body) {
// TODO: is this the right way to forward to another stream?
this._body.end(callback)
} else {
// end() called without a body, go ahead and start the request
this._startRequest()
callback()
}
return this._write(data, encoding, callback, false)
}
end (data, encoding, callback) {
if (this.urlRequest.finished) {
return false
_startRequest () {
this._started = true
const stringifyValues = (obj) => {
const ret = {}
for (const k in obj) {
ret[k] = obj[k].toString()
}
return ret
}
const opts = { ...this._urlLoaderOptions, extraHeaders: stringifyValues(this._urlLoaderOptions.extraHeaders) }
this._urlLoader = new URLLoader(opts)
this._urlLoader.on('response-started', (event, finalUrl, responseHead) => {
const response = this._response = new IncomingMessage(responseHead)
this.emit('response', response)
})
this._urlLoader.on('data', (event, data) => {
this._response._storeInternalData(Buffer.from(data))
})
this._urlLoader.on('complete', () => {
if (this._response) { this._response._storeInternalData(null) }
})
this._urlLoader.on('error', (event, netErrorString) => {
const error = new Error(netErrorString)
if (this._response) this._response.destroy(error)
this._die(error)
})
if (typeof data === 'function') {
callback = data
encoding = null
data = null
} else if (typeof encoding === 'function') {
callback = encoding
encoding = null
}
this._urlLoader.on('login', (event, authInfo, callback) => {
const handled = this.emit('login', authInfo, callback)
if (!handled) {
// If there were no listeners, cancel the authentication request.
callback()
}
})
data = data || ''
this._urlLoader.on('redirect', (event, redirectInfo, headers) => {
const { statusCode, newMethod, newUrl } = redirectInfo
if (this._redirectPolicy === 'error') {
this._die(new Error(`Attempted to redirect, but redirect policy was 'error'`))
} else if (this._redirectPolicy === 'manual') {
let _followRedirect = false
this._followRedirectCb = () => { _followRedirect = true }
try {
this.emit('redirect', statusCode, newMethod, newUrl, headers)
} finally {
this._followRedirectCb = null
if (!_followRedirect && !this._aborted) {
this._die(new Error('Redirect was cancelled'))
}
}
} else if (this._redirectPolicy === 'follow') {
// Calling followRedirect() when the redirect policy is 'follow' is
// allowed but does nothing. (Perhaps it should throw an error
// though...? Since the redirect will happen regardless.)
try {
this._followRedirectCb = () => {}
this.emit('redirect', statusCode, newMethod, newUrl, headers)
} finally {
this._followRedirectCb = null
}
} else {
this._die(new Error(`Unexpected redirect policy '${this._redirectPolicy}'`))
}
})
return this._write(data, encoding, callback, true)
this._urlLoader.on('upload-progress', (event, position, total) => {
this._uploadProgress = { active: true, started: true, current: position, total }
this.emit('upload-progress', position, total) // Undocumented, for now
})
this._urlLoader.on('download-progress', (event, current) => {
if (this._response) {
this._response.emit('download-progress', current) // Undocumented, for now
}
})
}
followRedirect () {
this.urlRequest.followRedirect()
if (this._followRedirectCb) {
this._followRedirectCb()
} else {
throw new Error('followRedirect() called, but was not waiting for a redirect')
}
}
abort () {
this.urlRequest.cancel()
if (!this._aborted) {
process.nextTick(() => { this.emit('abort') })
}
this._aborted = true
this._die()
}
_die (err) {
this.destroy(err)
if (this._urlLoader) {
this._urlLoader.cancel()
if (this._response) this._response.destroy(err)
}
}
getUploadProgress () {
return this.urlRequest.getUploadProgress()
return this._uploadProgress ? { ...this._uploadProgress } : { active: false }
}
}
function writeAfterEndNT (self, error, callback) {
self.emit('error', error)
if (callback) callback(error)
}
Net.prototype.request = function (options, callback) {
return new ClientRequest(options, callback)
}

View File

@@ -10,18 +10,28 @@ Object.setPrototypeOf(PowerMonitor.prototype, EventEmitter.prototype)
const powerMonitor = createLazyInstance(createPowerMonitor, PowerMonitor, true)
// On Linux we need to call blockShutdown() to subscribe to shutdown event.
if (process.platform === 'linux') {
powerMonitor.on('newListener', (event:string) => {
if (event === 'shutdown' && powerMonitor.listenerCount('shutdown') === 0) {
powerMonitor.blockShutdown()
}
})
powerMonitor.on('removeListener', (event: string) => {
if (event === 'shutdown' && powerMonitor.listenerCount('shutdown') === 0) {
powerMonitor.unblockShutdown()
}
// In order to delay system shutdown when e.preventDefault() is invoked
// on a powerMonitor 'shutdown' event, we need an org.freedesktop.login1
// shutdown delay lock. For more details see the "Taking Delay Locks"
// section of https://www.freedesktop.org/wiki/Software/systemd/inhibit/
//
// So here we watch for 'shutdown' listeners to be added or removed and
// set or unset our shutdown delay lock accordingly.
const { app } = require('electron')
app.whenReady().then(() => {
powerMonitor.on('newListener', (event: string) => {
// whenever the listener count is incremented to one...
if (event === 'shutdown' && powerMonitor.listenerCount('shutdown') === 0) {
powerMonitor.blockShutdown()
}
})
powerMonitor.on('removeListener', (event: string) => {
// whenever the listener count is decremented to zero...
if (event === 'shutdown' && powerMonitor.listenerCount('shutdown') === 0) {
powerMonitor.unblockShutdown()
}
})
})
}

View File

@@ -36,8 +36,9 @@ NetLog.prototype.startLogging = function (path, ...args) {
const _originalStopLogging = NetLog.prototype.stopLogging
NetLog.prototype.stopLogging = function () {
const logPath = this._currentlyLoggingPath
this._currentlyLoggingPath = null
return _originalStopLogging.call(this)
return _originalStopLogging.call(this).then(() => logPath)
}
const currentlyLoggingPathDeprecated = deprecate.warnOnce('currentlyLoggingPath')

View File

@@ -7,6 +7,7 @@ const path = require('path')
const url = require('url')
const { app, ipcMain, session, deprecate } = electron
const { internalWindowOpen } = require('@electron/internal/browser/guest-window-manager')
const NavigationController = require('@electron/internal/browser/navigation-controller')
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils')
@@ -71,7 +72,6 @@ const defaultPrintingSetting = {
headerFooterEnabled: false,
marginsType: 0,
isFirstRequest: false,
requestID: getNextId(),
previewUIID: 0,
previewModifiable: true,
printToPDF: true,
@@ -184,27 +184,33 @@ for (const method of webFrameMethods) {
}
}
const executeJavaScript = (contents, code, hasUserGesture) => {
return ipcMainUtils.invokeInWebContents(contents, false, 'ELECTRON_INTERNAL_RENDERER_WEB_FRAME_METHOD', 'executeJavaScript', code, hasUserGesture)
const waitTillCanExecuteJavaScript = async (webContents) => {
if (webContents.getURL() && !webContents.isLoadingMainFrame()) return
return new Promise((resolve) => {
webContents.once('did-stop-loading', () => {
resolve()
})
})
}
// Make sure WebContents::executeJavaScript would run the code only when the
// WebContents has been loaded.
WebContents.prototype.executeJavaScript = function (code, hasUserGesture) {
if (this.getURL() && !this.isLoadingMainFrame()) {
return executeJavaScript(this, code, hasUserGesture)
} else {
return new Promise((resolve, reject) => {
this.once('did-stop-loading', () => {
executeJavaScript(this, code, hasUserGesture).then(resolve, reject)
})
})
}
WebContents.prototype.executeJavaScript = async function (code, hasUserGesture) {
await waitTillCanExecuteJavaScript(this)
return ipcMainUtils.invokeInWebContents(this, false, 'ELECTRON_INTERNAL_RENDERER_WEB_FRAME_METHOD', 'executeJavaScript', code, hasUserGesture)
}
WebContents.prototype.executeJavaScriptInIsolatedWorld = async function (code, hasUserGesture) {
await waitTillCanExecuteJavaScript(this)
return ipcMainUtils.invokeInWebContents(this, false, 'ELECTRON_INTERNAL_RENDERER_WEB_FRAME_METHOD', 'executeJavaScriptInIsolatedWorld', code, hasUserGesture)
}
// Translate the options of printToPDF.
WebContents.prototype.printToPDF = function (options) {
const printingSetting = Object.assign({}, defaultPrintingSetting)
const printingSetting = {
...defaultPrintingSetting,
requestID: getNextId()
}
if (options.landscape) {
printingSetting.landscape = options.landscape
}
@@ -249,6 +255,8 @@ WebContents.prototype.printToPDF = function (options) {
// Chromium expects this in a 0-100 range number, not as float
printingSetting.scaleFactor = Math.ceil(printingSetting.scaleFactor) % 100
// PrinterType enum from //printing/print_job_constants.h
printingSetting.printerType = 2
if (features.isPrintingEnabled()) {
return this._printToPDF(printingSetting)
} else {
@@ -269,6 +277,7 @@ WebContents.prototype.getPrinters = function () {
return this._getPrinters()
} else {
console.error('Error: Printing feature is disabled.')
return []
}
}
@@ -311,8 +320,14 @@ const addReturnValueToEvent = (event) => {
})
}
let warnedAboutRendererProcessReuse = false
// Add JavaScript wrappers for WebContents class.
WebContents.prototype._init = function () {
if (!process.noDeprecation && !warnedAboutRendererProcessReuse && app._allowRendererProcessReuseIsDefaultValue) {
deprecate.log('The default value of app.allowRendererProcessReuse is deprecated, it is currently "false". It will change to be "true" in Electron 9. For more information please check https://github.com/electron/electron/issues/18397')
warnedAboutRendererProcessReuse = true
}
// The navigation controller.
NavigationController.call(this, this)
@@ -390,9 +405,7 @@ WebContents.prototype._init = function () {
width: 800,
height: 600
}
ipcMainInternal.emit('ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN',
event, url, referrer, frameName, disposition,
options, additionalFeatures, postData)
internalWindowOpen(event, url, referrer, frameName, disposition, options, additionalFeatures, postData)
})
// Create a new browser window for the native implementation of
@@ -414,11 +427,14 @@ WebContents.prototype._init = function () {
webContents
}
const referrer = { url: '', policy: 'default' }
ipcMainInternal.emit('ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN',
event, url, referrer, frameName, disposition, options)
internalWindowOpen(event, url, referrer, frameName, disposition, options)
})
}
this.on('login', (event, ...args) => {
app.emit('login', event, this, ...args)
})
const event = process.electronBinding('event').createEmpty()
app.emit('web-contents-created', event, this)
}

View File

@@ -5,6 +5,7 @@ const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-interna
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils')
const parseFeaturesString = require('@electron/internal/common/parse-features-string')
const { syncMethods, asyncMethods } = require('@electron/internal/common/web-view-methods')
const { serialize } = require('@electron/internal/common/type-utils')
// Doesn't exist in early initialization.
let webViewManager = null
@@ -200,7 +201,7 @@ const attachGuest = function (event, embedderFrameId, elementInstanceId, guestIn
nodeIntegrationInSubFrames: params.nodeintegrationinsubframes != null ? params.nodeintegrationinsubframes : false,
enableRemoteModule: params.enableremotemodule,
plugins: params.plugins,
zoomFactor: embedder.getZoomFactor(),
zoomFactor: embedder.zoomFactor,
disablePopups: !params.allowpopups,
webSecurity: !params.disablewebsecurity,
enableBlinkFeatures: params.blinkfeatures,
@@ -387,6 +388,12 @@ handleMessageSync('ELECTRON_GUEST_VIEW_MANAGER_CALL', function (event, guestInst
return guest[method](...args)
})
handleMessage('ELECTRON_GUEST_VIEW_MANAGER_CAPTURE_PAGE', async function (event, guestInstanceId, args) {
const guest = getGuestForWebContents(guestInstanceId, event.sender)
return serialize(await guest.capturePage(...args))
})
// Returns WebContents from its guest id hosted in given webContents.
const getGuestForWebContents = function (guestInstanceId, contents) {
const guest = getGuest(guestInstanceId)

View File

@@ -1,6 +1,7 @@
'use strict'
const { BrowserWindow, webContents } = require('electron')
const electron = require('electron')
const { BrowserWindow } = electron
const { isSameOrigin } = process.electronBinding('v8_util')
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils')
@@ -74,8 +75,10 @@ const mergeBrowserWindowOptions = function (embedder, options) {
}
}
// Sets correct openerId here to give correct options to 'new-window' event handler
options.webPreferences.openerId = embedder.id
if (!webPreferences.nativeWindowOpen) {
// Sets correct openerId here to give correct options to 'new-window' event handler
options.webPreferences.openerId = embedder.id
}
return options
}
@@ -244,13 +247,11 @@ ipcMainInternal.on('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_OPEN', (event, url, fra
}
const referrer = { url: '', policy: 'default' }
ipcMainInternal.emit('ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN', event,
url, referrer, frameName, disposition, options, additionalFeatures)
internalWindowOpen(event, url, referrer, frameName, disposition, options, additionalFeatures)
})
// Routed window.open messages with fully parsed options
ipcMainInternal.on('ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN', function (event, url, referrer,
frameName, disposition, options, additionalFeatures, postData) {
function internalWindowOpen (event, url, referrer, frameName, disposition, options, additionalFeatures, postData) {
options = mergeBrowserWindowOptions(event.sender, options)
event.sender.emit('new-window', event, url, frameName, disposition, options, additionalFeatures, referrer)
const { newGuest } = event
@@ -268,11 +269,12 @@ ipcMainInternal.on('ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN', functio
} else {
event.returnValue = createGuest(event.sender, url, referrer, frameName, options, postData)
}
})
}
const makeSafeHandler = function (handler) {
return (event, guestId, ...args) => {
const guestContents = webContents.fromId(guestId)
// Access webContents via electron to prevent circular require.
const guestContents = electron.webContents.fromId(guestId)
if (!guestContents) {
throw new Error(`Invalid guestId: ${guestId}`)
}
@@ -289,8 +291,8 @@ const handleMessageSync = function (channel, handler) {
ipcMainUtils.handleSync(channel, makeSafeHandler(handler))
}
const assertCanAccessWindow = function (contents, guestContents) {
if (!canAccessWindow(contents, guestContents)) {
const securityCheck = function (contents, guestContents, check) {
if (!check(contents, guestContents)) {
console.error(`Blocked ${contents.getURL()} from accessing guestId: ${guestContents.id}`)
throw new Error(`Access denied to guestId: ${guestContents.id}`)
}
@@ -303,7 +305,7 @@ const windowMethods = new Set([
])
handleMessage('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_METHOD', (event, guestContents, method, ...args) => {
assertCanAccessWindow(event.sender, guestContents)
securityCheck(event.sender, guestContents, canAccessWindow)
if (!windowMethods.has(method)) {
console.error(`Blocked ${event.sender.getURL()} from calling method: ${method}`)
@@ -321,6 +323,8 @@ handleMessage('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_POSTMESSAGE', (event, guestC
// The W3C does not seem to have word on how postMessage should work when the
// origins do not match, so we do not do |canAccessWindow| check here since
// postMessage across origins is useful and not harmful.
securityCheck(event.sender, guestContents, isRelatedWindow)
if (targetOrigin === '*' || isSameOrigin(guestContents.getURL(), targetOrigin)) {
const sourceId = event.sender.id
guestContents._sendInternal('ELECTRON_GUEST_WINDOW_POSTMESSAGE', sourceId, message, sourceOrigin)
@@ -334,7 +338,7 @@ const webContentsMethodsAsync = new Set([
])
handleMessage('ELECTRON_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', (event, guestContents, method, ...args) => {
assertCanAccessWindow(event.sender, guestContents)
securityCheck(event.sender, guestContents, canAccessWindow)
if (!webContentsMethodsAsync.has(method)) {
console.error(`Blocked ${event.sender.getURL()} from calling method: ${method}`)
@@ -349,7 +353,7 @@ const webContentsMethodsSync = new Set([
])
handleMessageSync('ELECTRON_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', (event, guestContents, method, ...args) => {
assertCanAccessWindow(event.sender, guestContents)
securityCheck(event.sender, guestContents, canAccessWindow)
if (!webContentsMethodsSync.has(method)) {
console.error(`Blocked ${event.sender.getURL()} from calling method: ${method}`)
@@ -358,3 +362,5 @@ handleMessageSync('ELECTRON_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', (event, g
return guestContents[method](...args)
})
exports.internalWindowOpen = internalWindowOpen

View File

@@ -195,13 +195,14 @@ app.on('window-all-closed', () => {
}
})
Promise.all([
import('@electron/internal/browser/default-menu'),
app.whenReady()
]).then(([{ setDefaultApplicationMenu }]) => {
// Create default menu
setDefaultApplicationMenu()
})
const { setDefaultApplicationMenu } = require('@electron/internal/browser/default-menu')
// Create default menu.
//
// Note that the task must be added before loading any app, so we can make sure
// the call is maded before any user window is created, otherwise the default
// menu may show even when user explicitly hides the menu.
app.once('ready', setDefaultApplicationMenu)
if (packagePath) {
// Finally load app's main.js and transfer control to C++.

View File

@@ -152,7 +152,8 @@ const NavigationController = (function () {
NavigationController.prototype.reloadIgnoringCache = function () {
this.pendingIndex = this.currentIndex
return this.webContents._loadURL(this.getURL(), {
extraHeaders: 'pragma: no-cache\n'
extraHeaders: 'pragma: no-cache\n',
reloadIgnoringCache: true
})
}

View File

@@ -5,7 +5,7 @@ import { EventEmitter } from 'events'
import objectsRegistry from './objects-registry'
import { ipcMainInternal } from '../ipc-main-internal'
import * as guestViewManager from '@electron/internal/browser/guest-view-manager'
import { isPromise, isSerializableObject } from '@electron/internal/common/remote/type-utils'
import { isPromise, isSerializableObject } from '@electron/internal/common/type-utils'
const v8Util = process.electronBinding('v8_util')
const eventBinding = process.electronBinding('event')
@@ -309,7 +309,7 @@ const unwrapArgs = function (sender: electron.WebContents, frameId: number, cont
v8Util.setHiddenValue(callIntoRenderer, 'location', meta.location)
Object.defineProperty(callIntoRenderer, 'length', { value: meta.length })
v8Util.setRemoteCallbackFreer(callIntoRenderer, contextId, meta.id, sender)
v8Util.setRemoteCallbackFreer(callIntoRenderer, frameId, contextId, meta.id, sender)
rendererFunctions.set(objectId, callIntoRenderer)
return callIntoRenderer
}

View File

@@ -11,7 +11,7 @@ const { crashReporterInit } = require('@electron/internal/browser/crash-reporter
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils')
const guestViewManager = require('@electron/internal/browser/guest-view-manager')
const clipboardUtils = require('@electron/internal/common/clipboard-utils')
const typeUtils = require('@electron/internal/common/type-utils')
const emitCustomEvent = function (contents, eventName, ...args) {
const event = eventBinding.createWithSender(contents)
@@ -62,7 +62,7 @@ ipcMainUtils.handleSync('ELECTRON_BROWSER_CLIPBOARD', function (event, method, .
throw new Error(`Invalid method: ${method}`)
}
return clipboardUtils.serialize(electron.clipboard[method](...clipboardUtils.deserialize(args)))
return typeUtils.serialize(electron.clipboard[method](...typeUtils.deserialize(args)))
})
if (features.isDesktopCapturerEnabled()) {
@@ -112,11 +112,15 @@ ipcMainUtils.handleSync('ELECTRON_BROWSER_SANDBOX_LOAD', async function (event)
contentScripts = getContentScripts()
}
const webPreferences = event.sender.getLastWebPreferences() || {}
return {
contentScripts,
preloadScripts: await Promise.all(preloadPaths.map(path => getPreloadScript(path))),
isRemoteModuleEnabled: isRemoteModuleEnabled(event.sender),
isWebViewTagEnabled: guestViewManager.isWebViewTagEnabled(event.sender),
guestInstanceId: webPreferences.guestInstanceId,
openerId: webPreferences.openerId,
process: {
arch: process.arch,
platform: process.platform,

View File

@@ -4,13 +4,13 @@ const clipboard = process.electronBinding('clipboard')
if (process.type === 'renderer') {
const ipcRendererUtils = require('@electron/internal/renderer/ipc-renderer-internal-utils')
const clipboardUtils = require('@electron/internal/common/clipboard-utils')
const typeUtils = require('@electron/internal/common/type-utils')
const makeRemoteMethod = function (method) {
return (...args) => {
args = clipboardUtils.serialize(args)
args = typeUtils.serialize(args)
const result = ipcRendererUtils.invokeSync('ELECTRON_BROWSER_CLIPBOARD', method, ...args)
return clipboardUtils.deserialize(result)
return typeUtils.deserialize(result)
}
}

View File

@@ -8,6 +8,8 @@
const path = require('path')
const util = require('util')
const Promise = global.Promise
const envNoAsar = process.env.ELECTRON_NO_ASAR &&
process.type !== 'browser' &&
process.type !== 'renderer'

View File

@@ -54,7 +54,12 @@ class CrashReporter {
}
getUploadedReports () {
return binding.getUploadedReports(this.getCrashesDirectory())
const crashDir = this.getCrashesDirectory()
if (!crashDir) {
throw new Error('crashReporter has not been started')
}
return binding.getUploadedReports(crashDir)
}
getCrashesDirectory () {

View File

@@ -1,25 +0,0 @@
export function isPromise (val: any) {
return (
val &&
val.then &&
val.then instanceof Function &&
val.constructor &&
val.constructor.reject &&
val.constructor.reject instanceof Function &&
val.constructor.resolve &&
val.constructor.resolve instanceof Function
)
}
const serializableTypes = [
Boolean,
Number,
String,
Date,
RegExp,
ArrayBuffer
]
export function isSerializableObject (value: any) {
return value === null || ArrayBuffer.isView(value) || serializableTypes.some(type => value instanceof type)
}

View File

@@ -1,5 +1,32 @@
const { nativeImage, NativeImage } = process.electronBinding('native_image')
export function isPromise (val: any) {
return (
val &&
val.then &&
val.then instanceof Function &&
val.constructor &&
val.constructor.reject &&
val.constructor.reject instanceof Function &&
val.constructor.resolve &&
val.constructor.resolve instanceof Function
)
}
const serializableTypes = [
Boolean,
Number,
String,
Date,
Error,
RegExp,
ArrayBuffer
]
export function isSerializableObject (value: any) {
return value === null || ArrayBuffer.isView(value) || serializableTypes.some(type => value instanceof type)
}
const objectMap = function (source: Object, mapper: (value: any) => any) {
const sourceEntries = Object.entries(source)
const targetEntries = sourceEntries.map(([key, val]) => [key, mapper(val)])
@@ -15,7 +42,7 @@ export function serialize (value: any): any {
}
} else if (Array.isArray(value)) {
return value.map(serialize)
} else if (value instanceof Buffer) {
} else if (isSerializableObject(value)) {
return value
} else if (value instanceof Object) {
return objectMap(value, serialize)
@@ -29,7 +56,7 @@ export function deserialize (value: any): any {
return nativeImage.createFromBitmap(value.buffer, value.size)
} else if (Array.isArray(value)) {
return value.map(deserialize)
} else if (value instanceof Buffer) {
} else if (isSerializableObject(value)) {
return value
} else if (value instanceof Object) {
return objectMap(value, deserialize)

View File

@@ -52,7 +52,6 @@ export const syncMethods = new Set([
export const asyncMethods = new Set([
'loadURL',
'capturePage',
'executeJavaScript',
'insertCSS',
'insertText',

View File

@@ -0,0 +1,8 @@
// Captures original globals into a scope to ensure that userland modifications do
// not impact Electron. Note that users doing:
//
// global.Promise.resolve = myFn
//
// Will mutate this captured one as well and that is OK.
export const Promise = global.Promise

View File

@@ -2,5 +2,7 @@ import { defineProperties } from '@electron/internal/common/define-properties'
import { commonModuleList } from '@electron/internal/common/api/module-list'
import { rendererModuleList } from '@electron/internal/renderer/api/module-list'
defineProperties(exports, commonModuleList)
defineProperties(exports, rendererModuleList)
module.exports = {}
defineProperties(module.exports, commonModuleList)
defineProperties(module.exports, rendererModuleList)

View File

@@ -4,7 +4,7 @@ const v8Util = process.electronBinding('v8_util')
const { hasSwitch } = process.electronBinding('command_line')
const { CallbacksRegistry } = require('@electron/internal/renderer/remote/callbacks-registry')
const { isPromise, isSerializableObject } = require('@electron/internal/common/remote/type-utils')
const { isPromise, isSerializableObject } = require('@electron/internal/common/type-utils')
const { ipcRendererInternal } = require('@electron/internal/renderer/ipc-renderer-internal')
const callbacksRegistry = new CallbacksRegistry()
@@ -64,11 +64,6 @@ function wrapArgs (args, visited = new Set()) {
type: 'remote-object',
id: v8Util.getHiddenValue(value, 'atomId')
}
} else if (value instanceof Error) {
return {
type: 'value',
value
}
}
const meta = {

View File

@@ -1,7 +1,10 @@
import { EventEmitter } from 'events'
import { deprecate } from 'electron'
const binding = process.electronBinding('web_frame')
const setLayoutZoomLevelLimitsWarning = deprecate.warnOnce('setLayoutZoomLevelLimits')
class WebFrame extends EventEmitter {
constructor (public context: Window) {
super()
@@ -45,6 +48,10 @@ class WebFrame extends EventEmitter {
get routingId () {
return binding._getRoutingId(this.context)
}
setLayoutZoomLevelLimits () {
setLayoutZoomLevelLimitsWarning()
}
}
// Populate the methods.

View File

@@ -120,7 +120,11 @@ export function injectTo (extensionId: string, context: any) {
let targetExtensionId = extensionId
let connectInfo = { name: '' }
if (args.length === 1) {
targetExtensionId = args[0]
if (typeof args[0] === 'string') {
targetExtensionId = args[0]
} else {
connectInfo = args[0]
}
} else if (args.length === 2) {
[targetExtensionId, connectInfo] = args
}

View File

@@ -192,6 +192,8 @@ if (nodeIntegration) {
delete global.setImmediate
delete global.clearImmediate
delete global.global
delete global.root
delete global.GLOBAL
})
}
}

View File

@@ -5,6 +5,7 @@ import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-inte
import * as guestViewInternal from '@electron/internal/renderer/web-view/guest-view-internal'
import { WEB_VIEW_CONSTANTS } from '@electron/internal/renderer/web-view/web-view-constants'
import { syncMethods, asyncMethods } from '@electron/internal/common/web-view-methods'
import { deserialize } from '@electron/internal/common/type-utils'
const { webFrame } = electron
const v8Util = process.electronBinding('v8_util')
@@ -238,6 +239,12 @@ export const setupMethods = (WebViewElement: typeof ElectronInternal.WebViewElem
return remote.getGuestWebContents(internal.guestInstanceId!)
}
WebViewElement.prototype.getWebContents = electron.deprecate.moveAPI(
WebViewElement.prototype.getWebContents,
'webview.getWebContents()',
'remote.webContents.fromId(webview.getWebContentsId())'
) as any
// Focusing the webview should move page focus to the underlying iframe.
WebViewElement.prototype.focus = function () {
this.contentWindow.focus()
@@ -263,6 +270,10 @@ export const setupMethods = (WebViewElement: typeof ElectronInternal.WebViewElem
for (const method of asyncMethods) {
(WebViewElement.prototype as Record<string, any>)[method] = createNonBlockHandler(method)
}
WebViewElement.prototype.capturePage = async function (...args) {
return deserialize(await ipcRendererInternal.invoke('ELECTRON_GUEST_VIEW_MANAGER_CAPTURE_PAGE', this.getWebContentsId(), args))
}
}
export const webViewImplModule = {

View File

@@ -177,7 +177,7 @@ class BrowserWindowProxy {
export const windowSetup = (
guestInstanceId: number, openerId: number, isHiddenPage: boolean, usesNativeWindowOpen: boolean
) => {
if (guestInstanceId == null) {
if (!process.sandboxed && guestInstanceId == null) {
// Override default window.close.
window.close = function () {
ipcRendererInternal.sendSync('ELECTRON_BROWSER_WINDOW_CLOSE')
@@ -197,10 +197,10 @@ export const windowSetup = (
return null
}
}
}
if (openerId != null) {
window.opener = getOrCreateProxy(openerId)
}
if (openerId != null) {
window.opener = getOrCreateProxy(openerId)
}
// But we do not support prompt().
@@ -208,42 +208,46 @@ export const windowSetup = (
throw new Error('prompt() is and will not be supported.')
}
ipcRendererInternal.on('ELECTRON_GUEST_WINDOW_POSTMESSAGE', function (
_event, sourceId: number, message: any, sourceOrigin: string
) {
// Manually dispatch event instead of using postMessage because we also need to
// set event.source.
//
// Why any? We can't construct a MessageEvent and we can't
// use `as MessageEvent` because you're not supposed to override
// data, origin, and source
const event: any = document.createEvent('Event')
event.initEvent('message', false, false)
if (!usesNativeWindowOpen || openerId != null) {
ipcRendererInternal.on('ELECTRON_GUEST_WINDOW_POSTMESSAGE', function (
_event, sourceId: number, message: any, sourceOrigin: string
) {
// Manually dispatch event instead of using postMessage because we also need to
// set event.source.
//
// Why any? We can't construct a MessageEvent and we can't
// use `as MessageEvent` because you're not supposed to override
// data, origin, and source
const event: any = document.createEvent('Event')
event.initEvent('message', false, false)
event.data = message
event.origin = sourceOrigin
event.source = getOrCreateProxy(sourceId)
event.data = message
event.origin = sourceOrigin
event.source = getOrCreateProxy(sourceId)
window.dispatchEvent(event as MessageEvent)
})
window.history.back = function () {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_BACK')
window.dispatchEvent(event as MessageEvent)
})
}
window.history.forward = function () {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_FORWARD')
}
window.history.go = function (offset: number) {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_TO_OFFSET', +offset)
}
Object.defineProperty(window.history, 'length', {
get: function () {
return ipcRendererInternal.sendSync('ELECTRON_NAVIGATION_CONTROLLER_LENGTH')
if (!process.sandboxed) {
window.history.back = function () {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_BACK')
}
})
window.history.forward = function () {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_FORWARD')
}
window.history.go = function (offset: number) {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_TO_OFFSET', +offset)
}
Object.defineProperty(window.history, 'length', {
get: function () {
return ipcRendererInternal.sendSync('ELECTRON_NAVIGATION_CONTROLLER_LENGTH')
}
})
}
if (guestInstanceId != null) {
// Webview `document.visibilityState` tracks window visibility (and ignores

View File

@@ -1,4 +1,6 @@
import { defineProperties } from '@electron/internal/common/define-properties'
import { moduleList } from '@electron/internal/sandboxed_renderer/api/module-list'
defineProperties(exports, moduleList)
module.exports = {}
defineProperties(module.exports, moduleList)

View File

@@ -30,7 +30,13 @@ const { ipcRendererInternal } = require('@electron/internal/renderer/ipc-rendere
const ipcRendererUtils = require('@electron/internal/renderer/ipc-renderer-internal-utils')
const {
contentScripts, preloadScripts, isRemoteModuleEnabled, isWebViewTagEnabled, process: processProps
contentScripts,
preloadScripts,
isRemoteModuleEnabled,
isWebViewTagEnabled,
guestInstanceId,
openerId,
process: processProps
} = ipcRendererUtils.invokeSync('ELECTRON_BROWSER_SANDBOX_LOAD')
process.isRemoteModuleEnabled = isRemoteModuleEnabled
@@ -94,6 +100,8 @@ Object.defineProperty(preloadProcess, 'noDeprecation', {
process.on('loaded', () => preloadProcess.emit('loaded'))
process.on('exit', () => preloadProcess.emit('exit'))
process.on('document-start', () => preloadProcess.emit('document-start'))
process.on('document-end', () => preloadProcess.emit('document-end'))
// This is the `require` function that will be visible to the preload script
function preloadRequire (module) {
@@ -107,6 +115,11 @@ function preloadRequire (module) {
const { hasSwitch } = process.electronBinding('command_line')
const contextIsolation = hasSwitch('context-isolation')
const isHiddenPage = hasSwitch('hidden-page')
const usesNativeWindowOpen = true
// The arguments to be passed to isolated world.
const isolatedWorldArgs = { ipcRendererInternal, guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen }
switch (window.location.protocol) {
case 'devtools:': {
@@ -125,6 +138,10 @@ switch (window.location.protocol) {
break
}
default: {
// Override default web functions.
const { windowSetup } = require('@electron/internal/renderer/window-setup')
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen)
// Inject content scripts.
if (!process.electronBinding('features').isExtensionsEnabled()) {
require('@electron/internal/renderer/content-scripts-injector')(contentScripts)
@@ -132,14 +149,17 @@ switch (window.location.protocol) {
}
}
const guestInstanceId = binding.guestInstanceId && parseInt(binding.guestInstanceId)
// Load webview tag implementation.
if (process.isMainFrame) {
const { webViewInit } = require('@electron/internal/renderer/web-view/web-view-init')
webViewInit(contextIsolation, isWebViewTagEnabled, guestInstanceId)
}
// Pass the arguments to isolatedWorld.
if (contextIsolation) {
v8Util.setHiddenValue(global, 'isolated-world-args', isolatedWorldArgs)
}
// Wrap the script into a function executed in global scope. It won't have
// access to the current scope, so we'll expose a few objects as arguments:
//

View File

@@ -5,6 +5,8 @@
#ifndef NATIVE_MATE_NATIVE_MATE_FUNCTION_TEMPLATE_H_
#define NATIVE_MATE_NATIVE_MATE_FUNCTION_TEMPLATE_H_
#include <utility>
#include "base/callback.h"
#include "native_mate/arguments.h"
#include "native_mate/wrappable_base.h"
@@ -194,7 +196,8 @@ class Invoker<IndicesHolder<indices...>, ArgTypes...>
void DispatchToCallback(base::Callback<ReturnType(ArgTypes...)> callback) {
v8::MicrotasksScope script_scope(args_->isolate(),
v8::MicrotasksScope::kRunMicrotasks);
args_->Return(callback.Run(ArgumentHolder<indices, ArgTypes>::value...));
args_->Return(
callback.Run(std::move(ArgumentHolder<indices, ArgTypes>::value)...));
}
// In C++, you can declare the function foo(void), but you can't pass a void
@@ -203,7 +206,7 @@ class Invoker<IndicesHolder<indices...>, ArgTypes...>
void DispatchToCallback(base::Callback<void(ArgTypes...)> callback) {
v8::MicrotasksScope script_scope(args_->isolate(),
v8::MicrotasksScope::kRunMicrotasks);
callback.Run(ArgumentHolder<indices, ArgTypes>::value...);
callback.Run(std::move(ArgumentHolder<indices, ArgTypes>::value)...);
}
private:

View File

@@ -1,11 +1,11 @@
{
"name": "electron",
"version": "8.0.0-nightly.20191023",
"version": "8.0.0",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {
"@electron/docs-parser": "^0.4.2",
"@electron/typescript-definitions": "^8.6.1",
"@electron/typescript-definitions": "^8.6.4",
"@octokit/rest": "^16.3.2",
"@primer/octicons": "^9.1.1",
"@types/basic-auth": "^1.1.2",
@@ -129,6 +129,9 @@
"node script/gen-filenames.js",
"python script/check-trailing-whitespace.py --fix",
"git add filenames.auto.gni"
],
"DEPS": [
"node script/gen-hunspell-filenames.js"
]
},
"dependencies": {

View File

@@ -1,2 +1,3 @@
expose_ripemd160.patch
expose_aes-cfb.patch
fix_add_RSA-PSS_keygen_functions.patch

View File

@@ -80,7 +80,7 @@ index d540144b293297791c087e0b968a47d368a73695..53cb9d2dc8f1962a70dc12b648d27c32
+ callback(EVP_ripemd160(), "ripemd160", NULL, arg);
}
diff --git a/include/openssl/digest.h b/include/openssl/digest.h
index c7c679760a30329311b4a6c0db475b2375537028..991fa00b8330a663625719436075bcc8ae32e17a 100644
index c3ceb7f22a123353f23cb33de9cc2931fb5e1c11..704d43a326e7cced925c9db1c2a6094a16f9abe9 100644
--- a/include/openssl/digest.h
+++ b/include/openssl/digest.h
@@ -88,6 +88,9 @@ OPENSSL_EXPORT const EVP_MD *EVP_sha512(void);

View File

@@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Wed, 23 Oct 2019 12:54:32 -0700
Subject: fix: add RSA-PSS keygen functions
This adds support for missing RSA_PSS key generation functions.
Refs https://github.com/nodejs/node/pull/26960.
Upstreamed at https://boringssl-review.googlesource.com/c/boringssl/+/38524.
diff --git a/include/openssl/evp.h b/include/openssl/evp.h
index 19baa64ddba84c3dd59e65aef77d1ebbf49e43df..37217c49f7e05eb25562023bf356fdadae1bc66f 100644
--- a/include/openssl/evp.h
+++ b/include/openssl/evp.h
@@ -723,6 +723,18 @@ OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *ctx, int padding);
OPENSSL_EXPORT int EVP_PKEY_CTX_get_rsa_padding(EVP_PKEY_CTX *ctx,
int *out_padding);
+// EVP_PKEY_CTX_set_rsa_pss_keygen_md() always returns 0.
+OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *ctx,
+ const EVP_MD *md);
+
+// EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen() always returns 0.
+OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *ctx,
+ int salt_len);
+
+// EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md() always returns 0.
+OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *ctx,
+ const EVP_MD *md);
+
// EVP_PKEY_CTX_set_rsa_pss_saltlen sets the length of the salt in a PSS-padded
// signature. A value of -1 cause the salt to be the same length as the digest
// in the signature. A value of -2 causes the salt to be the maximum length

View File

@@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Charles Kerr <ckerr@github.com>
Date: Fri, 15 Nov 2019 17:14:54 -0600
Subject: chore: fix FTBFS from stl features used but not included
diff --git a/src/common/windows/pe_util.cc b/src/common/windows/pe_util.cc
index 6fa63fa3b5699b79d3479c6d4a37a1c68553223f..59c1c1d74f70dca8f871fdddd8e27da102ec9148 100644
--- a/src/common/windows/pe_util.cc
+++ b/src/common/windows/pe_util.cc
@@ -119,7 +119,6 @@ private:
namespace google_breakpad {
-using std::unique_ptr;
using google_breakpad::GUIDString;
bool ReadModuleInfo(const wstring & pe_file, PDBModuleInfo * info) {
diff --git a/src/tools/windows/dump_syms/dump_syms.cc b/src/tools/windows/dump_syms/dump_syms.cc
index 5b7d1777538cd3cfefd0bef45558f900798d6c51..2b2fdaf3f908db1d6f3f96a6bc23f0698cf879dc 100644
--- a/src/tools/windows/dump_syms/dump_syms.cc
+++ b/src/tools/windows/dump_syms/dump_syms.cc
@@ -41,7 +41,6 @@
using std::wstring;
using google_breakpad::PDBSourceLineWriter;
using google_breakpad::PESourceLineWriter;
-using std::unique_ptr;
int wmain(int argc, wchar_t **argv) {
bool success;

View File

@@ -34,13 +34,12 @@ scroll_bounce_flag.patch
mas-cfisobjc.patch
mas-cgdisplayusesforcetogray.patch
mas-audiodeviceduck.patch
mas-lssetapplicationlaunchservicesserverconnectionstatus.patch
ignore_rc_check.patch
mas_disable_remote_accessibility.patch
mas_disable_custom_window_frame.patch
chrome_key_systems.patch
allow_nested_error_trackers.patch
blink_initialization_order.patch
ssl_security_state_tab_helper.patch
exclude-a-few-test-files-from-build.patch
desktop_media_list.patch
proxy_config_monitor.patch
gritsettings_resource_ids.patch
@@ -60,7 +59,6 @@ fix_disable_usage_of_setapplicationisdaemon_and.patch
unsandboxed_ppapi_processes_skip_zygote.patch
patch_the_ensure_gn_version_py_script_to_work_on_mac_ci.patch
build_add_electron_tracing_category.patch
disable_custom_libcxx_on_windows.patch
worker_context_will_destroy.patch
fix_breakpad_symbol_generation_on_linux_arm.patch
frame_host_manager.patch
@@ -68,7 +66,6 @@ crashpad_pid_check.patch
preconnect_feature.patch
network_service_allow_remote_certificate_verification_logic.patch
put_back_deleted_colors_for_autofill.patch
build_win_disable_zc_twophase.patch
disable_color_correct_rendering.patch
add_contentgpuclient_precreatemessageloop_callback.patch
picture-in-picture.patch
@@ -77,7 +74,13 @@ allow_new_privileges_in_unsandboxed_child_processes.patch
expose_setuseragent_on_networkcontext.patch
feat_add_set_theme_source_to_allow_apps_to.patch
revert_cleanup_remove_menu_subtitles_sublabels.patch
ui_views_fix_jumbo_build.patch
export_fetchapi_mojo_traits_to_fix_component_build.patch
build_fix_when_building_with_enable_plugins_false.patch
add_zoom_limit_setters_to_webcontents.patch
revert_remove_contentrendererclient_shouldfork.patch
ignore_rc_check.patch
remove_usage_of_incognito_apis_in_the_spellchecker.patch
chore_use_electron_resources_not_chrome_for_spellchecker.patch
add_trustedauthclient_to_urlloaderfactory.patch
feat_allow_disbaling_blink_scheduler_throttling_per_renderview.patch
accessible_pane_view.patch
fix_add_executable_to_chromedriver_s_rpath_for_electron_8.patch
fix_use_the_new_mediaplaypause_key_listener_for_internal_chrome.patch

View File

@@ -10,7 +10,7 @@ This patch makes three changes to Accelerator::GetShortcutText to improve shortc
3. Ctrl-Shift-= should show as Ctrl-+
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc
index 841a8ccd1f0ca5073cf0f0621f81561ed6425e0d..ac4c04b74b0a3b8e6d6c375fef021abbd8789a14 100644
index 025a82c14dd379f82e6c8242727346bd21e768f3..8b8b0e77c355acd1ef22fb51b89f65f90bfe5cc6 100644
--- a/ui/base/accelerators/accelerator.cc
+++ b/ui/base/accelerators/accelerator.cc
@@ -11,6 +11,7 @@
@@ -74,7 +74,7 @@ index 841a8ccd1f0ca5073cf0f0621f81561ed6425e0d..ac4c04b74b0a3b8e6d6c375fef021abb
+ base::StringPrintf("F%d", key_code_ - VKEY_F1 + 1));
}
// Checking whether the character used for the accelerator is alphanumeric.
#if defined(OS_MACOSX)
@@ -356,7 +356,7 @@ base::string16 Accelerator::ApplyLongFormModifiers(
// more information.
if (IsCtrlDown())

View File

@@ -0,0 +1,32 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 4 Oct 2018 14:57:02 -0700
Subject: fix: add back virtual methods in AccessiblePaneView
Mark SetPaneFocus and RemovePaneFocus as virtual in AccessiblePaneView, as we
need to override them in MenuBar.
Pending upstream patch: https://crrev.com/c/1959189
diff --git a/ui/views/accessible_pane_view.h b/ui/views/accessible_pane_view.h
index 813fd13860a863cd1e6e5bfec38d15f798418673..990c905e8f19dd015a625010ea30adfcb6f51ea6 100644
--- a/ui/views/accessible_pane_view.h
+++ b/ui/views/accessible_pane_view.h
@@ -35,7 +35,7 @@ class VIEWS_EXPORT AccessiblePaneView : public View,
// If |initial_focus| is not NULL, that control will get
// the initial focus, if it's enabled and focusable. Returns true if
// the pane was able to receive focus.
- bool SetPaneFocus(View* initial_focus);
+ virtual bool SetPaneFocus(View* initial_focus);
bool pane_has_focus() const { return pane_has_focus_; }
@@ -83,7 +83,7 @@ class VIEWS_EXPORT AccessiblePaneView : public View,
bool ContainsForFocusSearch(View* root, const View* v);
// Remove pane focus.
- void RemovePaneFocus();
+ virtual void RemovePaneFocus();
View* GetFirstFocusableChild();
View* GetLastFocusableChild();

View File

@@ -10,10 +10,10 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
This should be upstreamed.
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 4373f508964cb1e9fd51c952122ac2f41fb35ae9..065a7a57b77f1e3bf5e03fac900f1936d48ad4ff 100644
index 35b450a41a9a790aa166316a09f6439be7df08c6..39b1ac57f674777f398e72f565dc0c959f683ec7 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -236,6 +236,10 @@ int GpuMain(const MainFunctionParams& parameters) {
@@ -258,6 +258,10 @@ int GpuMain(const MainFunctionParams& parameters) {
logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
@@ -24,7 +24,7 @@ index 4373f508964cb1e9fd51c952122ac2f41fb35ae9..065a7a57b77f1e3bf5e03fac900f1936
// We are experiencing what appear to be memory-stomp issues in the GPU
// process. These issues seem to be impacting the task executor and listeners
// registered to it. Create the task executor on the heap to guard against
@@ -349,7 +353,6 @@ int GpuMain(const MainFunctionParams& parameters) {
@@ -366,7 +370,6 @@ int GpuMain(const MainFunctionParams& parameters) {
GpuProcess gpu_process(io_thread_priority);
#endif
@@ -33,7 +33,7 @@ index 4373f508964cb1e9fd51c952122ac2f41fb35ae9..065a7a57b77f1e3bf5e03fac900f1936
client->PostIOThreadCreated(gpu_process.io_task_runner());
diff --git a/content/public/gpu/content_gpu_client.h b/content/public/gpu/content_gpu_client.h
index 830d5e89af7bd3ddb409ac7bf9d8eb3109830d41..7d544536ec846c294deb6626f51d5de7846fc5c2 100644
index f68558bd2c4ff725443b0d6893ebe7da07c26a00..3dda58157f32dbc9c7d9001192c30a3a1c152437 100644
--- a/content/public/gpu/content_gpu_client.h
+++ b/content/public/gpu/content_gpu_client.h
@@ -39,6 +39,10 @@ class CONTENT_EXPORT ContentGpuClient {
@@ -44,6 +44,6 @@ index 830d5e89af7bd3ddb409ac7bf9d8eb3109830d41..7d544536ec846c294deb6626f51d5de7
+ // creating the message loop.
+ virtual void PreCreateMessageLoop() {}
+
// Initializes the registry. |registry| will be passed to a ConnectionFilter
// (which lives on the IO thread). Unlike other childthreads, the client must
// register additional interfaces on this registry rather than just creating
// Called during initialization once the GpuService has been initialized.
virtual void GpuServiceInitialized() {}

View File

@@ -12,7 +12,7 @@ when we override ReallocateBufferMemory, so we therefore need to implement
Realloc on the v8 side and correspondingly in gin.
diff --git a/gin/array_buffer.cc b/gin/array_buffer.cc
index a02797e94f61e8c71428633a4585a625dc5aadbd..305b7d307d233af699e3f495f85de0f8097ff311 100644
index b94a71ef856f92404e16544e22ebbadf57cff363..b15685f6907bcafeb1acd62bfe76f0713dea27f3 100644
--- a/gin/array_buffer.cc
+++ b/gin/array_buffer.cc
@@ -43,6 +43,10 @@ void* ArrayBufferAllocator::AllocateUninitialized(size_t length) {
@@ -39,45 +39,45 @@ index 2aef366ac8194aa261cbca6abc051f7da8a988d3..3c7d66c81032636abcca4f1538ce9b7f
GIN_EXPORT static ArrayBufferAllocator* SharedInstance();
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
index 3b1ced15de47f6b88716db2b79306bb7d98cfdf4..0ed89b4147d98f2239a3504c898666a758cee618 100644
index c69cfebccd7d7bff35d2292e61bf6008f0ca7940..2cb5f5d3f89f2af13221e66b2277a28532d53deb 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
@@ -645,6 +645,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
size, WTF::ArrayBufferContents::kDontInitialize);
@@ -654,6 +654,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
size, ArrayBufferContents::kDontInitialize);
}
+ void* Realloc(void* data, size_t size) override {
+ return WTF::ArrayBufferContents::Realloc(data, size);
+ return ArrayBufferContents::Realloc(data, size);
+ }
+
void Free(void* data, size_t size) override {
WTF::ArrayBufferContents::FreeMemory(data);
ArrayBufferContents::FreeMemory(data);
}
diff --git a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc
index ac76d127b96b80c8260a7e2cda0b669cd98787ad..dcab64586700a8740262aede8dba2755f652d8e8 100644
--- a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc
+++ b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc
@@ -130,6 +130,11 @@ void* ArrayBufferContents::AllocateMemoryOrNull(size_t size,
diff --git a/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.cc b/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.cc
index 095ca3db051362319611976b9052725ab16c1b3a..13e802a5732f0b04832d6dd8031ae43e1240b79a 100644
--- a/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.cc
+++ b/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.cc
@@ -126,6 +126,11 @@ void* ArrayBufferContents::AllocateMemoryOrNull(size_t size,
return AllocateMemoryWithFlags(size, policy, base::PartitionAllocReturnNull);
}
+void* ArrayBufferContents::Realloc(void* data, size_t size) {
+ return Partitions::ArrayBufferPartition()->Realloc(data, size,
+ return WTF::Partitions::ArrayBufferPartition()->Realloc(data, size,
+ WTF_HEAP_PROFILER_TYPE_NAME(ArrayBufferContents));
+}
+
void ArrayBufferContents::FreeMemory(void* data) {
Partitions::ArrayBufferPartition()->Free(data);
WTF::Partitions::ArrayBufferPartition()->Free(data);
}
diff --git a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
index ee7c89a4950d6b3c97a810c41a62fee7e372018d..c2b60f20a72cca46d05af369f33d9c19395b34ef 100644
--- a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
+++ b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
@@ -140,6 +140,7 @@ class WTF_EXPORT ArrayBufferContents {
diff --git a/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.h b/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.h
index 2e871b20c1e6fc3703178957fd03923f02ab1b47..8f2fd80130f1e7f957d642af4e5c22f9a5937ce4 100644
--- a/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.h
+++ b/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.h
@@ -106,6 +106,7 @@ class CORE_EXPORT ArrayBufferContents {
void CopyTo(ArrayBufferContents& other);
static void* AllocateMemoryOrNull(size_t, InitializationPolicy);
+ static void* Realloc(void* data, size_t);
static void FreeMemory(void*);
static DataHandle CreateDataHandle(size_t, InitializationPolicy);
static void Initialize(
private:

View File

@@ -0,0 +1,158 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Tue, 12 Nov 2019 11:50:16 -0800
Subject: add TrustedAuthClient to URLLoaderFactory
This allows intercepting authentication requests for the 'net' module.
Without this, the 'login' event for electron.net.ClientRequest can't be
implemented, because the existing path checks for the presence of a
WebContents, and cancels the authentication if there's no WebContents
available, which there isn't in the case of the 'net' module.
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 691f9b0f6f658cc259cc9c4e8bb3abb15592e8a3..09ecb3f3406da54440cdd977556f602496ec39a6 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -190,6 +190,25 @@ struct HttpAuthStaticNetworkContextParams {
= DefaultCredentials.ALLOW_DEFAULT_CREDENTIALS;
};
+interface TrustedAuthClient {
+ OnAuthRequired(
+ mojo_base.mojom.UnguessableToken? window_id,
+ uint32 process_id,
+ uint32 routing_id,
+ uint32 request_id,
+ url.mojom.Url url,
+ bool first_auth_attempt,
+ AuthChallengeInfo auth_info,
+ URLResponseHead? head,
+ pending_remote<AuthChallengeResponder> auth_challenge_responder);
+};
+interface TrustedURLLoaderAuthClient {
+ // When a new URLLoader is created, this will be called to pass a
+ // corresponding |auth_client|.
+ OnLoaderCreated(int32 request_id,
+ pending_receiver<TrustedAuthClient> auth_client);
+};
+
interface CertVerifierClient {
Verify(
int32 default_error,
@@ -597,6 +616,8 @@ struct URLLoaderFactoryParams {
// interface. This still respects the per-context block lists.
CorsOriginAccessPatterns? factory_bound_access_patterns;
+ pending_remote<TrustedURLLoaderAuthClient>? auth_client;
+
// Key used to isolate shared network resources like the cache.
NetworkIsolationKey? network_isolation_key;
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
index 486c92182695958a0c97d48d55ebd23e0bd5f3de..acd6c63eff1f94cc9fa8490610e571a73764369a 100644
--- a/services/network/url_loader.cc
+++ b/services/network/url_loader.cc
@@ -333,6 +333,7 @@ URLLoader::URLLoader(
base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder,
base::WeakPtr<NetworkUsageAccumulator> network_usage_accumulator,
mojom::TrustedURLLoaderHeaderClient* url_loader_header_client,
+ mojom::TrustedURLLoaderAuthClient* url_loader_auth_client,
mojom::OriginPolicyManager* origin_policy_manager)
: url_request_context_(url_request_context),
network_service_client_(network_service_client),
@@ -390,6 +391,11 @@ URLLoader::URLLoader(
header_client_.set_disconnect_handler(
base::BindOnce(&URLLoader::OnMojoDisconnect, base::Unretained(this)));
}
+ if (url_loader_auth_client) {
+ url_loader_auth_client->OnLoaderCreated(request_id_, auth_client_.BindNewPipeAndPassReceiver());
+ auth_client_.set_disconnect_handler(
+ base::BindOnce(&URLLoader::OnMojoDisconnect, base::Unretained(this)));
+ }
if (want_raw_headers_) {
options_ |= mojom::kURLLoadOptionSendSSLInfoWithResponse |
mojom::kURLLoadOptionSendSSLInfoForCertificateError;
@@ -824,7 +830,7 @@ void URLLoader::OnReceivedRedirect(net::URLRequest* url_request,
void URLLoader::OnAuthRequired(net::URLRequest* url_request,
const net::AuthChallengeInfo& auth_info) {
- if (!network_context_client_) {
+ if (!network_context_client_ && !auth_client_) {
OnAuthCredentials(base::nullopt);
return;
}
@@ -840,10 +846,18 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
if (url_request->response_headers())
head.headers = url_request->response_headers();
head.auth_challenge_info = auth_info;
- network_context_client_->OnAuthRequired(
- fetch_window_id_, factory_params_->process_id, render_frame_id_,
- request_id_, url_request_->url(), first_auth_attempt_, auth_info, head,
- auth_challenge_responder_receiver_.BindNewPipeAndPassRemote());
+
+ if (auth_client_) {
+ auth_client_->OnAuthRequired(
+ fetch_window_id_, factory_params_->process_id, render_frame_id_,
+ request_id_, url_request_->url(), first_auth_attempt_, auth_info, head,
+ auth_challenge_responder_receiver_.BindNewPipeAndPassRemote());
+ } else {
+ network_context_client_->OnAuthRequired(
+ fetch_window_id_, factory_params_->process_id, render_frame_id_,
+ request_id_, url_request_->url(), first_auth_attempt_, auth_info, head,
+ auth_challenge_responder_receiver_.BindNewPipeAndPassRemote());
+ }
auth_challenge_responder_receiver_.set_disconnect_handler(
base::BindOnce(&URLLoader::DeleteSelf, base::Unretained(this)));
diff --git a/services/network/url_loader.h b/services/network/url_loader.h
index 564851586d2ad5fe0ae6acd4457257ce8ed665b3..3291fe28deb20b9630589e8ea11ea1366583081c 100644
--- a/services/network/url_loader.h
+++ b/services/network/url_loader.h
@@ -85,6 +85,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder,
base::WeakPtr<NetworkUsageAccumulator> network_usage_accumulator,
mojom::TrustedURLLoaderHeaderClient* url_loader_header_client,
+ mojom::TrustedURLLoaderAuthClient* url_loader_auth_client,
mojom::OriginPolicyManager* origin_policy_manager);
~URLLoader() override;
@@ -378,6 +379,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
base::Optional<base::UnguessableToken> fetch_window_id_;
mojo::Remote<mojom::TrustedHeaderClient> header_client_;
+ mojo::Remote<mojom::TrustedAuthClient> auth_client_;
std::unique_ptr<FileOpenerForUpload> file_opener_for_upload_;
diff --git a/services/network/url_loader_factory.cc b/services/network/url_loader_factory.cc
index 9e9baaf8ecd33e6416027014361edc332ab71e3c..cc2c59828f56988d43b680588d4625d9864aa9b6 100644
--- a/services/network/url_loader_factory.cc
+++ b/services/network/url_loader_factory.cc
@@ -65,6 +65,7 @@ URLLoaderFactory::URLLoaderFactory(
params_(std::move(params)),
resource_scheduler_client_(std::move(resource_scheduler_client)),
header_client_(std::move(params_->header_client)),
+ auth_client_(std::move(params_->auth_client)),
cors_url_loader_factory_(cors_url_loader_factory) {
DCHECK(context);
DCHECK_NE(mojom::kInvalidProcessId, params_->process_id);
@@ -207,6 +208,7 @@ void URLLoaderFactory::CreateLoaderAndStart(
resource_scheduler_client_, std::move(keepalive_statistics_recorder),
std::move(network_usage_accumulator),
header_client_.is_bound() ? header_client_.get() : nullptr,
+ auth_client_.is_bound() ? auth_client_.get() : nullptr,
context_->origin_policy_manager());
cors_url_loader_factory_->OnLoaderCreated(std::move(loader));
}
diff --git a/services/network/url_loader_factory.h b/services/network/url_loader_factory.h
index 7d13494649c43be52b06774f2cf5763ebe9129c0..d4b19342c44f86c685f700e4260475ff2235b298 100644
--- a/services/network/url_loader_factory.h
+++ b/services/network/url_loader_factory.h
@@ -72,6 +72,7 @@ class URLLoaderFactory : public mojom::URLLoaderFactory {
mojom::URLLoaderFactoryParamsPtr params_;
scoped_refptr<ResourceSchedulerClient> resource_scheduler_client_;
mojo::Remote<mojom::TrustedURLLoaderHeaderClient> header_client_;
+ mojo::Remote<mojom::TrustedURLLoaderAuthClient> auth_client_;
// |cors_url_loader_factory_| owns this.
cors::CorsURLLoaderFactory* cors_url_loader_factory_;

View File

@@ -1,73 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: John Kleinschmidt <kleinschmidtorama@gmail.com>
Date: Mon, 23 Sep 2019 17:07:53 -0400
Subject: add zoom limit setters to webcontents
Allows minimum_zoom_percent_ and maximum_zoom_percent_ to be set on WebContents.
This is needed by Electron to allow apps to limit how much an app can zoom in
or out.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 8586f71224f1cae6a5e9b4005a6acfef9ff64d4d..4d4dce8124312d46f90db8d2fc59bd0b7acd498d 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4142,10 +4142,18 @@ bool WebContentsImpl::GetClosedByUserGesture() {
return closed_by_user_gesture_;
}
+void WebContentsImpl::SetMinimumZoomPercent(int zoom_percent) {
+ minimum_zoom_percent_ = zoom_percent;
+}
+
int WebContentsImpl::GetMinimumZoomPercent() {
return minimum_zoom_percent_;
}
+void WebContentsImpl::SetMaximumZoomPercent(int zoom_percent) {
+ maximum_zoom_percent_ = zoom_percent;
+}
+
int WebContentsImpl::GetMaximumZoomPercent() {
return maximum_zoom_percent_;
}
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 72f7570ed92886e97629116fec98c1c4dcf95f52..e876929be3df7ba7251886a56acf9b84bbe62e32 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -450,7 +450,9 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
void SystemDragEnded(RenderWidgetHost* source_rwh) override;
void SetClosedByUserGesture(bool value) override;
bool GetClosedByUserGesture() override;
+ void SetMinimumZoomPercent(int zoom_percent) override;
int GetMinimumZoomPercent() override;
+ void SetMaximumZoomPercent(int zoom_percent) override;
int GetMaximumZoomPercent() override;
void SetPageScale(float page_scale_factor) override;
gfx::Size GetPreferredSize() override;
@@ -1714,8 +1716,8 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
bool closed_by_user_gesture_;
// Minimum/maximum zoom percent.
- const int minimum_zoom_percent_;
- const int maximum_zoom_percent_;
+ int minimum_zoom_percent_;
+ int maximum_zoom_percent_;
// Used to correctly handle integer zooming through a smooth scroll device.
float zoom_scroll_remainder_;
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index 94a5b87ca72998729f1fca14f247914bb81d60d1..3af575d51d0a36f9586a3cfc00575e83e70a46b9 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -808,8 +808,10 @@ class WebContents : public PageNavigator,
virtual void SetClosedByUserGesture(bool value) = 0;
virtual bool GetClosedByUserGesture() = 0;
- // Gets the minimum/maximum zoom percent.
+ // Gets/sets the minimum/maximum zoom percent.
+ virtual void SetMinimumZoomPercent(int zoom_percent) = 0;
virtual int GetMinimumZoomPercent() = 0;
+ virtual void SetMaximumZoomPercent(int zoom_percent) = 0;
virtual int GetMaximumZoomPercent() = 0;
// Set the renderer's page scale to the given factor.

View File

@@ -6,10 +6,10 @@ Subject: allow new privileges in unsandboxed child processes
This allows unsandboxed renderers to launch setuid processes on Linux.
diff --git a/content/browser/child_process_launcher_helper_linux.cc b/content/browser/child_process_launcher_helper_linux.cc
index 720b92a1a3a7ab5512f839005b272e4989d2ac65..b1759109627cd00053489dcdd397e942fa9d289f 100644
index ea5258a03f83bcbda7bae296392a46cdd63d6fe1..14eed861e8828fd2ed7d8f27f9fd3bf180d04677 100644
--- a/content/browser/child_process_launcher_helper_linux.cc
+++ b/content/browser/child_process_launcher_helper_linux.cc
@@ -54,6 +54,18 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
@@ -53,6 +53,18 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
const int sandbox_fd = SandboxHostLinux::GetInstance()->GetChildSocket();
options->fds_to_remap.push_back(
std::make_pair(sandbox_fd, service_manager::GetSandboxFD()));

View File

@@ -5,7 +5,7 @@ Subject: blink-worker-enable-csp-in-file-scheme.patch
diff --git a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
index b1b9f451951bb7b11eefe6453a71a6b44be838a5..0f62ba09ef99538a5b0b306f601d10c44a7a7abf 100644
index 1f8273a782a5d3580e139d724ce8a791a100dcfb..90ad0d663003c0bded47183b61bff71a0c01a196 100644
--- a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
+++ b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
@@ -308,7 +308,6 @@ void WorkerClassicScriptLoader::ProcessContentSecurityPolicy(

View File

@@ -7,10 +7,10 @@ This is used by editors to obtain the filesystem path from a dragged file. See
documentation at https://electronjs.org/docs/api/file-object
diff --git a/third_party/blink/renderer/core/fileapi/file.h b/third_party/blink/renderer/core/fileapi/file.h
index 05e05fb1631851009897f3789d3e770475ce1363..e2ad5fef884532847d035430c14c25e042e2ab24 100644
index 7ea8ad8fd162fd6a97052188a8e8868dab1c1fe9..a64966e2db0e2e7b0390a322525522e05ddbb022 100644
--- a/third_party/blink/renderer/core/fileapi/file.h
+++ b/third_party/blink/renderer/core/fileapi/file.h
@@ -201,6 +201,9 @@ class CORE_EXPORT File final : public Blob {
@@ -193,6 +193,9 @@ class CORE_EXPORT File final : public Blob {
}
const String& name() const { return name_; }
@@ -21,7 +21,7 @@ index 05e05fb1631851009897f3789d3e770475ce1363..e2ad5fef884532847d035430c14c25e0
// http://dev.w3.org/2006/webapi/FileAPI/#file-attrs
int64_t lastModified() const;
diff --git a/third_party/blink/renderer/core/fileapi/file.idl b/third_party/blink/renderer/core/fileapi/file.idl
index 41b8183e858b6d955bacbb72281a08e750b6b29f..0db894ecfae63795724335d914f9f992c0755fd1 100644
index e5cf6cc926ff2670f713018dd750e79c53ee76eb..60eca3cf100b31c3d2c0c68271d98c60321e69a7 100644
--- a/third_party/blink/renderer/core/fileapi/file.idl
+++ b/third_party/blink/renderer/core/fileapi/file.idl
@@ -32,6 +32,7 @@

View File

@@ -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 4eb7d11483b55ef99758aa6782b3516fef706628..c384a9707d0f998b5e8bc80ad9af1ca29d9ef58c 100644
index 8095edd988c171a8ad7382d1c2f9fa63ee9e5ffc..802316843c6c270efb871a5d697c4e0d182605d0 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
@@ -210,11 +210,10 @@ void LocalWindowProxy::Initialize() {
@@ -227,11 +227,10 @@ void LocalWindowProxy::Initialize() {
GetFrame()->IsMainFrame());
MainThreadDebugger::Instance()->ContextCreated(script_state_, GetFrame(),
origin);

View File

@@ -14,10 +14,10 @@ when there is code doing that.
This patch reverts the change to fix the crash in Electron.
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
index 0c69b3af9d2144b5d4d61e2d4add7edec839d0b5..acfba2544f6329348f60dd92ca5d9865960db371 100644
index 0aa1376a9483ec93ecb6763295b3664105f106a4..c1045707d14051e9f990f571a3fe0aa708c5fb74 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -325,10 +325,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
@@ -336,10 +336,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
}
CHECK(!view_ || !view_->IsAttached());
@@ -28,7 +28,7 @@ index 0c69b3af9d2144b5d4d61e2d4add7edec839d0b5..acfba2544f6329348f60dd92ca5d9865
if (!Client())
return;
@@ -346,6 +342,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
@@ -357,6 +353,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
// Notify ScriptController that the frame is closing, since its cleanup ends
// up calling back to LocalFrameClient via WindowProxy.
GetScriptController().ClearForClose();

View File

@@ -5,10 +5,10 @@ Subject: blink_world_context.patch
diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h
index 900c1e97bd5b8ad113def9001be495cae94bbcdf..6cec8d0bdfce94fd3980eb7509dfced79903f0d6 100644
index 05a33b9a2cbed57e4e037428397b59f30f83ce66..0cd308b38a158a016b099beed6a31fa1c5a487ad 100644
--- a/third_party/blink/public/web/web_local_frame.h
+++ b/third_party/blink/public/web/web_local_frame.h
@@ -356,6 +356,9 @@ class WebLocalFrame : public WebFrame {
@@ -341,6 +341,9 @@ class WebLocalFrame : public WebFrame {
// be calling this API.
virtual v8::Local<v8::Context> MainWorldScriptContext() const = 0;
@@ -19,10 +19,10 @@ index 900c1e97bd5b8ad113def9001be495cae94bbcdf..6cec8d0bdfce94fd3980eb7509dfced7
// 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 bb640f13de34de5d966d97cf617faa3cb3fd54c2..686cddd0755ee219eaf367b3ce84320aeeb5053d 100644
index 8c984ae92de2a53e59782bea94a143ee7fde2248..105e1e92002adde207db5c770197547ab6b55f97 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
@@ -879,6 +879,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
@@ -935,6 +935,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
return MainWorldScriptContext()->Global();
}
@@ -37,15 +37,15 @@ index bb640f13de34de5d966d97cf617faa3cb3fd54c2..686cddd0755ee219eaf367b3ce84320a
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 ab52cef219785766b1315ec7e17d15c2ba2d6138..cf12b32172a0dc814a1478c275d1b5c067d5eaeb 100644
index e3d4a369e6708827497b7ef8ce38817bde8c8010..ad7fd6c34f10d10257ef5c6e5b4b916dc924f20c 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
@@ -150,6 +150,8 @@ class CORE_EXPORT WebLocalFrameImpl final
@@ -171,6 +171,8 @@ class CORE_EXPORT WebLocalFrameImpl final
int argc,
v8::Local<v8::Value> argv[]) override;
v8::Local<v8::Context> MainWorldScriptContext() const override;
+ v8::Local<v8::Context> WorldScriptContext(
+ v8::Isolate* isolate, int world_id) const override;
v8::Local<v8::Object> GlobalProxy() const override;
void StartReload(WebFrameLoadType) override;
void ReloadImage(const WebNode&) override;
void RequestExecuteScriptAndReturnValue(const WebScriptSource&,
bool user_gesture,
WebScriptExecutionCallback*) override;

View File

@@ -8,10 +8,10 @@ categories in use are known / declared. This patch is required for us
to introduce a new Electron category for Electron-specific tracing.
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
index dcb32a5eadb7fc3c431099107bdfdfba8764a187..e1a343fdbdc6098189bce9fc1d81e6df5555e7ab 100644
index 1ac3513eb4f74bddacae224c1f0fdd1932151224..6ed8074d16580daa48d443653ac21984981aa8e2 100644
--- a/base/trace_event/builtin_categories.h
+++ b/base/trace_event/builtin_categories.h
@@ -63,6 +63,7 @@
@@ -66,6 +66,7 @@
X("dwrite") \
X("DXVA Decoding") \
X("EarlyJava") \

View File

@@ -1,74 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Tue, 8 Oct 2019 15:40:50 +0000
Subject: build: fix when building with enable_plugins=false
Bug: none
Change-Id: If878b3a7f5bb051c6e99c617418475c12754ae90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1845624
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703739}
diff --git a/AUTHORS b/AUTHORS
index 6714e69599bc87c47663bec740b91e352ef92780..41aa5584412e4a325d2360691b00c43d7b08f1bb 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -223,6 +223,7 @@ Debashish Samantaray <d.samantaray@samsung.com>
Debug Wang <debugwang@tencent.com>
Deepak Dilip Borade <deepak.db@samsung.com>
Deepak Mittal <deepak.m1@samsung.com>
+Deepak Mohan <hop2deep@gmail.com>
Deepak Sharma <deepak.sharma@amd.com>
Deepak Singla <deepak.s@samsung.com>
Deokjin Kim <deokjin81.kim@samsung.com>
diff --git a/content/browser/sandbox_parameters_mac.mm b/content/browser/sandbox_parameters_mac.mm
index 5eead918eb9d9df03c86b5201b3f924643707f4b..a12cc8734c45a4ebb29672306da3a695a883eb9b 100644
--- a/content/browser/sandbox_parameters_mac.mm
+++ b/content/browser/sandbox_parameters_mac.mm
@@ -25,12 +25,16 @@
#include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
-#include "content/public/common/pepper_plugin_info.h"
+#include "ppapi/buildflags/buildflags.h"
#include "sandbox/mac/seatbelt_exec.h"
#include "services/service_manager/sandbox/mac/sandbox_mac.h"
#include "services/service_manager/sandbox/sandbox_type.h"
#include "services/service_manager/sandbox/switches.h"
+#if BUILDFLAG(ENABLE_PLUGINS)
+#include "content/public/common/pepper_plugin_info.h"
+#endif
+
namespace content {
namespace {
@@ -148,6 +152,7 @@ void SetupNetworkSandboxParameters(sandbox::SeatbeltExecClient* client) {
}
}
+#if BUILDFLAG(ENABLE_PLUGINS)
void SetupPPAPISandboxParameters(sandbox::SeatbeltExecClient* client) {
SetupCommonSandboxParameters(client);
@@ -172,6 +177,7 @@ void SetupPPAPISandboxParameters(sandbox::SeatbeltExecClient* client) {
// to n+1 more than the plugins added.
CHECK(index <= 5);
}
+#endif
void SetupCDMSandboxParameters(sandbox::SeatbeltExecClient* client) {
SetupCommonSandboxParameters(client);
@@ -212,9 +218,11 @@ void SetupSandboxParameters(service_manager::SandboxType sandbox_type,
case service_manager::SANDBOX_TYPE_NETWORK:
SetupNetworkSandboxParameters(client);
break;
+#if BUILDFLAG(ENABLE_PLUGINS)
case service_manager::SANDBOX_TYPE_PPAPI:
SetupPPAPISandboxParameters(client);
break;
+#endif
case service_manager::SANDBOX_TYPE_PROFILING:
case service_manager::SANDBOX_TYPE_UTILITY:
SetupUtilitySandboxParameters(client, command_line);

View File

@@ -1,36 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Tue, 16 Jul 2019 14:38:52 -0700
Subject: build_win_disable_zc_twophase.patch
Temporarily disable /Zc:twoPhase when libcxx is not used on
Windows. 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 a3a164b41b45381061c7fceb7d7ec1fdb4907792..8de0cb6a8d1987f84aaca5c3bb30ead0a2019bef 100644
--- a/build/config/win/BUILD.gn
+++ b/build/config/win/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/config/c++/c++.gni")
import("//build/config/chrome_build.gni")
import("//build/config/clang/clang.gni")
import("//build/config/compiler/compiler.gni")
@@ -61,9 +62,13 @@ config("compiler") {
"/FS", # Preserve previous PDB behavior.
"/bigobj", # Some of our files are bigger than the regular limits.
"/utf-8", # Assume UTF-8 by default to avoid code page dependencies.
- "/Zc:twoPhase",
]
+ if (use_custom_libcxx) {
+ # Work around crbug.com/969698#c6, bug in MSSTL <xxatomic>.
+ cflags += [ "/Zc:twoPhase" ]
+ }
+
# Force C/C++ mode for the given GN detected file type. This is necessary
# for precompiled headers where the same source file is compiled in both
# modes.

View File

@@ -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 d6d88e7b66f2de4b6733ea454fc45bb804f13a0e..30e9eabf785a0f241e9581ea38f55dd779acd8ce 100644
index 186de613d8b833e0ef357145b8dd5e6247157c79..61cad9e4d603943535ed978c39e258b9bb7198c2 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -4054,6 +4054,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -4374,6 +4374,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 d6d88e7b66f2de4b6733ea454fc45bb804f13a0e..30e9eabf785a0f241e9581ea38f55dd7
&no_javascript_access);
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
index f0d9cafca7efb0ae0440619b821b1976d8460396..e34e0e6387b907960d234da93a3e90a390488d02 100644
index 9e966549368e241d7b6acfc0899751c6f72b95bc..4de3b9200c59dc54aabbd13a69470d57c0cf2c89 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -313,6 +313,10 @@ struct CreateNewWindowParams {
@@ -301,6 +301,10 @@ struct CreateNewWindowParams {
// The window features to use for the new window.
blink.mojom.WindowFeatures features;
@@ -32,10 +32,10 @@ index f0d9cafca7efb0ae0440619b821b1976d8460396..e34e0e6387b907960d234da93a3e90a3
// 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 a9fddd7dd2d3f5c07a3b15925209a396c9aa096d..da7eca5f443e2ecdcb3f0819848735aafeb43a00 100644
index bcb85464359ce2f1c2b46e7bd86f71cbeaebb25d..53bafb5b97034078784f8ebb43212b792f6a5d17 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -502,6 +502,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -514,6 +514,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -45,18 +45,18 @@ index a9fddd7dd2d3f5c07a3b15925209a396c9aa096d..da7eca5f443e2ecdcb3f0819848735aa
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 4e18dfd0dc8d4be9b59f12e7010b7f2be70d6cf0..07fa16953d6167a5a381b28a5da3c08a78de4306 100644
index b70473936db044506e6d7ada4520920f0774eff7..fa942dd135ecfc6fe735b4ae52410ec00b6098af 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -178,6 +178,7 @@ class RenderFrameHost;
class RenderProcessHost;
class RenderViewHost;
class ResourceContext;
@@ -134,6 +134,7 @@ class NetworkService;
class TrustedURLLoaderHeaderClient;
} // namespace mojom
struct ResourceRequest;
+class ResourceRequestBody;
class SerialDelegate;
class SiteInstance;
class SpeechRecognitionManagerDelegate;
@@ -801,6 +802,8 @@ class CONTENT_EXPORT ContentBrowserClient {
} // namespace network
namespace rappor {
@@ -833,6 +834,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -66,7 +66,7 @@ index 4e18dfd0dc8d4be9b59f12e7010b7f2be70d6cf0..07fa16953d6167a5a381b28a5da3c08a
bool opener_suppressed,
bool* no_javascript_access);
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 4a3c760000fca5f53244a03b9a2074991bc0c382..c5ab8ad81bf11d0ec151b9585a4f1a7f5397ae4b 100644
index 556a107ed038752a242a137eec014453cd0f6de2..2ebac7d02b9645b9fa6256bb4e4104c7f14b300f 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -71,6 +71,7 @@
@@ -75,9 +75,9 @@ index 4a3c760000fca5f53244a03b9a2074991bc0c382..c5ab8ad81bf11d0ec151b9585a4f1a7f
#include "content/renderer/loader/request_extra_data.h"
+#include "content/renderer/loader/web_url_request_util.h"
#include "content/renderer/media/audio/audio_device_factory.h"
#include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
#include "content/renderer/media/webrtc/rtc_peer_connection_handler.h"
@@ -1367,6 +1368,8 @@ WebView* RenderViewImpl::CreateView(
#include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_frame_proxy.h"
@@ -1334,6 +1335,8 @@ WebView* RenderViewImpl::CreateView(
}
params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features);
@@ -87,10 +87,10 @@ index 4a3c760000fca5f53244a03b9a2074991bc0c382..c5ab8ad81bf11d0ec151b9585a4f1a7f
// moved on send.
bool is_background_tab =
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.cc b/content/shell/browser/web_test/web_test_content_browser_client.cc
index 5faaea374484d51b1af261ff93fb96aec2eaa4e1..786d3a904a765b5cb53859c35a045b9e04b6250b 100644
index b02eb3cef899fd5bd2c8c38fc77039aa240f8a7a..0e2d1e3c50af833ec60e3c49df45da7c4782ee74 100644
--- a/content/shell/browser/web_test/web_test_content_browser_client.cc
+++ b/content/shell/browser/web_test/web_test_content_browser_client.cc
@@ -312,6 +312,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
@@ -330,6 +330,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -100,10 +100,10 @@ index 5faaea374484d51b1af261ff93fb96aec2eaa4e1..786d3a904a765b5cb53859c35a045b9e
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.h b/content/shell/browser/web_test/web_test_content_browser_client.h
index 435f204a364e54b59c0bd651b760bf350ea94d11..1e6bee1fa08fa2d2a396678838d475e0e7e4ce0c 100644
index 3b30376feb2d32418978973316ad348ce4973ab1..508381ca134169d0bfe222bcf250ba1d7ca63dee 100644
--- a/content/shell/browser/web_test/web_test_content_browser_client.h
+++ b/content/shell/browser/web_test/web_test_content_browser_client.h
@@ -68,6 +68,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
@@ -69,6 +69,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,

View File

@@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@slack-corp.com>
Date: Wed, 23 Oct 2019 14:17:18 -0700
Subject: chore: use electron resources not chrome for spellchecker
spellchecker uses a few IDS_ resources. We need to load these from
Electrons grit header instead of Chromes
diff --git a/chrome/browser/spellchecker/spellcheck_factory.cc b/chrome/browser/spellchecker/spellcheck_factory.cc
index 48ac0a24efde0cb7d3ba71c8b8bdf5178f606e80..e2beefc276098fdc8f1cdab2e0edb8fae4ee67ca 100644
--- a/chrome/browser/spellchecker/spellcheck_factory.cc
+++ b/chrome/browser/spellchecker/spellcheck_factory.cc
@@ -6,7 +6,7 @@
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/spellchecker/spellcheck_service.h"
-#include "chrome/grit/locale_settings.h"
+#include "electron/grit/electron_resources.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
diff --git a/components/language/core/browser/language_prefs.cc b/components/language/core/browser/language_prefs.cc
index 4fd35c8d5bba01c25c906b19bb251222ba3d25b4..4770f0d6a8d145e5d16931d5caf4f1f85abead20 100644
--- a/components/language/core/browser/language_prefs.cc
+++ b/components/language/core/browser/language_prefs.cc
@@ -21,7 +21,7 @@
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
-#include "components/strings/grit/components_locale_settings.h"
+#include "electron/grit/electron_resources.h"
#include "ui/base/l10n/l10n_util.h"
namespace language {

View File

@@ -3,48 +3,18 @@ From: Jeremy Apthorp <jeremya@chromium.org>
Date: Wed, 10 Oct 2018 15:07:34 -0700
Subject: command-ismediakey.patch
define Command::IsMediaKey on mac; copied from //chrome/common/extensions/command.cc,
which also defines a bunch of other stuff that depends on extensions.
since we only need IsMediaKey, and we don't want the extensions stuff
(and aren't compiling command.cc), it's safe to duplicate the
definition. A candidate for upstreaming would be to move the IsMediaKey
function into //ui.
Override MediaKeysListener::IsMediaKeycode to also listen for Volume Up, Volume Down,
and Mute. We also need to patch out Chromium's usage of RemoteCommandCenterDelegate, as
it uses MPRemoteCommandCenter. MPRemoteCommandCenter makes it such that GlobalShortcuts
in Electron will not work as intended, because by design an app does not receive remote
control events until it begins playing audio. This means that a media shortcut would not kick
into effect until you, for example, began playing a YouTube video which sort of defeats the
purpose of GlobalShortcuts.
Also apply electron/electron@0f67b1866a9f00b852370e721affa4efda623f3a
and electron/electron@d2368d2d3b3de9eec4cc32b6aaf035cc89921bf1 as
patches.
At the moment there is no upstream possibility for this; but perhaps Chromium may
consider some kind of switch, enabled by default, which would conditionally choose to avoid usage of
RemoteCommandCenterDelegate on macOS.
diff --git a/chrome/browser/extensions/global_shortcut_listener_mac.mm b/chrome/browser/extensions/global_shortcut_listener_mac.mm
index befe726af9c10b1563a7fc0bb77cc55f65943d5c..46c6fe08bab8471007f78d3ef227e5195bfdf0e1 100644
--- a/chrome/browser/extensions/global_shortcut_listener_mac.mm
+++ b/chrome/browser/extensions/global_shortcut_listener_mac.mm
@@ -21,6 +21,26 @@
namespace extensions {
+// NOTE: this is defined in command.cc, but command.cc is full of
+// chrome-extensions-specific logic that we don't want to depend on.
+// Since we don't build command.cc in Electron, it's safe to re-define this
+// function here. Ideally, though, `IsMediaKey` would be the responsibility of
+// `ui::Accelerator`, rather than `extensions::Command`.
+
+// static
+bool Command::IsMediaKey(const ui::Accelerator& accelerator) {
+ if (accelerator.modifiers() != 0)
+ return false;
+
+ return (accelerator.key_code() == ui::VKEY_MEDIA_NEXT_TRACK ||
+ accelerator.key_code() == ui::VKEY_MEDIA_PREV_TRACK ||
+ accelerator.key_code() == ui::VKEY_MEDIA_PLAY_PAUSE ||
+ accelerator.key_code() == ui::VKEY_MEDIA_STOP ||
+ accelerator.key_code() == ui::VKEY_VOLUME_UP ||
+ accelerator.key_code() == ui::VKEY_VOLUME_DOWN ||
+ accelerator.key_code() == ui::VKEY_VOLUME_MUTE);
+}
+
// static
GlobalShortcutListener* GlobalShortcutListener::GetInstance() {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
diff --git a/chrome/browser/extensions/global_shortcut_listener_win.cc b/chrome/browser/extensions/global_shortcut_listener_win.cc
index c5125495b4d178ffb18be4d2d9670f7556412cbd..cddb321abb938c667a4a2089f87eab999510e9b1 100644
--- a/chrome/browser/extensions/global_shortcut_listener_win.cc
@@ -87,11 +57,34 @@ index 392cf3d58c64c088596e8d321a2ce37b0ec60b6e..43e30f47240dc10a3a9b950255d4e487
ui::Accelerator accelerator(
ui::KeyboardCodeFromXKeyEvent(x_event), modifiers);
diff --git a/ui/base/accelerators/media_keys_listener.cc b/ui/base/accelerators/media_keys_listener.cc
index 1145e1f3d79482b5bb468c3128431ac674310e5f..e319e7a3e34e05b0e96d4a2dbb456355f327137a 100644
--- a/ui/base/accelerators/media_keys_listener.cc
+++ b/ui/base/accelerators/media_keys_listener.cc
@@ -13,7 +13,9 @@ MediaKeysListener::~MediaKeysListener() = default;
// static
bool MediaKeysListener::IsMediaKeycode(KeyboardCode key_code) {
return key_code == VKEY_MEDIA_PLAY_PAUSE || key_code == VKEY_MEDIA_STOP ||
- key_code == VKEY_MEDIA_PREV_TRACK || key_code == VKEY_MEDIA_NEXT_TRACK;
+ key_code == VKEY_MEDIA_PREV_TRACK || key_code == VKEY_MEDIA_NEXT_TRACK ||
+ key_code == VKEY_VOLUME_UP || key_code == VKEY_VOLUME_DOWN ||
+ key_code == VKEY_VOLUME_MUTE;
}
} // namespace ui
diff --git a/ui/base/accelerators/media_keys_listener_mac.mm b/ui/base/accelerators/media_keys_listener_mac.mm
index f4e3126a4efd66f05c4f13e40ba23db10b8cca96..bb4c1a891dd13855227b39a0e582fd4dbc342ec9 100644
index 85378bb565de617b1bd611d28c8714361747a357..94a899e76586d2c7bb199828bfa4aa1ef9ccfcbc 100644
--- a/ui/base/accelerators/media_keys_listener_mac.mm
+++ b/ui/base/accelerators/media_keys_listener_mac.mm
@@ -33,6 +33,12 @@ KeyboardCode MediaKeyCodeToKeyboardCode(int key_code) {
@@ -11,6 +11,7 @@
#include <IOKit/hidsystem/ev_keymap.h>
#include "base/containers/flat_set.h"
+#include "electron/buildflags/buildflags.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/accelerators/system_media_controls_media_keys_listener.h"
@@ -32,6 +33,12 @@ KeyboardCode MediaKeyCodeToKeyboardCode(int key_code) {
case NX_KEYTYPE_NEXT:
case NX_KEYTYPE_FAST:
return VKEY_MEDIA_NEXT_TRACK;
@@ -104,7 +97,7 @@ index f4e3126a4efd66f05c4f13e40ba23db10b8cca96..bb4c1a891dd13855227b39a0e582fd4d
}
return VKEY_UNKNOWN;
}
@@ -193,7 +199,10 @@ static CGEventRef EventTapCallback(CGEventTapProxy proxy,
@@ -192,7 +199,10 @@ static CGEventRef EventTapCallback(CGEventTapProxy proxy,
int key_code = (data1 & 0xFFFF0000) >> 16;
if (key_code != NX_KEYTYPE_PLAY && key_code != NX_KEYTYPE_NEXT &&
key_code != NX_KEYTYPE_PREVIOUS && key_code != NX_KEYTYPE_FAST &&

View File

@@ -8,10 +8,10 @@ run before shutdown. This is required to cleanup WebContents asynchronously
in atom::CommonWebContentsDelegate::ResetManageWebContents.
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 82f291613ac9682ddf414699046393125eb102eb..440681987b4d6420be93fe2f17180cb42adc8d2c 100644
index 9da6475030a7962edc776e9427ce411eb11506dc..bc8031cde18f92c1f5a8c24adb4e654e3c381fd3 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -1505,7 +1505,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
@@ -1531,7 +1531,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
NOTREACHED();
#else
base::RunLoop run_loop;

View File

@@ -17,10 +17,10 @@ only one or two specific checks fail. Then it's better to simply comment out the
failing checks and allow the rest of the target to have them enabled.
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index f383b8ee13881b66144ca12e284e1ead4376a27f..42375cd33bb9759ef1c264672b250638a472fe7e 100644
index 9b489fed825c3a07cd2b3f606f342a7f52b58bb2..af22d8d0852d36d5e8a99f2f9af5feb1ec9e4f65 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1209,8 +1209,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
@@ -1250,8 +1250,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
return NAVIGATION_TYPE_NEW_SUBFRAME;
}
@@ -33,7 +33,7 @@ index f383b8ee13881b66144ca12e284e1ead4376a27f..42375cd33bb9759ef1c264672b250638
if (rfh->GetParent()) {
// All manual subframes would be did_create_new_entry and handled above, so
@@ -1462,7 +1464,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
@@ -1507,7 +1509,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
new_entry->GetFavicon() = GetLastCommittedEntry()->GetFavicon();
}
@@ -46,10 +46,10 @@ index f383b8ee13881b66144ca12e284e1ead4376a27f..42375cd33bb9759ef1c264672b250638
// navigation. Now we know that the renderer has updated its state accordingly
// and it is safe to also clear the browser side history.
diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
index 34c13c28117fe5fced5ca3190c5f948168cd010f..554ddabee8952e578a61a9b9c3f358b2475abd69 100644
index 00a096c43f13d8addcf202545ac2aef97ef9c556..0145c63c41ba67b260b5df273d04e5b87c22af23 100644
--- a/ui/base/clipboard/clipboard_win.cc
+++ b/ui/base/clipboard/clipboard_win.cc
@@ -730,9 +730,9 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap,
@@ -744,9 +744,9 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap,
}
void ClipboardWin::WriteToClipboard(unsigned int format, HANDLE handle) {

View File

@@ -7,10 +7,20 @@ Subject: desktop_media_list.patch
* Free the one-time use capturer after thumbnails are fetched
diff --git a/chrome/browser/media/webrtc/desktop_media_list.h b/chrome/browser/media/webrtc/desktop_media_list.h
index a489bf6ea2179059f53e53563e993db9c7cd123b..8d3df446290e2111e4952899539cbc16d37546e5 100644
index a489bf6ea2179059f53e53563e993db9c7cd123b..93e237569fe94ec8526f67d915e1a7352d586b16 100644
--- a/chrome/browser/media/webrtc/desktop_media_list.h
+++ b/chrome/browser/media/webrtc/desktop_media_list.h
@@ -69,6 +69,7 @@ class DesktopMediaList {
@@ -38,6 +38,9 @@ class DesktopMediaList {
virtual ~DesktopMediaList() {}
+ // Allows listening to notifications generated by the model.
+ virtual void AddObserver(DesktopMediaListObserver* observer) = 0;
+
// Sets time interval between updates. By default list of sources and their
// thumbnail are updated once per second. If called after StartUpdating() then
// it will take effect only after the next update.
@@ -69,6 +72,7 @@ class DesktopMediaList {
virtual int GetSourceCount() const = 0;
virtual const Source& GetSource(int index) const = 0;
@@ -19,10 +29,22 @@ index a489bf6ea2179059f53e53563e993db9c7cd123b..8d3df446290e2111e4952899539cbc16
virtual content::DesktopMediaID::Type GetMediaListType() const = 0;
};
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.cc b/chrome/browser/media/webrtc/desktop_media_list_base.cc
index 9d9b7435044c4b84f971bd94765eb875fbac1624..eb7e10f7d9e937ebd6f776e4b4ec495d02fb884b 100644
index 9d9b7435044c4b84f971bd94765eb875fbac1624..2918f91d8e1308bf5a47313e20ad3cec74918f3a 100644
--- a/chrome/browser/media/webrtc/desktop_media_list_base.cc
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.cc
@@ -56,7 +56,7 @@ void DesktopMediaListBase::Update(UpdateCallback callback) {
@@ -22,6 +22,11 @@ DesktopMediaListBase::DesktopMediaListBase(base::TimeDelta update_period)
DesktopMediaListBase::~DesktopMediaListBase() {}
+void DesktopMediaListBase::AddObserver(DesktopMediaListObserver* observer) {
+ DCHECK(!observer_);
+ observer_ = observer;
+}
+
void DesktopMediaListBase::SetUpdatePeriod(base::TimeDelta period) {
DCHECK(!observer_);
update_period_ = period;
@@ -56,7 +61,7 @@ void DesktopMediaListBase::Update(UpdateCallback callback) {
DCHECK(sources_.empty());
DCHECK(!refresh_callback_);
refresh_callback_ = std::move(callback);
@@ -31,7 +53,7 @@ index 9d9b7435044c4b84f971bd94765eb875fbac1624..eb7e10f7d9e937ebd6f776e4b4ec495d
}
int DesktopMediaListBase::GetSourceCount() const {
@@ -70,6 +70,11 @@ const DesktopMediaList::Source& DesktopMediaListBase::GetSource(
@@ -70,6 +75,11 @@ const DesktopMediaList::Source& DesktopMediaListBase::GetSource(
return sources_[index];
}
@@ -43,11 +65,32 @@ index 9d9b7435044c4b84f971bd94765eb875fbac1624..eb7e10f7d9e937ebd6f776e4b4ec495d
DesktopMediaID::Type DesktopMediaListBase::GetMediaListType() const {
return type_;
}
@@ -81,6 +91,12 @@ DesktopMediaListBase::SourceDescription::SourceDescription(
void DesktopMediaListBase::UpdateSourcesList(
const std::vector<SourceDescription>& new_sources) {
+ // Notify observer when there was no new source captured.
+ if (new_sources.empty()) {
+ observer_->OnSourceUnchanged(this);
+ return;
+ }
+
typedef std::set<DesktopMediaID> SourceSet;
SourceSet new_source_set;
for (size_t i = 0; i < new_sources.size(); ++i) {
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.h b/chrome/browser/media/webrtc/desktop_media_list_base.h
index 3c09ec3111d54cb4f0b74f16a81292b779009eae..26acc18acaef21ced3604fe7ede079d8577f53f4 100644
index 3c09ec3111d54cb4f0b74f16a81292b779009eae..5c3667822afd47a22878b508b844a615c24f3162 100644
--- a/chrome/browser/media/webrtc/desktop_media_list_base.h
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.h
@@ -34,6 +34,7 @@ class DesktopMediaListBase : public DesktopMediaList {
@@ -27,6 +27,7 @@ class DesktopMediaListBase : public DesktopMediaList {
~DesktopMediaListBase() override;
// DesktopMediaList interface.
+ void AddObserver(DesktopMediaListObserver* observer) override;
void SetUpdatePeriod(base::TimeDelta period) override;
void SetThumbnailSize(const gfx::Size& thumbnail_size) override;
void SetViewDialogWindowId(content::DesktopMediaID dialog_id) override;
@@ -34,6 +35,7 @@ class DesktopMediaListBase : public DesktopMediaList {
void Update(UpdateCallback callback) override;
int GetSourceCount() const override;
const Source& GetSource(int index) const override;
@@ -55,6 +98,18 @@ index 3c09ec3111d54cb4f0b74f16a81292b779009eae..26acc18acaef21ced3604fe7ede079d8
content::DesktopMediaID::Type GetMediaListType() const override;
static uint32_t GetImageHash(const gfx::Image& image);
diff --git a/chrome/browser/media/webrtc/desktop_media_list_observer.h b/chrome/browser/media/webrtc/desktop_media_list_observer.h
index ad7f766a36b1b6b2a8bc0f96369f1aaadf6681f7..f6c6c14a0937430df62c9b9c1132c5916a9f2009 100644
--- a/chrome/browser/media/webrtc/desktop_media_list_observer.h
+++ b/chrome/browser/media/webrtc/desktop_media_list_observer.h
@@ -20,6 +20,7 @@ class DesktopMediaListObserver {
int new_index) = 0;
virtual void OnSourceNameChanged(DesktopMediaList* list, int index) = 0;
virtual void OnSourceThumbnailChanged(DesktopMediaList* list, int index) = 0;
+ virtual void OnSourceUnchanged(DesktopMediaList* list) = 0;
protected:
virtual ~DesktopMediaListObserver() {}
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
index 2b109bd1dea2aed647ec01c0660b2d4c963312f2..8567b4c84b55f1f7774ef3755dca63e94ddd7a29 100644
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc

Some files were not shown because too many files have changed in this diff Show More