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

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

Issue 2879773002: Replace remaining ASSERT with DCHECK|DCHECK_FOO in modules (Closed)
Patch Set: Replace remaining ASSERT with DCHECK|DCHECK_FOO in modules Created 3 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 <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include "bindings/core/v8/Dictionary.h" 9 #include "bindings/core/v8/Dictionary.h"
10 #include "bindings/core/v8/ScriptPromise.h" 10 #include "bindings/core/v8/ScriptPromise.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 Frame* frame = ToDocument(context)->GetFrame(); 97 Frame* frame = ToDocument(context)->GetFrame();
98 SECURITY_CHECK(!frame || frame == frame->Tree().Top()); 98 SECURITY_CHECK(!frame || frame == frame->Tree().Top());
99 99
100 std::unique_ptr<WebCredential> credential = 100 std::unique_ptr<WebCredential> credential =
101 WTF::WrapUnique(web_credential.release()); 101 WTF::WrapUnique(web_credential.release());
102 if (!credential || !frame) { 102 if (!credential || !frame) {
103 resolver_->Resolve(); 103 resolver_->Resolve();
104 return; 104 return;
105 } 105 }
106 106
107 ASSERT(credential->IsPasswordCredential() || 107 DCHECK(credential->IsPasswordCredential() ||
108 credential->IsFederatedCredential()); 108 credential->IsFederatedCredential());
109 UseCounter::Count(ExecutionContext::From(resolver_->GetScriptState()), 109 UseCounter::Count(ExecutionContext::From(resolver_->GetScriptState()),
110 UseCounter::kCredentialManagerGetReturnedCredential); 110 UseCounter::kCredentialManagerGetReturnedCredential);
111 if (credential->IsPasswordCredential()) 111 if (credential->IsPasswordCredential())
112 resolver_->Resolve(PasswordCredential::Create( 112 resolver_->Resolve(PasswordCredential::Create(
113 static_cast<WebPasswordCredential*>(credential.get()))); 113 static_cast<WebPasswordCredential*>(credential.get())));
114 else 114 else
115 resolver_->Resolve(FederatedCredential::Create( 115 resolver_->Resolve(FederatedCredential::Create(
116 static_cast<WebFederatedCredential*>(credential.get()))); 116 static_cast<WebFederatedCredential*>(credential.get())));
117 } 117 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 ScriptPromise promise = resolver->Promise(); 208 ScriptPromise promise = resolver->Promise();
209 if (!CheckBoilerplate(resolver)) 209 if (!CheckBoilerplate(resolver))
210 return promise; 210 return promise;
211 211
212 CredentialManagerClient::From(ExecutionContext::From(script_state)) 212 CredentialManagerClient::From(ExecutionContext::From(script_state))
213 ->DispatchRequireUserMediation(new NotificationCallbacks(resolver)); 213 ->DispatchRequireUserMediation(new NotificationCallbacks(resolver));
214 return promise; 214 return promise;
215 } 215 }
216 216
217 } // namespace blink 217 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp ('k') | third_party/WebKit/Source/modules/crypto/CryptoKey.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698