| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 id_name = element->GetName(); | 85 id_name = element->GetName(); |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 | 89 |
| 90 // Create a PasswordCredential using the data gathered above. | 90 // Create a PasswordCredential using the data gathered above. |
| 91 PasswordCredential* credential = | 91 PasswordCredential* credential = |
| 92 PasswordCredential::Create(data, exception_state); | 92 PasswordCredential::Create(data, exception_state); |
| 93 if (exception_state.HadException()) | 93 if (exception_state.HadException()) |
| 94 return nullptr; | 94 return nullptr; |
| 95 ASSERT(credential); | 95 DCHECK(credential); |
| 96 | 96 |
| 97 // After creating the Credential, populate its 'additionalData', 'idName', and | 97 // After creating the Credential, populate its 'additionalData', 'idName', and |
| 98 // 'passwordName' attributes. If the form's 'enctype' is anything other than | 98 // 'passwordName' attributes. If the form's 'enctype' is anything other than |
| 99 // multipart, generate a URLSearchParams using the | 99 // multipart, generate a URLSearchParams using the |
| 100 // data in |formData|. | 100 // data in |formData|. |
| 101 credential->setIdName(id_name); | 101 credential->setIdName(id_name); |
| 102 credential->setPasswordName(password_name); | 102 credential->setPasswordName(password_name); |
| 103 | 103 |
| 104 FormDataOrURLSearchParams additional_data; | 104 FormDataOrURLSearchParams additional_data; |
| 105 if (form->enctype() == "multipart/form-data") { | 105 if (form->enctype() == "multipart/form-data") { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 return static_cast<PlatformPasswordCredential*>(platform_credential_.Get()) | 181 return static_cast<PlatformPasswordCredential*>(platform_credential_.Get()) |
| 182 ->Password(); | 182 ->Password(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 DEFINE_TRACE(PasswordCredential) { | 185 DEFINE_TRACE(PasswordCredential) { |
| 186 CredentialUserData::Trace(visitor); | 186 CredentialUserData::Trace(visitor); |
| 187 visitor->Trace(additional_data_); | 187 visitor->Trace(additional_data_); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace blink | 190 } // namespace blink |
| OLD | NEW |