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

Unified Diff: Source/bindings/v8/V8ThrowException.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/bindings/v8/V8ThrowException.h ('k') | Source/bindings/v8/custom/V8HTMLFrameElementCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8ThrowException.cpp
diff --git a/Source/bindings/v8/V8ThrowException.cpp b/Source/bindings/v8/V8ThrowException.cpp
index 553310860d9d4566cd001ccc009b4b60c1b9d084..1f303f7cde766660b6bd0dc365fe43a9d6434c88 100644
--- a/Source/bindings/v8/V8ThrowException.cpp
+++ b/Source/bindings/v8/V8ThrowException.cpp
@@ -44,16 +44,18 @@ static void domExceptionStackSetter(v8::Local<v8::String> name, v8::Local<v8::Va
info.Data()->ToObject()->Set(v8::String::NewSymbol("stack"), value);
}
-v8::Handle<v8::Value> V8ThrowException::createDOMException(int ec, const String& message, v8::Isolate* isolate)
+v8::Handle<v8::Value> V8ThrowException::createDOMException(int ec, const String& sanitizedMessage, const String& unsanitizedMessage, v8::Isolate* isolate)
{
if (ec <= 0 || v8::V8::IsExecutionTerminating())
return v8Undefined();
+ ASSERT(ec == SecurityError || unsanitizedMessage.isEmpty());
+
// FIXME: Handle other WebIDL exception types.
if (ec == TypeError)
- return V8ThrowException::createTypeError(message, isolate);
+ return V8ThrowException::createTypeError(sanitizedMessage, isolate);
- RefPtr<DOMException> domException = DOMException::create(ec, message);
+ RefPtr<DOMException> domException = DOMException::create(ec, sanitizedMessage, unsanitizedMessage);
v8::Handle<v8::Value> exception = toV8(domException, v8::Handle<v8::Object>(), isolate);
if (exception.IsEmpty())
@@ -68,9 +70,10 @@ v8::Handle<v8::Value> V8ThrowException::createDOMException(int ec, const String&
return exception;
}
-v8::Handle<v8::Value> V8ThrowException::throwDOMException(int ec, const String& message, v8::Isolate* isolate)
+v8::Handle<v8::Value> V8ThrowException::throwDOMException(int ec, const String& sanitizedMessage, const String& unsanitizedMessage, v8::Isolate* isolate)
{
- v8::Handle<v8::Value> exception = createDOMException(ec, message, isolate);
+ ASSERT(ec == SecurityError || unsanitizedMessage.isEmpty());
+ v8::Handle<v8::Value> exception = createDOMException(ec, sanitizedMessage, unsanitizedMessage, isolate);
if (exception.IsEmpty())
return v8Undefined();
« no previous file with comments | « Source/bindings/v8/V8ThrowException.h ('k') | Source/bindings/v8/custom/V8HTMLFrameElementCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698