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

Unified Diff: Source/bindings/v8/ExceptionStatePlaceholder.h

Issue 18398002: Remove IDBNotFoundError ExceptionCode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing include in code gen wich causes win compile failure Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698