| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 } | 99 } |
| 100 | 100 |
| 101 V8ThrowException::throwError(m_exception.newLocal(m_isolate), m_isolate)
; | 101 V8ThrowException::throwError(m_exception.newLocal(m_isolate), m_isolate)
; |
| 102 return true; | 102 return true; |
| 103 } | 103 } |
| 104 | 104 |
| 105 Context context() const { return m_context; } | 105 Context context() const { return m_context; } |
| 106 const char* propertyName() const { return m_propertyName; } | 106 const char* propertyName() const { return m_propertyName; } |
| 107 const char* interfaceName() const { return m_interfaceName; } | 107 const char* interfaceName() const { return m_interfaceName; } |
| 108 | 108 |
| 109 void rethrowV8Exception(v8::Handle<v8::Value> value) |
| 110 { |
| 111 setException(value); |
| 112 } |
| 113 |
| 109 protected: | 114 protected: |
| 110 ExceptionCode m_code; | 115 ExceptionCode m_code; |
| 111 Context m_context; | 116 Context m_context; |
| 112 const char* m_propertyName; | 117 const char* m_propertyName; |
| 113 const char* m_interfaceName; | 118 const char* m_interfaceName; |
| 114 | 119 |
| 115 private: | 120 private: |
| 116 void setException(v8::Handle<v8::Value>); | 121 void setException(v8::Handle<v8::Value>); |
| 117 | 122 |
| 118 String addExceptionContext(const String&) const; | 123 String addExceptionContext(const String&) const; |
| 119 | 124 |
| 120 ScopedPersistent<v8::Value> m_exception; | 125 ScopedPersistent<v8::Value> m_exception; |
| 121 v8::Handle<v8::Object> m_creationContext; | 126 v8::Handle<v8::Object> m_creationContext; |
| 122 v8::Isolate* m_isolate; | 127 v8::Isolate* m_isolate; |
| 123 }; | 128 }; |
| 124 | 129 |
| 125 class TrackExceptionState : public ExceptionState { | 130 class TrackExceptionState : public ExceptionState { |
| 126 public: | 131 public: |
| 127 TrackExceptionState(): ExceptionState(v8::Handle<v8::Object>(), 0) { } | 132 TrackExceptionState(): ExceptionState(v8::Handle<v8::Object>(), 0) { } |
| 128 virtual void throwDOMException(const ExceptionCode&, const String& message)
OVERRIDE FINAL; | 133 virtual void throwDOMException(const ExceptionCode&, const String& message)
OVERRIDE FINAL; |
| 129 virtual void throwTypeError(const String& message = String()) OVERRIDE FINAL
; | 134 virtual void throwTypeError(const String& message = String()) OVERRIDE FINAL
; |
| 130 virtual void throwSecurityError(const String& sanitizedMessage, const String
& unsanitizedMessage = String()) OVERRIDE FINAL; | 135 virtual void throwSecurityError(const String& sanitizedMessage, const String
& unsanitizedMessage = String()) OVERRIDE FINAL; |
| 131 }; | 136 }; |
| 132 | 137 |
| 133 } // namespace WebCore | 138 } // namespace WebCore |
| 134 | 139 |
| 135 #endif // ExceptionState_h | 140 #endif // ExceptionState_h |
| OLD | NEW |