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

Unified Diff: Source/bindings/core/v8/V8DOMWrapper.cpp

Issue 1339023002: Rethrow cross-site exceptions as security errors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: git cl set_commit Created 5 years, 3 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/core/v8/V8DOMWrapper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8DOMWrapper.cpp
diff --git a/Source/bindings/core/v8/V8DOMWrapper.cpp b/Source/bindings/core/v8/V8DOMWrapper.cpp
index 3bcdcd1e4d58fce06cfd32b4a9a248131424000c..c83dd50607c6dd0bf519505a3fe3c33574cc4b94 100644
--- a/Source/bindings/core/v8/V8DOMWrapper.cpp
+++ b/Source/bindings/core/v8/V8DOMWrapper.cpp
@@ -146,4 +146,15 @@ void V8WrapperInstantiationScope::securityCheck(v8::Isolate* isolate, v8::Local<
}
}
+void V8WrapperInstantiationScope::convertException()
+{
+ v8::Isolate* isolate = m_context->GetIsolate();
+ // TODO(jochen): Currently, Location is the only object for which we can reach this code path. Should be generalized.
+ ExceptionState exceptionState(ExceptionState::ConstructionContext, "Location", isolate->GetCurrentContext()->Global(), isolate);
+ LocalDOMWindow* callingWindow = callingDOMWindow(isolate);
+ DOMWindow* targetWindow = toFrameIfNotDetached(m_context)->domWindow();
+ exceptionState.throwSecurityError(targetWindow->sanitizedCrossDomainAccessErrorMessage(callingWindow), targetWindow->crossDomainAccessErrorMessage(callingWindow));
+ exceptionState.throwIfNeeded();
+}
+
} // namespace blink
« no previous file with comments | « Source/bindings/core/v8/V8DOMWrapper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698