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" |
| 37 #include "wtf/RefPtr.h" | |
| 35 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.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 colno; | 48 unsigned colno; |
| 49 ScriptValue error; | |
|
adamk
2013/07/31 16:37:30
I asked before but I don't think I got an answer:
Mike West
2013/08/01 07:52:15
Nothing! Killed it.
| |
| 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) |
| 55 { | 59 { |
| 56 return adoptRef(new ErrorEvent(message, fileName, lineNumber, columnNumb er)); | 60 return adoptRef(new ErrorEvent(message, fileName, lineNumber, columnNumb er)); |
| 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 } |
| 66 static PassRefPtr<ErrorEvent> createSanitizedError() | |
| 67 { | |
| 68 return adoptRef(new ErrorEvent("Script error.", String(), 0, 0)); | |
| 69 } | |
| 62 virtual ~ErrorEvent(); | 70 virtual ~ErrorEvent(); |
| 63 | 71 |
| 64 const String& message() const { return m_message; } | 72 const String& message() const { return m_message; } |
| 65 const String& filename() const { return m_fileName; } | 73 const String& filename() const { return m_fileName; } |
| 66 unsigned lineno() const { return m_lineNumber; } | 74 unsigned lineno() const { return m_lineNumber; } |
| 67 unsigned colno() const { return m_columnNumber; } | 75 unsigned colno() const { return m_columnNumber; } |
| 68 | 76 |
| 77 void setSerializedError(PassRefPtr<SerializedScriptValue>) { } | |
|
adamk
2013/07/31 16:37:30
I thought you were going to add something to the c
Mike West
2013/08/01 07:52:15
I was! And I have!
| |
| 78 | |
| 69 virtual const AtomicString& interfaceName() const; | 79 virtual const AtomicString& interfaceName() const; |
| 70 | 80 |
| 71 private: | 81 private: |
| 72 ErrorEvent(); | 82 ErrorEvent(); |
| 73 ErrorEvent(const String& message, const String& fileName, unsigned lineNumbe r, unsigned columnNumber); | 83 ErrorEvent(const String& message, const String& fileName, unsigned lineNumbe r, unsigned columnNumber); |
| 74 ErrorEvent(const AtomicString&, const ErrorEventInit&); | 84 ErrorEvent(const AtomicString&, const ErrorEventInit&); |
| 75 | 85 |
| 86 | |
|
dcarney
2013/07/30 18:51:58
nit: space
| |
| 76 String m_message; | 87 String m_message; |
| 77 String m_fileName; | 88 String m_fileName; |
| 78 unsigned m_lineNumber; | 89 unsigned m_lineNumber; |
| 79 unsigned m_columnNumber; | 90 unsigned m_columnNumber; |
| 80 }; | 91 }; |
| 81 | 92 |
| 82 } // namespace WebCore | 93 } // namespace WebCore |
| 83 | 94 |
| 84 #endif // ErrorEvent_h | 95 #endif // ErrorEvent_h |
| OLD | NEW |