| 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());
|
| }
|
|
|
|
|