Do not use virtual function to request shutdown
Would make it easier to port to other platforms.
This commit is contained in:
parent
8ae3d9dd0b
commit
109e2c760f
4 changed files with 36 additions and 13 deletions
|
@ -26,16 +26,20 @@ class PowerMonitor : public mate::TrackableObject<PowerMonitor>,
|
|||
explicit PowerMonitor(v8::Isolate* isolate);
|
||||
~PowerMonitor() override;
|
||||
|
||||
// Called by native calles.
|
||||
bool ShouldShutdown();
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
// Private JS APIs.
|
||||
void BlockShutdown();
|
||||
void UnblockShutdown();
|
||||
#endif
|
||||
|
||||
// base::PowerObserver implementations:
|
||||
void OnPowerStateChange(bool on_battery_power) override;
|
||||
void OnSuspend() override;
|
||||
void OnResume() override;
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
// atom::PowerObserver
|
||||
bool OnShutdown() override;
|
||||
#endif
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(PowerMonitor);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue