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

Unified Diff: Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp

Issue 9895001: Merge 111098 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 9 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/http/tests/security/cross-frame-access-call-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/v8/custom/V8DOMWindowCustom.cpp
===================================================================
--- Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp (revision 112459)
+++ Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp (working copy)
@@ -426,18 +426,17 @@
{
INC_STATS("DOM.DOMWindow.showModalDialog()");
DOMWindow* impl = V8DOMWindow::toNative(args.Holder());
-
V8BindingState* state = V8BindingState::Only();
+ if (!V8BindingSecurity::canAccessFrame(state, impl->frame(), true))
+ return v8::Undefined();
- DOMWindow* activeWindow = state->activeWindow();
- DOMWindow* firstWindow = state->firstWindow();
-
// FIXME: Handle exceptions properly.
String urlString = toWebCoreStringWithNullOrUndefinedCheck(args[0]);
+ DialogHandler handler(args[1]);
String dialogFeaturesString = toWebCoreStringWithNullOrUndefinedCheck(args[2]);
- DialogHandler handler(args[1]);
-
+ DOMWindow* activeWindow = state->activeWindow();
+ DOMWindow* firstWindow = state->firstWindow();
impl->showModalDialog(urlString, dialogFeaturesString, activeWindow, firstWindow, setUpDialog, &handler);
return handler.returnValue();
@@ -447,20 +446,21 @@
{
INC_STATS("DOM.DOMWindow.open()");
DOMWindow* impl = V8DOMWindow::toNative(args.Holder());
-
V8BindingState* state = V8BindingState::Only();
+ if (!V8BindingSecurity::canAccessFrame(state, impl->frame(), true))
+ return v8::Undefined();
- DOMWindow* activeWindow = state->activeWindow();
- DOMWindow* firstWindow = state->firstWindow();
-
// FIXME: Handle exceptions properly.
String urlString = toWebCoreStringWithNullOrUndefinedCheck(args[0]);
AtomicString frameName = (args[1]->IsUndefined() || args[1]->IsNull()) ? "_blank" : AtomicString(toWebCoreString(args[1]));
String windowFeaturesString = toWebCoreStringWithNullOrUndefinedCheck(args[2]);
+ DOMWindow* activeWindow = state->activeWindow();
+ DOMWindow* firstWindow = state->firstWindow();
RefPtr<DOMWindow> openedWindow = impl->open(urlString, frameName, windowFeaturesString, activeWindow, firstWindow);
if (!openedWindow)
return v8::Undefined();
+
return toV8(openedWindow.release());
}
« no previous file with comments | « LayoutTests/platform/chromium/http/tests/security/cross-frame-access-call-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698