Chromium Code Reviews| Index: Source/core/dom/ErrorEvent.h |
| diff --git a/Source/core/dom/ErrorEvent.h b/Source/core/dom/ErrorEvent.h |
| index 821554452fb4a24decb2d92844213b9222475257..f97491cd5b25e090ed4d76abdd77a1e7541a731b 100644 |
| --- a/Source/core/dom/ErrorEvent.h |
| +++ b/Source/core/dom/ErrorEvent.h |
| @@ -65,19 +65,29 @@ public: |
| } |
| virtual ~ErrorEvent(); |
| - const String& message() const { return m_message; } |
| + // As 'message' is exposed to JavaScript, prefer 'sanitizedMessage()' when present. |
| + const String& message() const { return !sanitizedMessage().isEmpty() ? sanitizedMessage() : unsanitizedMessage(); } |
|
abarth-chromium
2013/08/14 19:42:08
Woah, I don't think we should fall back to the san
|
| const String& filename() const { return m_fileName; } |
| unsigned lineno() const { return m_lineNumber; } |
| unsigned colno() const { return m_columnNumber; } |
| + // 'messageForConsole' is not exposed to JavaScript, and prefers 'unsanitizedMessage()'. |
| + const String& messageForConsole() const { return !unsanitizedMessage().isEmpty() ? unsanitizedMessage() : sanitizedMessage(); } |
|
abarth-chromium
2013/08/14 19:42:08
Fallback here makes sense.
|
| + |
| virtual const AtomicString& interfaceName() const; |
| + void setUnsanitizedMessage(const String&); |
| + |
| private: |
| ErrorEvent(); |
| ErrorEvent(const String& message, const String& fileName, unsigned lineNumber, unsigned columnNumber); |
| ErrorEvent(const AtomicString&, const ErrorEventInit&); |
| - String m_message; |
| + const String& unsanitizedMessage() const { return m_unsanitizedMessage; } |
| + const String& sanitizedMessage() const { return m_sanitizedMessage; } |
|
abarth-chromium
2013/08/14 19:42:08
What's the point of these private accessors? Code
|
| + |
| + String m_unsanitizedMessage; |
| + String m_sanitizedMessage; |
| String m_fileName; |
| unsigned m_lineNumber; |
| unsigned m_columnNumber; |