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

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

Issue 2693823003: Remove dependency from NetworkStateNotifier to ExecutionContext (Closed)
Patch Set: . Created 3 years, 10 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
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 e7cadfbfba4de4b9234ebbcf7ea0fd9d1eefee15..7ff297e91e19349b2f612456d16823f35576fac3 100644
--- a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp
+++ b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp
@@ -5,6 +5,7 @@
#include "modules/netinfo/NetworkInformation.h"
#include "core/dom/ExecutionContext.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/events/Event.h"
#include "core/page/NetworkStateNotifier.h"
#include "modules/EventTargetModules.h"
@@ -129,14 +130,18 @@ void NetworkInformation::contextDestroyed(ExecutionContext*) {
void NetworkInformation::startObserving() {
if (!m_observing && !m_contextStopped) {
m_type = networkStateNotifier().connectionType();
- networkStateNotifier().addObserver(this, getExecutionContext());
+ networkStateNotifier().addObserver(
+ this, TaskRunnerHelper::get(TaskType::Networking, getExecutionContext())
+ .get());
m_observing = true;
}
}
void NetworkInformation::stopObserving() {
if (m_observing) {
- networkStateNotifier().removeObserver(this, getExecutionContext());
+ networkStateNotifier().removeObserver(
+ this, TaskRunnerHelper::get(TaskType::Networking, getExecutionContext())
+ .get());
m_observing = false;
}
}

Powered by Google App Engine
This is Rietveld 408576698