| Index: Source/bindings/v8/ExceptionStatePlaceholder.h
|
| diff --git a/Source/modules/crypto/NormalizeAlgorithm.h b/Source/bindings/v8/ExceptionStatePlaceholder.h
|
| similarity index 57%
|
| copy from Source/modules/crypto/NormalizeAlgorithm.h
|
| copy to Source/bindings/v8/ExceptionStatePlaceholder.h
|
| index fdf1fd6299518a912e111769984786d87c8ebef5..8a94c53abc41e65a05c71ee842bfbba6c81b4fbc 100644
|
| --- a/Source/modules/crypto/NormalizeAlgorithm.h
|
| +++ b/Source/bindings/v8/ExceptionStatePlaceholder.h
|
| @@ -28,37 +28,48 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef NormalizeAlgorithm_h
|
| -#define NormalizeAlgorithm_h
|
| +#ifndef ExceptionStatePlaceholder_h
|
| +#define ExceptionStatePlaceholder_h
|
|
|
| +#include "bindings/v8/ExceptionState.h"
|
| #include "wtf/Assertions.h"
|
|
|
| -namespace WebKit { class WebCryptoAlgorithm; }
|
| -
|
| namespace WebCore {
|
|
|
| -class Dictionary;
|
| +class ExceptionState;
|
| +
|
| +class IgnorableExceptionState : public ExceptionState {
|
| +public:
|
| + IgnorableExceptionState(): ExceptionState(0) { }
|
| + ExceptionState& returnThis() { return *this; }
|
| + virtual void throwDOMException(const ExceptionCode&, const char* message = 0) OVERRIDE FINAL { };
|
| + virtual void throwTypeError(const char* message = 0) OVERRIDE FINAL { }
|
| +};
|
| +
|
| +#define IGNORE_EXCEPTION_STATE (::WebCore::IgnorableExceptionState().returnThis())
|
| +
|
| +#if ASSERT_DISABLED
|
|
|
| -typedef int ExceptionCode;
|
| +#define ASSERT_NO_EXCEPTION_STATE (::WebCore::IgnorableExceptionState().returnThis())
|
|
|
| -enum AlgorithmOperation {
|
| - Encrypt,
|
| - Decrypt,
|
| - Sign,
|
| - Verify,
|
| - Digest,
|
| - GenerateKey,
|
| - DeriveKey,
|
| - WrapKey,
|
| - UnwrapKey,
|
| - // <---- End of list
|
| - NumberOfAlgorithmOperations,
|
| +#else
|
| +
|
| +class NoExceptionStateAssertionChecker : public ExceptionState {
|
| +public:
|
| + NoExceptionStateAssertionChecker(const char* file, int line);
|
| + ExceptionState& returnThis() { return *this; }
|
| + virtual void throwDOMException(const ExceptionCode&, const char* message = 0) OVERRIDE FINAL;
|
| + virtual void throwTypeError(const char* message = 0) OVERRIDE FINAL;
|
| +
|
| +private:
|
| + const char* m_file;
|
| + int m_line;
|
| };
|
|
|
| -// Normalizes an algorithm identifier (dictionary) into a WebCryptoAlgorithm. If
|
| -// normalization fails then returns false and sets |ec|.
|
| -bool normalizeAlgorithm(const Dictionary&, AlgorithmOperation, WebKit::WebCryptoAlgorithm&, ExceptionCode&) WARN_UNUSED_RETURN;
|
| +#define ASSERT_NO_EXCEPTION_STATE (::WebCore::NoExceptionStateAssertionChecker(__FILE__, __LINE__).returnThis())
|
| +
|
| +#endif
|
|
|
| } // namespace WebCore
|
|
|
| -#endif
|
| +#endif // ExceptionStatePlaceholder_h
|
|
|