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

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

Issue 121113004: Improve handling of failed integer type conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 11 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
« no previous file with comments | « Source/bindings/v8/Dictionary.h ('k') | Source/bindings/v8/ExceptionState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ExceptionState.h
diff --git a/Source/bindings/v8/ExceptionState.h b/Source/bindings/v8/ExceptionState.h
index 69fea70bdc9ccf6852185ca9b839f2cb4fd5f00f..1e3bd7655ceecef6900040743a932d5ea97ab375 100644
--- a/Source/bindings/v8/ExceptionState.h
+++ b/Source/bindings/v8/ExceptionState.h
@@ -127,9 +127,19 @@ private:
v8::Isolate* m_isolate;
};
+// Used if exceptions can/should not be directly thrown.
+class NonThrowableExceptionState : public ExceptionState {
+public:
+ NonThrowableExceptionState(): ExceptionState(v8::Handle<v8::Object>(), v8::Isolate::GetCurrent()) { }
+ virtual void throwDOMException(const ExceptionCode&, const String& message) OVERRIDE FINAL;
+ virtual void throwTypeError(const String& message = String()) OVERRIDE FINAL;
+ virtual void throwSecurityError(const String& sanitizedMessage, const String& unsanitizedMessage = String()) OVERRIDE FINAL;
+};
+
+// Used if any exceptions thrown are ignorable.
class TrackExceptionState : public ExceptionState {
public:
- TrackExceptionState(): ExceptionState(v8::Handle<v8::Object>(), 0) { }
+ TrackExceptionState(): ExceptionState(v8::Handle<v8::Object>(), v8::Isolate::GetCurrent()) { }
virtual void throwDOMException(const ExceptionCode&, const String& message) OVERRIDE FINAL;
virtual void throwTypeError(const String& message = String()) OVERRIDE FINAL;
virtual void throwSecurityError(const String& sanitizedMessage, const String& unsanitizedMessage = String()) OVERRIDE FINAL;
« no previous file with comments | « Source/bindings/v8/Dictionary.h ('k') | Source/bindings/v8/ExceptionState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698