| 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/CredentialsContainer.h" | 5 #include "modules/credentialmanager/CredentialsContainer.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/Dictionary.h" | 7 #include "bindings/core/v8/Dictionary.h" |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 10 #include "core/dom/DOMException.h" | 10 #include "core/dom/DOMException.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 return promise; | 163 return promise; |
| 164 } | 164 } |
| 165 | 165 |
| 166 ScriptPromise CredentialsContainer::store(ScriptState* scriptState, Credential*
credential) | 166 ScriptPromise CredentialsContainer::store(ScriptState* scriptState, Credential*
credential) |
| 167 { | 167 { |
| 168 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; | 168 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; |
| 169 ScriptPromise promise = resolver->promise(); | 169 ScriptPromise promise = resolver->promise(); |
| 170 if (!checkBoilerplate(resolver)) | 170 if (!checkBoilerplate(resolver)) |
| 171 return promise; | 171 return promise; |
| 172 | 172 |
| 173 CredentialManagerClient::from(scriptState->getExecutionContext())->dispatchS
tore(WebCredential::create(credential->getPlatformCredential()), new Notificatio
nCallbacks(resolver)); | 173 auto web_credential = WebCredential::create(credential->getPlatformCredentia
l()); |
| 174 CredentialManagerClient::from(scriptState->getExecutionContext())->dispatchS
tore(*web_credential, new NotificationCallbacks(resolver)); |
| 174 return promise; | 175 return promise; |
| 175 } | 176 } |
| 176 | 177 |
| 177 ScriptPromise CredentialsContainer::requireUserMediation(ScriptState* scriptStat
e) | 178 ScriptPromise CredentialsContainer::requireUserMediation(ScriptState* scriptStat
e) |
| 178 { | 179 { |
| 179 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; | 180 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; |
| 180 ScriptPromise promise = resolver->promise(); | 181 ScriptPromise promise = resolver->promise(); |
| 181 if (!checkBoilerplate(resolver)) | 182 if (!checkBoilerplate(resolver)) |
| 182 return promise; | 183 return promise; |
| 183 | 184 |
| 184 CredentialManagerClient::from(scriptState->getExecutionContext())->dispatchR
equireUserMediation(new NotificationCallbacks(resolver)); | 185 CredentialManagerClient::from(scriptState->getExecutionContext())->dispatchR
equireUserMediation(new NotificationCallbacks(resolver)); |
| 185 return promise; | 186 return promise; |
| 186 } | 187 } |
| 187 | 188 |
| 188 } // namespace blink | 189 } // namespace blink |
| OLD | NEW |