Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1563)

Unified Diff: Source/modules/battery/BatteryManager.cpp

Issue 256593010: Gracefully support Navigator Gamepad methods in a detached state. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have document supplements keep a reference to their document Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/battery/BatteryManager.h ('k') | Source/modules/device_orientation/DeviceMotionController.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/battery/BatteryManager.cpp
diff --git a/Source/modules/battery/BatteryManager.cpp b/Source/modules/battery/BatteryManager.cpp
index 382eff3e7acb7228c2905a062eb3876b7f6317f9..6c2e2b5a633585f16f9207d445486cfd17026712 100644
--- a/Source/modules/battery/BatteryManager.cpp
+++ b/Source/modules/battery/BatteryManager.cpp
@@ -26,7 +26,7 @@ BatteryManager::~BatteryManager()
BatteryManager::BatteryManager(ExecutionContext* context)
: ActiveDOMObject(context)
- , DeviceSensorEventController(*toDocument(context))
+ , DeviceSensorEventController(toDocument(context)->page())
{
m_hasEventListener = true;
startUpdating();
@@ -97,6 +97,11 @@ bool BatteryManager::isNullEvent(Event*)
return false;
}
+Document* BatteryManager::document()
+{
+ return toDocument(executionContext());
+}
+
void BatteryManager::suspend()
{
m_hasEventListener = false;
« no previous file with comments | « Source/modules/battery/BatteryManager.h ('k') | Source/modules/device_orientation/DeviceMotionController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698