Chromium Code Reviews| Index: content/browser/webauth/authenticator_impl.cc |
| diff --git a/content/browser/webauth/authenticator_impl.cc b/content/browser/webauth/authenticator_impl.cc |
| index 95393e8f867bec14130d0d271334dfab1efbfd95..cd64502fdd32ce3852c6ad759c8a315e10d76153 100644 |
| --- a/content/browser/webauth/authenticator_impl.cc |
| +++ b/content/browser/webauth/authenticator_impl.cc |
| @@ -17,7 +17,7 @@ namespace content { |
| namespace { |
| -const char kGetAssertionType[] = "navigator.id.getAssertion"; |
| +const char kMakeCredentialType[] = "navigator.id.makeCredential"; |
|
vasilii
2017/07/05 14:36:12
The new trend is 'constexpr' wherever possible.
kpaulhamus
2017/07/12 21:21:45
Done.
|
| // JSON key values |
| const char kTypeKey[] = "type"; |
| @@ -53,10 +53,7 @@ AuthenticatorImpl::AuthenticatorImpl(RenderFrameHost* render_frame_host) { |
| // mojom:Authenticator |
| void AuthenticatorImpl::MakeCredential( |
| - webauth::mojom::RelyingPartyAccountPtr account, |
| - std::vector<webauth::mojom::ScopedCredentialParametersPtr> parameters, |
| - const std::vector<uint8_t>& challenge, |
| - webauth::mojom::ScopedCredentialOptionsPtr options, |
| + webauth::mojom::MakeCredentialOptionsPtr options, |
| MakeCredentialCallback callback) { |
| std::string effective_domain; |
| std::string relying_party_id; |
| @@ -71,7 +68,7 @@ void AuthenticatorImpl::MakeCredential( |
| return; |
| } |
| - if (!options->relying_party_id) { |
| + if (options->relying_party->id.empty()) { |
| relying_party_id = caller_origin_.Serialize(); |
| } else { |
| effective_domain = caller_origin_.host(); |
| @@ -80,18 +77,18 @@ void AuthenticatorImpl::MakeCredential( |
| // TODO(kpaulhamus): Check if relyingPartyId is a registrable domain |
| // suffix of and equal to effectiveDomain and set relyingPartyId |
| // appropriately. |
| - relying_party_id = options->relying_party_id.value_or(std::string()); |
| + relying_party_id = options->relying_party->id; |
| } |
| // TODO(kpaulhamus): Check ScopedCredentialParameter's type and |
| // algorithmIdentifier after algorithmIdentifier is added to mojom to |
| // make sure it is U2F_V2. |
| - client_data.SetString(kTypeKey, kGetAssertionType); |
| - client_data.SetString( |
| - kChallengeKey, |
| - base::StringPiece(reinterpret_cast<const char*>(challenge.data()), |
| - challenge.size())); |
| + client_data.SetString(kTypeKey, kMakeCredentialType); |
| + client_data.SetString(kChallengeKey, |
| + base::StringPiece(reinterpret_cast<const char*>( |
| + options->challenge.data()), |
| + options->challenge.size())); |
| client_data.SetString(kOriginKey, relying_party_id); |
| // Channel ID is optional, and missing if the browser doesn't support it. |
| // It is present and set to the constant "unused" if the browser |