summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus/fake_power_manager_client.h
Commit message (Collapse)AuthorAgeFilesLines
* Switch to standard integer types in chromeos/.avi2015-12-211-1/+0
| | | | | | | | | BUG=138542 TBR=zelidrag@chromium.org Review URL: https://codereview.chromium.org/1540803002 Cr-Commit-Position: refs/heads/master@{#366324}
* Make FakePowerManagerClient::policy() return a const ref.derat2015-10-161-1/+1
| | | | | | | | | | | It looks like I accidentally made this accessor return a non-const reference long ago. BUG=none Review URL: https://codereview.chromium.org/1412743002 Cr-Commit-Position: refs/heads/master@{#354566}
* Make PowerManagerClient aware of dual-role USB type-C devices.michaelpg2015-07-271-0/+1
| | | | | | | | BUG=419509 Review URL: https://codereview.chromium.org/1252873010 Cr-Commit-Position: refs/heads/master@{#340554}
* ChromeOs Power Emulation Implmozartalouis2015-07-151-1/+19
| | | | | | | | | | | | BUG=499095 Here is the design doc for those who are wondering exactly what is being done: https://docs.google.com/a/google.com/document/d/1X84nVB9r7Soe2VT2vB16wpE8TqFQ3J5tbkMDFmgVq-k/edit?usp=sharing Review URL: https://codereview.chromium.org/1206733002 Cr-Commit-Position: refs/heads/master@{#338947}
* Replace more ObserverList with base::ObserverList.brettw2015-06-031-1/+1
| | | | | | | | | | | | This is everything but the chrome directory CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel TBR=zelidrag@chromium.org (chromeos) TBR=keybuk@chromium.org (device/bluetooth) Review URL: https://codereview.chromium.org/1162943002 Cr-Commit-Position: refs/heads/master@{#332626}
* Update {virtual,override,final} to follow C++11 style in chromeos/dbus.dcheng2015-01-161-25/+22
| | | | | | | | | | | | | | | | The Google style guide states that only one of {virtual,override,final} should be used for each declaration, since override implies virtual and final implies both virtual and override. This patch was automatically generated with a ChromeOS build using a variation of https://codereview.chromium.org/598073004. BUG=417463 R=hashimoto@chromium.org Review URL: https://codereview.chromium.org/817853005 Cr-Commit-Position: refs/heads/master@{#311851}
* Re-land "chromeos: Add non-extension renderers to the freezer cgroup"chirantan2014-12-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | In preparation for lucid sleep, we will be putting all chrome renderers that do not host GCM extensions into a special freezer cgroup. All processes in this cgroup will be frozen when the system suspends and will not be thawed until the system has fully resumed. The code to freeze and thaw the cgroup has existed for a while. This code actually starts putting processes into the cgroup. Additionally, to deal with potential races that may occur with other suspend observers that interact with renderers, the RendererFreezer is no longer a PowerManagerClient::Observer but is instead a PowerManagerClient::RenderProcessManagerDelegate. This guarantees that the RendererFreezer's suspend related methods will be called only after all observers have reported ready and before observers are notified that the suspend has completed. Any race conditions that still exist now need to be fixed in the observer that is causing it. BUG=364339 Review URL: https://codereview.chromium.org/769413002 Cr-Commit-Position: refs/heads/master@{#306654}
* Revert of Re-land chromeos: Add non-extension renderers to the freezer ↵spang2014-12-011-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cgroup (patchset #3 id:40001 of https://codereview.chromium.org/738993002/) Reason for revert: Crashes (especially on login) BUG=364339, 437962 Original issue's description: > Re-land chromeos: Add non-extension renderers to the freezer cgroup > > In preparation for lucid sleep, we will be putting all chrome renderers > that do not host GCM extensions into a special freezer cgroup. All > processes in this cgroup will be frozen when the system suspends and > will not be thawed until the system has fully resumed. > > The code to freeze and thaw the cgroup has existed for a while. This > code actually starts putting processes into the cgroup. > > Additionally, to deal with potential races that may occur with other > suspend observers that interact with renderers, the RendererFreezer is > no longer a PowerManagerClient::Observer but is instead a > PowerManagerClient::RenderProcessManagerDelegate. This guarantees that > the RendererFreezer's suspend related methods will be called only after > all observers have reported ready and before observers are notified that > the suspend has completed. Any race conditions that still exist now > need to be fixed in the observer that is causing it. > > BUG=364339 > > Committed: https://crrev.com/1a085efa9263279b58d6fd06ba991709d598f796 > Cr-Commit-Position: refs/heads/master@{#304956} TBR=derat@chromium.org,chirantan@chromium.org NOTREECHECKS=true NOTRY=true BUG=364339 Review URL: https://codereview.chromium.org/753313005 Cr-Commit-Position: refs/heads/master@{#306269}
* Re-land chromeos: Add non-extension renderers to the freezer cgroupchirantan2014-11-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | In preparation for lucid sleep, we will be putting all chrome renderers that do not host GCM extensions into a special freezer cgroup. All processes in this cgroup will be frozen when the system suspends and will not be thawed until the system has fully resumed. The code to freeze and thaw the cgroup has existed for a while. This code actually starts putting processes into the cgroup. Additionally, to deal with potential races that may occur with other suspend observers that interact with renderers, the RendererFreezer is no longer a PowerManagerClient::Observer but is instead a PowerManagerClient::RenderProcessManagerDelegate. This guarantees that the RendererFreezer's suspend related methods will be called only after all observers have reported ready and before observers are notified that the suspend has completed. Any race conditions that still exist now need to be fixed in the observer that is causing it. BUG=364339 Review URL: https://codereview.chromium.org/738993002 Cr-Commit-Position: refs/heads/master@{#304956}
* ObserverList::HasObserver now takes a const pointer.mgiuca2014-11-101-1/+1
| | | | | | | | | | | | | Updated all clients that wrap HasObserver and expose it to also take a const pointer. This change avoids further propagation of non-constness (which was previously required when using HasObserver methods). BUG=429588 TBR=michaeln@chromium.org,nyquist@chromium.org,pkotwicz@chromium.org,satorux@chromium.org,sky@chromium.org,zea@chromium.org Review URL: https://codereview.chromium.org/697953002 Cr-Commit-Position: refs/heads/master@{#303428}
* replace OVERRIDE and FINAL with override and final in chromeos/mostynb2014-10-061-20/+20
| | | | | | | | BUG=417463 Review URL: https://codereview.chromium.org/628883002 Cr-Commit-Position: refs/heads/master@{#298229}
* [Athena] Make a quick power button tap suspend the devicepkotwicz2014-09-241-0/+1
| | | | | | | | | | | BUG=404661, 179713 TEST=Manual, see bug R=flackr, oshima, derat TBR=stevenjb Review URL: https://codereview.chromium.org/585623003 Cr-Commit-Position: refs/heads/master@{#296515}
* chromeos: power: Refactor RendererFreezer and add testschirantan2014-09-161-0/+8
| | | | | | | | | | | | | | | | | | Refactor the RendererFreezer class so that untestable code is moved into a delegate and add unit tests. Modify FakePowerManagerClient so that it provides more information for tests. Also use a CancelableClosure for the asynchronous suspend readiness callback in case we get a SuspendDone before we've had a chance to run OnReadyForSuspend(). BUG=364339,414396 Signed-off-by: Chirantan Ekbote <chirantan@chromium.org> Review URL: https://codereview.chromium.org/543303002 Cr-Commit-Position: refs/heads/master@{#295111}
* app_shell: Shut down in response to power button.derat2014-08-231-14/+9
| | | | | | | | | | | | | | Also fix a dependency issue in chromeos_test_support_without_gmock, make ExtensionsTestSuite call GLSurface::InitializeOneOffForTests(), and avoid double-initializating Aura in app_shell. BUG=405967 Review URL: https://codereview.chromium.org/468393005 Cr-Commit-Position: refs/heads/master@{#291607}
* This makes PowerManagerClient tell the power manager to notify chromechirantan@chromium.org2014-08-191-0/+1
| | | | | | | | | | | | | | | when the system comes up in dark resume. It also adds a DarkSuspendImminent() method that observers within chrome can implement if they want to be notified of this event. BUG=397346 Signed-off-by: Chirantan Ekbote <chirantan@chromium.org> Review URL: https://codereview.chromium.org/438433002 Cr-Commit-Position: refs/heads/master@{#290692} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290692 0039d316-1c4b-4281-b951-d872f2087c98
* chromeos: Clean up PowerManagerClient nits from r265058.derat@chromium.org2014-04-231-1/+0
| | | | | | | | BUG=none Review URL: https://codereview.chromium.org/249413002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265675 0039d316-1c4b-4281-b951-d872f2087c98
* chromeos: Update IdleActionImminent and SuspendDone handlingderat@chromium.org2014-04-211-10/+3
| | | | | | | | | | | | | | | | | | | IdleActionImminent signals sent by powerd now include the remaining time until the idle action will be performed; make PowerManagerClient decode it and pass it to observers. Also update PowerManagerClient to listen for SuspendDone signals rather than SuspendStateChanged; the latter is confusing and will be removed soon. Updates the system_api dependency to a9acc4df. BUG=287787,359619 TBR=stevenjb@chromium.org Review URL: https://codereview.chromium.org/240343004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265058 0039d316-1c4b-4281-b951-d872f2087c98
* Split projecting configuration into separate delegatednicoara@chromium.org2014-02-101-0/+12
| | | | | | | | | | | | Moved projecting configuration into separate delegate. Since Delegate deals only with display configuration, I've also renamed it to NativeDisplayDelegate to better reflect its purpose. BUG=333413 Review URL: https://codereview.chromium.org/154033004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250205 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of https://codereview.chromium.org/129193002/noamsml@chromium.org2014-01-081-9/+19
| | | | | | | | | | | | | Reason for revert: Did not fix chromeos failures TBR=bartfab@chromium.org,benwells@chromium.org,derat@chromium.org NOTREECHECKS=true NOTRY=true BUG=329930 Review URL: https://codereview.chromium.org/129303003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243671 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of https://codereview.chromium.org/116983008/noamsml@chromium.org2014-01-081-19/+9
| | | | | | | | | | | | | Reason for revert: ChromeOS bot failures on x86/amd64 TBR=bartfab@chromium.org,benwells@chromium.org,derat@chromium.org NOTREECHECKS=true NOTRY=true BUG=329930 Review URL: https://codereview.chromium.org/129193002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243634 0039d316-1c4b-4281-b951-d872f2087c98
* chromeos: Don't send empty power management policies.derat@chromium.org2014-01-081-9/+19
| | | | | | | | | | | | | | | | | | | Update PowerPolicyController to not send an empty policy to powerd when Chrome starts or exits. Empty policies were originally sent to ensure the system wouldn't be stuck with an old policy, but they also mean that powerd could briefly revert to its default settings with undesireable results when the system first boots or the user logs out (e.g. an enterprise policy has disabled the lid-closed action, but powerd reverts to its default settings and shuts down automatically when the user logs out). BUG=329930 TBR=benwells@chromium.org Review URL: https://codereview.chromium.org/116983008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243566 0039d316-1c4b-4281-b951-d872f2087c98
* chromeos: Fix lock-before-suspend regression.derat@chromium.org2013-10-291-0/+1
| | | | | | | | | | | | This fixes an uninitialized member variable in ash::internal::PowerEventObserver that could result in the screen not getting locked before the system goes to sleep. BUG=312210 Review URL: https://codereview.chromium.org/49743004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231622 0039d316-1c4b-4281-b951-d872f2087c98
* chromeos: Remove ScreensaverController.derat@chromium.org2013-10-161-1/+0
| | | | | | | | | | | | | Remove the ScreensaverController class, which isn't being used anymore. Also remove idle-notification code from PowerManagerClient. BUG=none TBR=yoz@chromium.org Review URL: https://codereview.chromium.org/26800005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228911 0039d316-1c4b-4281-b951-d872f2087c98
* Implement SendSuspendImminent() and SendSuspendStateChanged() of ↵hidehiko@chromium.org2013-09-111-1/+15
| | | | | | | | | | | | | | | | | FakePowerManagerClient. Observer's callback SuspendImminent() and SystemResumed() are used by MountedDiskMonitor. Focusing on the usage, this CL adds two methods SendSuspendImminent() and SendSuspendStateChanged() emulating DBus's signals for testing purpose. These methods will be used in tests of a following CL. BUG=279276 TEST=Ran unit_tests Review URL: https://chromiumcodereview.appspot.com/23484021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222525 0039d316-1c4b-4281-b951-d872f2087c98
* Split construction and initialization of DBus clients.pneubeck@chromium.org2013-08-271-1/+2
| | | | | | | | | | | | | | | Before, each Client had a Create function which constructed an instance of the client and initialized it (with a dbus::Bus*). To make the Clients separately replaceable in the DBusThreadManager, it's necessary to separate the construction of the Clients from their initialization. This CL, splits each Create function into Create (which only calls the constructor of either the real Impl or the Stub) and Init(dbus::Bus*). This is a pure refactoring. BUG=275286 Review URL: https://chromiumcodereview.appspot.com/23119006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219775 0039d316-1c4b-4281-b951-d872f2087c98
* chromeos: Report user activity type to power manager.derat@chromium.org2013-07-171-1/+2
| | | | | | | | | | | | | | | | | | | This makes Chrome's reports of user activity to powerd include an enum describing the event type (currently just "brightness up", "brightness down", and "other"). To facilitate this, it makes UserActivityDetector pass the event that triggered the notification to observers. To facilitate _that_, it reorders UserActivityDetector to run after EventRewriterEventFilter instead of before it. It also updates the cros_system_api dependency to 59a6e103. BUG=254841 Review URL: https://chromiumcodereview.appspot.com/18906003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211957 0039d316-1c4b-4281-b951-d872f2087c98
* chromeos: Use native D-Bus args for HandleVideoActivity.derat@chromium.org2013-07-031-3/+1
| | | | | | | | | | | | | | This updates HandleVideoActivity D-Bus method calls to the power manager to send a single "is_fullscreen" boolean argument instead of the heavier-weight protocol buffer that was used before. Doing so shortens some code and allows the removal of an old protobuf build target. BUG=none Review URL: https://chromiumcodereview.appspot.com/18385003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209861 0039d316-1c4b-4281-b951-d872f2087c98
* Reland r204614, chromeos: Clean up power status polling codederat@chromium.org2013-06-071-1/+1
| | | | | | | | | | | | | | | | | | Reland the following change after adding a WeakPtrFactory to avoid some use-after-free errors caused by posting unretained PowerManagerClientStubImpl objects to the message loop: This makes Chrome decode PowerSupplyProperties protocol buffers from PowerSupplyPoll D-Bus signals sent by powerd. It also removes an unnecessary UpdateRequestType enum from PowerManagerClient. BUG=245108,234671 Review URL: https://chromiumcodereview.appspot.com/16335023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204815 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 204614 "chromeos: Clean up power status polling code."dalecurtis@google.com2013-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | > chromeos: Clean up power status polling code. > > This makes Chrome decode PowerSupplyProperties protocol > buffers from PowerSupplyPoll D-Bus signals sent by powerd. > It also removes an unnecessary UpdateRequestType enum from > PowerManagerClient. > > BUG=245108,234671 > > Review URL: https://chromiumcodereview.appspot.com/16493002 ASAN failures everywhere: http://build.chromium.org/p/chromium.memory/builders/Linux%20Chromium%20OS%20ASAN%20Tests%20%283%29/builds/6411 TBR=derat@chromium.org Review URL: https://codereview.chromium.org/16409010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204640 0039d316-1c4b-4281-b951-d872f2087c98
* chromeos: Clean up power status polling code.derat@chromium.org2013-06-061-1/+1
| | | | | | | | | | | | | This makes Chrome decode PowerSupplyProperties protocol buffers from PowerSupplyPoll D-Bus signals sent by powerd. It also removes an unnecessary UpdateRequestType enum from PowerManagerClient. BUG=245108,234671 Review URL: https://chromiumcodereview.appspot.com/16493002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204614 0039d316-1c4b-4281-b951-d872f2087c98
* Use MockDBusThreadManagerWithoutGMock for AutomaticRebootManager{Basic,}Testharuki@chromium.org2013-05-141-0/+7
| | | | | | | | | | | | Adding FakePowerManagerClient a counter for RequestRestart() call. BUG=223061 TEST=unittests R=bartfab@chromium.org, satorux@chromium.org Review URL: https://codereview.chromium.org/15068011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199956 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Add FakePowerManagerClient and use it in PowerPolicyControllerTestharuki@chromium.org2013-04-241-0/+58
Will replace MockPowerManagerClient with this fake. BUG=234058 TEST=trybots Review URL: https://chromiumcodereview.appspot.com/14399003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196097 0039d316-1c4b-4281-b951-d872f2087c98