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 unsigned colno; |
46 }; | 46 }; |
47 | 47 |
48 class ErrorEvent : public Event { | 48 class ErrorEvent : public Event { |
49 public: | 49 public: |
50 static PassRefPtr<ErrorEvent> create() | 50 static PassRefPtr<ErrorEvent> create() |
51 { | 51 { |
52 return adoptRef(new ErrorEvent); | 52 return adoptRef(new ErrorEvent); |
53 } | 53 } |
54 static PassRefPtr<ErrorEvent> create(const String& message, const String& fi
leName, unsigned lineNumber, unsigned columnNumber) | 54 static PassRefPtr<ErrorEvent> create(const String& message, const String& fi
leName, unsigned lineNumber, unsigned columnNumber) |
55 { | 55 { |
56 return adoptRef(new ErrorEvent(message, fileName, lineNumber, columnNumb
er)); | 56 return adoptRef(new ErrorEvent(message, fileName, lineNumber, columnNumb
er)); |
57 } | 57 } |
58 static PassRefPtr<ErrorEvent> create(const AtomicString& type, const ErrorEv
entInit& initializer) | 58 static PassRefPtr<ErrorEvent> create(const AtomicString& type, const ErrorEv
entInit& initializer) |
59 { | 59 { |
60 return adoptRef(new ErrorEvent(type, initializer)); | 60 return adoptRef(new ErrorEvent(type, initializer)); |
61 } | 61 } |
62 virtual ~ErrorEvent(); | 62 virtual ~ErrorEvent(); |
63 | 63 |
64 const String& message() const { return m_message; } | 64 const String& message() const { return m_message; } |
65 const String& filename() const { return m_fileName; } | 65 const String& filename() const { return m_fileName; } |
66 unsigned lineno() const { return m_lineNumber; } | 66 unsigned lineno() const { return m_lineNumber; } |
67 unsigned column() const { return m_columnNumber; } | 67 unsigned colno() const { return m_columnNumber; } |
68 | 68 |
69 virtual const AtomicString& interfaceName() const; | 69 virtual const AtomicString& interfaceName() const; |
70 | 70 |
71 private: | 71 private: |
72 ErrorEvent(); | 72 ErrorEvent(); |
73 ErrorEvent(const String& message, const String& fileName, unsigned lineNumbe
r, unsigned columnNumber); | 73 ErrorEvent(const String& message, const String& fileName, unsigned lineNumbe
r, unsigned columnNumber); |
74 ErrorEvent(const AtomicString&, const ErrorEventInit&); | 74 ErrorEvent(const AtomicString&, const ErrorEventInit&); |
75 | 75 |
76 String m_message; | 76 String m_message; |
77 String m_fileName; | 77 String m_fileName; |
78 unsigned m_lineNumber; | 78 unsigned m_lineNumber; |
79 unsigned m_columnNumber; | 79 unsigned m_columnNumber; |
80 }; | 80 }; |
81 | 81 |
82 } // namespace WebCore | 82 } // namespace WebCore |
83 | 83 |
84 #endif // ErrorEvent_h | 84 #endif // ErrorEvent_h |
OLD | NEW |