New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(powerMonitor): expose interface to query system idle state #11807

Merged
merged 5 commits into from Mar 14, 2018

Conversation

Projects
None yet
9 participants
@kwonoj
Member

kwonoj commented Feb 1, 2018

This PR intend to expose 2 static method to powerMonitor - querySystemIdleState and querySystemIdleTime. As interface name stands for, both allows to query system's idle status.

There are handful of users need this features (including old backlog issue like #1528), and most cases user relies on native modules (https://www.npmjs.com/package/@paulcbetts/system-idle-time / https://www.npmjs.com/package/desktop-idle, etcs). This PR exposes interface to chromium's implementation removes need of custom native module.

QuerySystemIdleState(idleThreshold: number, 
                          (state: 'active' | 'idle' | 'locked' | 'unknown') => void): void

accepts non-negative number as a threshold in seconds to be considered as system idle, notify callback with current state. Callback can be resolved synchronously or either asynchronously, depends on platform support. Among state, locked state is only available if platform support to return it.

QuerySystemIdleTime((idleTime:number) => void): void

notifys callback with system idle time in seconds.

@kwonoj kwonoj requested review from electron/docs as code owners Feb 1, 2018

@kwonoj

This comment has been minimized.

Show comment
Hide comment
@kwonoj

kwonoj Feb 1, 2018

Member

I am cc'ing @felixrieseberg here as well for the interested party.

Member

kwonoj commented Feb 1, 2018

I am cc'ing @felixrieseberg here as well for the interested party.

@felixrieseberg

This comment has been minimized.

Show comment
Hide comment
@felixrieseberg

felixrieseberg Feb 1, 2018

Member

Neat! I love re-using Chromium's well-crafted code. I'm not sure about BrowserWindow though - how do you feel about adding the API to shell instead?

Member

felixrieseberg commented Feb 1, 2018

Neat! I love re-using Chromium's well-crafted code. I'm not sure about BrowserWindow though - how do you feel about adding the API to shell instead?

@kwonoj

This comment has been minimized.

Show comment
Hide comment
@kwonoj

kwonoj Feb 1, 2018

Member

I'm not sure about BrowserWindow though - how do you feel about adding the API to shell instead?

Good point, this is probably me not very well knowledgeable structure of electron. Let me try.

Member

kwonoj commented Feb 1, 2018

I'm not sure about BrowserWindow though - how do you feel about adding the API to shell instead?

Good point, this is probably me not very well knowledgeable structure of electron. Let me try.

@kwonoj kwonoj changed the title from feat(BrowserWindow): expose interface to query system idle state to feat(shell): expose interface to query system idle state Feb 1, 2018

@kwonoj

This comment has been minimized.

Show comment
Hide comment
@kwonoj

kwonoj Feb 1, 2018

Member

@felixrieseberg PR updated per suggestion, now interface is expoed via shell module.

Member

kwonoj commented Feb 1, 2018

@felixrieseberg PR updated per suggestion, now interface is expoed via shell module.

@deepak1556

I am not sure about adding it to the shell module when we have a powerMonitor module.

Show outdated Hide outdated atom/common/api/atom_api_shell.cc
@kwonoj

This comment has been minimized.

Show comment
Hide comment
@kwonoj

kwonoj Feb 1, 2018

Member

I'm fine to pick anywhere to expose this. @deepak1556 Is suggestion moving this interface to powerMonitor or somewhere else? if it's else, where would be? and @felixrieseberg , what do you think?

Member

kwonoj commented Feb 1, 2018

I'm fine to pick anywhere to expose this. @deepak1556 Is suggestion moving this interface to powerMonitor or somewhere else? if it's else, where would be? and @felixrieseberg , what do you think?

@deepak1556

This comment has been minimized.

Show comment
Hide comment
@deepak1556

deepak1556 Feb 1, 2018

Member

There isn't a strong argument for choosing between powerMonitor or shell. I will incline to what @felixrieseberg and other maintainers decides on this.

Member

deepak1556 commented Feb 1, 2018

There isn't a strong argument for choosing between powerMonitor or shell. I will incline to what @felixrieseberg and other maintainers decides on this.

@felixrieseberg

This comment has been minimized.

Show comment
Hide comment
@felixrieseberg

felixrieseberg Feb 1, 2018

Member

Nah, you're right, powerMonitor is probably better.

Member

felixrieseberg commented Feb 1, 2018

Nah, you're right, powerMonitor is probably better.

@kwonoj kwonoj changed the title from feat(shell): expose interface to query system idle state to feat(powerMonitor): expose interface to query system idle state Feb 2, 2018

@kwonoj

This comment has been minimized.

Show comment
Hide comment
@kwonoj

kwonoj Feb 2, 2018

Member

@deepak1556 @felixrieseberg now interface moved into powerMonitor'. it's class method, but I thought it's fine as powerMonitor binded into instance of class. Let me know if things need to be updated.

Member

kwonoj commented Feb 2, 2018

@deepak1556 @felixrieseberg now interface moved into powerMonitor'. it's class method, but I thought it's fine as powerMonitor binded into instance of class. Let me know if things need to be updated.

Show outdated Hide outdated atom/browser/api/atom_api_power_monitor.cc
Show outdated Hide outdated docs/api/power-monitor.md
Show outdated Hide outdated docs/api/power-monitor.md
Show outdated Hide outdated docs/api/power-monitor.md
Show outdated Hide outdated docs/api/power-monitor.md
Show outdated Hide outdated docs/api/power-monitor.md
Show outdated Hide outdated docs/api/power-monitor.md
Show outdated Hide outdated docs/api/power-monitor.md
@kwonoj

This comment has been minimized.

Show comment
Hide comment
@kwonoj

kwonoj Feb 2, 2018

Member

PR updated & fixed mistakes per comment / suggestion.

Member

kwonoj commented Feb 2, 2018

PR updated & fixed mistakes per comment / suggestion.

@deepak1556

Current specs of PowerMonitor run only on linux, we need to enable the tests for these new apis on all three platforms.

@kwonoj

This comment has been minimized.

Show comment
Hide comment
@kwonoj

kwonoj Feb 2, 2018

Member

Noticed that - what's best way? Is it allowed to instantiate powermonitor without dbus mock? (New interface won't nees those mock anyway)

Member

kwonoj commented Feb 2, 2018

Noticed that - what's best way? Is it allowed to instantiate powermonitor without dbus mock? (New interface won't nees those mock anyway)

@deepak1556

This comment has been minimized.

Show comment
Hide comment
@deepak1556

deepak1556 Feb 2, 2018

Member

Not having to lazily initialize the powerMonitor module should allow enabling these test cases along side the existing dbus specs for linux.

Member

deepak1556 commented Feb 2, 2018

Not having to lazily initialize the powerMonitor module should allow enabling these test cases along side the existing dbus specs for linux.

@deepak1556

This comment has been minimized.

Show comment
Hide comment
@deepak1556

deepak1556 Feb 2, 2018

Member

Can remove the call to base::PowerMonitorDeviceSource::AllocateSystemIOPorts, its already initialized for the main process by the content layer https://cs.chromium.org/chromium/src/content/app/content_main_runner.cc?type=cs&q=AllocateSystemIOPorts&l=582

Member

deepak1556 commented Feb 2, 2018

Can remove the call to base::PowerMonitorDeviceSource::AllocateSystemIOPorts, its already initialized for the main process by the content layer https://cs.chromium.org/chromium/src/content/app/content_main_runner.cc?type=cs&q=AllocateSystemIOPorts&l=582

@@ -41,7 +43,7 @@ const skip = process.platform !== 'linux' || !process.env.DBUS_SYSTEM_BUS_ADDRES
before((done) => {
logindMock.on('MethodCalled', onceMethodCalled(done))
// lazy load powerMonitor after we listen to MethodCalled mock signal
powerMonitor = require('electron').remote.powerMonitor
dbusMockPowerMonitor = require('electron').remote.powerMonitor

This comment has been minimized.

@deepak1556

deepak1556 Feb 2, 2018

Member

@tarruda Is it required to lazy initialize the module ? I was hoping we can just initialize the module only once for all the specs here.

@deepak1556

deepak1556 Feb 2, 2018

Member

@tarruda Is it required to lazy initialize the module ? I was hoping we can just initialize the module only once for all the specs here.

This comment has been minimized.

@tarruda

tarruda Feb 2, 2018

Contributor

It has to be lazy loaded if we want to verify that electron inhibits the system suspend (it does this by calling a method via dbus).

@tarruda

tarruda Feb 2, 2018

Contributor

It has to be lazy loaded if we want to verify that electron inhibits the system suspend (it does this by calling a method via dbus).

@ckerr

Mostly LGTM, nice idea && thanks for the PR. 👍

A couple of questions and suggestions inline

int idle_threshold,
const ui::IdleCallback& callback);
void QuerySystemIdleTime(const ui::IdleTimeCallback& callback);

This comment has been minimized.

@ckerr

ckerr Feb 2, 2018

Member

Let's make these methods private since we're only using them with the bindings. Permissions can be loosened later as needed

@ckerr

ckerr Feb 2, 2018

Member

Let's make these methods private since we're only using them with the bindings. Permissions can be loosened later as needed

This comment has been minimized.

@kwonoj

kwonoj Feb 2, 2018

Member

makes sense, moved it.

@kwonoj

kwonoj Feb 2, 2018

Member

makes sense, moved it.

} else {
isolate->ThrowException(v8::Exception::TypeError(
mate::StringToV8(isolate,
"Invalid idle threshold, must be greater than 0")));

This comment has been minimized.

@ckerr

ckerr Feb 2, 2018

Member

I know another reviewer suggested this, but are we sure that we want this?

Since we're not publishing the ui::CheckIdleStateIsLocked(), if all you want to do is check for system lock it's reasonable to pass a -1 in for idle_threshold.

If we include that method, we can avoid this wart by having a recommended way to test for lock

@ckerr

ckerr Feb 2, 2018

Member

I know another reviewer suggested this, but are we sure that we want this?

Since we're not publishing the ui::CheckIdleStateIsLocked(), if all you want to do is check for system lock it's reasonable to pass a -1 in for idle_threshold.

If we include that method, we can avoid this wart by having a recommended way to test for lock

This comment has been minimized.

@kwonoj

kwonoj Feb 2, 2018

Member

hmm I didn't thought in that way, but also checking lock state is somewhat limited per platform support, so passing -1 doesn't guarantee you can reliable acquire intended state. I think it's rather limit api surface, and expose CheckIdleStateIsLocked separately if there's demand for it.

@kwonoj

kwonoj Feb 2, 2018

Member

hmm I didn't thought in that way, but also checking lock state is somewhat limited per platform support, so passing -1 doesn't guarantee you can reliable acquire intended state. I think it's rather limit api surface, and expose CheckIdleStateIsLocked separately if there's demand for it.

Show outdated Hide outdated docs/api/power-monitor.md
Show outdated Hide outdated docs/api/power-monitor.md
Show outdated Hide outdated atom/browser/api/atom_api_power_monitor.cc
@kwonoj

This comment has been minimized.

Show comment
Hide comment
@kwonoj

kwonoj Feb 9, 2018

Member

I have rebased PR to master and seeing test failures on linux, peeking it some other PR sees as well (i.e https://circleci.com/gh/electron/electron/9330) not sure way to resolve it.

Member

kwonoj commented Feb 9, 2018

I have rebased PR to master and seeing test failures on linux, peeking it some other PR sees as well (i.e https://circleci.com/gh/electron/electron/9330) not sure way to resolve it.

@codebytere

This comment has been minimized.

Show comment
Hide comment
@codebytere

codebytere Feb 9, 2018

Member

@kwonoj it appears these are building in CI under your own name and not the electron org's, so we don't have the ability to restart them; often they flake so try restarting the failures yourself and see what happens

Member

codebytere commented Feb 9, 2018

@kwonoj it appears these are building in CI under your own name and not the electron org's, so we don't have the ability to restart them; often they flake so try restarting the failures yourself and see what happens

@kwonoj

This comment has been minimized.

Show comment
Hide comment
@kwonoj

kwonoj Feb 9, 2018

Member

Bit unsure why fork CI setup reports status to PR itself. I've retriggered couple of times already, but did one more time.

Member

kwonoj commented Feb 9, 2018

Bit unsure why fork CI setup reports status to PR itself. I've retriggered couple of times already, but did one more time.

@kwonoj

This comment has been minimized.

Show comment
Hide comment
@kwonoj

kwonoj Feb 9, 2018

Member

@codebytere stopping my circleci config makes status notification correctly goes for electron's, but doesn't seem like build failure resolves by retriggering it.

Member

kwonoj commented Feb 9, 2018

@codebytere stopping my circleci config makes status notification correctly goes for electron's, but doesn't seem like build failure resolves by retriggering it.

@felixrieseberg

This comment has been minimized.

Show comment
Hide comment
@felixrieseberg

felixrieseberg Feb 12, 2018

Member

@ckerr What do you think? Anything else OJ could do here to make it mergable?

Member

felixrieseberg commented Feb 12, 2018

@ckerr What do you think? Anything else OJ could do here to make it mergable?

@MarshallOfSound

Loving this 👍

Just need to rebase changes onto current master so that arm64 builds don't blow up 👍

@MarshallOfSound

This comment has been minimized.

Show comment
Hide comment
@MarshallOfSound

MarshallOfSound Mar 14, 2018

Member

To be clear for whoever merges this in the future as well, this does not get backported, new versioning scheme means that this will go out in 2.1.x or 3.0.x, we don't backport features 👍

Member

MarshallOfSound commented Mar 14, 2018

To be clear for whoever merges this in the future as well, this does not get backported, new versioning scheme means that this will go out in 2.1.x or 3.0.x, we don't backport features 👍

kwonoj added some commits Feb 1, 2018

@ckerr

ckerr approved these changes Mar 14, 2018

Apologies for not getting back to this sooner. Yes 👍 for landing this in master.

It would also make sense in the 2.x series when we open it back up to new nonbreaking features.

@ckerr ckerr merged commit e7181eb into electron:master Mar 14, 2018

10 checks passed

WIP ready for review
Details
ci/circleci: electron-linux-arm Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm-test Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm64 Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm64-test Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-ia32 Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-x64 Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
jenkins: arm64/pr-head This commit looks good
Details
jenkins: macOS/pr-head This commit looks good
Details

@kwonoj kwonoj deleted the kwonoj:feat-idle-time branch Mar 14, 2018

dakeshi added a commit to dakeshi/electron that referenced this pull request Apr 12, 2018

sync with upstream (#1)
* Use content origin in screen coordinates for calculating popup menu position (#12180)

* Print detailed error for serviceWorker test (#12186)

* Enable more debug info for electron-linux-ia32

* Newer CI images (#12188)

* Bump electronbuilds/electron* versions

The linux-appname branch has been gathering dust for awhile.
Some of the versions in `master` are higher, and some of the
versions in `linux-appname` are higher to add libnotify.

This commit takes the higher of the two numbers in each case.

* Add libnotify to the Dockerfiles

* Ensure that a document has been created before sending IPC messages

* Reverts 370476c in favor of moving the previous logic to the new RenderFrameObserver instead of RenderViewObserver

Fixes #12045

* Skip client-certificate test for Linux (#12189)

* update node ref to electron-node-v9.7.0

* OPENSSL_PRODUCT => openssl_product

* node => node_lib and V8_BASE => v8_base

* update node::Environment::TickInfo calls

* build node target for <(node_lib_target_name)

* clean node ref and remove short circuit

* update node ref fixing crash with buffer allocation

* Use InternalCallbackScope for ticking event loop

* When a render process is crashed, it might be reused

* Enter context scope before InternalCallbackScope

* Make the linter happy

* move ipc use from rvh to rfh

* add NOLINT rule for include order in renderer_client_base

* Fixed Mac build when enable_run_as_node==false

* Fixed passing of exception to the system crash handler

* remove process preference lock from AtomBrowserClient (#12194)

* Add heading for README

* Make link to related guide/tutorial more obvious (#12204)

It's generally not a good practice to just link the word "here"

* Linux named notifications (#12192)

* Set name & desktop-entry on Linux notifications

* DBusMock now honors verbose mode flag

* Disable DBus Notification tests on ia32

* Fix desktop-id notification edge case (#12216)

* Fix desktop-id notification edge case

* Extract-method platform_util::GetDesktopName()

This removes duplicated code from libnotify_notifications.cc
and atom/common/linux/application_info.cc.

* Check for empty case in GetDesktopName().

* Move GetDesktopName() to brightray::util

* Remove unnecessary changes in platform_util

* Add a brightray::platform_util namespace

* Parent's visibility trumps inherited 'show' option

* fix: Incorrect warnings in webviews (#12234)

* 🔧 Get correct webContents

* 🔧 Err, webPreferences

* Add tests

* Remove unnecessary work when merging options

* Use idiomatic ES6 when merging options

* Add config for trop (backporting bot) (#12238)

* add config for trop

* backportWhitelist => authorizedUsers

* Apply further ES6 bikeshedding

* spec: isolate sw file scheme spec storage with temp partition

* 🔧 Sort crashes

* Fix broken links (#12232)

* Update system-preferences.md

* Fix broken documentation links.

* 🔧 Actually test the method

* 🔪 Cut typo

* 👷 Fancy test

* 👷 Tests, how do they work

* 🔧 Linter's gotta lint

* fix crash when using getWebPreferences api with devtools webContents (#12254)

* Exposing process.env status (#12166)

* Enable easy rebuild of native modules for unreleased electron (#12217)

* Enable easy rebuild of native modules for unreleased electron

Sometimes when developing locally (as I found this morning) you want to rebuild native modules
against an unreleased version of Electron (in this case local master).  This PR adds a simple
script to launch a local HTTP server that generates and hosts the required header and checksum
files to rebuild modules.  So far only tested on macOS but should work on all OS's

* Allow custom port

* clean up serve script

* make optionality more obvious

* add missing report.length > 1 assertion (#12257)

* feat(powerMonitor): expose interface to query system idle state (#11807)

* feat(BrowserWindow): expose interface to query system idle state

* test(BrowserWindow): update test cases for querySystemIdle interface

* docs(BrowserWindow): add querySystemIdle interface documentation

* refactor(powerMonitor): move querySystemIdle into powerMonitor

* test(powerMonitor): split test cases for all platform

* fix remote setInterval flake (#12263)

* Change Contact Emails (#12278)

* Fix require on network share path (#12282)

* first pass at server/network require fix

* refactor for clarity

* Fixes electron/electron#12147 (#12193)

* Set appropriate defaults for webview options (#12271)

* Persist defaults to webPreferences object to JS land can read the inferred values instead of just user defined values

* Test inherited default propogation

* Refactor to remove coupling from fetching values and defaults

* Test description type

* Fix up tests

* Document BrowserView.{destroy,isDestroyed} (#12274)

* Revert "Fixes electron/electron#12147" (#12293)

* Revert "Set appropriate defaults for webview options (#12271)"

This reverts commit c2673aa.

* Revert "Fixes electron/electron#12147 (#12193)"

This reverts commit f54c94d.

* Fix AttributeError: 'dict' object has no attribute 'required'

* 🔧 Fix security warning (#12309)

* Update example code (#12315)

path and url needed to be require'd

* Delete .node-version (#12304)

This removes the .node-version file, it is a source of confusion and not incredibly useful.

It doesn't actually indicate the version of node that Electron uses, it's like a development helper that sets the version of node you should be using locally when devving on Electron.  Not many major tools use it so too remove confusion I think we should remove it

* net: change mime type deduction in Change URLRequestAsarJob (#12319)

* Use same delay-load settings in both debug and release

* Check menu.popup options are an object (#12325)

* check menu.popup options are an object

* Add a spec for menu.popup options check

* remove stray .only

* Better GTK+ Menu color support (#12300)

* Better GTK+ Menu color support

 * Fix 'invisible menu' issue (#12275)

 * Now updates menu text color when focus changes!

 * Better caching of colors when system theme changes

 * Removed all GTK+ deprecation warnings from menubar

* Don't highlight menu text on mouseover in GTK+

* Fix textColor declaration scope error

* Simplify FocusManager connection management a bit

* Make the linter happy

* Decouple MenuBar view recoloring from rebuilding

This way we don't need to rebuild the subview each time a recolor
is needed, e.g. when window focus changes or the system theme changes

* Don't iterate child views if we don't need to

* Move variable declaration outside of a loop

* More efficient iteration of MenuBar children

* Cleaner MenuButton bounds testing

* Fix oops

* Add a nullptr check in MenuBar::GetItemCount()

* Simplify iteration in MenuBar::RebuildChildren()

* Make the linter happy

* Fix signed-unsigned comparison

* Remove declarations of nonexistent methods

* Make SubmenuButton accessor const

* Cleaner accelerator iteration

* Windows fixes

* Fix non-draggable regions on macOS (#12327)

This was a regression in 503b0ba.

* Update CI to use Node 8

* Fix nil tray title crash (#12352)

* Add check for title_ being nil

* remove print stub

* Store InspectableWebContents instead of InspectableWebContentsView in NativeBrowserView

* Rename system_drag_exclude_areas => drag_exclude_rects

* Use NSView convertRect:toView: for BrowserView DragRegionView positioning

* Make BrowserView DragRegionViews children of the WebContents view

Previously they were children of the `InspectableWebContentsView` view,
which caused this assertion to fail:

https://github.com/electron/electron/blob/f9938884248627335c59da6b3b0ff0dc7df3b258/brightray/browser/mac/bry_inspectable_web_contents_view.mm#L162

* Update draggable regions when changing BrowserView

Fixes #12150.

* Remove the race condition between new process creation and context release (#12342)

* Remove the race condition between new process creation and old process releasing remote context

Previously there was a race condition where the getId() method would return the new context ID even
though the release was for the old context.  This changes it to send the "initial" context ID with
the release message to ensure there is no race.

* fetch context ID from remote in sandbox mode

* Use libcc with Chromium 63

* Update clang revision to match Chromium 63.0.3239.70

* Update Chrome version to 63.0.3239.84

* trackable_object has moved to base namespace

* HandleCommand now takes session_id and returns success boolean.  It is assumed a nullptr from the handler means failure

* TracingController -> Coordinator -- content tracing now uses 'endpoints' instead of 'sinks'

* AllowCertificateError no longer sends overridable

* WebContentsObserver no longer provides explicit_set, we can calculate it

* make_scoped_refptr --> WrapRefCounted

* BlockingPool has been removed

* v8 proxy service has been removed

* Fix system proxy config resolver constructor

* WebContents are no longer IPC Sender's

* Move proxy constructor to ProxyService namespace

* DialogClosedCallback are not const references anymore

* Calling non-const callbacks requires some tricks

* GetBlockingPool has been removed

* Implement GetBackgroundFetchDelegate in brightray::BrowserContext

* experimental_webgl_enabled is not supported, now use webgl1/2_enabled

* tracked_objects::Location --> base::Location

* PrintedPageSource has been removed

* GetRenderProcessHost() has been removed for OOPI support, should use #include GetMainFrame()->GetProcess()

* Convert optional webpoint

* Add support for size 64 skbitmap operations

* WebExceptionCode has been removed

* Update libcc

* Add new includes for leveldb and webrtc

* IPC fixes for WebContents

* Fix super fast hash and blocking pool

* Update Node.js submodule to fix a compilation error

* Move SoftwareOutputDevice to the viz service display compositor.

https://chromium-review.googlesource.com/677463

* Move CompositorFrame{Metadata} to viz/common/quads.

https://chromium-review.googlesource.com/676726

* Move ReleaseCallbacks and CopyOutputRequests out of quads/

https://chromium-review.googlesource.com/682760

* Move DrawQuads to components/viz/

https://chromium-review.googlesource.com/667539

* FIXME: Disable OSR by default

* Disable tautological check for chromium code

* Pickle write methods now return void and use GE_CHECK instead

* Fix WorkerPool and IPC send inside print job/manager

* Update chrome version

* Fix webrtc linking issues

* Temporarily disable OnCursorChange

ScopedProfile is removed
https://chromium-review.googlesource.com/c/chromium/src/+/655147

* FIXME: Disable some tests to avoid crashes

* REVIEW: Re-use devtools network throttling from content layer
https://chromium-review.googlesource.com/c/chromium/src/+/664356

* FIXME: Disbale browser side navigation aka PlzNavigate

* Update crashpad to match Chromium 63.0.3239.108

* Use XDG_CURRENT_DESKTOP to determine if the desktop environment is Unity

https://chromium-review.googlesource.com/682615

* re-use title information from NavigationEntry

* add taskpriority when creating sequences task runners

* REVIEW: move ipc use from rvh to rfh

* REVIEW: remove device emulation ipc dependecny on rvh

* FIXME: re-enable guest webcontents based on OOPIF feature

* FIXME: Disable node crypto spec

* Update Chrome version

* Unity detection now works in all OSes - returns false.

* rtc_base_approved renamed to generic

* Fix build by adding define in node_includes.h

* Fix warnings when building node

* Fix warning when building openssl-cli

* Fix cpplint warning

* CertificateList => ScopedCERTCertificateList

* Use lld for linking on both Debug/Release builds

This follows Chromium's config, otherwise we get linking error:
/usr/bin/ld: shared_library/libmirclient.so.9: __cxa_finalize: invalid needed version 2
shared_library/libmirclient.so.9: error adding symbols: Bad value

* Linker behaves differently on arm

* Chromium 63 - upgrade to Node v9.7.0 (#12219)

* OPENSSL_PRODUCT => openssl_product

* node => node_lib and V8_BASE => v8_base

* build node target for <(node_lib_target_name)

* update node ref

* update node::Environment::TickInfo calls

* update node ref

* Use InternalCallbackScope for ticking event loop

* enter context scope before InternalCallbackScope

* don't lint v8 platform header

* fix stale rebase

* v8-platform header is not required explicitly

* Fix build error caused by base::Passed changes

* update libcc ref to disable ScriptForbuddenScope check

* Fix webview resize test

* update node ref to fix --typed_array_max_size_in_heap error

* Build with Visual Studio 2017

* Enable node crypto spec

* Avoid using deprecated skia size methods

* Simplify transparent backgrounds

https://chromium-review.googlesource.com/669646

* Tab Capture in VIZ: CopyOutputRequest/Result API changes.

https://chromium-review.googlesource.com/637003

* Fix Windows linking error

* Use visual studio 17 image

* Add whole appveyor config

* Drop clone folder

* debug build issues

* spec: Do not assume en-US locale to be the current

* Fix release build on Windows

* REVIEW: ContentBrowserClient now provides geolocation api key and request context

* AccessTokenStore is only needed to initialize network location service

* Use 60 as module version for V8 6.3

* Update chrome_version.h

* 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.

* re-use request context from IOThread

* Update to the latest libcc with Ch63

* move pdf viewer behind feature flag

* add features module to detect availability of build time features at runtime

* FIXME: disable pdf viewer feature

* Remove custom appveyor config

* Fix windows build

* Avoid including web_contents_impl.h

This can fix the build error caused by duplicate typedefs.

* fixes offscreen rendering issues

* fixes class name

* Isolate the code using content::WebContentsImpl

* Ignore warning LNK4199

We are now sharing the /DELAYLOAD settings between configurations.

* add docs/development/README.md (#12373)

* Update 3 (of Visual Studio 2017) is leftover from 2015 (#12372)

does not apply to 2017
it's not clear to me that it's possible to download a non current version of vs2017
but if a specific version is required the directions should explain how to get it

* fix broken fragment link in ipc-main.md (#12389)

* Use the appname as the tray icon's default tooltip (#12388)

This makes an upstream DCHECK happy in AppIndicatorIcon::SetToolTip.
Empty tooltip strings are discouraged, as discussed in commit log
b6c510aa543193337041517c2d70113840189b06.

Fixes #12386.

* don't check darkmode for drawStatusBarBackgroundInRect (#12395)

* now we call ourselves electrocats

* web_prefrences() => dict()

Having property name being the same with class name is making code
harder to understand, and dict is much shorter.

* Add WebContentsPreferences::From that checks parameter

* Remove the static getter methods from WebContentsPreferences

* Hide WebContentPreferences::GetWebContentsFromProcessID from public

* Cleanup the static methods of WebContentsPreferences

The static methods are totally unnecessary, and it makes code harder to
understand since we are using different ways to do the same things.

* Fix error caused by refactor

* Use Clone explicitly instead of MergeDictionary

* Fix context menu for sandbox devtools (#11933)

*  Workspace notifications support on macOS (#12093)

* Do not block main process for async dialog (#12404)

* Increase timeout for inAppPurchase test (#12403)

* Update testing docs to reflect --grep syntax (#12400)

* Update testing docs to reflect --grep syntax

* Use @zeke's suggestion to s/suites/tests/

* Fix documentation tyop (#12422)

* Provide an easy way to use a local build of Electron (#12426)

* Provide an easy way to use a local build of Electron

For instance from ~/projects/electron/out/D

* document ELECTRON_OVERRIDE_DIST_PATH

* Make the linter happy

* Tweak ELECTRON_OVERRIDE_DIST_PATH docs

* s/now/not/ in allowRunningInsecureContent documentation (#12452)

* update doc for setProgressBar (#12428)

* update doc for setProgressBar

The linter was unable to get `paused` as a possible value for `mode`

* update doc for setProgressBar

Addressing PR feedback

* re-enable null check against menu item accelerators (#12449)

* Use latest libcc (#12476)

* Cleanup destruction of URLRequestContextGetter (#12305)

- Add Leak detector
 - Indicate shutdown of request context from Browser Context
 - Change stored references to URLRequestContextGetter to use BrowserContext
 - Destroy session properties explicitly

* Support for navigator.languages (#12419)

* WebFrame.setVisualZoomLevelLimits sets user-agent scale constraints (#12488)

Fixes #11216.

* Handle in-app-purchase less fatally on non-Darwin (#12511)

Fixes #12311

Right now it throws a new error when the file is even require()d, but this isn't ideal as there are cases where everything is mass-required, such as Spectron. Instead, we should throw an error on non-Darwin environments only when the IAP methods are invoked.

* Refactor NativeWindow (Part 3):  Remove is_offscreen_dummy from NativeWindow (#12503)

* Don't use is_offscreen_dummy in MessageBox

* Don't use is_offscreen_dummy in DownloadManagerDelegate

* Don't use is_offscreen_dummy in CommonWebContentsDelegate

* Remove is_offscreen_dummy from NativeWindow

* add IDL and Mojo to glossary (#12504)

* add moveTop API to move window z-oder to top for win32, mac (#12485)

* add moveTop API to move window z-oder to top for win32, mac

* BrowserWindow::MoveTop SetMethod bug fix

* Expose IsOffScreen method always to JS. (#12530)

* Move AutofillPopup from NativeWindow to WebContents (#12514)

* vendor: Update native mate to fix v8 DCHECK crash (#12534)

* update native_mate ref

* Remove MarkHighMemoryUsage api

* Focus webview directly in offscreen mode (#12507)

* Improve in-app purchase for MacOS (#12464)

* Add methods to finish transactions

* Add a method to get the product descriptions from the App Store

* Improve the documentation of a transaction structure

* Add a tutorial for In App Purchase

* Fix typo in In-App Purchase tutorial

* Fix style of In-App Purchase files

* Fix In-App-Purchase product structure conversion in amr64

* Fix code style in In-App Purchase tutorial documentation

* Fix typos in In-App Purchase documentation

* Fix typo in In-App Purchase spec

* Slight style fixes

* Disable chromium's redraw locking on Windows when DWM is disabled (#12501)

* disable redraw locking on windows

* update libcc ref

* Use Visual Studio's vswhere to find Visual Studio, and use proper version numbers to locate (#12537)

* Fixed one minor grammatical issue

Line 93: "principals and methods" -> "principles and methods"

* Propagate referrer to new windows (#12397)

* Propagate referrer to new windows

Fixes #9205

* Rearrange -new-window event arguments for backwards-compatibility

* Plumb referrer policy through guest-window-manager

* Document the Referrer structure and its uses

* Add tests for referrer in new windows

* Docs nits

* Use ui:view's Activate() on Linux (#12539)

In NativeWindowViews, we started rolling our own _NET_ACTIVE_WINDOW
event in June 2016 to raise windows because Chromium's implementation
wasn't working as expected. (See commit 32b692b)

I'm not seeing this behavior in our current version of libcc,
so I wonder if this workaround is still needed?

* Simplify views/menu_bar focus management (#12536)

* Simplify views/menu_bar focus management

* Make the linter happy

* Remove NativeWindowView focus manager listener API

* remove unnecessary change

* MenuBar ctor now takes a views::View

* Enable plznavigate aka browser side navigation (#12535)

* enable plznavigate code path

* AtomBrowserClient::GetGeolocationApiKey returns the right default

* use IsLoadingToDifferentDocument to identify top level navigation in mainFrame

* use candidate site instance when available

* spec: don't test httpReferrer option for file origin

* update libcc ref

* affinity: only group same site in this mode

* plznavigate: don't emit did-get-response-details event for blob scheme

* remove defines from build-libchromiumcontent (#11927)

* Check for devtools in BrowserWindow.getFocusedWindow() (#12526)

* asar: remove patch to support graceful-fs (#12562)

* Add a display_id parameter to the desktopCapturer API. (#12417)

* Add a screen_api_id parameter to the desktopCapturer API.

When using the DirectX capturer on Windows, there was previously no way
to associate desktopCapturer/getUserMedia and electron.screen API
screens. This new parameter provides the association.

* Fix non-Windows build.

* Fix Mac.

* Fix Mac harder.

* JS lint

* clang-format C++ code.

* IWYU

* display_id, Linux comment, better test

* lint

* Fix tests on Linux.

* Add display_id documentation.

* chore(build): support generating compilation db (#12104)

* feat(performspellcheck): queue spell check request asynchronously (#12112)

* feat(spellcheckrequest): implement spellcheckrequest

* feat(performspellcheck): queue spell check request asynchronously

* Show file filter name for accessory view of file dialog

- Respect filters option of dialog.showOpenDialog() and
  dialog.showSaveDialog(). (#10335)
- Show "All Files" for <input> apart from "accept" attribute. (#11456)

* Fix memory leaks in file_dialog_mac.mm

* Mouse forward on macOS (#12281)

* Accept mouse events according to the forward parameter on macOS.

* Update BrowserWindow docs: mouse forward is available on macOS

* Use CircleCI for Mac builds (#12572)

* Fix transparency in capturePage (#12561)

* Fix transparent window capture. Transparency is preserved and not converted to black pixels anymore

* Add test to make sure aplha channel exists in captured image

* web_view_ => content_view_

* Add NativeWindow::SetContentView

* Remove web_contents from NativeWindow's constructor

* mac: Correctly unload previous content view

* kVibrancyType should be read in InitFromOptions

* InstallView is no longer needed

* Fix crash when releasing window

* Enable WebFrame method forwarding in sandboxed renderers (#12538)

* Enable WebFrame method forwarding in sandboxed renderers

Fixes #9073

* Non-change to kick CI

sethlu added a commit to sethlu/electron that referenced this pull request May 3, 2018

feat(powerMonitor): expose interface to query system idle state (#11807)
* feat(BrowserWindow): expose interface to query system idle state

* test(BrowserWindow): update test cases for querySystemIdle interface

* docs(BrowserWindow): add querySystemIdle interface documentation

* refactor(powerMonitor): move querySystemIdle into powerMonitor

* test(powerMonitor): split test cases for all platform

sbannigan added a commit to sbannigan/electron that referenced this pull request May 10, 2018

feat(powerMonitor): expose interface to query system idle state (#11807)
* feat(BrowserWindow): expose interface to query system idle state

* test(BrowserWindow): update test cases for querySystemIdle interface

* docs(BrowserWindow): add querySystemIdle interface documentation

* refactor(powerMonitor): move querySystemIdle into powerMonitor

* test(powerMonitor): split test cases for all platform
@sachetsharma1

This comment has been minimized.

Show comment
Hide comment
@sachetsharma1

sachetsharma1 Jun 5, 2018

Is there any planned release for this feature?

sachetsharma1 commented Jun 5, 2018

Is there any planned release for this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment