Commit 41579485 authored by abarth@webkit.org's avatar abarth@webkit.org

2010-12-11 Adam Barth <abarth@webkit.org>

        Reviewed by Sam Weinig.

        [V8] Move to DOMWindow::setLocation
        https://bugs.webkit.org/show_bug.cgi?id=50876

        Recently, JavaScriptCore moved to implementing setLocation in WebCore.
        This patch change V8 to use that common code path.  I haven't removed
        the old code path because it's still used for other things (like
        assigning window.location.href), but I'll move the rest over in a
        future patch.

        * bindings/v8/custom/V8DOMWindowCustom.cpp:
        (WebCore::V8DOMWindow::locationAccessorSetter):
        * bindings/v8/specialization/V8BindingState.cpp:
        (WebCore::::getFirstWindow):
        * bindings/v8/specialization/V8BindingState.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73864 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent fa79051c
2010-12-11 Adam Barth <abarth@webkit.org>
Reviewed by Sam Weinig.
[V8] Move to DOMWindow::setLocation
https://bugs.webkit.org/show_bug.cgi?id=50876
Recently, JavaScriptCore moved to implementing setLocation in WebCore.
This patch change V8 to use that common code path. I haven't removed
the old code path because it's still used for other things (like
assigning window.location.href), but I'll move the rest over in a
future patch.
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::V8DOMWindow::locationAccessorSetter):
* bindings/v8/specialization/V8BindingState.cpp:
(WebCore::::getFirstWindow):
* bindings/v8/specialization/V8BindingState.h:
2010-10-11 Diego Gonzalez <diegohcg@webkit.org>
Reviewed by Kenneth Rohde Christiansen.
......
......@@ -193,9 +193,18 @@ v8::Handle<v8::Value> V8DOMWindow::cryptoAccessorGetter(v8::Local<v8::String> na
void V8DOMWindow::locationAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
DOMWindow* imp = V8DOMWindow::toNative(info.Holder());
V8DOMWindowShell::setLocation(imp, toWebCoreString(value));
}
State<V8Binding>* state = V8BindingState::Only();
DOMWindow* activeWindow = state->getActiveWindow();
if (!activeWindow)
return;
DOMWindow* firstWindow = state->getFirstWindow();
if (!firstWindow)
return;
imp->setLocation(toWebCoreString(value), activeWindow, firstWindow);
}
void V8DOMWindow::openerAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
......
......@@ -55,6 +55,11 @@ DOMWindow* State<V8Binding>::getActiveWindow()
return V8Proxy::retrieveWindow(activeContext);
}
DOMWindow* State<V8Binding>::getFirstWindow()
{
return V8Proxy::retrieveWindow(v8::Context::GetEntered());
}
Frame* State<V8Binding>::getActiveFrame()
{
Frame* frame = V8Proxy::retrieveFrameForCallingContext();
......
......@@ -49,13 +49,10 @@ public:
// Reports an error message (without delay) if the security check fails.
static void immediatelyReportUnsafeAccessTo(Frame*);
// The DOMWindow corresponding to the 'calling context' of execution.
DOMWindow* getActiveWindow();
DOMWindow* getFirstWindow();
// The frame corresponding to the 'calling context' of execution.
Frame* getActiveFrame();
// The first frame in which execution entered user script.
Frame* getFirstFrame();
bool processingUserGesture();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment