diff options
Diffstat (limited to 'WebCore/bindings/js/JSCustomXPathNSResolver.cpp')
-rw-r--r-- | WebCore/bindings/js/JSCustomXPathNSResolver.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/WebCore/bindings/js/JSCustomXPathNSResolver.cpp b/WebCore/bindings/js/JSCustomXPathNSResolver.cpp index 4476be5..da4a53a 100644 --- a/WebCore/bindings/js/JSCustomXPathNSResolver.cpp +++ b/WebCore/bindings/js/JSCustomXPathNSResolver.cpp @@ -49,13 +49,13 @@ PassRefPtr<JSCustomXPathNSResolver> JSCustomXPathNSResolver::create(JSC::ExecSta setDOMException(exec, TYPE_MISMATCH_ERR); return 0; } - - return adoptRef(new JSCustomXPathNSResolver(resolverObject, asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame())); + + return adoptRef(new JSCustomXPathNSResolver(resolverObject, asJSDOMWindow(exec->dynamicGlobalObject()))); } -JSCustomXPathNSResolver::JSCustomXPathNSResolver(JSObject* customResolver, Frame* frame) +JSCustomXPathNSResolver::JSCustomXPathNSResolver(JSObject* customResolver, JSDOMWindow* globalObject) : m_customResolver(customResolver) - , m_frame(frame) + , m_globalObject(globalObject) { } @@ -67,15 +67,9 @@ String JSCustomXPathNSResolver::lookupNamespaceURI(const String& prefix) { ASSERT(m_customResolver); - if (!m_frame) - return String(); - if (!m_frame->script()->isEnabled()) - return String(); - JSLock lock(SilenceAssertionsOnly); - JSGlobalObject* globalObject = m_frame->script()->globalObject(); - ExecState* exec = globalObject->globalExec(); + ExecState* exec = m_globalObject->globalExec(); JSValue function = m_customResolver->get(exec, Identifier(exec, "lookupNamespaceURI")); CallData callData; @@ -84,7 +78,7 @@ String JSCustomXPathNSResolver::lookupNamespaceURI(const String& prefix) callType = m_customResolver->getCallData(callData); if (callType == CallTypeNone) { // FIXME: Pass actual line number and source URL. - m_frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "XPathNSResolver does not have a lookupNamespaceURI method.", 0, String()); + m_globalObject->impl()->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "XPathNSResolver does not have a lookupNamespaceURI method.", 0, String()); return String(); } function = m_customResolver; @@ -95,9 +89,9 @@ String JSCustomXPathNSResolver::lookupNamespaceURI(const String& prefix) MarkedArgumentBuffer args; args.append(jsString(exec, prefix)); - globalObject->globalData()->timeoutChecker.start(); + m_globalObject->globalData()->timeoutChecker.start(); JSValue retval = call(exec, function, callType, callData, m_customResolver, args); - globalObject->globalData()->timeoutChecker.stop(); + m_globalObject->globalData()->timeoutChecker.stop(); String result; if (exec->hadException()) |