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

Unified Diff: content/child/webcrypto/openssl/aes_kw_openssl.cc

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/openssl/aes_kw_openssl.cc
diff --git a/content/common/android/surface_texture_lookup.cc b/content/child/webcrypto/openssl/aes_kw_openssl.cc
similarity index 21%
copy from content/common/android/surface_texture_lookup.cc
copy to content/child/webcrypto/openssl/aes_kw_openssl.cc
index ee6715d3d8de7ab84ae313beba7a9b10f452ce11..d2bb10fc88b8c7468fb37069d13e43db495a23f0 100644
--- a/content/common/android/surface_texture_lookup.cc
+++ b/content/child/webcrypto/openssl/aes_kw_openssl.cc
@@ -2,26 +2,43 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/common/android/surface_texture_lookup.h"
-
#include "base/logging.h"
+#include "content/child/webcrypto/openssl/aes_key_openssl.h"
+#include "content/child/webcrypto/status.h"
namespace content {
+namespace webcrypto {
+
namespace {
-SurfaceTextureLookup* g_instance = NULL;
+
+class AesKwImplementation : public AesAlgorithm {
+ public:
+ AesKwImplementation() : AesAlgorithm("KW") {}
+
+ virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm,
+ const blink::WebCryptoKey& key,
+ const CryptoData& data,
+ std::vector<uint8>* buffer) const OVERRIDE {
+ // TODO(eroman):
+ return Status::ErrorUnsupported();
+ }
+
+ virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm,
+ const blink::WebCryptoKey& key,
+ const CryptoData& data,
+ std::vector<uint8>* buffer) const OVERRIDE {
+ // TODO(eroman):
+ return Status::ErrorUnsupported();
+ }
+};
+
} // namespace
-// static
-SurfaceTextureLookup* SurfaceTextureLookup::GetInstance() {
- DCHECK(g_instance);
- return g_instance;
+AlgorithmImplementation* CreatePlatformAesKwImplementation() {
+ return new AesKwImplementation;
}
-// static
-void SurfaceTextureLookup::InitInstance(SurfaceTextureLookup* instance) {
- DCHECK(!g_instance || !instance);
- g_instance = instance;
-}
+} // namespace webcrypto
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698