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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 private: | 120 private: |
121 void setException(v8::Handle<v8::Value>); | 121 void setException(v8::Handle<v8::Value>); |
122 | 122 |
123 String addExceptionContext(const String&) const; | 123 String addExceptionContext(const String&) const; |
124 | 124 |
125 ScopedPersistent<v8::Value> m_exception; | 125 ScopedPersistent<v8::Value> m_exception; |
126 v8::Handle<v8::Object> m_creationContext; | 126 v8::Handle<v8::Object> m_creationContext; |
127 v8::Isolate* m_isolate; | 127 v8::Isolate* m_isolate; |
128 }; | 128 }; |
129 | 129 |
130 class TrackExceptionState : public ExceptionState { | 130 // Used if exceptions can/should not be directly thrown. |
| 131 class NonThrowableExceptionState : public ExceptionState { |
131 public: | 132 public: |
132 TrackExceptionState(): ExceptionState(v8::Handle<v8::Object>(), 0) { } | 133 NonThrowableExceptionState(): ExceptionState(v8::Handle<v8::Object>(), v8::I
solate::GetCurrent()) { } |
133 virtual void throwDOMException(const ExceptionCode&, const String& message)
OVERRIDE FINAL; | 134 virtual void throwDOMException(const ExceptionCode&, const String& message)
OVERRIDE FINAL; |
134 virtual void throwTypeError(const String& message = String()) OVERRIDE FINAL
; | 135 virtual void throwTypeError(const String& message = String()) OVERRIDE FINAL
; |
135 virtual void throwSecurityError(const String& sanitizedMessage, const String
& unsanitizedMessage = String()) OVERRIDE FINAL; | 136 virtual void throwSecurityError(const String& sanitizedMessage, const String
& unsanitizedMessage = String()) OVERRIDE FINAL; |
| 137 }; |
| 138 |
| 139 // Used if any exceptions thrown are ignorable. |
| 140 class TrackExceptionState : public ExceptionState { |
| 141 public: |
| 142 TrackExceptionState(): ExceptionState(v8::Handle<v8::Object>(), v8::Isolate:
:GetCurrent()) { } |
| 143 virtual void throwDOMException(const ExceptionCode&, const String& message)
OVERRIDE FINAL; |
| 144 virtual void throwTypeError(const String& message = String()) OVERRIDE FINAL
; |
| 145 virtual void throwSecurityError(const String& sanitizedMessage, const String
& unsanitizedMessage = String()) OVERRIDE FINAL; |
136 }; | 146 }; |
137 | 147 |
138 } // namespace WebCore | 148 } // namespace WebCore |
139 | 149 |
140 #endif // ExceptionState_h | 150 #endif // ExceptionState_h |
OLD | NEW |