| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 namespace WebCore { class CryptoResult; } | 38 namespace WebCore { class CryptoResult; } |
| 39 | 39 |
| 40 #if WEBKIT_IMPLEMENTATION | 40 #if WEBKIT_IMPLEMENTATION |
| 41 namespace WTF { template <typename T> class PassRefPtr; } | 41 namespace WTF { template <typename T> class PassRefPtr; } |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 namespace WebKit { | 44 namespace WebKit { |
| 45 | 45 |
| 46 class WebArrayBuffer; | 46 class WebArrayBuffer; |
| 47 class WebCryptoOperation; | |
| 48 | 47 |
| 49 class WebCryptoResult { | 48 class WebCryptoResult { |
| 50 public: | 49 public: |
| 51 WebCryptoResult(const WebCryptoResult& o) | 50 WebCryptoResult(const WebCryptoResult& o) |
| 52 { | 51 { |
| 53 assign(o); | 52 assign(o); |
| 54 } | 53 } |
| 55 | 54 |
| 56 ~WebCryptoResult() | 55 ~WebCryptoResult() |
| 57 { | 56 { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 77 | 76 |
| 78 private: | 77 private: |
| 79 WEBKIT_EXPORT void reset(); | 78 WEBKIT_EXPORT void reset(); |
| 80 WEBKIT_EXPORT void assign(const WebCryptoResult&); | 79 WEBKIT_EXPORT void assign(const WebCryptoResult&); |
| 81 | 80 |
| 82 WebPrivatePtr<WebCore::CryptoResult> m_impl; | 81 WebPrivatePtr<WebCore::CryptoResult> m_impl; |
| 83 }; | 82 }; |
| 84 | 83 |
| 85 class WebCrypto { | 84 class WebCrypto { |
| 86 public: | 85 public: |
| 87 // FIXME: Deprecated, delete once chromium side is updated. | |
| 88 virtual WebCryptoOperation* digest(const WebCryptoAlgorithm&) { WEBKIT_ASSER
T_NOT_REACHED(); return 0; } | |
| 89 | |
| 90 // Starts a one-shot cryptographic operation which can complete either | 86 // Starts a one-shot cryptographic operation which can complete either |
| 91 // synchronously, or asynchronously. | 87 // synchronously, or asynchronously. |
| 92 // | 88 // |
| 93 // Let the WebCryptoResult be called "result". | 89 // Let the WebCryptoResult be called "result". |
| 94 // | 90 // |
| 95 // The result should be set exactly once, from the same thread which | 91 // The result should be set exactly once, from the same thread which |
| 96 // initiated the operation. | 92 // initiated the operation. |
| 97 virtual void encrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const u
nsigned char* data, size_t data_size, WebCryptoResult) { WEBKIT_ASSERT_NOT_REACH
ED(); } | 93 virtual void encrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const u
nsigned char* data, size_t data_size, WebCryptoResult) { WEBKIT_ASSERT_NOT_REACH
ED(); } |
| 98 virtual void decrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const u
nsigned char* data, size_t data_size, WebCryptoResult) { WEBKIT_ASSERT_NOT_REACH
ED(); } | 94 virtual void decrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const u
nsigned char* data, size_t data_size, WebCryptoResult) { WEBKIT_ASSERT_NOT_REACH
ED(); } |
| 99 virtual void sign(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsi
gned char* data, size_t data_size, WebCryptoResult) { WEBKIT_ASSERT_NOT_REACHED(
); } | 95 virtual void sign(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsi
gned char* data, size_t data_size, WebCryptoResult) { WEBKIT_ASSERT_NOT_REACHED(
); } |
| 100 virtual void verifySignature(const WebCryptoAlgorithm&, const WebCryptoKey&,
const unsigned char* signature, size_t signature_size, const unsigned char* dat
a, size_t data_size, WebCryptoResult) { WEBKIT_ASSERT_NOT_REACHED(); } | 96 virtual void verifySignature(const WebCryptoAlgorithm&, const WebCryptoKey&,
const unsigned char* signature, size_t signature_size, const unsigned char* dat
a, size_t data_size, WebCryptoResult) { WEBKIT_ASSERT_NOT_REACHED(); } |
| 101 virtual void digest(const WebCryptoAlgorithm&, const unsigned char* data, si
ze_t data_size, WebCryptoResult) { WEBKIT_ASSERT_NOT_REACHED(); } | 97 virtual void digest(const WebCryptoAlgorithm&, const unsigned char* data, si
ze_t data_size, WebCryptoResult) { WEBKIT_ASSERT_NOT_REACHED(); } |
| 102 virtual void generateKey(const WebCryptoAlgorithm&, bool extractable, WebCry
ptoKeyUsageMask, WebCryptoResult) { WEBKIT_ASSERT_NOT_REACHED(); } | 98 virtual void generateKey(const WebCryptoAlgorithm&, bool extractable, WebCry
ptoKeyUsageMask, WebCryptoResult) { WEBKIT_ASSERT_NOT_REACHED(); } |
| 103 virtual void importKey(WebCryptoKeyFormat, const unsigned char* keyData, siz
e_t keyDataSize, const WebCryptoAlgorithm&, bool extractable, WebCryptoKeyUsageM
ask, WebCryptoResult) { WEBKIT_ASSERT_NOT_REACHED(); } | 99 virtual void importKey(WebCryptoKeyFormat, const unsigned char* keyData, siz
e_t keyDataSize, const WebCryptoAlgorithm&, bool extractable, WebCryptoKeyUsageM
ask, WebCryptoResult) { WEBKIT_ASSERT_NOT_REACHED(); } |
| 104 | 100 |
| 105 protected: | 101 protected: |
| 106 virtual ~WebCrypto() { } | 102 virtual ~WebCrypto() { } |
| 107 }; | 103 }; |
| 108 | 104 |
| 109 } // namespace WebKit | 105 } // namespace WebKit |
| 110 | 106 |
| 111 #endif | 107 #endif |
| OLD | NEW |