Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(725)

Unified Diff: Source/core/dom/ErrorEvent.h

Issue 22985006: Throw an exception when denying access to 'Frame's 'location' setter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/DOMException.cpp ('k') | Source/core/dom/ErrorEvent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ErrorEvent.h
diff --git a/Source/core/dom/ErrorEvent.h b/Source/core/dom/ErrorEvent.h
index 821554452fb4a24decb2d92844213b9222475257..583f07fe1a4d475b31763e390402b9c1d7c7c7f9 100644
--- a/Source/core/dom/ErrorEvent.h
+++ b/Source/core/dom/ErrorEvent.h
@@ -65,19 +65,26 @@ public:
}
virtual ~ErrorEvent();
- const String& message() const { return m_message; }
+ // As 'message' is exposed to JavaScript, never return unsanitizedMessage.
+ const String& message() const { return m_sanitizedMessage; }
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 'm_unsanitizedMessage'.
+ const String& messageForConsole() const { return !m_unsanitizedMessage.isEmpty() ? m_unsanitizedMessage : m_sanitizedMessage; }
+
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;
+ String m_unsanitizedMessage;
+ String m_sanitizedMessage;
String m_fileName;
unsigned m_lineNumber;
unsigned m_columnNumber;
« no previous file with comments | « Source/core/dom/DOMException.cpp ('k') | Source/core/dom/ErrorEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698