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

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

Issue 22829002: Throw an exception when denying access to 'Frame's 'location' setter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Off by one. 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..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;
« 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