Revert of Attempting to resolve a race condition with PowerMonitor (https://codereview.chromium.org/179923006/)

Reason for revert:
Failing interactive_ui_tests dbg:

http://build.chromium.org/p/chromium.win/builders/Interactive%20Tests%20(dbg)/builds/47083/steps/interactive_ui_tests/logs/stdio

Original issue's description:
> Attempting to resolve a race condition with PowerMonitor.
> 
> ThreadSanitizer caught multiple instances where PowerMonitor::Get or PowerMonitor::Add/RemoveObserver were being called concurrently with the PowerMonitor constructor in the main thread. These functions access a process-global PowerMontior instance (g_power_monitor), which was not thread safe.
> 
> This change adds locks around PowerMonitor creation and deletion, and forces Add/RemoveObserver to be called in a threadsafe manner. It also removes the need to call PowerMonitor::Get.
> 
> BUG=268924
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=262018

TBR=mattm@chromium.org,jyasskin@chromium.org,kbr@chromium.org,bradnelson@chromium.org,brettw@chromium.org,bradchen@chromium.org,willchan@chromium.org,jam@chromium.org,jochen@chromium.org,timurrrr@chromium.org,glider@chromium.org,acolwell@chromium.org,scherkus@chromium.org,bajones@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=268924

Review URL: https://codereview.chromium.org/226263008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262026 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: ed3bf8a649d33f2ac29be6846904ea905699e824
6 files changed
tree: 9a2f8957d9f64f38f29ed32d2b76d4837e51e81e
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/