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

Unified Diff: content/child/webcrypto/algorithm_registry.h

Issue 379383002: Refactor WebCrypto code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase onto master Created 6 years, 5 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: content/child/webcrypto/algorithm_registry.h
diff --git a/content/child/webcrypto/jwk.h b/content/child/webcrypto/algorithm_registry.h
similarity index 33%
copy from content/child/webcrypto/jwk.h
copy to content/child/webcrypto/algorithm_registry.h
index c9191888256d957f56c00da4bebe970307cca9c3..6db5f5f56dd42bbcb4cf95ea2c3e9cfcd854ccfc 100644
--- a/content/child/webcrypto/jwk.h
+++ b/content/child/webcrypto/algorithm_registry.h
@@ -2,33 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_CHILD_WEBCRYPTO_JWK_H_
-#define CONTENT_CHILD_WEBCRYPTO_JWK_H_
+#ifndef CONTENT_CHILD_WEBCRYPTO_ALGORITHM_REGISTRY_H_
+#define CONTENT_CHILD_WEBCRYPTO_ALGORITHM_REGISTRY_H_
-#include <vector>
-
-#include "base/basictypes.h"
-#include "third_party/WebKit/public/platform/WebArrayBuffer.h"
#include "third_party/WebKit/public/platform/WebCrypto.h"
-#include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
namespace content {
namespace webcrypto {
-class CryptoData;
+class AlgorithmImplementation;
class Status;
-Status ImportKeyJwk(const CryptoData& key_data,
- const blink::WebCryptoAlgorithm& algorithm,
- bool extractable,
- blink::WebCryptoKeyUsageMask usage_mask,
- blink::WebCryptoKey* key);
-
-Status ExportKeyJwk(const blink::WebCryptoKey& key, std::vector<uint8>* buffer);
+// Retrieves the AlgorithmImplementation applicable for |id|.
+//
+// If there is no available implementation, then an error is returned, and
+// *impl is set to NULL.
+//
+// Otherwise Success is returned and *impl is set to a non-NULL value. The
+// AlgorithmImplementation pointer will remain valid until the program's
+// termination.
+Status GetAlgorithmImplementation(blink::WebCryptoAlgorithmId id,
+ const AlgorithmImplementation** impl);
Ryan Sleevi 2014/07/12 00:55:27 How is this model supposed to support IPC-based cr
eroman 2014/07/12 01:59:30 This is no different than before. Previously the p
} // namespace webcrypto
} // namespace content
-#endif // CONTENT_CHILD_WEBCRYPTO_JWK_H_
+#endif // CONTENT_CHILD_WEBCRYPTO_ALGORITHM_REGISTRY_H_

Powered by Google App Engine
This is Rietveld 408576698