diff options
author | Ben Murdoch <benm@google.com> | 2011-05-24 11:24:40 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-02 09:53:15 +0100 |
commit | 81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch) | |
tree | 7a9e5ed86ff429fd347a25153107221543909b19 /Source/WebCore/bridge/jsc | |
parent | 94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff) | |
download | external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2 |
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'Source/WebCore/bridge/jsc')
-rw-r--r-- | Source/WebCore/bridge/jsc/BridgeJSC.cpp | 26 | ||||
-rw-r--r-- | Source/WebCore/bridge/jsc/BridgeJSC.h | 3 |
2 files changed, 13 insertions, 16 deletions
diff --git a/Source/WebCore/bridge/jsc/BridgeJSC.cpp b/Source/WebCore/bridge/jsc/BridgeJSC.cpp index 2747c75..9c0adfc 100644 --- a/Source/WebCore/bridge/jsc/BridgeJSC.cpp +++ b/Source/WebCore/bridge/jsc/BridgeJSC.cpp @@ -27,9 +27,12 @@ #include "config.h" #include "BridgeJSC.h" +#include "JSDOMWindowBase.h" #include "runtime_object.h" #include "runtime_root.h" -#include <runtime/JSLock.h> +#include "runtime/JSLock.h" +#include "runtime/ObjectPrototype.h" + #if PLATFORM(QT) #include "qt_instance.h" @@ -51,6 +54,7 @@ Array::~Array() Instance::Instance(PassRefPtr<RootObject> rootObject) : m_rootObject(rootObject) + , m_runtimeObject(*WebCore::JSDOMWindowBase::commonJSGlobalData()) { ASSERT(m_rootObject); } @@ -58,7 +62,6 @@ Instance::Instance(PassRefPtr<RootObject> rootObject) Instance::~Instance() { ASSERT(!m_runtimeObject); - ASSERT(!m_runtimeObject.hasDeadObject()); } static KJSDidExecuteFunctionPtr s_didExecuteFunction; @@ -92,28 +95,23 @@ JSObject* Instance::createRuntimeObject(ExecState* exec) JSLock lock(SilenceAssertionsOnly); RuntimeObject* newObject = newRuntimeObject(exec); - m_runtimeObject = newObject; - m_rootObject->addRuntimeObject(newObject); + m_runtimeObject.set(exec->globalData(), newObject, 0); + m_rootObject->addRuntimeObject(exec->globalData(), newObject); return newObject; } RuntimeObject* Instance::newRuntimeObject(ExecState* exec) { JSLock lock(SilenceAssertionsOnly); - return new (exec)RuntimeObject(exec, exec->lexicalGlobalObject(), this); -} -void Instance::willDestroyRuntimeObject(RuntimeObject* object) -{ - ASSERT(m_rootObject); - m_rootObject->removeRuntimeObject(object); - m_runtimeObject.clear(object); + // FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object + // We need to pass in the right global object for "i". + return new (exec) RuntimeObject(exec, exec->lexicalGlobalObject(), WebCore::deprecatedGetDOMStructure<RuntimeObject>(exec), this); } -void Instance::willInvalidateRuntimeObject(RuntimeObject* object) +void Instance::willInvalidateRuntimeObject() { - ASSERT(object); - m_runtimeObject.clear(object); + m_runtimeObject.clear(); } RootObject* Instance::rootObject() const diff --git a/Source/WebCore/bridge/jsc/BridgeJSC.h b/Source/WebCore/bridge/jsc/BridgeJSC.h index bb5a379..c44faf1 100644 --- a/Source/WebCore/bridge/jsc/BridgeJSC.h +++ b/Source/WebCore/bridge/jsc/BridgeJSC.h @@ -88,8 +88,7 @@ public: virtual Class* getClass() const = 0; JSObject* createRuntimeObject(ExecState*); - void willInvalidateRuntimeObject(RuntimeObject*); - void willDestroyRuntimeObject(RuntimeObject*); + void willInvalidateRuntimeObject(); // Returns false if the value was not set successfully. virtual bool setValueOfUndefinedField(ExecState*, const Identifier&, JSValue) { return false; } |