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); |
} |