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 24 matching lines...) Expand all Loading... |
35 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
36 | 36 |
37 namespace WebCore { | 37 namespace WebCore { |
38 | 38 |
39 struct ErrorEventInit : public EventInit { | 39 struct ErrorEventInit : public EventInit { |
40 ErrorEventInit(); | 40 ErrorEventInit(); |
41 | 41 |
42 String message; | 42 String message; |
43 String filename; | 43 String filename; |
44 unsigned lineno; | 44 unsigned lineno; |
| 45 unsigned column; |
45 }; | 46 }; |
46 | 47 |
47 class ErrorEvent : public Event { | 48 class ErrorEvent : public Event { |
48 public: | 49 public: |
49 static PassRefPtr<ErrorEvent> create() | 50 static PassRefPtr<ErrorEvent> create() |
50 { | 51 { |
51 return adoptRef(new ErrorEvent); | 52 return adoptRef(new ErrorEvent); |
52 } | 53 } |
53 static PassRefPtr<ErrorEvent> create(const String& message, const String& fi
leName, unsigned lineNumber) | 54 static PassRefPtr<ErrorEvent> create(const String& message, const String& fi
leName, unsigned lineNumber, unsigned columnNumber) |
54 { | 55 { |
55 return adoptRef(new ErrorEvent(message, fileName, lineNumber)); | 56 return adoptRef(new ErrorEvent(message, fileName, lineNumber, columnNumb
er)); |
56 } | 57 } |
57 static PassRefPtr<ErrorEvent> create(const AtomicString& type, const ErrorEv
entInit& initializer) | 58 static PassRefPtr<ErrorEvent> create(const AtomicString& type, const ErrorEv
entInit& initializer) |
58 { | 59 { |
59 return adoptRef(new ErrorEvent(type, initializer)); | 60 return adoptRef(new ErrorEvent(type, initializer)); |
60 } | 61 } |
61 virtual ~ErrorEvent(); | 62 virtual ~ErrorEvent(); |
62 | 63 |
63 const String& message() const { return m_message; } | 64 const String& message() const { return m_message; } |
64 const String& filename() const { return m_fileName; } | 65 const String& filename() const { return m_fileName; } |
65 unsigned lineno() const { return m_lineNumber; } | 66 unsigned lineno() const { return m_lineNumber; } |
| 67 unsigned column() const { return m_columnNumber; } |
66 | 68 |
67 virtual const AtomicString& interfaceName() const; | 69 virtual const AtomicString& interfaceName() const; |
68 | 70 |
69 private: | 71 private: |
70 ErrorEvent(); | 72 ErrorEvent(); |
71 ErrorEvent(const String& message, const String& fileName, unsigned lineNumbe
r); | 73 ErrorEvent(const String& message, const String& fileName, unsigned lineNumbe
r, unsigned columnNumber); |
72 ErrorEvent(const AtomicString&, const ErrorEventInit&); | 74 ErrorEvent(const AtomicString&, const ErrorEventInit&); |
73 | 75 |
74 String m_message; | 76 String m_message; |
75 String m_fileName; | 77 String m_fileName; |
76 unsigned m_lineNumber; | 78 unsigned m_lineNumber; |
| 79 unsigned m_columnNumber; |
77 }; | 80 }; |
78 | 81 |
79 } // namespace WebCore | 82 } // namespace WebCore |
80 | 83 |
81 #endif // ErrorEvent_h | 84 #endif // ErrorEvent_h |
OLD | NEW |