diff options
author | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-10 01:10:39 +0000 |
---|---|---|
committer | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-10 01:10:39 +0000 |
commit | 67c2610bc1a4a3ae776ed87507c57eed98dd36ea (patch) | |
tree | 5b8180628ce85cd7e979f89cd01e6d102e35c3d4 /webkit | |
parent | 6a3da2147c51fe8df50f19e9e9054e49ff97168f (diff) | |
download | chromium_src-67c2610bc1a4a3ae776ed87507c57eed98dd36ea.zip chromium_src-67c2610bc1a4a3ae776ed87507c57eed98dd36ea.tar.gz chromium_src-67c2610bc1a4a3ae776ed87507c57eed98dd36ea.tar.bz2 |
Some initial fixes for ScriptController errors. There's still
a ton, but I'd like to have all my changes checked in should
V8 folk want to help overnight.
Review URL: http://codereview.chromium.org/7048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3166 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/port/bridge/ScriptControllerKJS.cpp | 68 |
1 files changed, 27 insertions, 41 deletions
diff --git a/webkit/port/bridge/ScriptControllerKJS.cpp b/webkit/port/bridge/ScriptControllerKJS.cpp index 4786b6c..2ff7a04 100644 --- a/webkit/port/bridge/ScriptControllerKJS.cpp +++ b/webkit/port/bridge/ScriptControllerKJS.cpp @@ -31,85 +31,71 @@ #include "Frame.h" #include "EventListener.h" #include "HTMLPlugInElement.h" +#include "JSDOMBinding.h" #include "Node.h" -#include "kjs_dom.h" #include "kjs/JSLock.h" -#include "kjs/object.h" -#include "KJSBridge.h" -#include "kjs_window.h" +#include "kjs/protect.h" #include "bindings/npruntime.h" #include "npruntime_impl.h" #include "npruntime_priv.h" -#include "bindings/runtime.h" -#include "bindings/runtime_root.h" #include "NP_jsobject.h" namespace WebCore { -bool JSBridge::m_recordPlaybackMode = false; +bool ScriptController::m_recordPlaybackMode = false; // static -void JSBridge::setFlags(const char*, int) { +void ScriptController::setFlags(const char*, int) { // empty } // static -void JSBridge::setDomain(Frame*, const String&) { +void ScriptController::setDomain(Frame*, const String&) { // empty } // static -Frame* JSBridge::retrieveActiveFrame() { +Frame* ScriptController::retrieveActiveFrame() { // Not implemented. ASSERT(false); return 0; } // static -bool JSBridge::isSafeScript(Frame* target) { +bool ScriptController::isSafeScript(Frame* target) { // Not implemented. ASSERT(false); return false; } // static -void JSBridge::gcProtectJSWrapper(void* dom_object) { - KJS::JSLock lock; - KJS::gcProtectNullTolerant(KJS::ScriptInterpreter::getDOMObject(dom_object)); +void ScriptController::gcProtectJSWrapper(void* dom_object) { + KJS::JSLock lock(false); + KJS::gcProtectNullTolerant(ScriptInterpreter::getDOMObject(dom_object)); } // static -void JSBridge::gcUnprotectJSWrapper(void* dom_object) { - KJS::JSLock lock; - KJS::gcUnprotectNullTolerant(KJS::ScriptInterpreter::getDOMObject(dom_object)); +void ScriptController::gcUnprotectJSWrapper(void* dom_object) { + KJS::JSLock lock(false); + KJS::gcUnprotectNullTolerant(ScriptInterpreter::getDOMObject(dom_object)); } -// static -JSException JSBridge::NoException() { - return 0; -} - -// static -bool JSBridge::IsException(JSException exception) { - return exception != 0; -} - -// static -PausedTimeouts* JSBridge::pauseTimeouts(Frame* frame) { - if (!frame) - return NULL; - - KJS::Window* window = KJS::Window::retrieveWindow(frame); - if (!window) - return NULL; - - return window->pauseTimeouts(); +// static +PausedTimeouts* ScriptController::pauseTimeouts(Frame* frame) { + if (!frame) + return NULL; + + KJS::Window* window = KJS::Window::retrieveWindow(frame); + if (!window) + return NULL; + + return window->pauseTimeouts(); } // static -void JSBridge::resumeTimeouts(Frame* frame, PausedTimeouts* timeouts) { +void ScriptController::resumeTimeouts(Frame* frame, PausedTimeouts* timeouts) { if (!frame) return; @@ -140,7 +126,7 @@ String KJSBridge::evaluate(const String& filename, int baseLine, if (!value || value->isUndefined()) return String(); - KJS::JSLock lock; + KJS::JSLock lock(false); KJS::ExecState* exec = m_proxy->globalObject()->globalExec(); KJS::UString ustring = value->toString(exec); exec->clearException(); @@ -223,7 +209,7 @@ JSInstanceHolder& JSInstanceHolder::operator=(JSInstance instance) { /* JSRootObject* KJSBridge::getRootObject() { - KJS::JSLock lock; + KJS::JSLock lock(false); PassRefPtr<KJS::Bindings::RootObject> object = KJS::Bindings::RootObject::create(0, m_proxy->interpreter()); return ToWebCoreJSRootObject(object.releaseRef()); @@ -285,7 +271,7 @@ NPObject *KJSBridge::CreateScriptObject(Frame* frame) NPObject *KJSBridge::CreateScriptObject(Frame* frame, HTMLPlugInElement *element) { - KJS::JSLock lock; + KJS::JSLock lock(false); KJS::ExecState *exec = frame->scriptProxy()->globalObject()->globalExec(); //KJS::JSObject* wrappedObject = static_cast<KJS::JSObject*>(object); //PassRefPtr<KJS::JSObject> wrappedObject = static_cast<KJS::JSObject*>(object); |