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

Side by Side Diff: components/webcrypto/algorithm_registry.cc

Issue 1077273002: html_viewer: Move webcrypto to a place where html_viewer can use it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT Created 5 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
« no previous file with comments | « components/webcrypto/algorithm_registry.h ('k') | components/webcrypto/crypto_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/child/webcrypto/algorithm_registry.h" 5 #include "components/webcrypto/algorithm_registry.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "content/child/webcrypto/algorithm_implementation.h" 8 #include "components/webcrypto/algorithm_implementation.h"
9 #include "content/child/webcrypto/platform_crypto.h" 9 #include "components/webcrypto/platform_crypto.h"
10 #include "content/child/webcrypto/status.h" 10 #include "components/webcrypto/status.h"
11
12 namespace content {
13 11
14 namespace webcrypto { 12 namespace webcrypto {
15 13
16 namespace { 14 namespace {
17 15
18 // This class is used as a singleton. All methods must be threadsafe. 16 // This class is used as a singleton. All methods must be threadsafe.
19 class AlgorithmRegistry { 17 class AlgorithmRegistry {
20 public: 18 public:
21 AlgorithmRegistry() 19 AlgorithmRegistry()
22 : sha_(CreatePlatformShaImplementation()), 20 : sha_(CreatePlatformShaImplementation()),
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 93
96 Status GetAlgorithmImplementation(blink::WebCryptoAlgorithmId id, 94 Status GetAlgorithmImplementation(blink::WebCryptoAlgorithmId id,
97 const AlgorithmImplementation** impl) { 95 const AlgorithmImplementation** impl) {
98 *impl = g_algorithm_registry.Get().GetAlgorithm(id); 96 *impl = g_algorithm_registry.Get().GetAlgorithm(id);
99 if (*impl) 97 if (*impl)
100 return Status::Success(); 98 return Status::Success();
101 return Status::ErrorUnsupported(); 99 return Status::ErrorUnsupported();
102 } 100 }
103 101
104 } // namespace webcrypto 102 } // namespace webcrypto
105
106 } // namespace content
OLDNEW
« no previous file with comments | « components/webcrypto/algorithm_registry.h ('k') | components/webcrypto/crypto_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698