Chromium Code Reviews| 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 setException(v8::Handle<v8::Value>); | |
|
Mike West
2013/12/13 21:22:59
Why is this now public? I don't see where you need
sof
2013/12/13 21:51:33
It's used to transfer the exception from the TryCa
Dmitry Lomov (no reviews)
2013/12/16 09:14:39
I think the naming of methods on ExceptionState is
| |
| 110 | |
| 109 protected: | 111 protected: |
| 110 ExceptionCode m_code; | 112 ExceptionCode m_code; |
| 111 Context m_context; | 113 Context m_context; |
| 112 const char* m_propertyName; | 114 const char* m_propertyName; |
| 113 const char* m_interfaceName; | 115 const char* m_interfaceName; |
| 114 | 116 |
| 115 private: | 117 private: |
| 116 void setException(v8::Handle<v8::Value>); | |
| 117 | |
| 118 String addExceptionContext(const String&) const; | 118 String addExceptionContext(const String&) const; |
| 119 | 119 |
| 120 ScopedPersistent<v8::Value> m_exception; | 120 ScopedPersistent<v8::Value> m_exception; |
| 121 v8::Handle<v8::Object> m_creationContext; | 121 v8::Handle<v8::Object> m_creationContext; |
| 122 v8::Isolate* m_isolate; | 122 v8::Isolate* m_isolate; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 class TrackExceptionState : public ExceptionState { | 125 class TrackExceptionState : public ExceptionState { |
| 126 public: | 126 public: |
| 127 TrackExceptionState(): ExceptionState(v8::Handle<v8::Object>(), 0) { } | 127 TrackExceptionState(): ExceptionState(v8::Handle<v8::Object>(), 0) { } |
| 128 virtual void throwDOMException(const ExceptionCode&, const String& message) OVERRIDE FINAL; | 128 virtual void throwDOMException(const ExceptionCode&, const String& message) OVERRIDE FINAL; |
| 129 virtual void throwTypeError(const String& message = String()) OVERRIDE FINAL ; | 129 virtual void throwTypeError(const String& message = String()) OVERRIDE FINAL ; |
| 130 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String()) OVERRIDE FINAL; | 130 virtual void throwSecurityError(const String& sanitizedMessage, const String & unsanitizedMessage = String()) OVERRIDE FINAL; |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 } // namespace WebCore | 133 } // namespace WebCore |
| 134 | 134 |
| 135 #endif // ExceptionState_h | 135 #endif // ExceptionState_h |
| OLD | NEW |