projects
/
platform
/
framework
/
web
/
crosswalk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update To 11.40.268.0
[platform/framework/web/crosswalk.git]
/
src
/
third_party
/
WebKit
/
Source
/
modules
/
battery
/
BatteryManager.cpp
diff --git
a/src/third_party/WebKit/Source/modules/battery/BatteryManager.cpp
b/src/third_party/WebKit/Source/modules/battery/BatteryManager.cpp
index
a100fe5
..
98091ee
100644
(file)
--- a/
src/third_party/WebKit/Source/modules/battery/BatteryManager.cpp
+++ b/
src/third_party/WebKit/Source/modules/battery/BatteryManager.cpp
@@
-22,7
+22,9
@@
BatteryManager* BatteryManager::create(ExecutionContext* context)
BatteryManager::~BatteryManager()
{
BatteryManager::~BatteryManager()
{
+#if !ENABLE(OILPAN)
stopUpdating();
stopUpdating();
+#endif
}
BatteryManager::BatteryManager(ExecutionContext* context)
}
BatteryManager::BatteryManager(ExecutionContext* context)
@@
-41,8
+43,11
@@
ScriptPromise BatteryManager::startRequest(ScriptState* scriptState)
m_resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = m_resolver->promise();
m_resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = m_resolver->promise();
- if (m_state == Resolved) {
+ ASSERT(executionContext());
+ // If the context is in a stopped state already, do not start updating.
+ if (m_state == Resolved || executionContext()->activeDOMObjectsAreStopped()) {
// FIXME: Consider returning the same promise in this case. See crbug.com/385025.
// FIXME: Consider returning the same promise in this case. See crbug.com/385025.
+ m_state = Resolved;
m_resolver->resolve(this);
} else if (m_state == NotStarted) {
m_state = Pending;
m_resolver->resolve(this);
} else if (m_state == NotStarted) {
m_state = Pending;
@@
-89,6
+94,7
@@
void BatteryManager::didUpdateData()
}
Document* document = toDocument(executionContext());
}
Document* document = toDocument(executionContext());
+ ASSERT(document);
if (document->activeDOMObjectsAreSuspended() || document->activeDOMObjectsAreStopped())
return;
if (document->activeDOMObjectsAreSuspended() || document->activeDOMObjectsAreStopped())
return;
@@
-148,6
+154,7
@@
bool BatteryManager::hasPendingActivity() const
void BatteryManager::trace(Visitor* visitor)
{
visitor->trace(m_batteryStatus);
void BatteryManager::trace(Visitor* visitor)
{
visitor->trace(m_batteryStatus);
+ PlatformEventController::trace(visitor);
EventTargetWithInlineData::trace(visitor);
}
EventTargetWithInlineData::trace(visitor);
}