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

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

Issue 619583004: BatteryManager: release promise resolver once resolved. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clear fresh resolved-resolver also Created 6 years, 3 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 | « LayoutTests/battery-status/no-leak-on-detached-use-expected.txt ('k') | no next file » | 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 a100fe59d4725c5a192a58003ca75cce92b25f1a..57cfa22ae62565d02832a0bc39f8f6625ef52e19 100644
--- a/Source/modules/battery/BatteryManager.cpp
+++ b/Source/modules/battery/BatteryManager.cpp
@@ -44,6 +44,7 @@ ScriptPromise BatteryManager::startRequest(ScriptState* scriptState)
if (m_state == Resolved) {
// FIXME: Consider returning the same promise in this case. See crbug.com/385025.
m_resolver->resolve(this);
+ m_resolver = nullptr;
} else if (m_state == NotStarted) {
m_state = Pending;
m_hasEventListener = true;
@@ -85,6 +86,7 @@ void BatteryManager::didUpdateData()
ASSERT(m_resolver);
m_state = Resolved;
m_resolver->resolve(this);
+ m_resolver = nullptr;
return;
}
« no previous file with comments | « LayoutTests/battery-status/no-leak-on-detached-use-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698