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

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

Issue 1976943002: Avoid object slicing in WebCredential::create (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/exported/WebCredential.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/exported/WebCredential.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698