OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef WebAuthentication_h | 5 #ifndef WebAuthentication_h |
6 #define WebAuthentication_h | 6 #define WebAuthentication_h |
7 | 7 |
8 #include "bindings/core/v8/ArrayBufferOrArrayBufferView.h" | 8 #include "bindings/core/v8/ArrayBufferOrArrayBufferView.h" |
9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
(...skipping 19 matching lines...) Expand all Loading... | |
30 DEFINE_WRAPPERTYPEINFO(); | 30 DEFINE_WRAPPERTYPEINFO(); |
31 USING_GARBAGE_COLLECTED_MIXIN(WebAuthentication); | 31 USING_GARBAGE_COLLECTED_MIXIN(WebAuthentication); |
32 | 32 |
33 public: | 33 public: |
34 static WebAuthentication* Create(LocalFrame& frame) { | 34 static WebAuthentication* Create(LocalFrame& frame) { |
35 return new WebAuthentication(frame); | 35 return new WebAuthentication(frame); |
36 } | 36 } |
37 | 37 |
38 virtual ~WebAuthentication(); | 38 virtual ~WebAuthentication(); |
39 | 39 |
40 void Dispose(); | |
41 | |
42 // WebAuthentication.idl | 40 // WebAuthentication.idl |
43 ScriptPromise makeCredential(ScriptState*, | 41 ScriptPromise makeCredential(ScriptState*, |
44 const RelyingPartyAccount&, | 42 const RelyingPartyAccount&, |
45 const HeapVector<ScopedCredentialParameters>, | 43 const HeapVector<ScopedCredentialParameters>, |
46 const BufferSource&, | 44 const BufferSource&, |
47 ScopedCredentialOptions&); | 45 ScopedCredentialOptions&); |
48 ScriptPromise getAssertion(ScriptState*, | 46 ScriptPromise getAssertion(ScriptState*, |
49 const BufferSource&, | 47 const BufferSource&, |
50 const AuthenticationAssertionOptions&); | 48 const AuthenticationAssertionOptions&); |
51 | 49 |
52 // ContextLifecycleObserver overrides. | |
53 void ContextDestroyed(ExecutionContext*) override; | |
54 | |
55 webauth::mojom::blink::Authenticator* authenticator() const { | 50 webauth::mojom::blink::Authenticator* authenticator() const { |
56 return m_authenticator.get(); | 51 return m_authenticator.get(); |
57 } | 52 } |
58 | 53 |
59 void onMakeCredential(ScriptPromiseResolver*, | 54 // ContextLifecycleObserver overrides. |
60 Vector<webauth::mojom::blink::ScopedCredentialInfoPtr>); | 55 void ContextDestroyed(ExecutionContext*) override; |
61 bool markRequestComplete(ScriptPromiseResolver*); | |
62 | |
63 void onAuthenticatorConnectionError(); | |
64 | 56 |
65 DECLARE_VIRTUAL_TRACE(); | 57 DECLARE_VIRTUAL_TRACE(); |
66 | 58 |
67 private: | 59 private: |
68 explicit WebAuthentication(LocalFrame&); | 60 explicit WebAuthentication(LocalFrame&); |
69 | 61 |
62 void onMakeCredential(ScriptPromiseResolver*, | |
foolip
2017/05/12 07:55:50
Looks like this CL needs to be rebased to after th
| |
63 webauth::mojom::blink::AuthenticatorStatus, | |
64 webauth::mojom::blink::ScopedCredentialInfoPtr); | |
65 ScriptPromise rejectIfNotSupported(ScriptState*); | |
66 void onAuthenticatorConnectionError(); | |
67 bool markRequestComplete(ScriptPromiseResolver*); | |
68 void cleanup(); | |
69 | |
70 webauth::mojom::blink::AuthenticatorPtr m_authenticator; | 70 webauth::mojom::blink::AuthenticatorPtr m_authenticator; |
71 HeapHashSet<Member<ScriptPromiseResolver>> m_authenticatorRequests; | 71 HeapHashSet<Member<ScriptPromiseResolver>> m_authenticatorRequests; |
72 }; | 72 }; |
73 | 73 |
74 } // namespace blink | 74 } // namespace blink |
75 | 75 |
76 #endif // WebAuthentication_h | 76 #endif // WebAuthentication_h |
OLD | NEW |