[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

abarth at webkit.org abarth at webkit.org
Wed Dec 22 18:28:52 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 415794850283d6aab9aef1da9042560116debfb7
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Dec 12 00:35:15 2010 +0000

    2010-12-11  Adam Barth  <abarth at 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

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ca6a282..6401759 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-12-11  Adam Barth  <abarth at 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 at webkit.org>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index f7c75f7..3792a29 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -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)
 {
diff --git a/WebCore/bindings/v8/specialization/V8BindingState.cpp b/WebCore/bindings/v8/specialization/V8BindingState.cpp
index 2193c9f..f477702 100644
--- a/WebCore/bindings/v8/specialization/V8BindingState.cpp
+++ b/WebCore/bindings/v8/specialization/V8BindingState.cpp
@@ -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();
diff --git a/WebCore/bindings/v8/specialization/V8BindingState.h b/WebCore/bindings/v8/specialization/V8BindingState.h
index 14305b8..cdd0ef6 100644
--- a/WebCore/bindings/v8/specialization/V8BindingState.h
+++ b/WebCore/bindings/v8/specialization/V8BindingState.h
@@ -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();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list