Commit graph

284 commits

Author SHA1 Message Date
Cheng Zhao
0a6eb8afca
feat: migrate protocol module to NetworkService (Part 4) (#18084)
* Parse stream protocol handler

* Pipe node stream to mojo

* Merge the parser for headers

* Add ToDict helper to simplify code

* Simplify dispatching logic

* Add an experimental API for returning any type of response

* Fix subscribing event

* URL loaders' lifetime is independent of the factory

* HandleError helper is no longer needed

* Rename "SendResponse" => "StartLoading" to follow naming conventions

* Delete when connection error happens

* Fix cpplint warning
2019-05-03 09:48:51 +09:00
Jeremy Apthorp
3949f0bd50
refactor: convert crash reporter to gin (#17952) 2019-05-01 15:19:11 -07:00
Milan Burda
fcf0af15de feat: support ELECTRON_DEFAULT_ERROR_MODE in the GPU process (#17728) 2019-04-30 12:45:48 -04:00
Shelley Vohr
7b55ee9d36 refactor: allow requiring modules with no side effects (#17496) 2019-04-30 09:46:08 +09:00
Milan Burda
18b77a4de6 chore: rename atom-binding-setup.ts to electron-binding-setup.ts (#17949) 2019-04-29 10:57:32 -04:00
Cheng Zhao
3142d5ca00
chore: support converting OnceCallback to V8 (#17941) 2019-04-25 09:40:27 +09:00
Jeremy Apthorp
53c453567f
refactor: initialize feature list earlier (#17922) 2019-04-23 15:18:12 -07:00
Cheng Zhao
132137081a feat: migrate protocol module to NetworkService (Part 1) (#17899) 2019-04-23 14:39:20 -07:00
Jeremy Apthorp
ab009bba26 refactor: turn OnOffscreen message into a command-line flag (#17687)
This turns the AtomViewMsg_Offscreen message, which only called the global setter blink::WebView::SetUseExternalPopupMenus(false) to get Chrome to render popup menus in the renderer instead of externally on macOS, into a command-line renderer flag --offscreen which does the same thing, except at render thread startup time, which is where Chromium sets the flag: https://chromium.googlesource.com/chromium/src/+/refs/tags/75.0.3755.3/content/renderer/render_thread_impl.cc#728.

This was the last usage of RenderViewObserver in our codebase, so this PR also removes that class.
2019-04-19 12:55:20 -07:00
Shelley Vohr
0749dc4cc1
refactor: make app logs dir creation opt-in (#17841)
Previously, we were creating the app logs folder at a predefined location during initial electron startup, which meant that it had to be manually removed and prevented clean app portability. This refactors that implementation such that it's now an opt-in feature and developers must call app.setAppLogsPath(path) with an optional custom path in order to set this directory.
2019-04-18 22:04:58 -07:00
Jeremy Apthorp
53f6cbccbf
refactor: use mojo for electron internal IPC (#17406)
* refactor: use mojo for electron internal IPC

* add sender_id, drop MessageSync

* remove usages of AtomFrameMsg_Message

* iwyu

* first draft of renderer->browser direction

* refactor to reuse a single ipc interface

* implement TakeHeapSnapshot through mojo

* the rest of the owl^WtakeHeapSnapshot mojofication

* remove no-op overrides in AtomRendererClient

* delete renderer-side ElectronApiServiceImpl when its pipe is destroyed

* looks like we don't need to overlay the renderer manifest after all

* don't try to send 2 replies to a sync rpc

* undo changes to manifests.cc

* unify sandboxed + unsandboxed ipc events

* lint

* register ElectronBrowser mojo service on devtools WebContents

* fix takeHeapSnapshopt failure paths

* {electron_api => atom}::mojom

* add send_to_all to ElectronRenderer::Message

* keep interface alive until callback is called

* review comments

* use GetContext from RendererClientBase

* robustify a test that uses window.open

* MessageSync posts a task to put sync messages in the same queue as async ones

* add v8::MicrotasksScope and node::CallbackScope

* iwyu

* use weakptr to api::WebContents instead of Unretained

* make MessageSync an asynchronous message & use non-associated interface

* iwyu + comments

* remove unused WeakPtrFactory

* inline OnRendererMessage[Sync]

* cleanups & comments

* use helper methods instead of inline lambdas

* remove unneeded async in test

* add mojo to manifests deps

* add gn check for //electron/manifests and mojo

* don't register renderer side service until preload has been run

* update gn check targets list

* move interface registration back to RenderFrameCreated
2019-04-02 15:38:16 -07:00
Milan Burda
8cf15cc931 feat: only allow bundled preload scripts (#17308) 2019-03-28 11:38:51 +01:00
Robo
6c20c6e668 refactor: Enable network service (Part 1) (#17431)
* Convert InspectableWebContentsImpl::LoadNetworkResource to SimpleURLLoader

https://bugs.chromium.org/p/chromium/issues/detail?id=721408

* Plumb creation of network context with the service
2019-03-26 10:10:48 +09:00
Shelley Vohr
38d75010c7
chore: rename atomBinding to electronBinding (#17419) 2019-03-18 12:37:06 -07:00
Milan Burda
3a091cdea4 refactor: implement clipboard APIs without the remote module (#17200) 2019-03-15 17:32:04 -07:00
Milan Burda
a8698d092b chore: increase security of default_app (#17318) 2019-03-11 16:13:46 -07:00
Felix Rieseberg
f3fc4023cf refactor: Port renderer/web-view to TypeScript (#17250) 2019-03-07 15:26:23 -08:00
Felix Rieseberg
59a7fa6927 refactor: Port api/web-frame to TypeScript (#17053) 2019-03-01 08:39:04 +00:00
Felix Rieseberg
7f007109c3 refactor: Port inspector to TypeScript (#16943)
* refactor: Port inspector to TypeScript

* refactor: Add another type to inspector

* refactor: Use correct paths

* Update lib/renderer/inspector.ts

Co-Authored-By: felixrieseberg <felix@felixrieseberg.com>

* refactor: Implement feedback <3

* refactor: Don't define blob at all

* fix: Correct type
2019-02-25 18:10:25 -08:00
Felix Rieseberg
91f81b4b72 refactor: Port renderer/init to TypeScript (#17027)
* refactor: Port renderer/init to TypeScript

* Update lib/renderer/init.ts

Co-Authored-By: felixrieseberg <felix@felixrieseberg.com>

* refactor: Type this a bit more loosely

* refactor: Type parseOption strictly
2019-02-19 17:05:14 +00:00
Felix Rieseberg
2223114f20 refactor: Port chrome-api to TypeScript (#17014) 2019-02-19 13:09:44 +00:00
Felix Rieseberg
eaa0e28396 refactor: Port content-scripts-injector to TypeScript (#17012) 2019-02-18 12:47:07 +00:00
Felix Rieseberg
596acdcb91 refactor: Port web-frame-init to TypeScript (#16934)
* refactor: Port web-frame-init to TypeScript

* refactor: Use ipcRendererInternal
2019-02-18 00:24:18 +00:00
Felix Rieseberg
6b3ff4f1f7 refactor: Port security warnings to TypeScript (#16937)
* refactor: Port security-warnings to TypeScript

* chore: make aliasify work on .ts files as well

* refactor: Implement feedback <3

* refactor: Correctly call executeJavaScript
2019-02-16 17:06:30 -08:00
Felix Rieseberg
2498e8d1c2 refactor: Port renderer-internal to TypeScript (#16939)
* chore: make aliasify work on .ts files as well

* refactor: Port ipc-renderer-internal to TypeScript

* refactor: Correctly import internal ipcRenderer

* refactor: One more rename

* refactor: Fix one more lint issue

* refactor: Correctly reference ipcRendererInternal
2019-02-14 17:24:25 -08:00
Samuel Attard
5790869a3f
chore: refactor browser IPC into TS and app API into TS (#16921)
* chore: refactor browser IPC into typescript

* chore: refactor app.ts into Typescript

* Refactors app.dock into cpp
* Removes app.launcher which has not existed for 3 years
* Removes 2 deprecated APIs (that have been deprecated for more than one
major)
* Refactors deprecate.ts as well
2019-02-14 14:29:20 -08:00
deepak1556
9439ac108d content: Fix WebContentsUserData for usage across components.
https://chromium-review.googlesource.com/c/chromium/src/+/1354402
2019-02-14 23:59:21 +05:30
Felix Rieseberg
31494dfade refactor: Port getRemote to TypeScript (#16938)
* chore: make aliasify work on .ts files as well

* refactor: Port getRemote to TypeScript

* refactor: Implement feedback <3
2019-02-14 04:04:53 -10:00
Felix Rieseberg
6cd75744ef refactor: Port window-setup to TS (#16894)
* refactor: Port window-setup to TS

* refactor: Make the linter happy

* refactor: Sneaky little TS error

* refactor: Correctly import window-setup

* refactor: Implement feedback <3

* refactor: Allow decorators in TS

* refactor: Use named windowSetup in isolatedRenderer

* refactor: Help TS understand

* refactor: Welp, use createEvent again

* refactor: Use the correct target in the decorator
2019-02-14 03:52:38 -10:00
Felix Rieseberg
9112ad01be refactor: Port renderer-internal-utils to TypeScript (#16942)
* chore: make aliasify work on .ts files as well

* refactor: Port renderer-internal-utils to TypeScript

* refactor: Implement feedback <3
2019-02-13 23:05:49 -08:00
Samuel Attard
01c442de64 refactor: convert more files to typescript (#16820) 2019-02-12 04:22:33 -10:00
Cheng Zhao
d16b581140 fix: remove memory leak when using webFrame and spell checker (#16770)
* fix: do not create native api::WebFrame in webFrame

When reloading a page without restarting renderer process (for example
sandbox mode), the blink::WebFrame is not destroyed, but api::WebFrame
is always recreated for the new page context. This leaves a leak of
api::WebFrame.

* fix: remove spell checker when page context is released
2019-02-08 13:38:31 -08:00
Samuel Attard
26df9992cf
build: use typescript for internal Electron JS code (#16441) 2019-02-06 10:27:20 -08:00
Milan Burda
6d674eebb1 refactor: crashReporterInit (#16729) 2019-02-05 12:56:44 -08:00
Samuel Attard
b202ad1e24
refactor: remove js2asar.py and port logic to JS in more readable / GN-style way (#16718)
* refactor: remove js2asar.py and port logic to JS in more readable / GN-style way

* refactor: further clean up ASAR impl, add new node_action GN template
2019-02-05 12:10:15 -08:00
Milan Burda
7dc565fc2e refactor: implement inspector APIs without the remote module (#16607) 2019-02-01 19:56:46 +01:00
Milan Burda
713df08e3e chore: remove deprecated modules internally using remote.require in sandboxed renderer context (#15957) 2019-01-24 10:53:52 -08:00
Cheng Zhao
03d499bf34 fix: detach webview instead of destroying it
Chromium no longer cleans up everything when a guest webcontents is
destroyed, we have to force detaching it and let Chromium destroy everything.
2019-01-22 10:32:06 -08:00
Milan Burda
0e27f133d7 refactor: delete atom_api_renderer_ipc.h (#16481) 2019-01-21 22:31:37 -08:00
Milan Burda
b965e54efc fix: <webview> not working with contextIsolation + sandbox (#16469) 2019-01-22 10:08:16 +09:00
Milan Burda
23d44e322d feat: use default-app behavior in packaged apps (#16310)
Unify the behavior between default app and packaged apps:
- create default application menu unless the app has one
- default window-all-closed handling unless the app handles the event
2019-01-15 21:35:53 +01:00
Robo
52fe92d02e feat: Upgrade to Chromium 71.0.3578.98 (#15966) 2019-01-11 17:00:43 -08:00
Milan Burda
3f1d22759a refactor: use helpers for command-line parsing in renderer/init.js (#16239) 2019-01-03 11:22:34 -05:00
Milan Burda
c65a0d90b8 chore: misc cleanup (#16037) 2018-12-12 15:31:16 -06:00
Milan Burda
aa2b2f7c8f fix: security: don't allow arbitrary methods to be invoked on webContents via IPC (#15919) 2018-12-04 16:12:21 +01:00
Milan Burda
a33eeda4f7 refactor: don't expose NavigationController as an internal module (#15920) 2018-12-03 17:13:09 +01:00
deepak1556
414dcfcd07 fix: create system network context for global requests
Global requests currently includes DNS over HTTPS requests,
certain cert validation requests (OCSP, AIA, etc) on some platforms
and geolocation requests.
2018-11-14 12:42:24 +05:30
Samuel Attard
1cf28e8b75 build: auto-gen libnotify_loader.cc (#15648) 2018-11-10 14:21:40 -05:00
Jeremy Apthorp
7e0e12b8a3 fix: match Chrome's font fallback behavior (#15486)
* fix: match Chrome's font fallback behavior

Fixes #15481

* add a cache

* add test

* another test

* fix tests

* arial -> dejavu sans on linux apparently?
2018-11-08 10:51:51 -04:00
Heilig Benedek
ca2d74e118 feat: add methods to allow customization of save dialog during will-download event (#15497)
* feat: add method to DownloadItem that allows customization of dialog options

* docs: add docs for get/setSaveDialogOptions

* add missing copy constructor for DialogSettings on mac and linux

* fix: don't filter dialog options for mas build, don't return properties

* test: add test for get/setSaveDialogOptions

* fix: remove openDevtools added for debugging

* test: fix failing test because of new event parameter

* docs: use SaveDialogOptions instead of Object
2018-11-08 10:51:06 -04:00
Milan Burda
a19d20cfb8 refactor: more cleanup of chromium_src (#15424) 2018-11-05 10:29:33 -04:00
Shelley Vohr
b2e1a93177
refactor: remove hardcoded google api key (#15478)
* refactor: remove hardcoded Google API key

* address changes from review
2018-10-31 07:49:44 -07:00
Milan Burda
f921df7ad1 chore: move spellcheck out of chromium_src (#15407) 2018-10-26 10:34:57 -07:00
Milan Burda
405edebc51 chore: remove unused chrome_notification_types.h (#15409)
* chore: remove unused chrome_notification_types.h

* chore: remove dummy simple_message_box.h
2018-10-26 10:16:24 -05:00
Milan Burda
8ba271efba refactor: eliminate brightray (#15240) 2018-10-24 12:49:10 +02:00
Cheng Zhao
cb9be091aa refactor: remove potential double free when managing WebContents (#15280)
* refactor: remove -new-contents-created event

Chromium expects us to take ownership of WebContents in AddNewContents,
we should not create V8 wrapper in WebContentsCreated, otherwise we
would have WebContents being managed by 2 unique_ptr at the same time.

* refactor: make CreateAndTake take unique_ptr
2018-10-22 13:02:25 -05:00
Milan Burda
6d844a0b67 refactor: move media/net from brightray to atom (#15288) 2018-10-19 14:51:43 -04:00
Milan Burda
6f3c46cc7e refactor: move devtools from brightray to atom (#15234) 2018-10-19 15:50:30 +02:00
Milan Burda
db37ab1039 feat: add remote.require() / remote.getGlobal() filtering (#15014) 2018-10-18 14:36:45 +11:00
Milan Burda
a369a4172b refactor: move notifications from brightray to atom (#15209) 2018-10-17 20:01:11 +02:00
Nitish Sakhawalkar
0c711f690e fix: add microtask runner and fix promise test (#15071)
* fix: Promise resolution and unit test

* Update to use microtask runner

* Address review
2018-10-16 02:26:47 +11:00
Milan Burda
d3efc52745 feat: add webPreferences.enableRemoteModule option (#13028) 2018-10-13 20:50:07 +03:00
Heilig Benedek
a82bcc7e3c refactor: move printing out of chromium_src (#15023)
* remove printing related things from chromium_src

* chore: add printing build flag and patch

* fix: include PrintingService on other platforms too

* fix: printing_handler is only needed on Windows

* fix: format BUILD.gn properly

* fix: rename printing build flag to avoid conflict with chromium

* fix: place previously missed printing calls behind build flag

* fix: accidentally renamed flag in patch file

* fix: don't include all printing strings

* fix: allow ShowItemInFolder and OpenItem to block, fixing a DCHECK crash

* fix: make things compile, some changes got lost while rebasing

* fix: remove rogue line from BUILD.gn

* chore: update patch description

* style: lint fix

* chore: use chromium printing buildflag, move node related stuff out of patch

* revert: remove ScopedAllowBlockingForTesting call

* fix: fix my rebase blooper

* fix: re-add header lost during rebase, update patch

* fix: add <map> include, tweak the patch a bit

* revert: remove rogue diff from patch

* fix: clean up after rebase
2018-10-13 12:57:04 +11:00
Heilig Benedek
5ef5d60f77 refactor: move color_chooser out of chromium_src (#15091)
* chore: move color_chooser out of chromium_src

* fix: remove deleted source files

* fix: add build flag, patch and build instructions for ColorChooser
2018-10-12 10:53:46 +11:00
Heilig Benedek
95696c9456 refactor: move text-to-speech out of chromium_src (#15024)
* chore: add tts patch and buildflag, makes tts work again

* chore: add tts patch and buildflag, makes tts work again

* fix: make things compile

* build: add relevant tts files for linux

* fix: update patch and patch description, should now compile on mac

* build: move chrome specific sources under chromium_src:chrome target

* build: enable_extensions again

We are depending on them, check `//electron/chromium_src:chrome` target
for more info.

* fix: update tts.patch to receive notifications about browser context destruction

* fix: extend browser process from chrome layer

The global state g_browser_process is shared between //chrome
and //electron.

* spec: add basic speech synthesis test

* spec: skip speech tests on ci

* build: fix compilation on windows
2018-10-11 08:52:12 -05:00
Jeremy Apthorp
ce26687577 refactor: remove global_shortcut_listener from chromium_src/ (#15070) 2018-10-11 16:02:58 +11:00
Jeremy Apthorp
8eb15f7554 Creates TaskScheduler and MessageLoop on main thread early
https://chromium-review.googlesource.com/c/chromium/src/+/1072387
2018-10-09 14:38:00 -07:00
Samuel Attard
7589c56cea fix: intercept the isolate_holder's new isolate and register it with the node platform before initialization
Chromium Change: https://chromium-review.googlesource.com/c/chromium/src/+/1015020
2018-10-09 14:38:00 -07:00
Jeremy Apthorp
b57b342352 Remove PlatformAccelerator
https://chromium-review.googlesource.com/c/chromium/src/+/1140211
2018-10-09 14:38:00 -07:00
Milan Burda
b50f86ef43 refactor: use separate ipc-renderer-internal / ipc-main-internal APIs for Electron internals (#13940) 2018-10-07 00:48:00 +13:00
Robo
2700eaca1e build: remove //chrome/browser/icon_loader source copies (#14955)
* build: remove //chrome/browser/icon_loader source copies

* chore: add DCHECK to ensure IconManager is accessed from UI thread
2018-10-05 14:12:53 -05:00
Robo
434a6e3561 refactor: create request context from network context (#14656)
* [ci skip] refactor: create request context from network context

* [ci skip] refactor: subscribe to mojo cookiemanager for cookie changes

* [ci skip] refactor: manage the lifetime of custom URLRequestJobFactory

* refactor: use OOP mojo proxy resolver

* revert: add support for kIgnoreCertificateErrorsSPKIList

* build: provide service manifest overlays for content services

* chore: gn format

* fix: log-net-log switch not working as expected

* spec: verify proxy settings are respected from pac script with session.setProxy

* chore: use chrome constants where possible

* fix: initialize request context for global cert fetcher

* refactor: fix destruction of request context getters

* spec: use custom session for proxy tests

* fix: queue up additional stop callbacks while net log is being stopped

* fix: Add CHECK for cookie manager retrieval

* chore: add helper to retrieve logging state for net log module

* fix: ui::ResourceBundle::GetRawDataResourceForScale => GetRawDataResource

* style: comment unused parameters

* build: move //components/certificate_transparency deps from //brightray

* chore: update gritsettings_resource_ids patch

* chore: update api for chromium 68

* fix: net log instance is now a property of session
2018-10-04 13:08:56 -05:00
Cheng Zhao
d3ae541397 refactor: Clean up the implementation of the registerStreamProtocol (#11357)
* Use weak pointer to avoid race condition

* Use DeleteSoon to delete pointer across threads

* Simplify EventSubscriber

* No need to manually mange V8 convertions

* Fix cpplint warning

We should update cpplint for this, but let's do it in other PR.

* Move UI thread operations to EventSubscriber

* Less and more assertions

Some methods are now private so no more need to assert threads.

* Fix cpplint warnings

* No longer needs the EventEmitted

* EventSubscriber => StreamSubscriber

* Reduce the copies when passing data

* Fix cpplint warnings
2018-10-04 10:13:09 -04:00
Jeremy Apthorp
14fc6f3081 chore: add GN linting (#14678)
* chore: add GN linter

* chore: fix GN lint errors

* try some crazy bash to get a gn exe

* base64 on linux is different

* cloning build_tools doesn't download GN

* download_from_google_storage needs depot_tools in the path

* fixup! chore: add GN linter
2018-10-03 18:03:26 -05:00
Robo
7a43c8732c build: remove //chrome/common source copies (#14950)
* Removes
  * //chrome/common/chrome_constants.*
  * //chrome/common/chrome_paths*.*
  * //chrome/common/pref_names.*
2018-10-03 11:44:22 -07:00
Robo
91a965e24d build: remove //extensions source copies (#14949)
* build: remove //extensions source copies

* chore: gn format
2018-10-03 11:44:50 -05:00
Robo
596ae2c2df refactor: desktop capturer module (#14835)
* Revert "post all desktop capturer apis to worker threads"

This reverts commit 5a28759fea.

* refactor: desktop capturer module

* Creates the screen and window capturer for the liftime of the app
* Fixes incorrect usage of weak ptr

* build: add //ui/snapshot to chromium_src deps

* fix: handle scenarios when there are no captured sources
2018-10-03 21:26:42 +09:00
Nitish Sakhawalkar
5c108728d6 feat: Implementation of getGPUInfo API. (#13486)
* Implementation of getGPUInfo API.

* Clear promise set

* Changes to promise usage

* Minor fixes

* Fix linux build

* Update spec

* Fix lint (linter didn't run on windows locally)

* Test running single test for CI

* Update spec
2018-09-28 00:59:23 +10:00
Samuel Attard
32a9df2940
refactor: clean up the default app implementation (#14719)
* Disable nodeIntegration
* Enable contextIsolation
* Re-implement the CSP security check to handle running in
contextIsolation
* Disable bad DCHECKS for the promise helper
* Remove the unused "-d" flag for the electron binary
* Added a way to hide the default help output for electron devs who
don't want to see it every time
2018-09-21 15:24:42 +10:00
Milan Burda
e22142ef9c feat: add process.takeHeapSnapshot() / webContents.takeHeapSnapshot() (#14456) 2018-09-18 11:00:31 -07:00
Samuel Attard
7065093869
feat: add will-redirect (#13866)
* feat: add will-redirect to allow people to prevent 30X redirects

* spec: add tests for the will-redirect event

* refactor: implement will-redirect using NavigationThrottle instead of PostTask

This avoids a potential race condition and immediately cancels the
navigation

* docs: add docs for did-redirect-navigation

* refactor: move AtomNavigationThrottle out of net folder

* refactor: update header guard for atom_navigation_throttle.h

* refactor: fix chromium style errors in the GN build

* refactor: update throttle impl to NOTREACHED and std::make_unqique
2018-09-16 01:42:43 +10:00
Robo
2cd03bf360 build: remove duplicate devtools sources (#14522)
* build: remove duplicate devtools sources

* build: create separate target for chrome sources

* Move sources that are always depended on by electron,
  starting with security_state_tab_helper.{cc|h}
* Add //component/strings to pak for devtools security tab

* fix: allow specifying type of the added filesystem.

https://chromium-review.googlesource.com/c/chromium/src/+/729250

* fix: do not index excluded folders

https://chromium-review.googlesource.com/c/chromium/src/+/972579
2018-09-12 08:45:08 -05:00
Milan Burda
0821edc843 refactor: cleanup web-frame-init.js (#14516)
* refactor: add error-utils.js

* fix exception handling for asyncWebFrameMethods

* remove dead code

* handle exceptions

* rename rehydratedError to deserializedError

* Revert "handle exceptions"

This reverts commit 396b179948b137f9e525e9ebba4f7c6e9bf19429.
2018-09-11 19:56:00 +10:00
Jeremy Apthorp
72526927d9 build: remove gyp build files (#14097)
* build: remove gyp build files

* docs: update build instructions

* build: temporary restore electron.gyp

* build: do not update Electron version in the electron.gyp

* chore: remove unused submodules

* ci: remove obsolete CI scripts and configs

* chore: remove obsolete scripts

* chore: remove obsolete functions from lib/util.py

* ci: send Slack notification for nightly build results
2018-09-09 10:15:32 +09:00