Chromium Code Reviews| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 return promise; | 164 return promise; |
| 165 } | 165 } |
| 166 | 166 |
| 167 ScriptPromise CredentialsContainer::store(ScriptState* scriptState, Credential* credential) | 167 ScriptPromise CredentialsContainer::store(ScriptState* scriptState, Credential* credential) |
| 168 { | 168 { |
| 169 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ; | 169 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ; |
| 170 ScriptPromise promise = resolver->promise(); | 170 ScriptPromise promise = resolver->promise(); |
| 171 if (!checkBoilerplate(resolver)) | 171 if (!checkBoilerplate(resolver)) |
| 172 return promise; | 172 return promise; |
| 173 | 173 |
| 174 CredentialManagerClient::from(scriptState->getExecutionContext())->dispatchS tore(WebCredential::create(credential->getPlatformCredential()), new Notificatio nCallbacks(resolver)); | 174 auto web_credential = WebCredential::create(credential->getPlatformCredentia l()); |
|
Yuta Kitamura
2016/05/12 03:58:55
This variable violates our naming convention
| |
| 175 CredentialManagerClient::from(scriptState->getExecutionContext())->dispatchS tore(*web_credential, new NotificationCallbacks(resolver)); | |
| 175 return promise; | 176 return promise; |
| 176 } | 177 } |
| 177 | 178 |
| 178 ScriptPromise CredentialsContainer::requireUserMediation(ScriptState* scriptStat e) | 179 ScriptPromise CredentialsContainer::requireUserMediation(ScriptState* scriptStat e) |
| 179 { | 180 { |
| 180 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ; | 181 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ; |
| 181 ScriptPromise promise = resolver->promise(); | 182 ScriptPromise promise = resolver->promise(); |
| 182 if (!checkBoilerplate(resolver)) | 183 if (!checkBoilerplate(resolver)) |
| 183 return promise; | 184 return promise; |
| 184 | 185 |
| 185 CredentialManagerClient::from(scriptState->getExecutionContext())->dispatchR equireUserMediation(new NotificationCallbacks(resolver)); | 186 CredentialManagerClient::from(scriptState->getExecutionContext())->dispatchR equireUserMediation(new NotificationCallbacks(resolver)); |
| 186 return promise; | 187 return promise; |
| 187 } | 188 } |
| 188 | 189 |
| 189 } // namespace blink | 190 } // namespace blink |
| OLD | NEW |