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

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

Issue 2571193002: Signal no pending activity in destructed contexts. (Closed)
Patch Set: Created 4 years 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
Index: third_party/WebKit/Source/modules/battery/BatteryManager.cpp
diff --git a/third_party/WebKit/Source/modules/battery/BatteryManager.cpp b/third_party/WebKit/Source/modules/battery/BatteryManager.cpp
index 8fdf4e88a974353762890c2ecfa78c1e0fc2f160..fbcf9639f411e8b48ac5b8b97b03a5004801180c 100644
--- a/third_party/WebKit/Source/modules/battery/BatteryManager.cpp
+++ b/third_party/WebKit/Source/modules/battery/BatteryManager.cpp
@@ -109,14 +109,14 @@ void BatteryManager::resume() {
void BatteryManager::contextDestroyed() {
m_hasEventListener = false;
- m_batteryProperty.clear();
+ m_batteryProperty = nullptr;
stopUpdating();
}
bool BatteryManager::hasPendingActivity() const {
// Prevent V8 from garbage collecting the wrapper object if there are
// event listeners attached to it.
- return hasEventListeners();
+ return getExecutionContext() && hasEventListeners();
}
DEFINE_TRACE(BatteryManager) {
« no previous file with comments | « third_party/WebKit/Source/core/css/MediaQueryList.cpp ('k') | third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698