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

Unified Diff: Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

Issue 7273022: Merge 89782 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 years, 6 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 | « LayoutTests/platform/chromium/fast/dom/prototype-inheritance-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
===================================================================
--- Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (revision 89891)
+++ Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (working copy)
@@ -634,6 +634,12 @@
return IsSubType($dataNode, "Node");
}
+sub IsVisibleAcrossOrigins
+{
+ my $dataNode = shift;
+ return $dataNode->extendedAttributes->{"CheckDomainSecurity"} && !($dataNode->name eq "DOMWindow");
+}
+
sub GenerateDomainSafeFunctionGetter
{
my $function = shift;
@@ -2505,9 +2511,22 @@
END
}
- if (IsNodeSubType($dataNode)) {
+ # FIXME: We need a better way of recovering the correct prototype chain
+ # for every sort of object. For now, we special-case cross-origin visible
+ # objects (i.e., those with CheckDomainSecurity).
+ if (IsVisibleAcrossOrigins($dataNode)) {
push(@implContent, <<END);
+ if (impl->frame()) {
+ proxy = V8Proxy::retrieve(impl->frame());
+ if (proxy)
+ proxy->windowShell()->initContextIfNeeded();
+ }
+END
+ }
+ if (IsNodeSubType($dataNode) || IsVisibleAcrossOrigins($dataNode)) {
+ push(@implContent, <<END);
+
v8::Handle<v8::Context> context;
if (proxy)
context = proxy->context();
@@ -2521,7 +2540,7 @@
push(@implContent, <<END);
wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
END
- if (IsNodeSubType($dataNode)) {
+ if (IsNodeSubType($dataNode) || IsVisibleAcrossOrigins($dataNode)) {
push(@implContent, <<END);
// Exit the node's context if it was entered.
if (!context.IsEmpty())
« no previous file with comments | « LayoutTests/platform/chromium/fast/dom/prototype-inheritance-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698