Index: Source/core/xml/XMLHttpRequest.cpp |
diff --git a/Source/core/xml/XMLHttpRequest.cpp b/Source/core/xml/XMLHttpRequest.cpp |
index b480b02a31bea4fa37041ed06c444ee527bd5d26..fda4f2dae82c98ab64c7a8e9c0fe51f157795322 100644 |
--- a/Source/core/xml/XMLHttpRequest.cpp |
+++ b/Source/core/xml/XMLHttpRequest.cpp |
@@ -792,11 +792,12 @@ void XMLHttpRequest::createRequest(ExceptionState& exceptionState) |
// added after the request is started. |
m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !isSimpleCrossOriginAccessRequest(m_method, m_requestHeaders); |
+ ExecutionContext* executionContextLocal = executionContext(); |
Inactive
2014/03/31 17:43:26
Same comment about naming / local variable.
maheshkk
2014/03/31 20:46:49
Done.
|
ResourceRequest request(m_url); |
request.setHTTPMethod(m_method); |
request.setTargetType(ResourceRequest::TargetIsXHR); |
- InspectorInstrumentation::willLoadXHR(executionContext(), this, this, m_method, m_url, m_async, m_requestEntityBody ? m_requestEntityBody->deepCopy() : nullptr, m_requestHeaders, m_includeCredentials); |
+ InspectorInstrumentation::willLoadXHR(executionContextLocal, this, this, m_method, m_url, m_async, m_requestEntityBody ? m_requestEntityBody->deepCopy() : nullptr, m_requestHeaders, m_includeCredentials); |
if (m_requestEntityBody) { |
ASSERT(m_method != "GET"); |
@@ -815,7 +816,7 @@ void XMLHttpRequest::createRequest(ExceptionState& exceptionState) |
options.crossOriginRequestPolicy = UseAccessControl; |
options.securityOrigin = securityOrigin(); |
options.initiator = FetchInitiatorTypeNames::xmlhttprequest; |
- options.contentSecurityPolicyEnforcement = ContentSecurityPolicy::shouldBypassMainWorld(executionContext()) ? DoNotEnforceContentSecurityPolicy : EnforceConnectSrcDirective; |
+ options.contentSecurityPolicyEnforcement = ContentSecurityPolicy::shouldBypassMainWorld(executionContextLocal) ? DoNotEnforceContentSecurityPolicy : EnforceConnectSrcDirective; |
// TODO(tsepez): Specify TreatAsActiveContent per http://crbug.com/305303. |
options.mixedContentBlockingTreatment = TreatAsPassiveContent; |
options.timeoutMilliseconds = m_timeoutMilliseconds; |
@@ -832,7 +833,7 @@ void XMLHttpRequest::createRequest(ExceptionState& exceptionState) |
// FIXME: Maybe we need to be able to send XMLHttpRequests from onunload, <http://bugs.webkit.org/show_bug.cgi?id=10904>. |
// FIXME: Maybe create() can return null for other reasons too? |
ASSERT(!m_loader); |
- m_loader = ThreadableLoader::create(executionContext(), this, request, options); |
+ m_loader = ThreadableLoader::create(*executionContextLocal, this, request, options); |
if (m_loader) { |
// Neither this object nor the JavaScript wrapper should be deleted while |
// a request is in progress because we need to keep the listeners alive, |
@@ -840,7 +841,7 @@ void XMLHttpRequest::createRequest(ExceptionState& exceptionState) |
setPendingActivity(this); |
} |
} else { |
- ThreadableLoader::loadResourceSynchronously(executionContext(), request, *this, options); |
+ ThreadableLoader::loadResourceSynchronously(*executionContextLocal, request, *this, options); |
} |
if (!m_exceptionCode && m_error) |