Commit graph

690 commits

Author SHA1 Message Date
Robo
edd5c4b9bb fix: use OS process handle to clear object registry (#14324)
RenderProcessHost switch can happen between ipc calls when
speculative process are invvolved, which will lead to deletion
of entries on current context. Use OS process handles to
uniquely associate a destruction handler for a render process.
2018-08-28 13:32:46 -05:00
Milan Burda
2a253c73db refactor: use std::string instead of base::string16 for IPC channel names (ipcRenderer.sendTo) (#14302) 2018-08-24 15:30:10 -07:00
Milan Burda
c23e7fa101 refactor: implement ipcRenderer.sendTo in native code for better performance (#14285) 2018-08-24 14:14:39 -07:00
Milan Burda
e6e3ccfc50 refactor: use std::string instead of base::string16 for IPC channel names (#14286) 2018-08-24 10:30:37 -05:00
Milan Burda
fc85d02786 feat: expose missing process APIs in sandboxed renderers (#13505) 2018-08-21 11:05:45 -07:00
Cheng Zhao
dd5b8769be fix: use OOPIF for webview tag (#13869)
* fix: use OOIF for webview tag

* fix: do not call GetNativeView for webview

* fix: OOIPF webview's WebContents is managed by embedder frame

* fix: guest view can not be focused

* fix: clear zoom controller when guest is destroyed

* fix: implement the webview resize event

The webview is no longer a browser plugin with the resize event, use
ResizeObserver instead.

* test: disable failed tests due to OOPIF webview

* fix: embedder can be destroyed earlier than guest

This happens when embedder is manually destroyed.

* fix: don't double attach

* fix: recreate iframe when webview is reattached

* fix: resize event may happen very early

* test: some tests are working after OOPIF webview

* chore: remove unused browser plugin webview code

* fix: get embedder via closure

When the "destroyed" event is emitted, the entry in guestInstances would be
cleared.

* chore: rename browserPluginNode to internalElement

* test: make the visibilityState test more robust

* chore: guestinstance can not work with OOPIF webview

* fix: element could be detached before got response from browser
2018-08-16 15:57:40 -07:00
Milan Burda
702cc84bd3 Don't pass preloadPath via ELECTRON_BROWSER_SANDBOX_LOAD for security reasons (#13031) 2018-08-10 17:19:49 -05:00
Shelley Vohr
9f328abe19 refactor: remove instances of createDeepCopy (#13703)
* add new native_mate converters for base::Value

* fix converter swapping

* remove createDeepCopy from browser/api

* replace missing ListValue converter

* convert bulk of remaining createDeepCopy instances

* convert last remaining instances of createDeepCopy

* incremental progress and helper methods for value conversion

* convert Get and add template function for GetString

* final DictionaryValue method conversions

* remove usage of base::DictionaryValue in web_contents_preferences

* use IsEnabled helper where possible

* Update atom_api_web_view_manager.cc
2018-08-04 07:23:07 +10:00
Milan Burda
db38c8b620 Fix process.execPath returning parent process path instead of the helper in sandboxed renderer (#13839) 2018-07-30 11:13:42 +10:00
Cheng Zhao
ce4e05b85a
fix: pass scrollBounce by command line flag (#13812)
Implement the scrollBounce option by reading the command line flag in
`RenderThreadImpl::IsElasticOverscrollEnabled`, there is no more need
to set NSScrollViewRubberbanding.
2018-07-26 18:38:37 +09:00
Cheng Zhao
3094f62f0b
fix: use webContentsId with contextId together (#13749)
After after using `processId-contextCounter` as contextId, it may happen
that contexts in different WebContents sharing the same renderer process
get the same contextId. Using webContentsId as part of key in
ObjectsRegistry can fix this.
2018-07-24 16:21:38 +09:00
Cheng Zhao
e2029435c4 fix: use context counter as contextId
For sandboxed renderer it may not have a node::Environment in the context,
using a increasing counter as contextId works for all cases.
2018-07-19 11:00:10 -07:00
PalmerAL
ffc15e02a6 fix: add native function to create preload script (#13032)
* add native function to create preload script

* add tests

* fix formatting

* fix tests

* rerun CI
2018-07-13 11:17:11 +09:00
Jeremy Apthorp
bdceea6aca fix: enable spell checking, which broke in upgrade to ch66
Chromium commit [03563dd163][1] changed the way that the
spellcheck-enabled status was checked, defaulting to false.

Added the first (!) test for spellchecking, too.

Fixes #13608.

[1]: 03563dd163
2018-07-11 10:27:56 -07:00
Hari Juturu
eb223f8bc3 Enable webview in sandbox renderer (#13435)
* Enable webview in sandbox renderer
Security: Inherit embedder prefs onto webview

* cache lastwebprefs
2018-07-03 02:06:26 +10:00
deepak1556
5e2406081e build: move pepper flash behind feature flag 2018-06-21 17:02:12 +05:30
Milan Burda
28fd571d0c refactoring: use std::make_unique<T> (#13245) 2018-06-18 16:32:55 +09:00
Thiago de Arruda
6ff111a141 perf: don't use JSON to send the result of ipcRenderer.sendSync. (#8953)
* Don't use JSON to send the result of `ipcRenderer.sendSync`.

- Change the return type of AtomViewHostMsg_Message_Sync from `base::string16`
  to `base::ListValue`
- Adjust lib/browser/api/web-contents.js and /lib/renderer/api/ipc-renderer.js
  to wrap/unwrap return values to/from array, instead of
  serializing/deserializing JSON.

This change can greatly improve `ipcRenderer.sendSync` calls where the return
value contains Buffer instances, because those are converted to Array before
being serialized to JSON(which has no efficient way of representing byte
arrays).

A simple benchmark where remote.require('fs') was used to read a 16mb file got
at least 5x faster, not to mention it used a lot less memory.  This difference
tends increases with larger buffers.

* Don't base64 encode Buffers

* Don't allocate V8ValueConverter on the heap

* Replace hidden global.sandbox with NodeBindings::IsInitialized()

* Refactoring: check NodeBindings::IsInitialized() in V8ValueConverter

* Refactor problematic test to make it more reliable

* Add tests for NaN and Infinity
2018-06-13 17:38:31 +10:00
Milan Burda
6ad0a22602 Add process.getHeapStatistics() (#13183) 2018-06-10 22:00:36 +10:00
Charles Kerr
b89fe86fa1
Merge pull request #13050 from electron/3.0.0-deprecations
chore: removal of 3.0.0 deprecations
2018-05-30 09:25:36 +02:00
Milan Burda
45e78728bd chore: move more constants to options_switches.h/cc (#13093)
* Add options::kNativeWindowOpen

* Add options::kSandbox

* Add options::kPlugins

* Add options::kWebSecurity

* Add options::kAllowRunningInsecureContent

* Add options::kOffscreen
2018-05-29 03:09:51 -05:00
Shelley Vohr
94e825378c
remove webFrame.registerURLSchemeAsSecure() deprecation 2018-05-23 09:33:57 -07:00
Milan Burda
2337237d58 Refactoring: use C++11 class member variable initialization 2018-05-22 00:18:38 +02:00
Jeremy Apthorp
73ac019882 Fix up #includes to work with both GYP and GN 2018-05-10 13:38:40 -07:00
Jeremy Apthorp
118da36b52 Send document-start/end to the right context when contextIsolation=true (#12738) 2018-05-04 23:39:54 -07:00
Jeremy Apthorp
78ab97ab04 Fix crash when releasing a script context that never had node injected (#12741) 2018-05-01 20:00:46 -04:00
bughit
4fcd178c36 expose WebFrame#routingId (#12614)
* expose WebFrame#routingId and pass it to WebContents frame specific events along with frameProcessId; add WebContets.did-start-navigation event
* fix compilation error on ia32 Windows
2018-04-26 19:17:55 +09:00
Robo
ff571f3b5d Part I: Move from base::Bind to base::BindOnce and remove unneeded base::Passed (#12661) 2018-04-20 19:55:05 +09:00
Jeremy Apthorp
f1587da480 [chromium-style] out-of-line default constructors and destructors 2018-04-19 11:12:58 -07:00
Jeremy Apthorp
e6695cf2ec [chromium-style] override / virtual warnings 2018-04-19 11:12:10 -07:00
Jeremy Apthorp
a635f078c6 [chromium-style] auto variable type must not deduce to a raw pointer type 2018-04-19 11:10:52 -07:00
Shelley Vohr
c6f4bbd143
also format missing .cc files 2018-04-18 20:48:45 -04:00
Shelley Vohr
53bdf22c85
clang-format atom files 2018-04-18 20:48:45 -04:00
Robo
ad2baccefa tools: pass custom template for js2c (#12593)
* Update node v9.7.0 ref

* tools: pass custom template to node/tools/js2c.py
2018-04-13 08:20:04 -04:00
Shelley Vohr
d722008367
remove unnecessary ptr_util.h include 2018-04-12 22:34:26 -04:00
Shelley Vohr
b05932310b
replace base::MakeUnique with std::make_unique 2018-04-12 08:48:32 -04:00
OJ Kwon
4c51c03779 feat(performspellcheck): queue spell check request asynchronously (#12112)
* feat(spellcheckrequest): implement spellcheckrequest

* feat(performspellcheck): queue spell check request asynchronously
2018-04-09 15:18:50 +09:00
Cheng Zhao
c75dd93b92
Move AutofillPopup from NativeWindow to WebContents (#12514) 2018-04-05 09:53:51 +09:00
Jeremy Apthorp
a7352e57d5 WebFrame.setVisualZoomLevelLimits sets user-agent scale constraints (#12488)
Fixes #11216.
2018-04-02 18:20:13 -04:00
Nitish Sakhawalkar
9d1527b1df Fix context menu for sandbox devtools (#11933) 2018-03-22 16:15:57 +09:00
deepak1556
4b39d17e5f move pdf viewer behind feature flag 2018-03-20 10:13:17 +03:00
Cheng Zhao
94fce43ed9 Emit document-start for the correct env
This fixes the crash in RunScriptsAtDocumentStart when "affinity" option
is specified. Previously we were assuming only one main frame exists in
the renderer process, but the "affinity" option breaks this option.

There is also a bug that "node::Environment::GetCurrent" does not return
nullptr for context without a env in it, I'm not sure whether it is a
bug of Node or V8.
2018-03-20 10:13:17 +03:00
deepak1556
b08d086b0f fix stale rebase 2018-03-20 10:13:16 +03:00
deepak1556
719980a948 REVIEW: remove device emulation ipc dependecny on rvh 2018-03-20 10:13:15 +03:00
deepak1556
5684f8886f REVIEW: move ipc use from rvh to rfh 2018-03-20 10:13:15 +03:00
Samuel Attard
f80b328937 WebExceptionCode has been removed 2018-03-20 10:13:14 +03:00
deepak1556
2bf1131dab add NOLINT rule for include order in renderer_client_base 2018-03-09 15:19:07 +05:30
deepak1556
3cfe66e4c3 move ipc use from rvh to rfh 2018-03-09 15:01:09 +05:30
Charles Kerr
0d12fc3033 Make the linter happy 2018-03-09 17:03:00 +09:00
Samuel Attard
a9dcce82ed Ensure that a document has been created before sending IPC messages
* Reverts 370476c4af in favor of moving the previous logic to the new RenderFrameObserver instead of RenderViewObserver

Fixes #12045
2018-03-09 14:24:56 +11:00