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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 static PassRefPtr<ErrorEvent> createSanitizedError() |
| 63 { |
| 64 return adoptRef(new ErrorEvent("Script error.", String(), 0, 0)); |
| 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 colno() const { return m_columnNumber; } | 71 unsigned colno() const { return m_columnNumber; } |
68 | 72 |
69 virtual const AtomicString& interfaceName() const; | 73 virtual const AtomicString& interfaceName() const; |
70 | 74 |
71 private: | 75 private: |
72 ErrorEvent(); | 76 ErrorEvent(); |
73 ErrorEvent(const String& message, const String& fileName, unsigned lineNumbe
r, unsigned columnNumber); | 77 ErrorEvent(const String& message, const String& fileName, unsigned lineNumbe
r, unsigned columnNumber); |
74 ErrorEvent(const AtomicString&, const ErrorEventInit&); | 78 ErrorEvent(const AtomicString&, const ErrorEventInit&); |
75 | 79 |
76 String m_message; | 80 String m_message; |
77 String m_fileName; | 81 String m_fileName; |
78 unsigned m_lineNumber; | 82 unsigned m_lineNumber; |
79 unsigned m_columnNumber; | 83 unsigned m_columnNumber; |
80 }; | 84 }; |
81 | 85 |
82 } // namespace WebCore | 86 } // namespace WebCore |
83 | 87 |
84 #endif // ErrorEvent_h | 88 #endif // ErrorEvent_h |
OLD | NEW |