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

Unified Diff: Source/core/dom/DOMException.cpp

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.h ('k') | Source/core/dom/ErrorEvent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMException.cpp
diff --git a/Source/core/dom/DOMException.cpp b/Source/core/dom/DOMException.cpp
index 7510e27dbd2655ec999759c5d87ba5fe71bc4003..348a94e98d314f4ed504503d69b774f1adbebf98 100644
--- a/Source/core/dom/DOMException.cpp
+++ b/Source/core/dom/DOMException.cpp
@@ -86,22 +86,24 @@ static const CoreException* getErrorEntry(ExceptionCode ec)
return tableIndex < tableSize ? &coreExceptions[tableIndex] : 0;
}
-DOMException::DOMException(unsigned short code, const String& name, const String& message)
+DOMException::DOMException(unsigned short code, const String& name, const String& sanitizedMessage, const String& unsanitizedMessage)
{
ASSERT(name);
m_code = code;
m_name = name;
- m_message = message;
+ m_sanitizedMessage = sanitizedMessage;
+ m_unsanitizedMessage = unsanitizedMessage;
ScriptWrappable::init(this);
}
-PassRefPtr<DOMException> DOMException::create(ExceptionCode ec, const String& message)
+PassRefPtr<DOMException> DOMException::create(ExceptionCode ec, const String& sanitizedMessage, const String& unsanitizedMessage)
{
const CoreException* entry = getErrorEntry(ec);
ASSERT(entry);
return adoptRef(new DOMException(entry->code,
entry->name ? entry->name : "Error",
- message.isNull() ? String(entry->message) : message));
+ sanitizedMessage.isNull() ? String(entry->message) : sanitizedMessage,
+ unsanitizedMessage));
}
String DOMException::toString() const
@@ -109,6 +111,11 @@ String DOMException::toString() const
return name() + ": " + message();
}
+String DOMException::toStringForConsole() const
+{
+ return name() + ": " + messageForConsole();
+}
+
String DOMException::getErrorName(ExceptionCode ec)
{
const CoreException* entry = getErrorEntry(ec);
« no previous file with comments | « Source/core/dom/DOMException.h ('k') | Source/core/dom/ErrorEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698