| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |