Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 13 matching lines...) Expand all Loading... | |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef ErrorEvent_h | 31 #ifndef ErrorEvent_h |
| 32 #define ErrorEvent_h | 32 #define ErrorEvent_h |
| 33 | 33 |
| 34 #include "bindings/v8/ScriptValue.h" | |
| 35 #include "bindings/v8/SerializedScriptValue.h" | |
| 34 #include "core/dom/Event.h" | 36 #include "core/dom/Event.h" |
| 35 #include "wtf/text/WTFString.h" | 37 #include "wtf/text/WTFString.h" |
| 38 #include "wtf/RefPtr.h" | |
| 36 | 39 |
| 37 namespace WebCore { | 40 namespace WebCore { |
| 38 | 41 |
| 39 struct ErrorEventInit : public EventInit { | 42 struct ErrorEventInit : public EventInit { |
| 40 ErrorEventInit(); | 43 ErrorEventInit(); |
| 41 | 44 |
| 42 String message; | 45 String message; |
| 43 String filename; | 46 String filename; |
| 44 unsigned lineno; | 47 unsigned lineno; |
| 45 unsigned column; | 48 unsigned column; |
| 49 ScriptValue error; | |
| 46 }; | 50 }; |
| 47 | 51 |
| 48 class ErrorEvent : public Event { | 52 class ErrorEvent : public Event { |
| 49 public: | 53 public: |
| 50 static PassRefPtr<ErrorEvent> create() | 54 static PassRefPtr<ErrorEvent> create() |
| 51 { | 55 { |
| 52 return adoptRef(new ErrorEvent); | 56 return adoptRef(new ErrorEvent); |
| 53 } | 57 } |
| 54 static PassRefPtr<ErrorEvent> create(const String& message, const String& fi leName, unsigned lineNumber, unsigned columnNumber) | 58 static PassRefPtr<ErrorEvent> create(const String& message, const String& fi leName, unsigned lineNumber, unsigned columnNumber, const ScriptValue& error) |
| 55 { | 59 { |
| 56 return adoptRef(new ErrorEvent(message, fileName, lineNumber, columnNumb er)); | 60 return adoptRef(new ErrorEvent(message, fileName, lineNumber, columnNumb er, error)); |
| 57 } | 61 } |
| 58 static PassRefPtr<ErrorEvent> create(const AtomicString& type, const ErrorEv entInit& initializer) | 62 static PassRefPtr<ErrorEvent> create(const AtomicString& type, const ErrorEv entInit& initializer) |
| 59 { | 63 { |
| 60 return adoptRef(new ErrorEvent(type, initializer)); | 64 return adoptRef(new ErrorEvent(type, initializer)); |
| 61 } | 65 } |
| 62 virtual ~ErrorEvent(); | 66 virtual ~ErrorEvent(); |
| 63 | 67 |
| 64 const String& message() const { return m_message; } | 68 const String& message() const { return m_message; } |
| 65 const String& filename() const { return m_fileName; } | 69 const String& filename() const { return m_fileName; } |
| 66 unsigned lineno() const { return m_lineNumber; } | 70 unsigned lineno() const { return m_lineNumber; } |
| 67 unsigned column() const { return m_columnNumber; } | 71 unsigned column() const { return m_columnNumber; } |
| 72 const ScriptValue& error() const { return m_error; } | |
|
abarth-chromium
2013/07/25 18:24:08
Doesn't this create a leak between isolated worlds
| |
| 73 void setSerializedError(PassRefPtr<SerializedScriptValue> error) { m_seriali zedError = error; } | |
| 68 | 74 |
| 69 virtual const AtomicString& interfaceName() const; | 75 virtual const AtomicString& interfaceName() const; |
| 70 | 76 |
| 71 private: | 77 private: |
| 72 ErrorEvent(); | 78 ErrorEvent(); |
| 73 ErrorEvent(const String& message, const String& fileName, unsigned lineNumbe r, unsigned columnNumber); | 79 ErrorEvent(const String& message, const String& fileName, unsigned lineNumbe r, unsigned columnNumber, const ScriptValue& error); |
| 74 ErrorEvent(const AtomicString&, const ErrorEventInit&); | 80 ErrorEvent(const AtomicString&, const ErrorEventInit&); |
| 75 | 81 |
| 76 String m_message; | 82 String m_message; |
| 77 String m_fileName; | 83 String m_fileName; |
| 78 unsigned m_lineNumber; | 84 unsigned m_lineNumber; |
| 79 unsigned m_columnNumber; | 85 unsigned m_columnNumber; |
| 86 ScriptValue m_error; | |
| 87 | |
| 88 RefPtr<SerializedScriptValue> m_serializedError; | |
| 80 }; | 89 }; |
| 81 | 90 |
| 82 } // namespace WebCore | 91 } // namespace WebCore |
| 83 | 92 |
| 84 #endif // ErrorEvent_h | 93 #endif // ErrorEvent_h |
| OLD | NEW |