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

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

Issue 1967693003: Avoid object slicing in WebCredential::create (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding the hilarious namespace :) 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
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698