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

Unified Diff: third_party/WebKit/Source/core/page/EventSource.cpp

Issue 1808533003: Revert of Reduce ActiveDOMObjects from core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/core/page/EventSource.cpp
diff --git a/third_party/WebKit/Source/core/page/EventSource.cpp b/third_party/WebKit/Source/core/page/EventSource.cpp
index 9e2d27d98d0e8cb752b2c848dcd81447f38b88e5..0fb02c69acb4c03d16383bfdf3f2d61341c951f1 100644
--- a/third_party/WebKit/Source/core/page/EventSource.cpp
+++ b/third_party/WebKit/Source/core/page/EventSource.cpp
@@ -61,7 +61,7 @@
const unsigned long long EventSource::defaultReconnectDelay = 3000;
inline EventSource::EventSource(ExecutionContext* context, const KURL& url, const EventSourceInit& eventSourceInit)
- : ContextLifecycleObserver(context)
+ : ActiveDOMObject(context)
, m_url(url)
, m_withCredentials(eventSourceInit.withCredentials())
, m_state(CONNECTING)
@@ -91,7 +91,9 @@
}
EventSource* source = new EventSource(context, fullURL, eventSourceInit);
+
source->scheduleInitialConnect();
+ source->suspendIfNeeded();
return source;
}
@@ -193,8 +195,7 @@
if (m_parser)
m_parser->stop();
- // Stop trying to reconnect if EventSource was explicitly closed
- // or if ContextLifecycleObserver::stop() was called.
+ // Stop trying to reconnect if EventSource was explicitly closed or if ActiveDOMObject::stop() was called.
if (m_connectTimer.isActive()) {
m_connectTimer.stop();
}
@@ -214,7 +215,7 @@
ExecutionContext* EventSource::executionContext() const
{
- return ContextLifecycleObserver::executionContext();
+ return ActiveDOMObject::executionContext();
}
void EventSource::didReceiveResponse(unsigned long, const ResourceResponse& response, PassOwnPtr<WebDataConsumerHandle> handle)
@@ -335,7 +336,7 @@
dispatchEvent(Event::create(EventTypeNames::error));
}
-void EventSource::contextDestroyed()
+void EventSource::stop()
{
close();
}
@@ -349,7 +350,7 @@
{
visitor->trace(m_parser);
RefCountedGarbageCollectedEventTargetWithInlineData::trace(visitor);
- ContextLifecycleObserver::trace(visitor);
+ ActiveDOMObject::trace(visitor);
EventSourceParser::Client::trace(visitor);
}
« no previous file with comments | « third_party/WebKit/Source/core/page/EventSource.h ('k') | third_party/WebKit/Source/core/streams/ReadableStreamReader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698