| OLD | NEW | 
|   1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |   1 // Copyright (c) 2013 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 #ifndef CONTENT_RENDERER_WEBCRYPTO_IMPL_H_ |   5 #ifndef CONTENT_RENDERER_WEBCRYPTO_IMPL_H_ | 
|   6 #define CONTENT_RENDERER_WEBCRYPTO_IMPL_H_ |   6 #define CONTENT_RENDERER_WEBCRYPTO_IMPL_H_ | 
|   7  |   7  | 
|   8 #include "base/basictypes.h" |   8 #include "base/basictypes.h" | 
|   9 #include "base/compiler_specific.h" |   9 #include "base/compiler_specific.h" | 
|  10 #include "base/gtest_prod_util.h" |  | 
|  11 #include "base/memory/scoped_ptr.h" |  10 #include "base/memory/scoped_ptr.h" | 
|  12 #include "content/common/content_export.h" |  11 #include "content/common/content_export.h" | 
|  13 #include "third_party/WebKit/public/platform/WebCrypto.h" |  12 #include "third_party/WebKit/public/platform/WebCrypto.h" | 
|  14  |  13  | 
|  15 namespace content { |  14 namespace content { | 
|  16  |  15  | 
|  17 class CONTENT_EXPORT WebCryptoImpl |  16 class CONTENT_EXPORT WebCryptoImpl | 
|  18     : NON_EXPORTED_BASE(public WebKit::WebCrypto) { |  17     : NON_EXPORTED_BASE(public WebKit::WebCrypto) { | 
|  19  public: |  18  public: | 
|  20   WebCryptoImpl(); |  19   WebCryptoImpl(); | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
|  33       WebKit::WebCryptoKeyUsageMask usage_mask, |  32       WebKit::WebCryptoKeyUsageMask usage_mask, | 
|  34       WebKit::WebCryptoResult result); |  33       WebKit::WebCryptoResult result); | 
|  35   virtual void sign( |  34   virtual void sign( | 
|  36       const WebKit::WebCryptoAlgorithm& algorithm, |  35       const WebKit::WebCryptoAlgorithm& algorithm, | 
|  37       const WebKit::WebCryptoKey& key, |  36       const WebKit::WebCryptoKey& key, | 
|  38       const unsigned char* data, |  37       const unsigned char* data, | 
|  39       unsigned data_size, |  38       unsigned data_size, | 
|  40       WebKit::WebCryptoResult result); |  39       WebKit::WebCryptoResult result); | 
|  41  |  40  | 
|  42  protected: |  41  protected: | 
|  43   FRIEND_TEST_ALL_PREFIXES(WebCryptoImplTest, DigestSampleSets); |  | 
|  44   FRIEND_TEST_ALL_PREFIXES(WebCryptoImplTest, HMACSampleSets); |  | 
|  45  |  | 
|  46   void Init(); |  42   void Init(); | 
|  47  |  43  | 
|  48   bool DigestInternal( |  44   bool DigestInternal( | 
|  49       const WebKit::WebCryptoAlgorithm& algorithm, |  45       const WebKit::WebCryptoAlgorithm& algorithm, | 
|  50       const unsigned char* data, |  46       const unsigned char* data, | 
|  51       unsigned data_size, |  47       unsigned data_size, | 
|  52       WebKit::WebArrayBuffer* buffer); |  48       WebKit::WebArrayBuffer* buffer); | 
|  53   bool ImportKeyInternal( |  49   bool ImportKeyInternal( | 
|  54       WebKit::WebCryptoKeyFormat format, |  50       WebKit::WebCryptoKeyFormat format, | 
|  55       const unsigned char* key_data, |  51       const unsigned char* key_data, | 
|  56       unsigned key_data_size, |  52       unsigned key_data_size, | 
|  57       const WebKit::WebCryptoAlgorithm& algorithm, |  53       const WebKit::WebCryptoAlgorithm& algorithm, | 
|  58       WebKit::WebCryptoKeyUsageMask usage_mask, |  54       WebKit::WebCryptoKeyUsageMask usage_mask, | 
|  59       scoped_ptr<WebKit::WebCryptoKeyHandle>* handle, |  55       scoped_ptr<WebKit::WebCryptoKeyHandle>* handle, | 
|  60       WebKit::WebCryptoKeyType* type); |  56       WebKit::WebCryptoKeyType* type); | 
|  61   bool SignInternal( |  57   bool SignInternal( | 
|  62       const WebKit::WebCryptoAlgorithm& algorithm, |  58       const WebKit::WebCryptoAlgorithm& algorithm, | 
|  63       const WebKit::WebCryptoKey& key, |  59       const WebKit::WebCryptoKey& key, | 
|  64       const unsigned char* data, |  60       const unsigned char* data, | 
|  65       unsigned data_size, |  61       unsigned data_size, | 
|  66       WebKit::WebArrayBuffer* buffer); |  62       WebKit::WebArrayBuffer* buffer); | 
|  67  |  63  | 
|  68  private: |  64  private: | 
|  69   DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); |  65   DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); | 
|  70 }; |  66 }; | 
|  71  |  67  | 
|  72 }  // namespace content |  68 }  // namespace content | 
|  73  |  69  | 
|  74 #endif  // CONTENT_RENDERER_WEBCRYPTO_IMPL_H_ |  70 #endif  // CONTENT_RENDERER_WEBCRYPTO_IMPL_H_ | 
| OLD | NEW |