summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/xml/XMLHttpRequest.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-18 13:36:51 +0100
committerSteve Block <steveblock@google.com>2011-05-24 15:38:28 +0100
commit2fc2651226baac27029e38c9d6ef883fa32084db (patch)
treee396d4bf89dcce6ed02071be66212495b1df1dec /Source/WebCore/xml/XMLHttpRequest.cpp
parentb3725cedeb43722b3b175aaeff70552e562d2c94 (diff)
downloadexternal_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.zip
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.gz
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.bz2
Merge WebKit at r78450: Initial merge by git.
Change-Id: I6d3e5f1f868ec266a0aafdef66182ddc3f265dc1
Diffstat (limited to 'Source/WebCore/xml/XMLHttpRequest.cpp')
-rw-r--r--Source/WebCore/xml/XMLHttpRequest.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/WebCore/xml/XMLHttpRequest.cpp b/Source/WebCore/xml/XMLHttpRequest.cpp
index c05ab29..a548ebc 100644
--- a/Source/WebCore/xml/XMLHttpRequest.cpp
+++ b/Source/WebCore/xml/XMLHttpRequest.cpp
@@ -56,6 +56,7 @@
#if USE(JSC)
#include "JSDOMBinding.h"
#include "JSDOMWindow.h"
+#include <runtime/JSLock.h>
#include <runtime/Protect.h>
#endif
@@ -249,6 +250,7 @@ Document* XMLHttpRequest::responseXML(ExceptionCode& ec)
m_responseXML = Document::create(0, m_url);
// FIXME: Set Last-Modified.
m_responseXML->setContent(m_responseBuilder.toStringPreserveCapacity());
+ m_responseXML->setSecurityOrigin(document()->securityOrigin());
if (!m_responseXML->wellFormed())
m_responseXML = 0;
}
@@ -269,7 +271,7 @@ Blob* XMLHttpRequest::responseBlob(ExceptionCode& ec) const
}
#endif
-#if ENABLE(3D_CANVAS) || ENABLE(BLOB)
+#if ENABLE(WEBGL) || ENABLE(BLOB)
ArrayBuffer* XMLHttpRequest::responseArrayBuffer(ExceptionCode& ec)
{
if (m_responseTypeCode != ResponseTypeArrayBuffer) {
@@ -310,7 +312,7 @@ void XMLHttpRequest::setResponseType(const String& responseType, ExceptionCode&
m_responseTypeCode = ResponseTypeBlob;
#endif
} else if (responseType == "arraybuffer") {
-#if ENABLE(3D_CANVAS) || ENABLE(BLOB)
+#if ENABLE(WEBGL) || ENABLE(BLOB)
m_responseTypeCode = ResponseTypeArrayBuffer;
#endif
} else
@@ -584,7 +586,7 @@ void XMLHttpRequest::send(DOMFormData* body, ExceptionCode& ec)
createRequest(ec);
}
-#if ENABLE(3D_CANVAS) || ENABLE(BLOB)
+#if ENABLE(WEBGL) || ENABLE(BLOB)
void XMLHttpRequest::send(ArrayBuffer* body, ExceptionCode& ec)
{
if (!initSend(ec))
@@ -737,7 +739,7 @@ void XMLHttpRequest::clearResponse()
#if ENABLE(XHR_RESPONSE_BLOB)
m_responseBlob = 0;
#endif
-#if ENABLE(3D_CANVAS) || ENABLE(BLOB)
+#if ENABLE(WEBGL) || ENABLE(BLOB)
m_binaryResponseBuilder.clear();
m_responseArrayBuffer.clear();
#endif
@@ -791,8 +793,10 @@ void XMLHttpRequest::dropProtection()
// can't be recouped until the load is done, so only
// report the extra cost at that point.
JSC::JSGlobalData* globalData = scriptExecutionContext()->globalData();
- if (hasCachedDOMObjectWrapper(globalData, this))
+ if (hasCachedDOMObjectWrapper(globalData, this)) {
+ JSC::JSLock lock(JSC::SilenceAssertionsOnly);
globalData->heap.reportExtraMemoryCost(m_responseBuilder.length() * 2);
+ }
#endif
unsetPendingActivity(this);
@@ -1072,7 +1076,7 @@ void XMLHttpRequest::didReceiveData(const char* data, int len)
if (useDecoder)
m_responseBuilder.append(m_decoder->decode(data, len));
-#if ENABLE(3D_CANVAS) || ENABLE(BLOB)
+#if ENABLE(WEBGL) || ENABLE(BLOB)
else if (responseTypeCode() == ResponseTypeArrayBuffer) {
// Buffer binary data.
if (!m_binaryResponseBuilder)