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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "content/common/android/surface_texture_lookup.h"
6
7 #include "base/logging.h" 5 #include "base/logging.h"
6 #include "content/child/webcrypto/openssl/aes_key_openssl.h"
7 #include "content/child/webcrypto/status.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 namespace webcrypto {
12
11 namespace { 13 namespace {
12 SurfaceTextureLookup* g_instance = NULL; 14
15 class AesKwImplementation : public AesAlgorithm {
16 public:
17 AesKwImplementation() : AesAlgorithm("KW") {}
18
19 virtual Status Encrypt(const blink::WebCryptoAlgorithm& algorithm,
20 const blink::WebCryptoKey& key,
21 const CryptoData& data,
22 std::vector<uint8>* buffer) const OVERRIDE {
23 // TODO(eroman):
24 return Status::ErrorUnsupported();
25 }
26
27 virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm,
28 const blink::WebCryptoKey& key,
29 const CryptoData& data,
30 std::vector<uint8>* buffer) const OVERRIDE {
31 // TODO(eroman):
32 return Status::ErrorUnsupported();
33 }
34 };
35
13 } // namespace 36 } // namespace
14 37
15 // static 38 AlgorithmImplementation* CreatePlatformAesKwImplementation() {
16 SurfaceTextureLookup* SurfaceTextureLookup::GetInstance() { 39 return new AesKwImplementation;
17 DCHECK(g_instance);
18 return g_instance;
19 } 40 }
20 41
21 // static 42 } // namespace webcrypto
22 void SurfaceTextureLookup::InitInstance(SurfaceTextureLookup* instance) {
23 DCHECK(!g_instance || !instance);
24 g_instance = instance;
25 }
26 43
27 } // namespace content 44 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698