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

Side by Side Diff: third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp

Issue 1998563002: Fix URLSearchParams to use the right encoding algorithm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/credentialmanager/PasswordCredential.h" 5 #include "modules/credentialmanager/PasswordCredential.h"
6 6
7 #include "bindings/core/v8/Dictionary.h" 7 #include "bindings/core/v8/Dictionary.h"
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "core/HTMLNames.h" 9 #include "core/HTMLNames.h"
10 #include "core/dom/ExecutionContext.h" 10 #include "core/dom/ExecutionContext.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 for (const auto& param : additionalData->params()) { 127 for (const auto& param : additionalData->params()) {
128 const String& name = param.first; 128 const String& name = param.first;
129 if (name != idName() && name != passwordName()) 129 if (name != idName() && name != passwordName())
130 params->append(name, param.second); 130 params->append(name, param.second);
131 } 131 }
132 params->append(idName(), id()); 132 params->append(idName(), id());
133 params->append(passwordName(), password()); 133 params->append(passwordName(), password());
134 134
135 contentType = AtomicString("application/x-www-form-urlencoded;charset=UT F-8"); 135 contentType = AtomicString("application/x-www-form-urlencoded;charset=UT F-8");
136 136
137 return params->encodeFormData(); 137 return params->toEncodedFormData();
138 } 138 }
139 139
140 // Otherwise, we'll build a multipart response. 140 // Otherwise, we'll build a multipart response.
141 FormData* formData = FormData::create(nullptr); 141 FormData* formData = FormData::create(nullptr);
142 if (m_additionalData.isFormData()) { 142 if (m_additionalData.isFormData()) {
143 FormData* additionalData = m_additionalData.getAsFormData(); 143 FormData* additionalData = m_additionalData.getAsFormData();
144 for (const FormData::Entry* entry : additionalData->entries()) { 144 for (const FormData::Entry* entry : additionalData->entries()) {
145 const String& name = formData->decode(entry->name()); 145 const String& name = formData->decode(entry->name());
146 if (name == idName() || name == passwordName()) 146 if (name == idName() || name == passwordName())
147 continue; 147 continue;
(...skipping 17 matching lines...) Expand all
165 return static_cast<PlatformPasswordCredential*>(m_platformCredential.get())- >password(); 165 return static_cast<PlatformPasswordCredential*>(m_platformCredential.get())- >password();
166 } 166 }
167 167
168 DEFINE_TRACE(PasswordCredential) 168 DEFINE_TRACE(PasswordCredential)
169 { 169 {
170 SiteBoundCredential::trace(visitor); 170 SiteBoundCredential::trace(visitor);
171 visitor->trace(m_additionalData); 171 visitor->trace(m_additionalData);
172 } 172 }
173 173
174 } // namespace blink 174 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FormSubmission.cpp ('k') | third_party/WebKit/Source/modules/fetch/RequestInit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698