| 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 class WebArrayBuffer; | 38 class WebArrayBuffer; |
| 39 class WebCryptoAlgorithm; | 39 class WebCryptoAlgorithm; |
| 40 class WebCryptoKey; | 40 class WebCryptoKey; |
| 41 class WebCryptoOperation; | 41 class WebCryptoOperation; |
| 42 class WebCryptoOperationResult; | 42 class WebCryptoOperationResult; |
| 43 | 43 |
| 44 class WebCrypto { | 44 class WebCrypto { |
| 45 public: | 45 public: |
| 46 // FIXME: Deprecated, delete once chromium side is updated. | 46 // FIXME: Deprecated, delete once chromium side is updated. |
| 47 virtual WebCryptoOperation* digest(const WebCryptoAlgorithm&) = 0; | 47 virtual WebCryptoOperation* digest(const WebCryptoAlgorithm&) { return 0; } |
| 48 | 48 |
| 49 // The following methods begin an asynchronous multi-part cryptographic | 49 // The following methods begin an asynchronous multi-part cryptographic |
| 50 // operation. | 50 // operation. |
| 51 // | 51 // |
| 52 // Let the WebCryptoOperationResult* be called "result". | 52 // Let the WebCryptoOperationResult* be called "result". |
| 53 // | 53 // |
| 54 // Implementations can either: | 54 // Implementations can either: |
| 55 // | 55 // |
| 56 // * Synchronously fail initialization by calling: | 56 // * Synchronously fail initialization by calling: |
| 57 // result->initializationFailed(errorDetails) | 57 // result->initializationFailed(errorDetails) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 77 // The cryptoOperation is said to be "in progress" from the time after | 77 // The cryptoOperation is said to be "in progress" from the time after |
| 78 // result->initializationSucceded() has been called, up until either: | 78 // result->initializationSucceded() has been called, up until either: |
| 79 // | 79 // |
| 80 // - Blink calls cryptoOperation->abort() | 80 // - Blink calls cryptoOperation->abort() |
| 81 // OR | 81 // OR |
| 82 // - Embedder calls result->completeWithXXX() | 82 // - Embedder calls result->completeWithXXX() |
| 83 // | 83 // |
| 84 // Once the cryptoOperation is no longer "in progress" the "result" pointer | 84 // Once the cryptoOperation is no longer "in progress" the "result" pointer |
| 85 // is no longer valid. At this time the embedder is responsible for freeing | 85 // is no longer valid. At this time the embedder is responsible for freeing |
| 86 // the cryptoOperation. | 86 // the cryptoOperation. |
| 87 virtual void digest2(const WebCryptoAlgorithm&, WebCryptoOperationResult*) {
} | 87 virtual void digest(const WebCryptoAlgorithm&, WebCryptoOperationResult*) {
} |
| 88 | 88 |
| 89 protected: | 89 protected: |
| 90 virtual ~WebCrypto() { } | 90 virtual ~WebCrypto() { } |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 class WebCryptoOperation { | 93 class WebCryptoOperation { |
| 94 public: | 94 public: |
| 95 // Feeds data (bytes, size) to the operation. | 95 // Feeds data (bytes, size) to the operation. |
| 96 // - |bytes| may be 0 if |size| is 0 | 96 // - |bytes| may be 0 if |size| is 0 |
| 97 // - |bytes| is valid only until process() returns | 97 // - |bytes| is valid only until process() returns |
| (...skipping 22 matching lines...) Expand all Loading... |
| 120 virtual void completeWithError() = 0; | 120 virtual void completeWithError() = 0; |
| 121 virtual void completeWithArrayBuffer(const WebArrayBuffer&) = 0; | 121 virtual void completeWithArrayBuffer(const WebArrayBuffer&) = 0; |
| 122 | 122 |
| 123 protected: | 123 protected: |
| 124 virtual ~WebCryptoOperationResult() { } | 124 virtual ~WebCryptoOperationResult() { } |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 } // namespace WebKit | 127 } // namespace WebKit |
| 128 | 128 |
| 129 #endif | 129 #endif |
| OLD | NEW |