[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

abarth at webkit.org abarth at webkit.org
Thu Apr 8 00:54:44 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 0df0549892b6af51c4e19c0f7e5e8a64283366b4
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 5 19:04:23 2010 +0000

    2010-01-05  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Dimitri Glazkov.
    
            [V8] Separate DOMWrapperWorld from V8IsolatedWorld
            https://bugs.webkit.org/show_bug.cgi?id=33087
    
            This change separate DOMWrapperWorld and IsolatedWorld from
            V8IsolatedWorld.  I've also renamed V8IsolatedWorld to
            V8IsolatedContext in preparation for having more than one context in a
            single isolated world.
    
            This patch moves us closer to two goals:
            1) Matching the structure of the JSC implementation of isolated worlds.
            2) Letting scripts running in isolated contexts see into other iframes
               (which requires having more than one context in an isolated world.)
    
            * WebCore.gypi:
            * bindings/v8/DOMWrapperWorld.cpp: Added.
            (WebCore::DOMWrapperWorld::DOMWrapperWorld):
            (WebCore::mainThreadNormalWorld):
            * bindings/v8/DOMWrapperWorld.h: Added.
            (WebCore::DOMWrapperWorld::create):
            * bindings/v8/IsolatedWorld.cpp: Added.
            (WebCore::IsolatedWorld::IsolatedWorld):
            (WebCore::IsolatedWorld::~IsolatedWorld):
            * bindings/v8/IsolatedWorld.h: Added.
            (WebCore::IsolatedWorld::create):
            (WebCore::IsolatedWorld::count):
            (WebCore::IsolatedWorld::domDataStore):
            * bindings/v8/MainThreadDOMData.cpp:
            (WebCore::MainThreadDOMData::getMainThreadStore):
            * bindings/v8/ScriptController.cpp:
            (WebCore::ScriptController::currentScriptState):
            * bindings/v8/ScriptState.cpp:
            * bindings/v8/ScriptState.h:
            * bindings/v8/V8DOMWindowShell.cpp:
            * bindings/v8/V8DOMWrapper.cpp:
            (WebCore::V8DOMWrapper::instantiateV8Object):
            * bindings/v8/V8IsolatedContext.cpp: Copied from WebCore/bindings/v8/V8IsolatedWorld.cpp.
            (WebCore::V8IsolatedContext::contextWeakReferenceCallback):
            (WebCore::V8IsolatedContext::V8IsolatedContext):
            (WebCore::V8IsolatedContext::destroy):
            (WebCore::V8IsolatedContext::~V8IsolatedContext):
            (WebCore::V8IsolatedContext::scriptState):
            * bindings/v8/V8IsolatedContext.h: Copied from WebCore/bindings/v8/V8IsolatedWorld.h.
            (WebCore::V8IsolatedContext::getEntered):
            (WebCore::V8IsolatedContext::world):
            * bindings/v8/V8IsolatedWorld.cpp: Removed.
            * bindings/v8/V8IsolatedWorld.h: Removed.
            * bindings/v8/V8Proxy.cpp:
            (WebCore::V8Proxy::evaluateInIsolatedWorld):
            (WebCore::V8Proxy::context):
            * bindings/v8/V8Proxy.h:
            * bindings/v8/WorldContextHandle.cpp:
            (WebCore::WorldContextHandle::WorldContextHandle):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52811 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0508043..649132d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,63 @@
 
         Reviewed by Dimitri Glazkov.
 
+        [V8] Separate DOMWrapperWorld from V8IsolatedWorld
+        https://bugs.webkit.org/show_bug.cgi?id=33087
+
+        This change separate DOMWrapperWorld and IsolatedWorld from
+        V8IsolatedWorld.  I've also renamed V8IsolatedWorld to
+        V8IsolatedContext in preparation for having more than one context in a
+        single isolated world.
+
+        This patch moves us closer to two goals:
+        1) Matching the structure of the JSC implementation of isolated worlds.
+        2) Letting scripts running in isolated contexts see into other iframes
+           (which requires having more than one context in an isolated world.)
+
+        * WebCore.gypi:
+        * bindings/v8/DOMWrapperWorld.cpp: Added.
+        (WebCore::DOMWrapperWorld::DOMWrapperWorld):
+        (WebCore::mainThreadNormalWorld):
+        * bindings/v8/DOMWrapperWorld.h: Added.
+        (WebCore::DOMWrapperWorld::create):
+        * bindings/v8/IsolatedWorld.cpp: Added.
+        (WebCore::IsolatedWorld::IsolatedWorld):
+        (WebCore::IsolatedWorld::~IsolatedWorld):
+        * bindings/v8/IsolatedWorld.h: Added.
+        (WebCore::IsolatedWorld::create):
+        (WebCore::IsolatedWorld::count):
+        (WebCore::IsolatedWorld::domDataStore):
+        * bindings/v8/MainThreadDOMData.cpp:
+        (WebCore::MainThreadDOMData::getMainThreadStore):
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::currentScriptState):
+        * bindings/v8/ScriptState.cpp:
+        * bindings/v8/ScriptState.h:
+        * bindings/v8/V8DOMWindowShell.cpp:
+        * bindings/v8/V8DOMWrapper.cpp:
+        (WebCore::V8DOMWrapper::instantiateV8Object):
+        * bindings/v8/V8IsolatedContext.cpp: Copied from WebCore/bindings/v8/V8IsolatedWorld.cpp.
+        (WebCore::V8IsolatedContext::contextWeakReferenceCallback):
+        (WebCore::V8IsolatedContext::V8IsolatedContext):
+        (WebCore::V8IsolatedContext::destroy):
+        (WebCore::V8IsolatedContext::~V8IsolatedContext):
+        (WebCore::V8IsolatedContext::scriptState):
+        * bindings/v8/V8IsolatedContext.h: Copied from WebCore/bindings/v8/V8IsolatedWorld.h.
+        (WebCore::V8IsolatedContext::getEntered):
+        (WebCore::V8IsolatedContext::world):
+        * bindings/v8/V8IsolatedWorld.cpp: Removed.
+        * bindings/v8/V8IsolatedWorld.h: Removed.
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::evaluateInIsolatedWorld):
+        (WebCore::V8Proxy::context):
+        * bindings/v8/V8Proxy.h:
+        * bindings/v8/WorldContextHandle.cpp:
+        (WebCore::WorldContextHandle::WorldContextHandle):
+
+2010-01-05  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Dimitri Glazkov.
+
         [V8] Move createWindow into generic bindings so it can be shared with JSC
         https://bugs.webkit.org/show_bug.cgi?id=33201
 
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 38d2f11..9c240e0 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -753,6 +753,10 @@
             'bindings/v8/DOMDataStore.cpp',
             'bindings/v8/DOMDataStore.h',
             'bindings/v8/DOMObjectsInclude.h',
+            'bindings/v8/DOMWrapperWorld.cpp',
+            'bindings/v8/DOMWrapperWorld.h',
+            'bindings/v8/IsolatedWorld.cpp',
+            'bindings/v8/IsolatedWorld.h',
             'bindings/v8/MainThreadDOMData.cpp',
             'bindings/v8/MainThreadDOMData.h',
             'bindings/v8/NPV8Object.cpp',
@@ -823,8 +827,8 @@
             'bindings/v8/V8HiddenPropertyName.h',
             'bindings/v8/V8Index.cpp',
             'bindings/v8/V8Index.h',
-            'bindings/v8/V8IsolatedWorld.cpp',
-            'bindings/v8/V8IsolatedWorld.h',
+            'bindings/v8/V8IsolatedContext.cpp',
+            'bindings/v8/V8IsolatedContext.h',
             'bindings/v8/V8LazyEventListener.cpp',
             'bindings/v8/V8LazyEventListener.h',
             'bindings/v8/V8NPObject.cpp',
diff --git a/WebCore/bindings/v8/DOMWrapperWorld.cpp b/WebCore/bindings/v8/DOMWrapperWorld.cpp
new file mode 100644
index 0000000..1e9429f
--- /dev/null
+++ b/WebCore/bindings/v8/DOMWrapperWorld.cpp
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DOMWrapperWorld.h"
+
+#include <wtf/StdLibExtras.h>
+#include <wtf/Threading.h>
+
+namespace WebCore {
+
+DOMWrapperWorld::DOMWrapperWorld()
+{
+    // This class is pretty boring, huh?
+}
+
+DOMWrapperWorld* mainThreadNormalWorld()
+{
+    ASSERT(isMainThread());
+    DEFINE_STATIC_LOCAL(RefPtr<DOMWrapperWorld>, cachedNormalWorld, (DOMWrapperWorld::create()));
+    return cachedNormalWorld.get();
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/DOMWrapperWorld.h b/WebCore/bindings/v8/DOMWrapperWorld.h
new file mode 100644
index 0000000..f54cd4e
--- /dev/null
+++ b/WebCore/bindings/v8/DOMWrapperWorld.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DOMWrapperWorld_h
+#define DOMWrapperWorld_h
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+// This class represent a collection of DOM wrappers for a specific world.
+// The base class is pretty boring because the wrappers are actually stored
+// statically in V8DOMMap and garbage collected by V8 itself.
+class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
+public:
+    static PassRefPtr<DOMWrapperWorld> create() { return adoptRef(new DOMWrapperWorld()); }
+
+protected:
+    DOMWrapperWorld();
+};
+
+DOMWrapperWorld* mainThreadNormalWorld();
+
+} // namespace WebCore
+
+#endif // DOMWrapperWorld_h
diff --git a/WebCore/bindings/v8/IsolatedWorld.cpp b/WebCore/bindings/v8/IsolatedWorld.cpp
new file mode 100644
index 0000000..368683d
--- /dev/null
+++ b/WebCore/bindings/v8/IsolatedWorld.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "IsolatedWorld.h"
+
+namespace WebCore {
+
+int IsolatedWorld::isolatedWorldCount = 0;
+
+IsolatedWorld::IsolatedWorld()
+{
+    ++isolatedWorldCount;
+}
+
+IsolatedWorld::~IsolatedWorld()
+{
+    --isolatedWorldCount;
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/IsolatedWorld.h b/WebCore/bindings/v8/IsolatedWorld.h
new file mode 100644
index 0000000..3e86437
--- /dev/null
+++ b/WebCore/bindings/v8/IsolatedWorld.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IsolatedWorld_h
+#define IsolatedWorld_h
+
+#include "DOMWrapperWorld.h"
+#include "V8DOMMap.h"
+
+namespace WebCore {
+
+// An DOMWrapperWorld other than the thread's normal world.
+class IsolatedWorld : public DOMWrapperWorld {
+public:
+    static PassRefPtr<IsolatedWorld> create() { return adoptRef(new IsolatedWorld()); }
+    static int count() { return isolatedWorldCount; }
+
+    DOMDataStore* domDataStore() const { return m_domDataStore.getStore(); }
+
+protected:
+    IsolatedWorld();
+    ~IsolatedWorld();
+
+private:
+    // The backing store for the isolated world's DOM wrappers.  This class
+    // doesn't have visibility into the wrappers.  This handle simply helps
+    // manage their lifetime.
+    DOMDataStoreHandle m_domDataStore;
+
+    static int isolatedWorldCount;
+};
+
+} // namespace WebCore
+
+#endif // IsolatedWorld_h
diff --git a/WebCore/bindings/v8/MainThreadDOMData.cpp b/WebCore/bindings/v8/MainThreadDOMData.cpp
index b1b63bf..d9c865c 100644
--- a/WebCore/bindings/v8/MainThreadDOMData.cpp
+++ b/WebCore/bindings/v8/MainThreadDOMData.cpp
@@ -31,7 +31,7 @@
 #include "config.h"
 #include "MainThreadDOMData.h"
 
-#include "V8IsolatedWorld.h"
+#include "V8IsolatedContext.h"
 
 namespace WebCore {
 
@@ -53,9 +53,9 @@ DOMDataStore& MainThreadDOMData::getMainThreadStore()
     // so that it can be inlined by getCurrentMainThreadStore, which is
     // a hot spot in Dromaeo DOM tests.
     ASSERT(WTF::isMainThread());
-    V8IsolatedWorld* world = V8IsolatedWorld::getEntered();
-    if (UNLIKELY(world != 0))
-        return *world->getDOMDataStore();
+    V8IsolatedContext* context = V8IsolatedContext::getEntered();
+    if (UNLIKELY(context != 0))
+        return *context->world()->domDataStore();
     return m_defaultStore;
 }
 
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index 9df1722..3298cad 100644
--- a/WebCore/bindings/v8/ScriptController.cpp
+++ b/WebCore/bindings/v8/ScriptController.cpp
@@ -51,7 +51,7 @@
 #include "Settings.h"
 #include "V8Binding.h"
 #include "V8BindingState.h"
-#include "V8IsolatedWorld.h"
+#include "V8IsolatedContext.h"
 #include "V8NPObject.h"
 #include "V8Proxy.h"
 #include "Widget.h"
@@ -369,8 +369,8 @@ ScriptState* ScriptController::mainWorldScriptState()
 
 ScriptState* ScriptController::currentScriptState()
 {
-    if (V8IsolatedWorld* world = V8IsolatedWorld::getEntered())
-        return world->scriptState();
+    if (V8IsolatedContext* context = V8IsolatedContext::getEntered())
+        return context->scriptState();
     Frame* frame = V8Proxy::retrieveFrameForCurrentContext();
     ASSERT(frame);
     return frame->script()->mainWorldScriptState();
diff --git a/WebCore/bindings/v8/ScriptState.cpp b/WebCore/bindings/v8/ScriptState.cpp
index 68593e7..085fd2b 100644
--- a/WebCore/bindings/v8/ScriptState.cpp
+++ b/WebCore/bindings/v8/ScriptState.cpp
@@ -73,11 +73,4 @@ ScriptState* scriptStateFromPage(DOMWrapperWorld*, Page* page)
     return page->mainFrame()->script()->mainWorldScriptState();
 }
 
-// FIXME: Stub method so we compile.  Currently called from FrameLoader.cpp.
-DOMWrapperWorld* mainThreadNormalWorld()
-{
-    DEFINE_STATIC_LOCAL(DOMWrapperWorld, oneWorld, ());
-    return &oneWorld;
-}
-
 }
diff --git a/WebCore/bindings/v8/ScriptState.h b/WebCore/bindings/v8/ScriptState.h
index 12a1388..8130092 100644
--- a/WebCore/bindings/v8/ScriptState.h
+++ b/WebCore/bindings/v8/ScriptState.h
@@ -31,6 +31,7 @@
 #ifndef ScriptState_h
 #define ScriptState_h
 
+#include "DOMWrapperWorld.h"
 #include <v8.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/RefCounted.h>
@@ -70,14 +71,9 @@ namespace WebCore {
     ScriptState* scriptStateFromNode(DOMWrapperWorld*, Node*);
     ScriptState* scriptStateFromPage(DOMWrapperWorld*, Page*);
 
-    DOMWrapperWorld* mainThreadNormalWorld();
     inline DOMWrapperWorld* debuggerWorld() { return mainThreadNormalWorld(); }
     inline DOMWrapperWorld* pluginWorld() { return mainThreadNormalWorld(); }
 
-    // Dummy class to avoid a bunch of ifdef's in WebCore.
-    class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
-    };
-
 }
 
 #endif // ScriptState_h
diff --git a/WebCore/bindings/v8/V8DOMWindowShell.cpp b/WebCore/bindings/v8/V8DOMWindowShell.cpp
index 49b5bf9..968ab05 100644
--- a/WebCore/bindings/v8/V8DOMWindowShell.cpp
+++ b/WebCore/bindings/v8/V8DOMWindowShell.cpp
@@ -51,7 +51,6 @@
 #include "V8DOMWindow.h"
 #include "V8HiddenPropertyName.h"
 #include "V8Index.h"
-#include "V8IsolatedWorld.h"
 #include "V8Proxy.h"
 #include "WorkerContextExecutionProxy.h"
 
diff --git a/WebCore/bindings/v8/V8DOMWrapper.cpp b/WebCore/bindings/v8/V8DOMWrapper.cpp
index 9c08611..6b212c0 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -49,7 +49,7 @@
 #include "V8EventListenerList.h"
 #include "V8HTMLCollection.h"
 #include "V8Index.h"
-#include "V8IsolatedWorld.h"
+#include "V8IsolatedContext.h"
 #include "V8Location.h"
 #include "V8NodeList.h"
 #include "V8Proxy.h"
@@ -790,11 +790,12 @@ v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(V8Proxy* proxy, V8ClassI
     if (descriptorType == V8ClassIndex::HTMLCOLLECTION && static_cast<HTMLCollection*>(impl)->type() == DocAll)
         descriptorType = V8ClassIndex::HTMLALLCOLLECTION;
 
-    if (V8IsolatedWorld::getEntered()) {
+    if (V8IsolatedContext::getEntered()) {
         // This effectively disables the wrapper cache for isolated worlds.
         proxy = 0;
         // FIXME: Do we need a wrapper cache for the isolated world?  We should
-        // see if the performance gains are worth while.
+        //        see if the performance gains are worth while.
+        // We'll get one once we give the isolated context a proper window shell.
     } else if (!proxy)
         proxy = V8Proxy::retrieve();
 
diff --git a/WebCore/bindings/v8/V8IsolatedContext.cpp b/WebCore/bindings/v8/V8IsolatedContext.cpp
new file mode 100644
index 0000000..e8a51cb
--- /dev/null
+++ b/WebCore/bindings/v8/V8IsolatedContext.cpp
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "V8IsolatedContext.h"
+
+#include "Frame.h"
+#include "FrameLoaderClient.h"
+#include "HashMap.h"
+#include "ScriptController.h"
+#include "V8DOMWindow.h"
+#include "V8HiddenPropertyName.h"
+#include <v8.h>
+
+namespace WebCore {
+
+
+void V8IsolatedContext::contextWeakReferenceCallback(v8::Persistent<v8::Value> object, void* isolatedContext)
+{
+    // Our context is going away.  Time to clean up the world.
+    V8IsolatedContext* context = static_cast<V8IsolatedContext*>(isolatedContext);
+    delete context;
+}
+
+V8IsolatedContext::V8IsolatedContext(V8Proxy* proxy, int extensionGroup)
+    : m_world(IsolatedWorld::create())
+{
+    v8::HandleScope scope;
+    // FIXME: We should be creating a new V8DOMWindowShell here instead of riping out the context.
+    m_context = SharedPersistent<v8::Context>::create(proxy->windowShell()->createNewContext(v8::Handle<v8::Object>(), extensionGroup));
+    if (m_context->get().IsEmpty())
+        return;
+
+    // Run code in the new context.
+    v8::Context::Scope contextScope(m_context->get());
+
+    getGlobalObject(m_context->get())->SetPointerInInternalField(V8Custom::kDOMWindowEnteredIsolatedWorldIndex, this);
+
+    V8DOMWindowShell::installHiddenObjectPrototype(m_context->get());
+    // FIXME: This will go away once we have a windowShell for the isolated world.
+    proxy->windowShell()->installDOMWindow(m_context->get(), proxy->frame()->domWindow());
+
+    // Using the default security token means that the canAccess is always
+    // called, which is slow.
+    // FIXME: Use tokens where possible. This will mean keeping track of all
+    //        created contexts so that they can all be updated when the
+    //        document domain
+    //        changes.
+    m_context->get()->UseDefaultSecurityToken();
+
+    proxy->frame()->loader()->client()->didCreateIsolatedScriptContext();
+}
+
+void V8IsolatedContext::destroy()
+{
+    m_context->get().MakeWeak(this, &contextWeakReferenceCallback);
+}
+
+V8IsolatedContext::~V8IsolatedContext()
+{
+    m_context->disposeHandle();
+}
+
+ScriptState* V8IsolatedContext::scriptState()
+{
+    if (!m_scriptState) {
+        v8::HandleScope scope;
+        v8::Handle<v8::Context> context = m_context.get()->get();
+        m_scriptState.set(new ScriptState(V8Proxy::retrieveFrame(context), context));
+    }
+    return m_scriptState.get();
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/V8IsolatedContext.h b/WebCore/bindings/v8/V8IsolatedContext.h
new file mode 100644
index 0000000..4f9a5b8
--- /dev/null
+++ b/WebCore/bindings/v8/V8IsolatedContext.h
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef V8IsolatedContext_h
+#define V8IsolatedContext_h
+
+#include "IsolatedWorld.h"
+#include "ScriptSourceCode.h" // for WebCore::ScriptSourceCode
+#include "V8Index.h"
+#include "V8Proxy.h"
+#include "V8Utilities.h"
+#include <v8.h>
+
+namespace WebCore {
+
+class V8Proxy;
+
+// V8IsolatedContext
+//
+// V8IsolatedContext represents a isolated execution environment for
+// JavaScript.  Each isolated world executes in parallel with the main
+// JavaScript world.  An isolated world has access to the same DOM data
+// structures as the main world but none of the JavaScript pointers.
+//
+// It is an error to ever share a JavaScript pointer between two isolated
+// worlds or between an isolated world and the main world.  Because
+// isolated worlds have access to the DOM, they need their own DOM wrappers
+// to avoid having pointers to the main world's DOM wrappers (which are
+// JavaScript objects).
+class V8IsolatedContext {
+public:
+    // Creates an isolated world. To destroy it, call destroy().
+    // This will delete the isolated world when the context it owns is GC'd.
+    V8IsolatedContext(V8Proxy* proxy, int extensionGroup);
+    ~V8IsolatedContext();
+
+    // Call this to destroy the isolated world. It will be deleted sometime
+    // after this call, once all script references to the world's context
+    // have been dropped.
+    void destroy();
+
+    // Returns the isolated world associated with
+    // v8::Context::GetEntered().  Because worlds are isolated, the entire
+    // JavaScript call stack should be from the same isolated world.
+    // Returns 0 if the entered context is from the main world.
+    //
+    // FIXME: Consider edge cases with DOM mutation events that might
+    // violate this invariant.
+    //
+    static V8IsolatedContext* getEntered()
+    {
+        // This is a temporary performance optimization.   Essentially,
+        // GetHiddenValue is too slow for this code path.  We need to get the
+        // V8 team to add a real property to v8::Context for isolated worlds.
+        // Until then, we optimize the common case of not having any isolated
+        // worlds at all.
+        if (!IsolatedWorld::count())
+            return 0;
+        if (!v8::Context::InContext())
+            return 0;
+        return reinterpret_cast<V8IsolatedContext*>(getGlobalObject(v8::Context::GetEntered())->GetPointerFromInternalField(V8Custom::kDOMWindowEnteredIsolatedWorldIndex));
+    }
+
+    v8::Handle<v8::Context> context() { return m_context->get(); }
+    PassRefPtr<SharedPersistent<v8::Context> > sharedContext() { return m_context; }
+
+    IsolatedWorld* world() const { return m_world.get(); }
+
+    ScriptState* scriptState();
+
+private:
+    static v8::Handle<v8::Object> getGlobalObject(v8::Handle<v8::Context> context)
+    {
+        return v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype());
+    }
+
+    // Called by the garbage collector when our JavaScript context is about
+    // to be destroyed.
+    static void contextWeakReferenceCallback(v8::Persistent<v8::Value> object, void* isolatedContext);
+
+    // The underlying v8::Context. This object is keep on the heap as
+    // long as |m_context| has not been garbage collected.
+    RefPtr<SharedPersistent<v8::Context> > m_context;
+
+    RefPtr<IsolatedWorld> m_world;
+
+    // FIXME: get rid of redundant m_context field. The context can be retrieved from the ScriptState.
+    OwnPtr<ScriptState> m_scriptState;
+};
+
+} // namespace WebCore
+
+#endif // V8IsolatedContext_h
diff --git a/WebCore/bindings/v8/V8IsolatedWorld.cpp b/WebCore/bindings/v8/V8IsolatedWorld.cpp
deleted file mode 100644
index 6ec1539..0000000
--- a/WebCore/bindings/v8/V8IsolatedWorld.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "V8IsolatedWorld.h"
-
-#include <v8.h>
-
-#include "Frame.h"
-#include "FrameLoaderClient.h"
-#include "HashMap.h"
-#include "ScriptController.h"
-#include "V8DOMWindow.h"
-#include "V8HiddenPropertyName.h"
-
-namespace WebCore {
-
-int V8IsolatedWorld::isolatedWorldCount = 0;
-
-void V8IsolatedWorld::contextWeakReferenceCallback(v8::Persistent<v8::Value> object, void* isolated_world)
-{
-    // Our context is going away.  Time to clean up the world.
-    V8IsolatedWorld* world = static_cast<V8IsolatedWorld*>(isolated_world);
-    delete world;
-}
-
-V8IsolatedWorld::V8IsolatedWorld(V8Proxy* proxy, int extensionGroup)
-{
-    ++isolatedWorldCount;
-
-    v8::HandleScope scope;
-    // FIXME: We should be creating a new V8DOMWindowShell here instead of riping out the context.
-    m_context = SharedPersistent<v8::Context>::create(proxy->windowShell()->createNewContext(v8::Handle<v8::Object>(), extensionGroup));
-    if (m_context->get().IsEmpty())
-        return;
-
-    // Run code in the new context.
-    v8::Context::Scope context_scope(m_context->get());
-
-    getGlobalObject(m_context->get())->SetPointerInInternalField(V8Custom::kDOMWindowEnteredIsolatedWorldIndex, this);
-
-    V8DOMWindowShell::installHiddenObjectPrototype(m_context->get());
-    // FIXME: This will go away once we have a windowShell for the isolated world.
-    proxy->windowShell()->installDOMWindow(m_context->get(), proxy->frame()->domWindow());
-
-    // Using the default security token means that the canAccess is always
-    // called, which is slow.
-    // FIXME: Use tokens where possible. This will mean keeping track of all
-    //        created contexts so that they can all be updated when the
-    //        document domain
-    //        changes.
-    m_context->get()->UseDefaultSecurityToken();
-
-    proxy->frame()->loader()->client()->didCreateIsolatedScriptContext();
-}
-
-void V8IsolatedWorld::destroy()
-{
-    m_context->get().MakeWeak(this, &contextWeakReferenceCallback);
-}
-
-V8IsolatedWorld::~V8IsolatedWorld()
-{
-    --isolatedWorldCount;
-    m_context->disposeHandle();
-}
-
-ScriptState* V8IsolatedWorld::scriptState()
-{
-    if (!m_scriptState) {
-        v8::HandleScope scope;
-        v8::Handle<v8::Context> context = m_context.get()->get();
-        m_scriptState.set(new ScriptState(V8Proxy::retrieveFrame(context), context));
-    }
-    return m_scriptState.get();
-}
-
-} // namespace WebCore
diff --git a/WebCore/bindings/v8/V8IsolatedWorld.h b/WebCore/bindings/v8/V8IsolatedWorld.h
deleted file mode 100644
index c3c18fe..0000000
--- a/WebCore/bindings/v8/V8IsolatedWorld.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef V8IsolatedWorld_h
-#define V8IsolatedWorld_h
-
-#include <v8.h>
-
-#include "V8DOMMap.h"
-#include "V8Index.h"
-#include "V8Proxy.h"
-#include "V8Utilities.h"
-#include "ScriptSourceCode.h"  // for WebCore::ScriptSourceCode
-
-namespace WebCore {
-
-    class V8Proxy;
-
-    // V8IsolatedWorld
-    //
-    // V8IsolatedWorld represents a isolated execution environment for
-    // JavaScript.  Each isolated world executes in parallel with the main
-    // JavaScript world.  An isolated world has access to the same DOM data
-    // structures as the main world but none of the JavaScript pointers.
-    //
-    // It is an error to ever share a JavaScript pointer between two isolated
-    // worlds or between an isolated world and the main world.  Because
-    // isolated worlds have access to the DOM, they need their own DOM wrappers
-    // to avoid having pointers to the main world's DOM wrappers (which are
-    // JavaScript objects).
-    //
-    class V8IsolatedWorld {
-    public:
-        // Creates an isolated world. To destroy it, call destroy().
-        // This will delete the isolated world when the context it owns is GC'd.
-        V8IsolatedWorld(V8Proxy* proxy, int extensionGroup);
-        ~V8IsolatedWorld();
-
-        // Call this to destroy the isolated world. It will be deleted sometime
-        // after this call, once all script references to the world's context
-        // have been dropped.
-        void destroy();
-
-        // Returns the isolated world associated with
-        // v8::Context::GetEntered().  Because worlds are isolated, the entire
-        // JavaScript call stack should be from the same isolated world.
-        // Returns NULL if the entered context is from the main world.
-        //
-        // FIXME: Consider edge cases with DOM mutation events that might
-        // violate this invariant.
-        //
-        static V8IsolatedWorld* getEntered()
-        {
-            // This is a temporary performance optimization.   Essentially,
-            // GetHiddenValue is too slow for this code path.  We need to get the
-            // V8 team to add a real property to v8::Context for isolated worlds.
-            // Until then, we optimize the common case of not having any isolated
-            // worlds at all.
-            if (!isolatedWorldCount)
-                return 0;
-            if (!v8::Context::InContext())
-                return 0;
-            return reinterpret_cast<V8IsolatedWorld*>(getGlobalObject(v8::Context::GetEntered())->GetPointerFromInternalField(V8Custom::kDOMWindowEnteredIsolatedWorldIndex));
-        }
-
-        v8::Handle<v8::Context> context() { return m_context->get(); }
-        PassRefPtr<SharedPersistent<v8::Context> > sharedContext() { return m_context; }
-
-        DOMDataStore* getDOMDataStore() const { return m_domDataStore.getStore(); }
-
-        ScriptState* scriptState();
-
-    private:
-        static v8::Handle<v8::Object> getGlobalObject(v8::Handle<v8::Context> context)
-        {
-            return v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype());
-        }
-
-        // Called by the garbage collector when our JavaScript context is about
-        // to be destroyed.
-        static void contextWeakReferenceCallback(v8::Persistent<v8::Value> object, void* isolated_world);
-
-        // The v8::Context for the isolated world.  This object is keep on the
-        // heap as long as |m_context| has not been garbage collected.
-        RefPtr<SharedPersistent<v8::Context> > m_context;
-
-        // The backing store for the isolated world's DOM wrappers.  This class
-        // doesn't have visibility into the wrappers.  This handle simply helps
-        // manage their lifetime.
-        DOMDataStoreHandle m_domDataStore;
-
-        // FIXME: get rid of redundant m_context field. The context can be retrieved from the ScriptState.
-        OwnPtr<ScriptState> m_scriptState;
-
-        static int isolatedWorldCount;
-    };
-
-} // namespace WebCore
-
-#endif // V8IsolatedWorld_h
diff --git a/WebCore/bindings/v8/V8Proxy.cpp b/WebCore/bindings/v8/V8Proxy.cpp
index 7223435..e6e7f89 100644
--- a/WebCore/bindings/v8/V8Proxy.cpp
+++ b/WebCore/bindings/v8/V8Proxy.cpp
@@ -51,7 +51,7 @@
 #include "V8DOMWindow.h"
 #include "V8HiddenPropertyName.h"
 #include "V8Index.h"
-#include "V8IsolatedWorld.h"
+#include "V8IsolatedContext.h"
 #include "WorkerContextExecutionProxy.h"
 
 #include <algorithm>
@@ -270,43 +270,44 @@ void V8Proxy::evaluateInIsolatedWorld(int worldID, const Vector<ScriptSourceCode
     windowShell()->initContextIfNeeded();
 
     v8::HandleScope handleScope;
-    V8IsolatedWorld* world = 0;
+    V8IsolatedContext* isolatedContext = 0;
 
     if (worldID > 0) {
         IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(worldID);
         if (iter != m_isolatedWorlds.end()) {
-            world = iter->second;
+            isolatedContext = iter->second;
         } else {
-            world = new V8IsolatedWorld(this, extensionGroup);
-            if (world->context().IsEmpty()) {
-                delete world;
+            isolatedContext = new V8IsolatedContext(this, extensionGroup);
+            if (isolatedContext->context().IsEmpty()) {
+                delete isolatedContext;
                 return;
             }
 
-            m_isolatedWorlds.set(worldID, world);
+            // FIXME: We should change this to using window shells to match JSC.
+            m_isolatedWorlds.set(worldID, isolatedContext);
 
             // Setup context id for JS debugger.
-            if (!setInjectedScriptContextDebugId(world->context())) {
+            if (!setInjectedScriptContextDebugId(isolatedContext->context())) {
                 m_isolatedWorlds.take(worldID);
-                delete world;
+                delete isolatedContext;
                 return;
             }
         }
     } else {
-        world = new V8IsolatedWorld(this, extensionGroup);
-        if (world->context().IsEmpty()) {
-            delete world;
+        isolatedContext = new V8IsolatedContext(this, extensionGroup);
+        if (isolatedContext->context().IsEmpty()) {
+            delete isolatedContext;
             return;
         }
     }
 
-    v8::Local<v8::Context> context = v8::Local<v8::Context>::New(world->context());
+    v8::Local<v8::Context> context = v8::Local<v8::Context>::New(isolatedContext->context());
     v8::Context::Scope context_scope(context);
     for (size_t i = 0; i < sources.size(); ++i)
       evaluate(sources[i], 0);
 
     if (worldID == 0)
-      world->destroy();
+      isolatedContext->destroy();
 }
 
 bool V8Proxy::setInjectedScriptContextDebugId(v8::Handle<v8::Context> targetContext)
@@ -658,8 +659,8 @@ v8::Local<v8::Context> V8Proxy::context(Frame* frame)
     if (context.IsEmpty())
         return v8::Local<v8::Context>();
 
-    if (V8IsolatedWorld* world = V8IsolatedWorld::getEntered()) {
-        context = v8::Local<v8::Context>::New(world->context());
+    if (V8IsolatedContext* isolatedContext = V8IsolatedContext::getEntered()) {
+        context = v8::Local<v8::Context>::New(isolatedContext->context());
         if (frame != V8Proxy::retrieveFrame(context))
             return v8::Local<v8::Context>();
     }
@@ -669,8 +670,8 @@ v8::Local<v8::Context> V8Proxy::context(Frame* frame)
 
 v8::Local<v8::Context> V8Proxy::context()
 {
-    if (V8IsolatedWorld* world = V8IsolatedWorld::getEntered()) {
-        RefPtr<SharedPersistent<v8::Context> > context = world->sharedContext();
+    if (V8IsolatedContext* isolatedContext = V8IsolatedContext::getEntered()) {
+        RefPtr<SharedPersistent<v8::Context> > context = isolatedContext->sharedContext();
         if (m_frame != V8Proxy::retrieveFrame(context->get()))
             return v8::Local<v8::Context>();
         return v8::Local<v8::Context>::New(context->get());
diff --git a/WebCore/bindings/v8/V8Proxy.h b/WebCore/bindings/v8/V8Proxy.h
index 3d53846..598340d 100644
--- a/WebCore/bindings/v8/V8Proxy.h
+++ b/WebCore/bindings/v8/V8Proxy.h
@@ -59,7 +59,7 @@ namespace WebCore {
     class ScriptExecutionContext;
     class String;
     class V8EventListener;
-    class V8IsolatedWorld;
+    class V8IsolatedContext;
     class WorldContextHandle;
 
     // FIXME: use standard logging facilities in WebCore.
@@ -401,7 +401,10 @@ namespace WebCore {
         // Note: although the pointer is raw, the instance is kept alive by a strong
         // reference to the v8 context it contains, which is not made weak until we
         // call world->destroy().
-        typedef HashMap<int, V8IsolatedWorld*> IsolatedWorldMap;
+        //
+        // FIXME: We want to eventually be holding window shells instead of the
+        //        IsolatedContext directly.
+        typedef HashMap<int, V8IsolatedContext*> IsolatedWorldMap;
         IsolatedWorldMap m_isolatedWorlds;
     };
 
diff --git a/WebCore/bindings/v8/WorldContextHandle.cpp b/WebCore/bindings/v8/WorldContextHandle.cpp
index eb83586..7ba76d3 100644
--- a/WebCore/bindings/v8/WorldContextHandle.cpp
+++ b/WebCore/bindings/v8/WorldContextHandle.cpp
@@ -31,7 +31,7 @@
 #include "config.h"
 #include "WorldContextHandle.h"
 
-#include "V8IsolatedWorld.h"
+#include "V8IsolatedContext.h"
 
 namespace WebCore {
 
@@ -41,8 +41,8 @@ WorldContextHandle::WorldContextHandle(WorldToUse worldToUse)
     if (worldToUse == UseMainWorld)
         return;
 
-    if (V8IsolatedWorld* world = V8IsolatedWorld::getEntered())
-        m_context = world->sharedContext();
+    if (V8IsolatedContext* context = V8IsolatedContext::getEntered())
+        m_context = context->sharedContext();
 }
 
 v8::Local<v8::Context> WorldContextHandle::adjustedContext(V8Proxy* proxy) const

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list