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

Unified Diff: Source/core/loader/FormSubmission.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 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/loader/DocumentLoader.cpp ('k') | Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FormSubmission.cpp
diff --git a/Source/core/loader/FormSubmission.cpp b/Source/core/loader/FormSubmission.cpp
index 13fb0e9f93e2d3c3bb62b4335e1178bfe7c624e5..9b2b86681aa7d3073e7093b50f5fa836e7e14e73 100644
--- a/Source/core/loader/FormSubmission.cpp
+++ b/Source/core/loader/FormSubmission.cpp
@@ -162,8 +162,8 @@ PassRefPtr<FormSubmission> FormSubmission::create(HTMLFormElement* form, const A
copiedAttributes.setTarget(attributeValue);
}
- Document* document = form->document();
- KURL actionURL = document->completeURL(copiedAttributes.action().isEmpty() ? document->url().string() : copiedAttributes.action());
+ Document& document = form->document();
+ KURL actionURL = document.completeURL(copiedAttributes.action().isEmpty() ? document.url().string() : copiedAttributes.action());
bool isMailtoForm = actionURL.protocolIs("mailto");
bool isMultiPartForm = false;
String encodingType = copiedAttributes.encodingType();
@@ -176,7 +176,7 @@ PassRefPtr<FormSubmission> FormSubmission::create(HTMLFormElement* form, const A
}
}
- WTF::TextEncoding dataEncoding = isMailtoForm ? UTF8Encoding() : FormDataBuilder::encodingFromAcceptCharset(copiedAttributes.acceptCharset(), document);
+ WTF::TextEncoding dataEncoding = isMailtoForm ? UTF8Encoding() : FormDataBuilder::encodingFromAcceptCharset(copiedAttributes.acceptCharset(), &document);
RefPtr<DOMFormData> domFormData = DOMFormData::create(dataEncoding.encodingForFormSubmission());
Vector<pair<String, String> > formValues;
@@ -199,7 +199,7 @@ PassRefPtr<FormSubmission> FormSubmission::create(HTMLFormElement* form, const A
String boundary;
if (isMultiPartForm) {
- formData = FormData::createMultiPart(*(static_cast<FormDataList*>(domFormData.get())), domFormData->encoding(), document);
+ formData = FormData::createMultiPart(*(static_cast<FormDataList*>(domFormData.get())), domFormData->encoding(), &document);
boundary = formData->boundary().data();
} else {
formData = FormData::create(*(static_cast<FormDataList*>(domFormData.get())), domFormData->encoding(), attributes.method() == GetMethod ? FormData::FormURLEncoded : FormData::parseEncodingType(encodingType));
@@ -212,8 +212,8 @@ PassRefPtr<FormSubmission> FormSubmission::create(HTMLFormElement* form, const A
formData->setIdentifier(generateFormDataIdentifier());
formData->setContainsPasswordData(containsPasswordData);
- String targetOrBaseTarget = copiedAttributes.target().isEmpty() ? document->baseTarget() : copiedAttributes.target();
- RefPtr<FormState> formState = FormState::create(form, formValues, document, trigger);
+ String targetOrBaseTarget = copiedAttributes.target().isEmpty() ? document.baseTarget() : copiedAttributes.target();
+ RefPtr<FormState> formState = FormState::create(form, formValues, &document, trigger);
return adoptRef(new FormSubmission(copiedAttributes.method(), actionURL, targetOrBaseTarget, encodingType, formState.release(), formData.release(), boundary, event));
}
« no previous file with comments | « Source/core/loader/DocumentLoader.cpp ('k') | Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698