diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-14 18:39:50 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-14 18:39:50 +0000 |
commit | a035982962aa5af5f97aeef374755843d6ad2c89 (patch) | |
tree | 2a1bdb04c729444fd6223e9edc9b5bb5a3223852 | |
parent | 773169e0326446476a339300fbdfaf499d13598f (diff) | |
download | chromium_src-a035982962aa5af5f97aeef374755843d6ad2c89.zip chromium_src-a035982962aa5af5f97aeef374755843d6ad2c89.tar.gz chromium_src-a035982962aa5af5f97aeef374755843d6ad2c89.tar.bz2 |
Lots of ScriptController fixes, but it still doesn't compile cleanly.
This makes the header and C file noticeably more like the upstream versions. In some cases I have ripped out the implementations of functions that we added that there's no obvious way to make it work. The V8 team is going to have to implement these.
This code absolutely isn't going to run.
Review URL: http://codereview.chromium.org/7313
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3356 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/pending/ScriptController.h | 40 | ||||
-rw-r--r-- | webkit/port/bridge/ScriptControllerKJS.cpp | 586 |
2 files changed, 408 insertions, 218 deletions
diff --git a/webkit/pending/ScriptController.h b/webkit/pending/ScriptController.h index 9b90e75..6dbe13a 100644 --- a/webkit/pending/ScriptController.h +++ b/webkit/pending/ScriptController.h @@ -37,6 +37,7 @@ #include "bindings/npruntime.h" #if USE(JSC) +#include "JSDOMWindowShell.h" #include <kjs/ustring.h> #endif @@ -167,6 +168,21 @@ public: ScriptController(Frame*); ~ScriptController(); +#if USE(JSC) + bool haveWindowShell() const { return m_windowShell; } + JSDOMWindowShell* windowShell() + { + initScriptIfNeeded(); + return m_windowShell; + } + + JSDOMWindow* globalObject() + { + initScriptIfNeeded(); + return m_windowShell->window(); + } +#endif + #if USE(V8) // TODO(eseidel): V8Proxy should either be folded into ScriptController // or this accessor should be made JSProxy* @@ -192,8 +208,6 @@ public: PassRefPtr<EventListener> createSVGEventHandler(const String& functionName, const String& code, Node*); #endif - // Get the Root object - // JSRootObject* getRootObject(); // Creates a property of the global object of a frame. void BindToWindowObject(Frame*, const String& key, NPObject*); @@ -210,7 +224,7 @@ public: bool isEnabled() const; - // TODO(eseide): void* is a compile hack + // TODO(eseidel): void* is a compile hack void attachDebugger(void*); // Create a NPObject wrapper for a JSObject @@ -271,12 +285,32 @@ public: void clearScriptObjects(); void cleanupScriptObjectsForPlugin(void*); +#if USE(JSC) + KJS::Bindings::RootObject* bindingRootObject(); +#endif + #if ENABLE(NETSCAPE_PLUGIN_API) NPObject* createScriptObjectForPluginElement(HTMLPlugInElement*); NPObject* windowScriptNPObject(); #endif private: +#if USE(JSC) + void initScriptIfNeeded() + { + if (!m_windowShell) + initScript(); + } + void initScript(); + + void clearPlatformScriptObjects(); + void disconnectPlatformScriptObjects(); + + KJS::ProtectedPtr<JSDOMWindowShell> m_windowShell; + HashSet<JSDOMWindow*> m_liveFormerWindows; + int m_handlerLineno; +#endif + static bool m_recordPlaybackMode; Frame* m_frame; diff --git a/webkit/port/bridge/ScriptControllerKJS.cpp b/webkit/port/bridge/ScriptControllerKJS.cpp index f08c353..6e3d830 100644 --- a/webkit/port/bridge/ScriptControllerKJS.cpp +++ b/webkit/port/bridge/ScriptControllerKJS.cpp @@ -28,32 +28,152 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "config.h" +#include "ScriptController.h" + +#include "Event.h" +#include "EventNames.h" #include "Frame.h" -#include "EventListener.h" +#include "FrameLoader.h" +#include "GCController.h" +#include "JSEventListener.h" +#include "npruntime_impl.h" +#include "NP_jsobject.h" +#include "Page.h" +#include "PageGroup.h" +#include "runtime_root.h" +#include "Settings.h" + +#include <kjs/debugger.h> +#include <kjs/JSLock.h> + +#if ENABLE(NETSCAPE_PLUGIN_API) #include "HTMLPlugInElement.h" -#include "JSDOMBinding.h" -#include "Node.h" -#include "kjs/JSLock.h" -#include "kjs/protect.h" +#endif -#include "bindings/npruntime.h" -#include "npruntime_impl.h" -#include "npruntime_priv.h" +#if ENABLE(SVG) +#include "JSSVGLazyEventListener.h" +#endif -#include "NP_jsobject.h" +using namespace KJS; +using namespace WebCore::EventNames; namespace WebCore { bool ScriptController::m_recordPlaybackMode = false; -// static -void ScriptController::setFlags(const char*, int) { - // empty +ScriptController::ScriptController(Frame* frame) + : m_frame(frame) + , m_handlerLineno(0) + , m_sourceURL(0) + , m_processingTimerCallback(false) + , m_paused(false) +#if ENABLE(NETSCAPE_PLUGIN_API) + , m_windowScriptNPObject(0) +#endif +#if PLATFORM(MAC) + , m_windowScriptObject(0) +#endif +{ +#if PLATFORM(MAC) && ENABLE(MAC_JAVA_BRIDGE) + static bool initializedJavaJSBindings; + if (!initializedJavaJSBindings) { + initializedJavaJSBindings = true; + initJavaJSBindings(); + } +#endif } -// static -void ScriptController::setDomain(Frame*, const String&) { - // empty +ScriptController::~ScriptController() +{ + if (m_windowShell) { + m_windowShell = 0; + + // It's likely that releasing the global object has created a lot of garbage. + gcController().garbageCollectSoon(); + } + + disconnectPlatformScriptObjects(); +} + +// Evaluate a script file in the environment of this proxy. +String ScriptController::evaluate(const String& filename, int baseLine, const String& code, Node* node, bool* succ) { + // Not implemented. + ASSERT(false); + return String(); +} + + +// Evaluate a script file in the environment of this proxy. +JSResult ScriptController::evaluate(const String& filename, int baseLine, const String& code, Node* node) { + // Not implemented. + ASSERT(false); + return 0; +} + +void ScriptController::clearWindowShell() +{ + if (!m_windowShell) + return; + + JSLock lock(false); + m_windowShell->window()->clear(); + m_liveFormerWindows.add(m_windowShell->window()); + m_windowShell->setWindow(new (JSDOMWindow::commonJSGlobalData()) JSDOMWindow(m_frame->domWindow(), m_windowShell)); + if (Page* page = m_frame->page()) { + attachDebugger(page->debugger()); + m_windowShell->window()->setProfileGroup(page->group().identifier()); + } + + // There is likely to be a lot of garbage now. + gcController().garbageCollectSoon(); +} + +PassRefPtr<EventListener> ScriptController::createHTMLEventHandler(const String& functionName, const String& code, Node* node) +{ + initScriptIfNeeded(); + JSLock lock(false); + return JSLazyEventListener::create(functionName, code, m_windowShell->window(), node, m_handlerLineno); +} + +#if ENABLE(SVG) +PassRefPtr<EventListener> ScriptController::createSVGEventHandler(const String& functionName, const String& code, Node* node) +{ + initScriptIfNeeded(); + JSLock lock(false); + return JSSVGLazyEventListener::create(functionName, code, m_windowShell->window(), node, m_handlerLineno); +} +#endif + +void ScriptController::BindToWindowObject(Frame* frame, const String& key, NPObject* object) { + // Not implemented. + ASSERT(false); +} + +NPRuntimeFunctions npruntime_functions = { + _NPN_GetStringIdentifier, + _NPN_GetStringIdentifiers, + _NPN_GetIntIdentifier, + _NPN_IdentifierIsString, + _NPN_UTF8FromIdentifier, + _NPN_IntFromIdentifier, + _NPN_CreateObject, + _NPN_RetainObject, + _NPN_ReleaseObject, + _NPN_Invoke, + _NPN_InvokeDefault, + _NPN_Evaluate, + _NPN_GetProperty, + _NPN_SetProperty, + _NPN_RemoveProperty, + _NPN_HasProperty, + _NPN_HasMethod, + _NPN_ReleaseVariantValue, + _NPN_SetException +}; + +NPRuntimeFunctions* ScriptController::functions() +{ + return &npruntime_functions; } // static @@ -71,224 +191,266 @@ bool ScriptController::isSafeScript(Frame* target) { } // static -void ScriptController::gcProtectJSWrapper(void* dom_object) { - KJS::JSLock lock(false); - KJS::gcProtectNullTolerant(ScriptInterpreter::getDOMObject(dom_object)); +void ScriptController::setDomain(Frame*, const String&) { + // empty } // static -void ScriptController::gcUnprotectJSWrapper(void* dom_object) { - KJS::JSLock lock(false); - KJS::gcUnprotectNullTolerant(ScriptInterpreter::getDOMObject(dom_object)); +void ScriptController::setFlags(const char*, int) { + // empty } -// 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 ScriptController::gcProtectJSWrapper(void* dom_object) { + KJS::JSLock lock(false); + KJS::gcProtectNullTolerant(ScriptInterpreter::getDOMObject(dom_object)); } // static -void ScriptController::resumeTimeouts(Frame* frame, PausedTimeouts* timeouts) { - if (!frame) - return; - - KJS::Window* window = KJS::Window::retrieveWindow(frame); - if (window) - window->resumeTimeouts(timeouts); +void ScriptController::gcUnprotectJSWrapper(void* dom_object) { + KJS::JSLock lock(false); + KJS::gcUnprotectNullTolerant(ScriptInterpreter::getDOMObject(dom_object)); } -void KJSBridge::disconnectFrame() +void ScriptController::finishedWithEvent(Event* event) { - if (m_proxy->haveGlobalObject()) { - static_cast<KJS::Window*>(m_proxy->globalObject())->disconnectFrame(); - } + // This is called when the DOM implementation has finished with a particular event. This + // is the case in sitations where an event has been created just for temporary usage, + // e.g. an image load or mouse move. Once the event has been dispatched, it is forgotten + // by the DOM implementation and so does not need to be cached still by the interpreter + ScriptInterpreter::forgetDOMObject(event); } -bool KJSBridge::wasRunByUserGesture() { - return m_proxy->processingUserGesture(); +void ScriptController::setEventHandlerLineno(int lineno) { + m_handlerLineno = lineno; } +void ScriptController::initScript() +{ + if (m_windowShell) + return; -// Evaluate a script file in the environment of this proxy. -String KJSBridge::evaluate(const String& filename, int baseLine, - const String& code, Node* node, bool* succ) { - *succ = false; + JSLock lock(false); - KJS::JSValue* value = m_proxy->evaluate(filename, baseLine, code); + m_windowShell = new JSDOMWindowShell(m_frame->domWindow()); + updateDocument(); - if (!value || value->isUndefined()) - return String(); + if (Page* page = m_frame->page()) { + attachDebugger(page->debugger()); + m_windowShell->window()->setProfileGroup(page->group().identifier()); + } - KJS::JSLock lock(false); - KJS::ExecState* exec = m_proxy->globalObject()->globalExec(); - KJS::UString ustring = value->toString(exec); - exec->clearException(); - *succ = true; - return String(ustring); + m_frame->loader()->dispatchWindowObjectAvailable(); } - -// Evaluate a script file in the environment of this proxy. -JSResult KJSBridge::evaluate(const String& filename, int baseLine, - const String& code, Node* node) { - return m_proxy->evaluate(filename, baseLine, code); +void ScriptController::disconnectFrame() +{ + // Not implemented. + ASSERT(false); } - -EventListener* KJSBridge::createHTMLEventHandler(const String& functionName, - const String& code, Node* node) { - return m_proxy->createHTMLEventHandler(functionName, code, node); +bool ScriptController::processingUserGesture() const +{ + if (!m_windowShell) + return false; + + if (Event* event = m_windowShell->window()->currentEvent()) { + const AtomicString& type = event->type(); + if ( // mouse events + type == clickEvent || type == mousedownEvent || + type == mouseupEvent || type == dblclickEvent || + // keyboard events + type == keydownEvent || type == keypressEvent || + type == keyupEvent || + // other accepted events + type == selectEvent || type == changeEvent || + type == focusEvent || type == blurEvent || + type == submitEvent) + return true; + } else { // no event + if (m_sourceURL && m_sourceURL->isNull() && !m_processingTimerCallback) { + // This is the <a href="javascript:window.open('...')> case -> we let it through + return true; + } + // This is the <script>window.open(...)</script> case or a timer callback -> block it + } + return false; +} + +bool ScriptController::isEnabled() const +{ + Settings* settings = m_frame->settings(); + return (settings && settings->isJavaScriptEnabled()); } -#if ENABLE(SVG) -EventListener* KJSBridge::createSVGEventHandler(const String& functionName, - const String& code, Node* node) { - return m_proxy->createSVGEventHandler(functionName, code, node); -} -#endif +void ScriptController::attachDebugger(void* debugger_voidptr) +{ + if (!m_windowShell) + return; -void KJSBridge::finishedWithEvent(Event* evt) { - m_proxy->finishedWithEvent(evt); + KJS::Debugger* debugger = reinterpret_cast<KJS::Debugger*>(debugger_voidptr); + if (debugger) + debugger->attach(m_windowShell->window()); + else if (KJS::Debugger* currentDebugger = m_windowShell->window()->debugger()) + currentDebugger->detach(m_windowShell->window()); } +Bindings::RootObject* ScriptController::bindingRootObject() +{ + if (!isEnabled()) + return 0; -void KJSBridge::setEventHandlerLineno(int lineno) { - m_proxy->setEventHandlerLineno(lineno); + if (!m_bindingRootObject) { + JSLock lock(false); + m_bindingRootObject = Bindings::RootObject::create(0, globalObject()); + } + return m_bindingRootObject.get(); } -void KJSBridge::clear() { - m_proxy->clear(); -} +#if ENABLE(NETSCAPE_PLUGIN_API) +NPObject* ScriptController::windowScriptNPObject() +{ + if (!m_windowScriptNPObject) { + if (isEnabled()) { + // JavaScript is enabled, so there is a JavaScript window object. + // Return an NPObject bound to the window object. + KJS::JSLock lock(false); + JSObject* win = windowShell()->window(); + ASSERT(win); + Bindings::RootObject* root = bindingRootObject(); + m_windowScriptNPObject = _NPN_CreateScriptObject(0, win, root); + } else { + // JavaScript is not enabled, so we cannot bind the NPObject to the JavaScript window object. + // Instead, we create an NPObject of a different class, one which is not bound to a JavaScript object. + m_windowScriptNPObject = _NPN_CreateNoScriptObject(); + } + } + + return m_windowScriptNPObject; +} + +NPObject* ScriptController::createScriptObjectForPluginElement(HTMLPlugInElement* plugin) +{ + // Can't create NPObjects when JavaScript is disabled + if (!isEnabled()) + return _NPN_CreateNoScriptObject(); -// JSInstanceHolder -JSInstanceHolder::JSInstanceHolder() : - m_instance(0) { -} + // Create a JSObject bound to this element + JSLock lock(false); + ExecState* exec = globalObject()->globalExec(); + JSValue* jsElementValue = toJS(exec, plugin); + if (!jsElementValue || !jsElementValue->isObject()) + return _NPN_CreateNoScriptObject(); -JSInstanceHolder::JSInstanceHolder(JSInstanceHandle instance) { - m_instance = instance; + // Wrap the JSObject in an NPObject + return _NPN_CreateScriptObject(0, jsElementValue->getObject(), bindingRootObject()); } +#endif -JSInstanceHolder::~JSInstanceHolder() { - Clear(); +#if !PLATFORM(MAC) +void ScriptController::clearPlatformScriptObjects() +{ } -bool JSInstanceHolder::IsEmpty() { - return m_instance == 0; +void ScriptController::disconnectPlatformScriptObjects() +{ } +#endif -void JSInstanceHolder::Clear() { - m_instance = 0; -} +void ScriptController::cleanupScriptObjectsForPlugin(void* nativeHandle) +{ + RootObjectMap::iterator it = m_rootObjects.find(nativeHandle); -JSInstance JSInstanceHolder::Get() { - return m_instance.get(); -} + if (it == m_rootObjects.end()) + return; -JSInstance JSInstanceHolder::EmptyInstance() { - return 0; + it->second->invalidate(); + m_rootObjects.remove(it); } -JSInstanceHolder& JSInstanceHolder::operator=(JSInstanceHandle instance) { - m_instance = instance; - return *this; -} +void ScriptController::clearScriptObjects() +{ + JSLock lock(false); + + RootObjectMap::const_iterator end = m_rootObjects.end(); + for (RootObjectMap::const_iterator it = m_rootObjects.begin(); it != end; ++it) + it->second->invalidate(); + + m_rootObjects.clear(); + + if (m_bindingRootObject) { + m_bindingRootObject->invalidate(); + m_bindingRootObject = 0; + } + +#if ENABLE(NETSCAPE_PLUGIN_API) + if (m_windowScriptNPObject) { + // Call _NPN_DeallocateObject() instead of _NPN_ReleaseObject() so that we don't leak if a plugin fails to release the window + // script object properly. + // This shouldn't cause any problems for plugins since they should have already been stopped and destroyed at this point. + _NPN_DeallocateObject(m_windowScriptNPObject); + m_windowScriptNPObject = 0; + } +#endif -/* -JSRootObject* KJSBridge::getRootObject() { - KJS::JSLock lock(false); - PassRefPtr<KJS::Bindings::RootObject> object = - KJS::Bindings::RootObject::create(0, m_proxy->interpreter()); - return ToWebCoreJSRootObject(object.releaseRef()); + clearPlatformScriptObjects(); } -*/ -NPRuntimeFunctions npruntime_functions = { - _NPN_GetStringIdentifier, - _NPN_GetStringIdentifiers, - _NPN_GetIntIdentifier, - _NPN_IdentifierIsString, - _NPN_UTF8FromIdentifier, - _NPN_IntFromIdentifier, - _NPN_CreateObject, - _NPN_RetainObject, - _NPN_ReleaseObject, - _NPN_Invoke, - _NPN_InvokeDefault, - _NPN_Evaluate, - _NPN_GetProperty, - _NPN_SetProperty, - _NPN_RemoveProperty, - _NPN_HasProperty, - _NPN_HasMethod, - _NPN_ReleaseVariantValue, - _NPN_SetException -}; - -NPRuntimeFunctions *KJSBridge::functions() +void ScriptController::pauseTimeouts(OwnPtr<PausedTimeouts>& result) { - return &npruntime_functions; + if (!haveWindowShell()) { + result.clear(); + return; + } + + windowShell()->window()->pauseTimeouts(result); } -void KJSBridge::BindToWindowObject(Frame* frame, const String& key, NPObject* object) { - KJS::Bindings::RootObject *root = frame->bindingRootObject(); - KJS::ExecState *exec = root->globalObject()->globalExec(); - ASSERT(exec); - KJS::JSObject *rootObject = root->globalObject(); - KJS::JSObject *window = rootObject->get(exec, KJS::Identifier("window"))->getObject(); - ASSERT(window); +void ScriptController::resumeTimeouts(OwnPtr<PausedTimeouts>& pausedTimeouts) +{ + if (!haveWindowShell()) { + // Callers can assume we will always clear the passed in timeouts + pausedTimeouts.clear(); + return; + } - KJS::JSObject *runtimeObject = - KJS::Bindings::Instance::createRuntimeObject( - KJS::Bindings::Instance::CLanguage, object, root); + windowShell()->window()->resumeTimeouts(pausedTimeouts); +} - window->put(exec, key, runtimeObject); +// JSInstanceHolder +JSInstanceHolder::JSInstanceHolder() + : m_instance(0) { } -NPObject *KJSBridge::CreateScriptObject(Frame* frame) -{ - KJS::JSObject *jsObject = KJS::Window::retrieveWindow(frame); - ASSERT(jsObject); +JSInstanceHolder::JSInstanceHolder(JSInstanceHandle instance) { + m_instance = instance; +} - // Wrap the JSObject in an NPObject - KJS::Bindings::RootObject* rootObject = frame->bindingRootObject(); - return _NPN_CreateScriptObject(0, jsObject, rootObject); +JSInstanceHolder::~JSInstanceHolder() { + Clear(); } -NPObject *KJSBridge::CreateScriptObject(Frame* frame, - HTMLPlugInElement *element) -{ - 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); - KJS::JSValue* jsElementValue = toJS(exec, element); - return CreateScriptObject(frame, jsElementValue); +bool JSInstanceHolder::IsEmpty() { + return m_instance == 0; } -NPObject *KJSBridge::CreateScriptObject(Frame* frame, KJS::JSValue* value) -{ - if (!value || !value->isObject()) - return _NPN_CreateNoScriptObject(); +void JSInstanceHolder::Clear() { + m_instance = 0; +} - KJS::JSObject *jsObject = value->getObject(); +JSInstance JSInstanceHolder::Get() { + return m_instance.get(); +} - // Wrap the JSObject in an NPObject - KJS::Bindings::RootObject* rootObject = frame->bindingRootObject(); - return _NPN_CreateScriptObject(0, jsObject, rootObject); +JSInstance JSInstanceHolder::EmptyInstance() { + return 0; } -NPObject *KJSBridge::CreateNoScriptObject() -{ - return _NPN_CreateNoScriptObject(); +JSInstanceHolder& JSInstanceHolder::operator=(JSInstanceHandle instance) { + m_instance = instance; + return *this; } + } // namespace WebCore // KJS should only expose functions declared in npruntime.h (NPN_*) @@ -297,92 +459,86 @@ NPObject *KJSBridge::CreateNoScriptObject() // KJSBridge implements NPN_* functions by wrapping around _NPN_* functions. // // Following styles in JavaScriptCore/bindings/npruntime.cpp -void NPN_ReleaseVariantValue(NPVariant *variant) { - _NPN_ReleaseVariantValue(variant); +void NPN_ReleaseVariantValue(NPVariant* variant) { + _NPN_ReleaseVariantValue(variant); } -NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name) { - return _NPN_GetStringIdentifier(name); +NPIdentifier NPN_GetStringIdentifier(const NPUTF8* name) { + return _NPN_GetStringIdentifier(name); } -void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, - NPIdentifier *identifiers) { - _NPN_GetStringIdentifiers(names, nameCount, identifiers); +void NPN_GetStringIdentifiers(const NPUTF8** names, int32_t nameCount, NPIdentifier* identifiers) { + _NPN_GetStringIdentifiers(names, nameCount, identifiers); } NPIdentifier NPN_GetIntIdentifier(int32_t intid) { - return _NPN_GetIntIdentifier(intid); + return _NPN_GetIntIdentifier(intid); } bool NPN_IdentifierIsString(NPIdentifier identifier) { - return _NPN_IdentifierIsString(identifier); + return _NPN_IdentifierIsString(identifier); } -NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier) { - return _NPN_UTF8FromIdentifier(identifier); +NPUTF8* NPN_UTF8FromIdentifier(NPIdentifier identifier) { + return _NPN_UTF8FromIdentifier(identifier); } int32_t NPN_IntFromIdentifier(NPIdentifier identifier) { - return _NPN_IntFromIdentifier(identifier); + return _NPN_IntFromIdentifier(identifier); } -NPObject *NPN_CreateObject(NPP npp, NPClass *aClass) { - return _NPN_CreateObject(npp, aClass); +NPObject* NPN_CreateObject(NPP npp, NPClass* aClass) { + return _NPN_CreateObject(npp, aClass); } -NPObject *NPN_RetainObject(NPObject *obj) { - return _NPN_RetainObject(obj); +NPObject* NPN_RetainObject(NPObject* obj) { + return _NPN_RetainObject(obj); } -void NPN_ReleaseObject(NPObject *obj) { - _NPN_ReleaseObject(obj); +void NPN_ReleaseObject(NPObject* obj) { + _NPN_ReleaseObject(obj); } -void NPN_DeallocateObject(NPObject *obj) { - _NPN_DeallocateObject(obj); +void NPN_DeallocateObject(NPObject* obj) { + _NPN_DeallocateObject(obj); } -bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier methodName, - const NPVariant *args, uint32_t argCount, NPVariant *result) { - return _NPN_Invoke(npp, npobj, methodName, args, argCount, result); +bool NPN_Invoke(NPP npp, NPObject* npobj, NPIdentifier methodName, const NPVariant* args, uint32_t argCount, NPVariant* result) { + return _NPN_Invoke(npp, npobj, methodName, args, argCount, result); } -bool NPN_InvokeDefault(NPP npp, NPObject *npobj, const NPVariant *args, - uint32_t argCount, NPVariant *result) { - return _NPN_InvokeDefault(npp, npobj, args, argCount, result); +bool NPN_InvokeDefault(NPP npp, NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result) { + return _NPN_InvokeDefault(npp, npobj, args, argCount, result); } -bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script, NPVariant *result) { - return _NPN_Evaluate(npp, npobj, script, result); +bool NPN_Evaluate(NPP npp, NPObject* npobj, NPString* script, NPVariant* result) { + return _NPN_Evaluate(npp, npobj, script, result); } -bool NPN_GetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName, - NPVariant *result) { - return _NPN_GetProperty(npp, npobj, propertyName, result); +bool NPN_GetProperty(NPP npp, NPObject* npobj, NPIdentifier propertyName, NPVariant* result) { + return _NPN_GetProperty(npp, npobj, propertyName, result); } -bool NPN_SetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName, - const NPVariant *value) { - return _NPN_SetProperty(npp, npobj, propertyName, value); +bool NPN_SetProperty(NPP npp, NPObject* npobj, NPIdentifier propertyName, const NPVariant* value) { + return _NPN_SetProperty(npp, npobj, propertyName, value); } -bool NPN_RemoveProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName) { - return _NPN_RemoveProperty(npp, npobj, propertyName); +bool NPN_RemoveProperty(NPP npp, NPObject* npobj, NPIdentifier propertyName) { + return _NPN_RemoveProperty(npp, npobj, propertyName); } -bool NPN_HasProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName) { - return _NPN_HasProperty(npp, npobj, propertyName); +bool NPN_HasProperty(NPP npp, NPObject* npobj, NPIdentifier propertyName) { + return _NPN_HasProperty(npp, npobj, propertyName); } -bool NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName) { - return _NPN_HasMethod(npp, npobj, methodName); +bool NPN_HasMethod(NPP npp, NPObject* npobj, NPIdentifier methodName) { + return _NPN_HasMethod(npp, npobj, methodName); } -void NPN_SetException(NPObject *obj, const NPUTF8 *message) { - _NPN_SetException(obj, message); +void NPN_SetException(NPObject* obj, const NPUTF8* message) { + _NPN_SetException(obj, message); } -bool NPN_Enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier, - uint32_t *count) { - return _NPN_Enumerate(npp, npobj, identifier, count); +bool NPN_Enumerate(NPP npp, NPObject* npobj, NPIdentifier** identifier, uint32_t* count) { + return _NPN_Enumerate(npp, npobj, identifier, count); } |