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

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

Issue 204983007: Make ThreadableLoader class to use references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added asserts Created 6 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: Source/core/page/EventSource.cpp
diff --git a/Source/core/page/EventSource.cpp b/Source/core/page/EventSource.cpp
index 695529aece01bd1ef5b2e2e5074979234a883866..4dbcaa6ee70deafb2ab5aff9699bb9dfcc652daa 100644
--- a/Source/core/page/EventSource.cpp
+++ b/Source/core/page/EventSource.cpp
@@ -125,6 +125,7 @@ void EventSource::connect()
ASSERT(m_state == CONNECTING);
ASSERT(!m_requestInFlight);
+ ExecutionContext* executionContextLocal = executionContext();
Inactive 2014/03/31 17:43:26 I don't really like the "*Local" naming. I guess y
maheshkk 2014/03/31 20:46:49 Thanks! changed it as per your suggestion.
ResourceRequest request(m_url);
request.setHTTPMethod("GET");
request.setHTTPHeaderField("Accept", "text/event-stream");
@@ -132,7 +133,7 @@ void EventSource::connect()
if (!m_lastEventId.isEmpty())
request.setHTTPHeaderField("Last-Event-ID", m_lastEventId);
- SecurityOrigin* origin = executionContext()->securityOrigin();
+ SecurityOrigin* origin = executionContextLocal->securityOrigin();
ThreadableLoaderOptions options;
options.sniffContent = DoNotSniffContent;
@@ -142,9 +143,9 @@ void EventSource::connect()
options.crossOriginRequestPolicy = UseAccessControl;
options.dataBufferingPolicy = DoNotBufferData;
options.securityOrigin = origin;
- options.contentSecurityPolicyEnforcement = ContentSecurityPolicy::shouldBypassMainWorld(executionContext()) ? DoNotEnforceContentSecurityPolicy : EnforceConnectSrcDirective;
+ options.contentSecurityPolicyEnforcement = ContentSecurityPolicy::shouldBypassMainWorld(executionContextLocal) ? DoNotEnforceContentSecurityPolicy : EnforceConnectSrcDirective;
- m_loader = ThreadableLoader::create(executionContext(), this, request, options);
+ m_loader = ThreadableLoader::create(*executionContextLocal, this, request, options);
if (m_loader)
m_requestInFlight = true;

Powered by Google App Engine
This is Rietveld 408576698