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

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

Issue 561533002: Add EventSourceInit (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « Source/core/page/EventSource.h ('k') | Source/core/page/EventSource.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/EventSource.cpp
diff --git a/Source/core/page/EventSource.cpp b/Source/core/page/EventSource.cpp
index 24c21f322e2b86128aa4cf5d23222fb20276f70b..8de6a372b36e9ba0f5a7886af6e54c4e6a4d81e1 100644
--- a/Source/core/page/EventSource.cpp
+++ b/Source/core/page/EventSource.cpp
@@ -33,7 +33,6 @@
#include "config.h"
#include "core/page/EventSource.h"
-#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/ScriptController.h"
#include "bindings/core/v8/SerializedScriptValue.h"
@@ -48,6 +47,7 @@
#include "core/html/parser/TextResourceDecoder.h"
#include "core/inspector/ConsoleMessage.h"
#include "core/loader/ThreadableLoader.h"
+#include "core/page/EventSourceInit.h"
#include "platform/network/ResourceError.h"
#include "platform/network/ResourceRequest.h"
#include "platform/network/ResourceResponse.h"
@@ -59,10 +59,10 @@ namespace blink {
const unsigned long long EventSource::defaultReconnectDelay = 3000;
-inline EventSource::EventSource(ExecutionContext* context, const KURL& url, const Dictionary& eventSourceInit)
+inline EventSource::EventSource(ExecutionContext* context, const KURL& url, const EventSourceInit* eventSourceInit)
: ActiveDOMObject(context)
, m_url(url)
- , m_withCredentials(false)
+ , m_withCredentials(eventSourceInit->withCredentials())
, m_state(CONNECTING)
, m_decoder(TextResourceDecoder::create("text/plain", "UTF-8"))
, m_connectTimer(this, &EventSource::connectTimerFired)
@@ -70,10 +70,9 @@ inline EventSource::EventSource(ExecutionContext* context, const KURL& url, cons
, m_requestInFlight(false)
, m_reconnectDelay(defaultReconnectDelay)
{
- DictionaryHelper::get(eventSourceInit, "withCredentials", m_withCredentials);
}
-PassRefPtrWillBeRawPtr<EventSource> EventSource::create(ExecutionContext* context, const String& url, const Dictionary& eventSourceInit, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<EventSource> EventSource::create(ExecutionContext* context, const String& url, const EventSourceInit* eventSourceInit, ExceptionState& exceptionState)
{
if (url.isEmpty()) {
exceptionState.throwDOMException(SyntaxError, "Cannot open an EventSource to an empty URL.");
« no previous file with comments | « Source/core/page/EventSource.h ('k') | Source/core/page/EventSource.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698