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

Unified Diff: Source/core/xmlhttprequest/XMLHttpRequest.cpp

Issue 1311923004: Rename FormData/FormDataBuilder to EncodedFormData/FormDataEncoder respectively. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update comments Created 5 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/xmlhttprequest/XMLHttpRequest.h ('k') | Source/modules/fetch/BodyStreamBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xmlhttprequest/XMLHttpRequest.cpp
diff --git a/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/Source/core/xmlhttprequest/XMLHttpRequest.cpp
index 582385923a8717d77b2fde59f94499c20f3c1d7b..9e12c2cf362644d89f8f52151e8ce5895039d3d5 100644
--- a/Source/core/xmlhttprequest/XMLHttpRequest.cpp
+++ b/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -706,7 +706,7 @@ void XMLHttpRequest::send(Document* document, ExceptionState& exceptionState)
if (!initSend(exceptionState))
return;
- RefPtr<FormData> httpBody;
+ RefPtr<EncodedFormData> httpBody;
if (areMethodAndURLValidForSend()) {
// FIXME: Per https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send the
@@ -717,7 +717,7 @@ void XMLHttpRequest::send(Document* document, ExceptionState& exceptionState)
String body = createMarkup(document);
- httpBody = FormData::create(UTF8Encoding().encode(body, WTF::EntitiesForUnencodables));
+ httpBody = EncodedFormData::create(UTF8Encoding().encode(body, WTF::EntitiesForUnencodables));
}
createRequest(httpBody.release(), exceptionState);
@@ -730,7 +730,7 @@ void XMLHttpRequest::send(const String& body, ExceptionState& exceptionState)
if (!initSend(exceptionState))
return;
- RefPtr<FormData> httpBody;
+ RefPtr<EncodedFormData> httpBody;
if (!body.isNull() && areMethodAndURLValidForSend()) {
String contentType = getRequestHeader("Content-Type");
@@ -741,7 +741,7 @@ void XMLHttpRequest::send(const String& body, ExceptionState& exceptionState)
m_requestHeaders.set("Content-Type", AtomicString(contentType));
}
- httpBody = FormData::create(UTF8Encoding().encode(body, WTF::EntitiesForUnencodables));
+ httpBody = EncodedFormData::create(UTF8Encoding().encode(body, WTF::EntitiesForUnencodables));
}
createRequest(httpBody.release(), exceptionState);
@@ -754,7 +754,7 @@ void XMLHttpRequest::send(Blob* body, ExceptionState& exceptionState)
if (!initSend(exceptionState))
return;
- RefPtr<FormData> httpBody;
+ RefPtr<EncodedFormData> httpBody;
if (areMethodAndURLValidForSend()) {
if (getRequestHeader("Content-Type").isEmpty()) {
@@ -765,7 +765,7 @@ void XMLHttpRequest::send(Blob* body, ExceptionState& exceptionState)
}
// FIXME: add support for uploading bundles.
- httpBody = FormData::create();
+ httpBody = EncodedFormData::create();
if (body->hasBackingFile()) {
File* file = toFile(body);
if (!file->path().isEmpty())
@@ -789,7 +789,7 @@ void XMLHttpRequest::send(DOMFormData* body, ExceptionState& exceptionState)
if (!initSend(exceptionState))
return;
- RefPtr<FormData> httpBody;
+ RefPtr<EncodedFormData> httpBody;
if (areMethodAndURLValidForSend()) {
httpBody = body->createMultiPartFormData();
@@ -822,16 +822,16 @@ void XMLHttpRequest::sendBytesData(const void* data, size_t length, ExceptionSta
if (!initSend(exceptionState))
return;
- RefPtr<FormData> httpBody;
+ RefPtr<EncodedFormData> httpBody;
if (areMethodAndURLValidForSend()) {
- httpBody = FormData::create(data, length);
+ httpBody = EncodedFormData::create(data, length);
}
createRequest(httpBody.release(), exceptionState);
}
-void XMLHttpRequest::sendForInspectorXHRReplay(PassRefPtr<FormData> formData, ExceptionState& exceptionState)
+void XMLHttpRequest::sendForInspectorXHRReplay(PassRefPtr<EncodedFormData> formData, ExceptionState& exceptionState)
{
createRequest(formData ? formData->deepCopy() : nullptr, exceptionState);
m_exceptionCode = exceptionState.code();
@@ -856,7 +856,7 @@ void XMLHttpRequest::throwForLoadFailureIfNeeded(ExceptionState& exceptionState,
exceptionState.throwDOMException(m_exceptionCode, message);
}
-void XMLHttpRequest::createRequest(PassRefPtr<FormData> httpBody, ExceptionState& exceptionState)
+void XMLHttpRequest::createRequest(PassRefPtr<EncodedFormData> httpBody, ExceptionState& exceptionState)
{
// Only GET request is supported for blob URL.
if (m_url.protocolIs("blob") && m_method != "GET") {
« no previous file with comments | « Source/core/xmlhttprequest/XMLHttpRequest.h ('k') | Source/modules/fetch/BodyStreamBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698