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

Side by Side Diff: third_party/WebKit/Source/modules/webauth/WebAuthentication.h

Issue 2788823002: Add the Mojo implementation of authenticator.mojom's MakeCredential. (Closed)
Patch Set: Stripping out unnecessary comments Created 3 years, 8 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 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 11 matching lines...) Expand all
22 class ScriptPromiseResolver; 22 class ScriptPromiseResolver;
23 23
24 typedef ArrayBufferOrArrayBufferView BufferSource; 24 typedef ArrayBufferOrArrayBufferView BufferSource;
25 25
26 class WebAuthentication final 26 class WebAuthentication final
27 : public GarbageCollectedFinalized<WebAuthentication>, 27 : public GarbageCollectedFinalized<WebAuthentication>,
28 public ScriptWrappable, 28 public ScriptWrappable,
29 public ContextLifecycleObserver { 29 public ContextLifecycleObserver {
30 DEFINE_WRAPPERTYPEINFO(); 30 DEFINE_WRAPPERTYPEINFO();
31 USING_GARBAGE_COLLECTED_MIXIN(WebAuthentication); 31 USING_GARBAGE_COLLECTED_MIXIN(WebAuthentication);
32 USING_PRE_FINALIZER(WebAuthentication, Dispose);
haraken 2017/04/13 01:59:40 What is it for? The Dispose method is empty.
32 33
33 public: 34 public:
34 static WebAuthentication* Create(LocalFrame& frame) { 35 static WebAuthentication* Create(LocalFrame& frame) {
35 return new WebAuthentication(frame); 36 return new WebAuthentication(frame);
36 } 37 }
37 38
38 virtual ~WebAuthentication(); 39 virtual ~WebAuthentication();
39 40
40 void Dispose(); 41 void Dispose();
41 42
42 // WebAuthentication.idl 43 // WebAuthentication.idl
43 ScriptPromise makeCredential(ScriptState*, 44 ScriptPromise makeCredential(ScriptState*,
44 const RelyingPartyAccount&, 45 const RelyingPartyAccount&,
45 const HeapVector<ScopedCredentialParameters>, 46 const HeapVector<ScopedCredentialParameters>,
46 const BufferSource&, 47 const BufferSource&,
47 ScopedCredentialOptions&); 48 ScopedCredentialOptions&);
48 ScriptPromise getAssertion(ScriptState*, 49 ScriptPromise getAssertion(ScriptState*,
49 const BufferSource&, 50 const BufferSource&,
50 const AuthenticationAssertionOptions&); 51 const AuthenticationAssertionOptions&);
51 52
52 // ContextLifecycleObserver overrides.
53 void ContextDestroyed(ExecutionContext*) override;
54
55 webauth::mojom::blink::Authenticator* authenticator() const { 53 webauth::mojom::blink::Authenticator* authenticator() const {
56 return m_authenticator.get(); 54 return m_authenticator.get();
57 } 55 }
58 56
59 void onMakeCredential(ScriptPromiseResolver*, 57 // ContextLifecycleObserver overrides.
60 Vector<webauth::mojom::blink::ScopedCredentialInfoPtr>); 58 void ContextDestroyed(ExecutionContext*) override;
61 bool markRequestComplete(ScriptPromiseResolver*);
62
63 void onAuthenticatorConnectionError();
64 59
65 DECLARE_VIRTUAL_TRACE(); 60 DECLARE_VIRTUAL_TRACE();
66 61
67 private: 62 private:
68 explicit WebAuthentication(LocalFrame&); 63 explicit WebAuthentication(LocalFrame&);
69 64
65 void onMakeCredential(ScriptPromiseResolver*,
66 webauth::mojom::blink::AuthenticatorStatus,
67 webauth::mojom::blink::ScopedCredentialInfoPtr);
68 ScriptPromise rejectIfNotSupported(ScriptState*);
69 void onAuthenticatorConnectionError();
70 bool markRequestComplete(ScriptPromiseResolver*);
71 void cleanup();
72
70 webauth::mojom::blink::AuthenticatorPtr m_authenticator; 73 webauth::mojom::blink::AuthenticatorPtr m_authenticator;
71 HeapHashSet<Member<ScriptPromiseResolver>> m_authenticatorRequests; 74 HeapHashSet<Member<ScriptPromiseResolver>> m_authenticatorRequests;
72 }; 75 };
73 76
74 } // namespace blink 77 } // namespace blink
75 78
76 #endif // WebAuthentication_h 79 #endif // WebAuthentication_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webauth/BUILD.gn ('k') | third_party/WebKit/Source/modules/webauth/WebAuthentication.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698