Changeset 73864 in webkit


Ignore:
Timestamp:
Dec 11, 2010 4:35:15 PM (13 years ago)
Author:
abarth@webkit.org
Message:

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:
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r73862 r73864  
     12010-12-11  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Sam Weinig.
     4
     5        [V8] Move to DOMWindow::setLocation
     6        https://bugs.webkit.org/show_bug.cgi?id=50876
     7
     8        Recently, JavaScriptCore moved to implementing setLocation in WebCore.
     9        This patch change V8 to use that common code path.  I haven't removed
     10        the old code path because it's still used for other things (like
     11        assigning window.location.href), but I'll move the rest over in a
     12        future patch.
     13
     14        * bindings/v8/custom/V8DOMWindowCustom.cpp:
     15        (WebCore::V8DOMWindow::locationAccessorSetter):
     16        * bindings/v8/specialization/V8BindingState.cpp:
     17        (WebCore::::getFirstWindow):
     18        * bindings/v8/specialization/V8BindingState.h:
     19
    1202010-10-11  Diego Gonzalez  <diegohcg@webkit.org>
    221
  • trunk/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp

    r67509 r73864  
    194194{
    195195    DOMWindow* imp = V8DOMWindow::toNative(info.Holder());
    196     V8DOMWindowShell::setLocation(imp, toWebCoreString(value));
    197 }
    198 
     196    State<V8Binding>* state = V8BindingState::Only();
     197
     198    DOMWindow* activeWindow = state->getActiveWindow();
     199    if (!activeWindow)
     200      return;
     201
     202    DOMWindow* firstWindow = state->getFirstWindow();
     203    if (!firstWindow)
     204      return;
     205
     206    imp->setLocation(toWebCoreString(value), activeWindow, firstWindow);
     207}
    199208
    200209void V8DOMWindow::openerAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
  • trunk/WebCore/bindings/v8/specialization/V8BindingState.cpp

    r67167 r73864  
    5656}
    5757
     58DOMWindow* State<V8Binding>::getFirstWindow()
     59{
     60    return V8Proxy::retrieveWindow(v8::Context::GetEntered());
     61}
     62
    5863Frame* State<V8Binding>::getActiveFrame()
    5964{
  • trunk/WebCore/bindings/v8/specialization/V8BindingState.h

    r67167 r73864  
    5050    static void immediatelyReportUnsafeAccessTo(Frame*);
    5151
    52     // The DOMWindow corresponding to the 'calling context' of execution.
    5352    DOMWindow* getActiveWindow();
     53    DOMWindow* getFirstWindow();
    5454
    55     // The frame corresponding to the 'calling context' of execution.
    5655    Frame* getActiveFrame();
    57 
    58     // The first frame in which execution entered user script.
    5956    Frame* getFirstFrame();
    6057
Note: See TracChangeset for help on using the changeset viewer.