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

Unified Diff: third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp

Issue 2583093002: Reduce SuspendableObjects (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/netinfo/NetworkInformation.cpp
diff --git a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp
index 6fbaf93e62047c0a892da7f358e7d6c69356b265..93888dc16fea9dada6de03f7c2b2de2d1d83cb19 100644
--- a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp
+++ b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp
@@ -45,9 +45,7 @@ String connectionTypeToString(WebConnectionType type) {
namespace blink {
NetworkInformation* NetworkInformation::create(ExecutionContext* context) {
- NetworkInformation* connection = new NetworkInformation(context);
- connection->suspendIfNeeded();
- return connection;
+ return new NetworkInformation(context);
}
NetworkInformation::~NetworkInformation() {
@@ -93,7 +91,7 @@ const AtomicString& NetworkInformation::interfaceName() const {
}
ExecutionContext* NetworkInformation::getExecutionContext() const {
- return SuspendableObject::getExecutionContext();
+ return ContextLifecycleObserver::getExecutionContext();
}
void NetworkInformation::addedEventListener(
@@ -146,7 +144,7 @@ void NetworkInformation::stopObserving() {
}
NetworkInformation::NetworkInformation(ExecutionContext* context)
- : SuspendableObject(context),
+ : ContextLifecycleObserver(context),
m_type(networkStateNotifier().connectionType()),
m_downlinkMaxMbps(networkStateNotifier().maxBandwidth()),
m_observing(false),
@@ -154,7 +152,7 @@ NetworkInformation::NetworkInformation(ExecutionContext* context)
DEFINE_TRACE(NetworkInformation) {
EventTargetWithInlineData::trace(visitor);
- SuspendableObject::trace(visitor);
+ ContextLifecycleObserver::trace(visitor);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698