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

Unified Diff: third_party/WebKit/Source/modules/webauth/ScopedCredential.h

Issue 2533863002: Add WebAuthn bindings and client interface. (Closed)
Patch Set: Layout test expected file tweaks Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webauth/ScopedCredential.h
diff --git a/third_party/WebKit/Source/modules/webauth/ScopedCredential.h b/third_party/WebKit/Source/modules/webauth/ScopedCredential.h
new file mode 100644
index 0000000000000000000000000000000000000000..6ca82980b1237e1b6475b85373392456525eaf99
--- /dev/null
+++ b/third_party/WebKit/Source/modules/webauth/ScopedCredential.h
@@ -0,0 +1,54 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ScopedCredential_h
+#define ScopedCredential_h
+
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "core/dom/DOMArrayBuffer.h"
+
+namespace blink {
+
+class ScopedCredentialType;
+
+class ScopedCredential final
+ : public GarbageCollectedFinalized<ScopedCredential>,
+ public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+
+ public:
+ enum class ScopedCredentialType { SCOPEDCRED };
+
+ static ScopedCredential* create(const ScopedCredentialType type,
+ DOMArrayBuffer* id) {
+ return new ScopedCredential(type, id);
+ }
+
+ ScopedCredential(const ScopedCredentialType type, DOMArrayBuffer* id)
+ : m_type(type), m_id(id) {}
+
+ virtual ~ScopedCredential() {}
+
+ String type() const {
+ DCHECK_EQ(m_type, ScopedCredentialType::SCOPEDCRED);
+ return "ScopedCred";
+ }
+
+ DOMArrayBuffer* id() const { return m_id.get(); }
+
+ ScopedCredentialType stringToCredentialType(const String& type) {
+ // There is currently only one type
+ return ScopedCredentialType::SCOPEDCRED;
+ }
+
+ DEFINE_INLINE_TRACE() { visitor->trace(m_id); }
+
+ private:
+ const ScopedCredentialType m_type;
+ const Member<DOMArrayBuffer> m_id;
+};
+
+} // namespace blink
+
+#endif // ScopedCredential_h

Powered by Google App Engine
This is Rietveld 408576698